2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
34 #include "api_arrayelt.h"
36 #include "api_loopback.h"
37 #include "api_validate.h"
38 #if FEATURE_ATI_fragment_shader
39 #include "atifragshader.h"
42 #include "mfeatures.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
51 #include "framebuffer.h"
52 #include "glapi/glapi.h"
60 #include "samplerobj.h"
61 #include "shaderapi.h"
64 #include "texstorage.h"
67 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
68 #include "arbprogram.h"
70 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
71 #include "nvprogram.h"
73 #if FEATURE_EXT_transform_feedback
74 #include "transformfeedback.h"
77 #include "math/m_matrix.h"
79 #include "main/dispatch.h"
84 * Other parts of Mesa (such as the VBO module) can plug into the display
85 * list system. This structure describes new display list instructions.
87 struct gl_list_instruction
90 void (*Execute
)( struct gl_context
*ctx
, void *data
);
91 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
92 void (*Print
)( struct gl_context
*ctx
, void *data
);
96 #define MAX_DLIST_EXT_OPCODES 16
99 * Used by device drivers to hook new commands into display lists.
101 struct gl_list_extensions
103 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
112 * \param ctx GL context.
114 * Checks if dd_function_table::SaveNeedFlush is marked to flush
115 * stored (save) vertices, and calls
116 * dd_function_table::SaveFlushVertices if so.
118 #define SAVE_FLUSH_VERTICES(ctx) \
120 if (ctx->Driver.SaveNeedFlush) \
121 ctx->Driver.SaveFlushVertices(ctx); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair, with return value.
129 * \param ctx GL context.
130 * \param retval value to return value in case the assertion fails.
132 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
134 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
135 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
136 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
142 * Macro to assert that the API call was made outside the
143 * glBegin()/glEnd() pair.
145 * \param ctx GL context.
147 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
149 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
150 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
151 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
157 * Macro to assert that the API call was made outside the
158 * glBegin()/glEnd() pair and flush the vertices.
160 * \param ctx GL context.
162 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
164 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
165 SAVE_FLUSH_VERTICES(ctx); \
169 * Macro to assert that the API call was made outside the
170 * glBegin()/glEnd() pair and flush the vertices, with return value.
172 * \param ctx GL context.
173 * \param retval value to return value in case the assertion fails.
175 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
177 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
178 SAVE_FLUSH_VERTICES(ctx); \
184 * Display list opcodes.
186 * The fact that these identifiers are assigned consecutive
187 * integer values starting at 0 is very important, see InstSize array usage)
191 OPCODE_INVALID
= -1, /* Force signed enum */
197 OPCODE_BLEND_EQUATION
,
198 OPCODE_BLEND_EQUATION_SEPARATE
,
199 OPCODE_BLEND_FUNC_SEPARATE
,
201 OPCODE_BLEND_EQUATION_I
,
202 OPCODE_BLEND_EQUATION_SEPARATE_I
,
204 OPCODE_BLEND_FUNC_SEPARATE_I
,
207 OPCODE_CALL_LIST_OFFSET
,
213 OPCODE_CLEAR_STENCIL
,
214 OPCODE_CLEAR_BUFFER_IV
,
215 OPCODE_CLEAR_BUFFER_UIV
,
216 OPCODE_CLEAR_BUFFER_FV
,
217 OPCODE_CLEAR_BUFFER_FI
,
220 OPCODE_COLOR_MASK_INDEXED
,
221 OPCODE_COLOR_MATERIAL
,
223 OPCODE_COLOR_TABLE_PARAMETER_FV
,
224 OPCODE_COLOR_TABLE_PARAMETER_IV
,
225 OPCODE_COLOR_SUB_TABLE
,
226 OPCODE_CONVOLUTION_FILTER_1D
,
227 OPCODE_CONVOLUTION_FILTER_2D
,
228 OPCODE_CONVOLUTION_PARAMETER_I
,
229 OPCODE_CONVOLUTION_PARAMETER_IV
,
230 OPCODE_CONVOLUTION_PARAMETER_F
,
231 OPCODE_CONVOLUTION_PARAMETER_FV
,
232 OPCODE_COPY_COLOR_SUB_TABLE
,
233 OPCODE_COPY_COLOR_TABLE
,
235 OPCODE_COPY_TEX_IMAGE1D
,
236 OPCODE_COPY_TEX_IMAGE2D
,
237 OPCODE_COPY_TEX_SUB_IMAGE1D
,
238 OPCODE_COPY_TEX_SUB_IMAGE2D
,
239 OPCODE_COPY_TEX_SUB_IMAGE3D
,
245 OPCODE_DISABLE_INDEXED
,
249 OPCODE_ENABLE_INDEXED
,
264 OPCODE_LOAD_IDENTITY
,
278 OPCODE_PIXEL_TRANSFER
,
281 OPCODE_POINT_PARAMETERS
,
283 OPCODE_POLYGON_STIPPLE
,
284 OPCODE_POLYGON_OFFSET
,
288 OPCODE_PRIORITIZE_TEXTURE
,
294 OPCODE_RESET_HISTOGRAM
,
295 OPCODE_RESET_MIN_MAX
,
299 OPCODE_SELECT_TEXTURE_SGIS
,
300 OPCODE_SELECT_TEXTURE_COORD_SET
,
311 OPCODE_TEX_SUB_IMAGE1D
,
312 OPCODE_TEX_SUB_IMAGE2D
,
313 OPCODE_TEX_SUB_IMAGE3D
,
317 /* GL_ARB_multitexture */
318 OPCODE_ACTIVE_TEXTURE
,
319 /* GL_ARB_texture_compression */
320 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
321 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
322 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
323 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
324 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
325 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
326 /* GL_ARB_multisample */
327 OPCODE_SAMPLE_COVERAGE
,
328 /* GL_ARB_window_pos */
329 OPCODE_WINDOW_POS_ARB
,
330 /* GL_NV_vertex_program */
331 OPCODE_BIND_PROGRAM_NV
,
332 OPCODE_EXECUTE_PROGRAM_NV
,
333 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
334 OPCODE_LOAD_PROGRAM_NV
,
335 OPCODE_TRACK_MATRIX_NV
,
336 /* GL_NV_fragment_program */
337 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
338 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
339 /* GL_EXT_stencil_two_side */
340 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
341 /* GL_EXT_depth_bounds_test */
342 OPCODE_DEPTH_BOUNDS_EXT
,
343 /* GL_ARB_vertex/fragment_program */
344 OPCODE_PROGRAM_STRING_ARB
,
345 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
346 /* GL_ARB_occlusion_query */
347 OPCODE_BEGIN_QUERY_ARB
,
348 OPCODE_END_QUERY_ARB
,
349 /* GL_ARB_draw_buffers */
350 OPCODE_DRAW_BUFFERS_ARB
,
351 /* GL_ATI_fragment_shader */
352 OPCODE_TEX_BUMP_PARAMETER_ATI
,
353 /* GL_ATI_fragment_shader */
354 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
355 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
357 OPCODE_STENCIL_FUNC_SEPARATE
,
358 OPCODE_STENCIL_OP_SEPARATE
,
359 OPCODE_STENCIL_MASK_SEPARATE
,
361 /* GL_ARB_shader_objects */
379 OPCODE_UNIFORM_MATRIX22
,
380 OPCODE_UNIFORM_MATRIX33
,
381 OPCODE_UNIFORM_MATRIX44
,
382 OPCODE_UNIFORM_MATRIX23
,
383 OPCODE_UNIFORM_MATRIX32
,
384 OPCODE_UNIFORM_MATRIX24
,
385 OPCODE_UNIFORM_MATRIX42
,
386 OPCODE_UNIFORM_MATRIX34
,
387 OPCODE_UNIFORM_MATRIX43
,
399 /* GL_ARB_color_buffer_float */
402 /* GL_EXT_framebuffer_blit */
403 OPCODE_BLIT_FRAMEBUFFER
,
405 /* Vertex attributes -- fallback for when optimized display
406 * list build isn't active.
425 /* GL_EXT_provoking_vertex */
426 OPCODE_PROVOKING_VERTEX
,
428 /* GL_EXT_transform_feedback */
429 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
430 OPCODE_END_TRANSFORM_FEEDBACK
,
431 OPCODE_BIND_TRANSFORM_FEEDBACK
,
432 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
433 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
434 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
436 /* GL_EXT_texture_integer */
438 OPCODE_CLEARCOLOR_UI
,
439 OPCODE_TEXPARAMETER_I
,
440 OPCODE_TEXPARAMETER_UI
,
442 /* GL_EXT_separate_shader_objects */
443 OPCODE_ACTIVE_PROGRAM_EXT
,
444 OPCODE_USE_SHADER_PROGRAM_EXT
,
446 /* GL_ARB_instanced_arrays */
447 OPCODE_VERTEX_ATTRIB_DIVISOR
,
449 /* GL_NV_texture_barrier */
450 OPCODE_TEXTURE_BARRIER_NV
,
452 /* GL_ARB_sampler_object */
454 OPCODE_SAMPLER_PARAMETERIV
,
455 OPCODE_SAMPLER_PARAMETERFV
,
456 OPCODE_SAMPLER_PARAMETERIIV
,
457 OPCODE_SAMPLER_PARAMETERUIV
,
459 /* GL_ARB_geometry_shader4 */
460 OPCODE_PROGRAM_PARAMETERI
,
461 OPCODE_FRAMEBUFFER_TEXTURE
,
462 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
467 /* GL_NV_conditional_render */
468 OPCODE_BEGIN_CONDITIONAL_RENDER
,
469 OPCODE_END_CONDITIONAL_RENDER
,
471 /* The following three are meta instructions */
472 OPCODE_ERROR
, /* raise compiled-in error */
483 * Display list instructions are stored as sequences of "nodes". Nodes
484 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
485 * are linked together with a pointer.
487 * Each instruction in the display list is stored as a sequence of
488 * contiguous nodes in memory.
489 * Each node is the union of a variety of data types.
504 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
508 typedef union gl_dlist_node Node
;
512 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
513 * environment. In 64-bit env, sizeof(Node)==8 anyway.
523 * How many nodes to allocate at a time.
525 * \note Reduced now that we hold vertices etc. elsewhere.
527 #define BLOCK_SIZE 256
532 * Number of nodes of storage needed for each instruction.
533 * Sizes for dynamically allocated opcodes are stored in the context struct.
535 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
541 void mesa_print_display_list(GLuint list
);
544 /**********************************************************************/
545 /***** Private *****/
546 /**********************************************************************/
550 * Make an empty display list. This is used by glGenLists() to
551 * reserve display list IDs.
553 static struct gl_display_list
*
554 make_list(GLuint name
, GLuint count
)
556 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
558 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
559 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
565 * Lookup function to just encapsulate casting.
567 static inline struct gl_display_list
*
568 lookup_list(struct gl_context
*ctx
, GLuint list
)
570 return (struct gl_display_list
*)
571 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
575 /** Is the given opcode an extension code? */
576 static inline GLboolean
577 is_ext_opcode(OpCode opcode
)
579 return (opcode
>= OPCODE_EXT_0
);
583 /** Destroy an extended opcode instruction */
585 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
587 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
589 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
590 step
= ctx
->ListExt
->Opcode
[i
].Size
;
595 /** Execute an extended opcode instruction */
597 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
599 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
601 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
602 step
= ctx
->ListExt
->Opcode
[i
].Size
;
607 /** Print an extended opcode instruction */
609 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
611 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
613 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
614 step
= ctx
->ListExt
->Opcode
[i
].Size
;
620 * Delete the named display list, but don't remove from hash table.
621 * \param dlist - display list pointer
624 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
629 n
= block
= dlist
->Head
;
631 done
= block
? GL_FALSE
: GL_TRUE
;
633 const OpCode opcode
= n
[0].opcode
;
635 /* check for extension opcodes first */
636 if (is_ext_opcode(opcode
)) {
637 n
+= ext_opcode_destroy(ctx
, n
);
641 /* for some commands, we need to free malloc'd memory */
644 n
+= InstSize
[n
[0].opcode
];
648 n
+= InstSize
[n
[0].opcode
];
650 case OPCODE_DRAW_PIXELS
:
652 n
+= InstSize
[n
[0].opcode
];
656 n
+= InstSize
[n
[0].opcode
];
658 case OPCODE_COLOR_TABLE
:
660 n
+= InstSize
[n
[0].opcode
];
662 case OPCODE_COLOR_SUB_TABLE
:
664 n
+= InstSize
[n
[0].opcode
];
666 case OPCODE_CONVOLUTION_FILTER_1D
:
668 n
+= InstSize
[n
[0].opcode
];
670 case OPCODE_CONVOLUTION_FILTER_2D
:
672 n
+= InstSize
[n
[0].opcode
];
674 case OPCODE_POLYGON_STIPPLE
:
676 n
+= InstSize
[n
[0].opcode
];
678 case OPCODE_TEX_IMAGE1D
:
680 n
+= InstSize
[n
[0].opcode
];
682 case OPCODE_TEX_IMAGE2D
:
684 n
+= InstSize
[n
[0].opcode
];
686 case OPCODE_TEX_IMAGE3D
:
688 n
+= InstSize
[n
[0].opcode
];
690 case OPCODE_TEX_SUB_IMAGE1D
:
692 n
+= InstSize
[n
[0].opcode
];
694 case OPCODE_TEX_SUB_IMAGE2D
:
696 n
+= InstSize
[n
[0].opcode
];
698 case OPCODE_TEX_SUB_IMAGE3D
:
700 n
+= InstSize
[n
[0].opcode
];
702 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
704 n
+= InstSize
[n
[0].opcode
];
706 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
708 n
+= InstSize
[n
[0].opcode
];
710 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
712 n
+= InstSize
[n
[0].opcode
];
714 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
716 n
+= InstSize
[n
[0].opcode
];
718 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
720 n
+= InstSize
[n
[0].opcode
];
722 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
724 n
+= InstSize
[n
[0].opcode
];
726 #if FEATURE_NV_vertex_program
727 case OPCODE_LOAD_PROGRAM_NV
:
728 free(n
[4].data
); /* program string */
729 n
+= InstSize
[n
[0].opcode
];
731 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
732 free(n
[2].data
); /* array of program ids */
733 n
+= InstSize
[n
[0].opcode
];
736 #if FEATURE_NV_fragment_program
737 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
738 free(n
[3].data
); /* parameter name */
739 n
+= InstSize
[n
[0].opcode
];
742 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
743 case OPCODE_PROGRAM_STRING_ARB
:
744 free(n
[4].data
); /* program string */
745 n
+= InstSize
[n
[0].opcode
];
748 case OPCODE_UNIFORM_1FV
:
749 case OPCODE_UNIFORM_2FV
:
750 case OPCODE_UNIFORM_3FV
:
751 case OPCODE_UNIFORM_4FV
:
752 case OPCODE_UNIFORM_1IV
:
753 case OPCODE_UNIFORM_2IV
:
754 case OPCODE_UNIFORM_3IV
:
755 case OPCODE_UNIFORM_4IV
:
756 case OPCODE_UNIFORM_1UIV
:
757 case OPCODE_UNIFORM_2UIV
:
758 case OPCODE_UNIFORM_3UIV
:
759 case OPCODE_UNIFORM_4UIV
:
761 n
+= InstSize
[n
[0].opcode
];
763 case OPCODE_UNIFORM_MATRIX22
:
764 case OPCODE_UNIFORM_MATRIX33
:
765 case OPCODE_UNIFORM_MATRIX44
:
766 case OPCODE_UNIFORM_MATRIX24
:
767 case OPCODE_UNIFORM_MATRIX42
:
768 case OPCODE_UNIFORM_MATRIX23
:
769 case OPCODE_UNIFORM_MATRIX32
:
770 case OPCODE_UNIFORM_MATRIX34
:
771 case OPCODE_UNIFORM_MATRIX43
:
773 n
+= InstSize
[n
[0].opcode
];
776 case OPCODE_CONTINUE
:
777 n
= (Node
*) n
[1].next
;
781 case OPCODE_END_OF_LIST
:
786 /* Most frequent case */
787 n
+= InstSize
[n
[0].opcode
];
798 * Destroy a display list and remove from hash table.
799 * \param list - display list number
802 destroy_list(struct gl_context
*ctx
, GLuint list
)
804 struct gl_display_list
*dlist
;
809 dlist
= lookup_list(ctx
, list
);
813 _mesa_delete_list(ctx
, dlist
);
814 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
819 * Translate the nth element of list from <type> to GLint.
822 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
834 bptr
= (GLbyte
*) list
;
835 return (GLint
) bptr
[n
];
836 case GL_UNSIGNED_BYTE
:
837 ubptr
= (GLubyte
*) list
;
838 return (GLint
) ubptr
[n
];
840 sptr
= (GLshort
*) list
;
841 return (GLint
) sptr
[n
];
842 case GL_UNSIGNED_SHORT
:
843 usptr
= (GLushort
*) list
;
844 return (GLint
) usptr
[n
];
846 iptr
= (GLint
*) list
;
848 case GL_UNSIGNED_INT
:
849 uiptr
= (GLuint
*) list
;
850 return (GLint
) uiptr
[n
];
852 fptr
= (GLfloat
*) list
;
853 return (GLint
) FLOORF(fptr
[n
]);
855 ubptr
= ((GLubyte
*) list
) + 2 * n
;
856 return (GLint
) ubptr
[0] * 256
859 ubptr
= ((GLubyte
*) list
) + 3 * n
;
860 return (GLint
) ubptr
[0] * 65536
861 + (GLint
) ubptr
[1] * 256
864 ubptr
= ((GLubyte
*) list
) + 4 * n
;
865 return (GLint
) ubptr
[0] * 16777216
866 + (GLint
) ubptr
[1] * 65536
867 + (GLint
) ubptr
[2] * 256
877 /**********************************************************************/
879 /**********************************************************************/
882 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
883 * If width < 0 or height < 0 or format or type are invalid we'll just
884 * return NULL. We will not generate an error since OpenGL command
885 * arguments aren't error-checked until the command is actually executed
886 * (not when they're compiled).
887 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
890 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
891 GLsizei width
, GLsizei height
, GLsizei depth
,
892 GLenum format
, GLenum type
, const GLvoid
* pixels
,
893 const struct gl_pixelstore_attrib
*unpack
)
895 if (width
<= 0 || height
<= 0) {
899 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
900 /* bad format and/or type */
904 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
908 if (type
== GL_BITMAP
)
909 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
911 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
912 format
, type
, pixels
, unpack
);
913 if (pixels
&& !image
) {
914 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
918 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
919 depth
, format
, type
, INT_MAX
, pixels
)) {
920 const GLubyte
*map
, *src
;
924 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
925 GL_MAP_READ_BIT
, unpack
->BufferObj
);
927 /* unable to map src buffer! */
928 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
932 src
= ADD_POINTERS(map
, pixels
);
933 if (type
== GL_BITMAP
)
934 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
936 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
937 format
, type
, src
, unpack
);
939 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
942 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
948 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
953 * Allocate space for a display list instruction (opcode + payload space).
954 * \param opcode the instruction opcode (OPCODE_* value)
955 * \param bytes instruction payload size (not counting opcode)
956 * \return pointer to allocated memory (the opcode space)
959 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
961 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
964 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
965 if (InstSize
[opcode
] == 0) {
966 /* save instruction size now */
967 InstSize
[opcode
] = numNodes
;
970 /* make sure instruction size agrees */
971 ASSERT(numNodes
== InstSize
[opcode
]);
975 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
976 /* This block is full. Allocate a new block and chain to it */
978 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
979 n
[0].opcode
= OPCODE_CONTINUE
;
980 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
982 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
985 n
[1].next
= (Node
*) newblock
;
986 ctx
->ListState
.CurrentBlock
= newblock
;
987 ctx
->ListState
.CurrentPos
= 0;
990 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
991 ctx
->ListState
.CurrentPos
+= numNodes
;
993 n
[0].opcode
= opcode
;
1001 * Allocate space for a display list instruction. Used by callers outside
1002 * this file for things like VBO vertex data.
1004 * \param opcode the instruction opcode (OPCODE_* value)
1005 * \param bytes instruction size in bytes, not counting opcode.
1006 * \return pointer to the usable data area (not including the internal
1010 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1012 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1014 return n
+ 1; /* return pointer to payload area, after opcode */
1021 * This function allows modules and drivers to get their own opcodes
1022 * for extending display list functionality.
1023 * \param ctx the rendering context
1024 * \param size number of bytes for storing the new display list command
1025 * \param execute function to execute the new display list command
1026 * \param destroy function to destroy the new display list command
1027 * \param print function to print the new display list command
1028 * \return the new opcode number or -1 if error
1031 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1033 void (*execute
) (struct gl_context
*, void *),
1034 void (*destroy
) (struct gl_context
*, void *),
1035 void (*print
) (struct gl_context
*, void *))
1037 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1038 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1039 ctx
->ListExt
->Opcode
[i
].Size
=
1040 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1041 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1042 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1043 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1044 return i
+ OPCODE_EXT_0
;
1051 * Allocate space for a display list instruction. The space is basically
1052 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1053 * function parameter, node[2] is the second parameter, etc.
1055 * \param opcode one of OPCODE_x
1056 * \param nparams number of function parameters
1057 * \return pointer to start of instruction space
1059 static inline Node
*
1060 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1062 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1068 * Display List compilation functions
1070 static void GLAPIENTRY
1071 save_Accum(GLenum op
, GLfloat value
)
1073 GET_CURRENT_CONTEXT(ctx
);
1075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1076 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1081 if (ctx
->ExecuteFlag
) {
1082 CALL_Accum(ctx
->Exec
, (op
, value
));
1087 static void GLAPIENTRY
1088 save_AlphaFunc(GLenum func
, GLclampf ref
)
1090 GET_CURRENT_CONTEXT(ctx
);
1092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1093 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1096 n
[2].f
= (GLfloat
) ref
;
1098 if (ctx
->ExecuteFlag
) {
1099 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1104 static void GLAPIENTRY
1105 save_BindTexture(GLenum target
, GLuint texture
)
1107 GET_CURRENT_CONTEXT(ctx
);
1109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1110 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1115 if (ctx
->ExecuteFlag
) {
1116 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1121 static void GLAPIENTRY
1122 save_Bitmap(GLsizei width
, GLsizei height
,
1123 GLfloat xorig
, GLfloat yorig
,
1124 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1126 GET_CURRENT_CONTEXT(ctx
);
1128 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1129 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1131 n
[1].i
= (GLint
) width
;
1132 n
[2].i
= (GLint
) height
;
1137 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1138 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1140 if (ctx
->ExecuteFlag
) {
1141 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1142 xorig
, yorig
, xmove
, ymove
, pixels
));
1147 static void GLAPIENTRY
1148 save_BlendEquation(GLenum mode
)
1150 GET_CURRENT_CONTEXT(ctx
);
1152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1153 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1157 if (ctx
->ExecuteFlag
) {
1158 CALL_BlendEquation(ctx
->Exec
, (mode
));
1163 static void GLAPIENTRY
1164 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1166 GET_CURRENT_CONTEXT(ctx
);
1168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1169 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1174 if (ctx
->ExecuteFlag
) {
1175 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1180 static void GLAPIENTRY
1181 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1182 GLenum sfactorA
, GLenum dfactorA
)
1184 GET_CURRENT_CONTEXT(ctx
);
1186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1187 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1189 n
[1].e
= sfactorRGB
;
1190 n
[2].e
= dfactorRGB
;
1194 if (ctx
->ExecuteFlag
) {
1195 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1196 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1201 static void GLAPIENTRY
1202 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1204 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1208 static void GLAPIENTRY
1209 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1211 GET_CURRENT_CONTEXT(ctx
);
1213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1214 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1221 if (ctx
->ExecuteFlag
) {
1222 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1226 /* GL_ARB_draw_buffers_blend */
1227 static void GLAPIENTRY
1228 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1229 GLenum sfactorA
, GLenum dfactorA
)
1231 GET_CURRENT_CONTEXT(ctx
);
1233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1234 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1237 n
[2].e
= sfactorRGB
;
1238 n
[3].e
= dfactorRGB
;
1242 if (ctx
->ExecuteFlag
) {
1243 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1244 sfactorA
, dfactorA
));
1248 /* GL_ARB_draw_buffers_blend */
1249 static void GLAPIENTRY
1250 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1252 GET_CURRENT_CONTEXT(ctx
);
1254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1255 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1261 if (ctx
->ExecuteFlag
) {
1262 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1266 /* GL_ARB_draw_buffers_blend */
1267 static void GLAPIENTRY
1268 save_BlendEquationi(GLuint buf
, GLenum mode
)
1270 GET_CURRENT_CONTEXT(ctx
);
1272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1273 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1278 if (ctx
->ExecuteFlag
) {
1279 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1283 /* GL_ARB_draw_buffers_blend */
1284 static void GLAPIENTRY
1285 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1287 GET_CURRENT_CONTEXT(ctx
);
1289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1290 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1296 if (ctx
->ExecuteFlag
) {
1297 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1302 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1306 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1307 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1309 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1310 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1312 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1314 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1317 static void GLAPIENTRY
1318 save_CallList(GLuint list
)
1320 GET_CURRENT_CONTEXT(ctx
);
1322 SAVE_FLUSH_VERTICES(ctx
);
1324 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1329 /* After this, we don't know what state we're in. Invalidate all
1330 * cached information previously gathered:
1332 invalidate_saved_current_state( ctx
);
1334 if (ctx
->ExecuteFlag
) {
1335 _mesa_CallList(list
);
1340 static void GLAPIENTRY
1341 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1343 GET_CURRENT_CONTEXT(ctx
);
1345 GLboolean typeErrorFlag
;
1347 SAVE_FLUSH_VERTICES(ctx
);
1351 case GL_UNSIGNED_BYTE
:
1353 case GL_UNSIGNED_SHORT
:
1355 case GL_UNSIGNED_INT
:
1360 typeErrorFlag
= GL_FALSE
;
1363 typeErrorFlag
= GL_TRUE
;
1366 for (i
= 0; i
< num
; i
++) {
1367 GLint list
= translate_id(i
, type
, lists
);
1368 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1371 n
[2].b
= typeErrorFlag
;
1375 /* After this, we don't know what state we're in. Invalidate all
1376 * cached information previously gathered:
1378 invalidate_saved_current_state( ctx
);
1380 if (ctx
->ExecuteFlag
) {
1381 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1386 static void GLAPIENTRY
1387 save_Clear(GLbitfield mask
)
1389 GET_CURRENT_CONTEXT(ctx
);
1391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1392 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1396 if (ctx
->ExecuteFlag
) {
1397 CALL_Clear(ctx
->Exec
, (mask
));
1402 static void GLAPIENTRY
1403 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1405 GET_CURRENT_CONTEXT(ctx
);
1407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1408 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1411 n
[2].i
= drawbuffer
;
1413 if (buffer
== GL_COLOR
) {
1424 if (ctx
->ExecuteFlag
) {
1425 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1430 static void GLAPIENTRY
1431 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1433 GET_CURRENT_CONTEXT(ctx
);
1435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1436 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1439 n
[2].i
= drawbuffer
;
1441 if (buffer
== GL_COLOR
) {
1452 if (ctx
->ExecuteFlag
) {
1453 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1458 static void GLAPIENTRY
1459 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1461 GET_CURRENT_CONTEXT(ctx
);
1463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1464 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1467 n
[2].i
= drawbuffer
;
1469 if (buffer
== GL_COLOR
) {
1480 if (ctx
->ExecuteFlag
) {
1481 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1486 static void GLAPIENTRY
1487 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1488 GLfloat depth
, GLint stencil
)
1490 GET_CURRENT_CONTEXT(ctx
);
1492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1493 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1496 n
[2].i
= drawbuffer
;
1500 if (ctx
->ExecuteFlag
) {
1501 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1506 static void GLAPIENTRY
1507 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1509 GET_CURRENT_CONTEXT(ctx
);
1511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1512 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1519 if (ctx
->ExecuteFlag
) {
1520 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1525 static void GLAPIENTRY
1526 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1528 GET_CURRENT_CONTEXT(ctx
);
1530 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1531 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1538 if (ctx
->ExecuteFlag
) {
1539 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1544 static void GLAPIENTRY
1545 save_ClearDepth(GLclampd depth
)
1547 GET_CURRENT_CONTEXT(ctx
);
1549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1550 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1552 n
[1].f
= (GLfloat
) depth
;
1554 if (ctx
->ExecuteFlag
) {
1555 CALL_ClearDepth(ctx
->Exec
, (depth
));
1560 static void GLAPIENTRY
1561 save_ClearIndex(GLfloat c
)
1563 GET_CURRENT_CONTEXT(ctx
);
1565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1566 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1570 if (ctx
->ExecuteFlag
) {
1571 CALL_ClearIndex(ctx
->Exec
, (c
));
1576 static void GLAPIENTRY
1577 save_ClearStencil(GLint s
)
1579 GET_CURRENT_CONTEXT(ctx
);
1581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1582 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1586 if (ctx
->ExecuteFlag
) {
1587 CALL_ClearStencil(ctx
->Exec
, (s
));
1592 static void GLAPIENTRY
1593 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1595 GET_CURRENT_CONTEXT(ctx
);
1597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1598 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1601 n
[2].f
= (GLfloat
) equ
[0];
1602 n
[3].f
= (GLfloat
) equ
[1];
1603 n
[4].f
= (GLfloat
) equ
[2];
1604 n
[5].f
= (GLfloat
) equ
[3];
1606 if (ctx
->ExecuteFlag
) {
1607 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1613 static void GLAPIENTRY
1614 save_ColorMask(GLboolean red
, GLboolean green
,
1615 GLboolean blue
, GLboolean alpha
)
1617 GET_CURRENT_CONTEXT(ctx
);
1619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1620 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1627 if (ctx
->ExecuteFlag
) {
1628 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1633 static void GLAPIENTRY
1634 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1635 GLboolean blue
, GLboolean alpha
)
1637 GET_CURRENT_CONTEXT(ctx
);
1639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1640 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1648 if (ctx
->ExecuteFlag
) {
1649 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1654 static void GLAPIENTRY
1655 save_ColorMaterial(GLenum face
, GLenum mode
)
1657 GET_CURRENT_CONTEXT(ctx
);
1659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1661 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1666 if (ctx
->ExecuteFlag
) {
1667 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1672 static void GLAPIENTRY
1673 save_ColorTable(GLenum target
, GLenum internalFormat
,
1674 GLsizei width
, GLenum format
, GLenum type
,
1675 const GLvoid
* table
)
1677 GET_CURRENT_CONTEXT(ctx
);
1678 if (_mesa_is_proxy_texture(target
)) {
1679 /* execute immediately */
1680 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1681 format
, type
, table
));
1685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1686 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1689 n
[2].e
= internalFormat
;
1693 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1696 if (ctx
->ExecuteFlag
) {
1697 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1698 format
, type
, table
));
1705 static void GLAPIENTRY
1706 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1707 const GLfloat
*params
)
1709 GET_CURRENT_CONTEXT(ctx
);
1712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1714 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1719 if (pname
== GL_COLOR_TABLE_SGI
||
1720 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1721 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1728 if (ctx
->ExecuteFlag
) {
1729 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1734 static void GLAPIENTRY
1735 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1737 GET_CURRENT_CONTEXT(ctx
);
1740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1742 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1747 if (pname
== GL_COLOR_TABLE_SGI
||
1748 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1749 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1756 if (ctx
->ExecuteFlag
) {
1757 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1763 static void GLAPIENTRY
1764 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1765 GLenum format
, GLenum type
, const GLvoid
* table
)
1767 GET_CURRENT_CONTEXT(ctx
);
1769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1770 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1777 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1780 if (ctx
->ExecuteFlag
) {
1781 CALL_ColorSubTable(ctx
->Exec
,
1782 (target
, start
, count
, format
, type
, table
));
1787 static void GLAPIENTRY
1788 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1789 GLint x
, GLint y
, GLsizei width
)
1791 GET_CURRENT_CONTEXT(ctx
);
1794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1795 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1803 if (ctx
->ExecuteFlag
) {
1804 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1809 static void GLAPIENTRY
1810 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1811 GLint x
, GLint y
, GLsizei width
)
1813 GET_CURRENT_CONTEXT(ctx
);
1816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1817 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1820 n
[2].e
= internalformat
;
1825 if (ctx
->ExecuteFlag
) {
1826 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1831 static void GLAPIENTRY
1832 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1833 GLenum format
, GLenum type
, const GLvoid
* filter
)
1835 GET_CURRENT_CONTEXT(ctx
);
1838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1840 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1843 n
[2].e
= internalFormat
;
1847 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1850 if (ctx
->ExecuteFlag
) {
1851 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1852 format
, type
, filter
));
1857 static void GLAPIENTRY
1858 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1859 GLsizei width
, GLsizei height
, GLenum format
,
1860 GLenum type
, const GLvoid
* filter
)
1862 GET_CURRENT_CONTEXT(ctx
);
1865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1867 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1870 n
[2].e
= internalFormat
;
1875 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1878 if (ctx
->ExecuteFlag
) {
1879 CALL_ConvolutionFilter2D(ctx
->Exec
,
1880 (target
, internalFormat
, width
, height
, format
,
1886 static void GLAPIENTRY
1887 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1889 GET_CURRENT_CONTEXT(ctx
);
1891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1892 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1898 if (ctx
->ExecuteFlag
) {
1899 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1904 static void GLAPIENTRY
1905 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1907 GET_CURRENT_CONTEXT(ctx
);
1909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1910 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1915 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1916 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1917 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1923 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1926 if (ctx
->ExecuteFlag
) {
1927 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1932 static void GLAPIENTRY
1933 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1935 GET_CURRENT_CONTEXT(ctx
);
1937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1938 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1944 if (ctx
->ExecuteFlag
) {
1945 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1950 static void GLAPIENTRY
1951 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1952 const GLfloat
*params
)
1954 GET_CURRENT_CONTEXT(ctx
);
1956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1957 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1962 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1963 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1964 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1970 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1973 if (ctx
->ExecuteFlag
) {
1974 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1979 static void GLAPIENTRY
1980 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1982 GET_CURRENT_CONTEXT(ctx
);
1984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1985 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1989 n
[3].i
= (GLint
) width
;
1990 n
[4].i
= (GLint
) height
;
1993 if (ctx
->ExecuteFlag
) {
1994 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2000 static void GLAPIENTRY
2001 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2002 GLint x
, GLint y
, GLsizei width
, GLint border
)
2004 GET_CURRENT_CONTEXT(ctx
);
2006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2007 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2011 n
[3].e
= internalformat
;
2017 if (ctx
->ExecuteFlag
) {
2018 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2019 x
, y
, width
, border
));
2024 static void GLAPIENTRY
2025 save_CopyTexImage2D(GLenum target
, GLint level
,
2026 GLenum internalformat
,
2027 GLint x
, GLint y
, GLsizei width
,
2028 GLsizei height
, GLint border
)
2030 GET_CURRENT_CONTEXT(ctx
);
2032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2033 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2037 n
[3].e
= internalformat
;
2044 if (ctx
->ExecuteFlag
) {
2045 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2046 x
, y
, width
, height
, border
));
2052 static void GLAPIENTRY
2053 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2054 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2056 GET_CURRENT_CONTEXT(ctx
);
2058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2059 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2068 if (ctx
->ExecuteFlag
) {
2069 CALL_CopyTexSubImage1D(ctx
->Exec
,
2070 (target
, level
, xoffset
, x
, y
, width
));
2075 static void GLAPIENTRY
2076 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2077 GLint xoffset
, GLint yoffset
,
2078 GLint x
, GLint y
, GLsizei width
, GLint height
)
2080 GET_CURRENT_CONTEXT(ctx
);
2082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2083 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2094 if (ctx
->ExecuteFlag
) {
2095 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2096 x
, y
, width
, height
));
2101 static void GLAPIENTRY
2102 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2103 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2104 GLint x
, GLint y
, GLsizei width
, GLint height
)
2106 GET_CURRENT_CONTEXT(ctx
);
2108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2109 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2121 if (ctx
->ExecuteFlag
) {
2122 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2123 xoffset
, yoffset
, zoffset
,
2124 x
, y
, width
, height
));
2129 static void GLAPIENTRY
2130 save_CullFace(GLenum mode
)
2132 GET_CURRENT_CONTEXT(ctx
);
2134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2135 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2139 if (ctx
->ExecuteFlag
) {
2140 CALL_CullFace(ctx
->Exec
, (mode
));
2145 static void GLAPIENTRY
2146 save_DepthFunc(GLenum func
)
2148 GET_CURRENT_CONTEXT(ctx
);
2150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2151 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2155 if (ctx
->ExecuteFlag
) {
2156 CALL_DepthFunc(ctx
->Exec
, (func
));
2161 static void GLAPIENTRY
2162 save_DepthMask(GLboolean mask
)
2164 GET_CURRENT_CONTEXT(ctx
);
2166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2167 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2171 if (ctx
->ExecuteFlag
) {
2172 CALL_DepthMask(ctx
->Exec
, (mask
));
2177 static void GLAPIENTRY
2178 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2180 GET_CURRENT_CONTEXT(ctx
);
2182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2183 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2185 n
[1].f
= (GLfloat
) nearval
;
2186 n
[2].f
= (GLfloat
) farval
;
2188 if (ctx
->ExecuteFlag
) {
2189 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2194 static void GLAPIENTRY
2195 save_Disable(GLenum cap
)
2197 GET_CURRENT_CONTEXT(ctx
);
2199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2200 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2204 if (ctx
->ExecuteFlag
) {
2205 CALL_Disable(ctx
->Exec
, (cap
));
2210 static void GLAPIENTRY
2211 save_DisableIndexed(GLuint index
, GLenum cap
)
2213 GET_CURRENT_CONTEXT(ctx
);
2215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2216 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2221 if (ctx
->ExecuteFlag
) {
2222 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2227 static void GLAPIENTRY
2228 save_DrawBuffer(GLenum mode
)
2230 GET_CURRENT_CONTEXT(ctx
);
2232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2233 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2237 if (ctx
->ExecuteFlag
) {
2238 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2243 static void GLAPIENTRY
2244 save_DrawPixels(GLsizei width
, GLsizei height
,
2245 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2247 GET_CURRENT_CONTEXT(ctx
);
2250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2252 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2258 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2259 pixels
, &ctx
->Unpack
);
2261 if (ctx
->ExecuteFlag
) {
2262 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2268 static void GLAPIENTRY
2269 save_Enable(GLenum cap
)
2271 GET_CURRENT_CONTEXT(ctx
);
2273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2274 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2278 if (ctx
->ExecuteFlag
) {
2279 CALL_Enable(ctx
->Exec
, (cap
));
2285 static void GLAPIENTRY
2286 save_EnableIndexed(GLuint index
, GLenum cap
)
2288 GET_CURRENT_CONTEXT(ctx
);
2290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2291 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2296 if (ctx
->ExecuteFlag
) {
2297 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2303 static void GLAPIENTRY
2304 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2315 if (ctx
->ExecuteFlag
) {
2316 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2321 static void GLAPIENTRY
2322 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2324 GET_CURRENT_CONTEXT(ctx
);
2326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2327 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2335 if (ctx
->ExecuteFlag
) {
2336 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2343 static void GLAPIENTRY
2344 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2346 GET_CURRENT_CONTEXT(ctx
);
2348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2349 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2357 if (ctx
->ExecuteFlag
) {
2358 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2363 static void GLAPIENTRY
2364 save_Fogf(GLenum pname
, GLfloat param
)
2368 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2369 save_Fogfv(pname
, parray
);
2373 static void GLAPIENTRY
2374 save_Fogiv(GLenum pname
, const GLint
*params
)
2379 case GL_FOG_DENSITY
:
2383 p
[0] = (GLfloat
) *params
;
2389 p
[0] = INT_TO_FLOAT(params
[0]);
2390 p
[1] = INT_TO_FLOAT(params
[1]);
2391 p
[2] = INT_TO_FLOAT(params
[2]);
2392 p
[3] = INT_TO_FLOAT(params
[3]);
2395 /* Error will be caught later in gl_Fogfv */
2396 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2398 save_Fogfv(pname
, p
);
2402 static void GLAPIENTRY
2403 save_Fogi(GLenum pname
, GLint param
)
2407 parray
[1] = parray
[2] = parray
[3] = 0;
2408 save_Fogiv(pname
, parray
);
2412 static void GLAPIENTRY
2413 save_FrontFace(GLenum mode
)
2415 GET_CURRENT_CONTEXT(ctx
);
2417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2418 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2422 if (ctx
->ExecuteFlag
) {
2423 CALL_FrontFace(ctx
->Exec
, (mode
));
2428 static void GLAPIENTRY
2429 save_Frustum(GLdouble left
, GLdouble right
,
2430 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2432 GET_CURRENT_CONTEXT(ctx
);
2434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2435 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2437 n
[1].f
= (GLfloat
) left
;
2438 n
[2].f
= (GLfloat
) right
;
2439 n
[3].f
= (GLfloat
) bottom
;
2440 n
[4].f
= (GLfloat
) top
;
2441 n
[5].f
= (GLfloat
) nearval
;
2442 n
[6].f
= (GLfloat
) farval
;
2444 if (ctx
->ExecuteFlag
) {
2445 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2450 static void GLAPIENTRY
2451 save_Hint(GLenum target
, GLenum mode
)
2453 GET_CURRENT_CONTEXT(ctx
);
2455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2456 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2461 if (ctx
->ExecuteFlag
) {
2462 CALL_Hint(ctx
->Exec
, (target
, mode
));
2467 static void GLAPIENTRY
2468 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2471 GET_CURRENT_CONTEXT(ctx
);
2474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2475 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2479 n
[3].e
= internalFormat
;
2482 if (ctx
->ExecuteFlag
) {
2483 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2488 static void GLAPIENTRY
2489 save_IndexMask(GLuint mask
)
2491 GET_CURRENT_CONTEXT(ctx
);
2493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2494 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2498 if (ctx
->ExecuteFlag
) {
2499 CALL_IndexMask(ctx
->Exec
, (mask
));
2504 static void GLAPIENTRY
2505 save_InitNames(void)
2507 GET_CURRENT_CONTEXT(ctx
);
2508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2509 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2510 if (ctx
->ExecuteFlag
) {
2511 CALL_InitNames(ctx
->Exec
, ());
2516 static void GLAPIENTRY
2517 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2519 GET_CURRENT_CONTEXT(ctx
);
2521 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2522 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2540 case GL_SPOT_DIRECTION
:
2543 case GL_SPOT_EXPONENT
:
2546 case GL_SPOT_CUTOFF
:
2549 case GL_CONSTANT_ATTENUATION
:
2552 case GL_LINEAR_ATTENUATION
:
2555 case GL_QUADRATIC_ATTENUATION
:
2561 for (i
= 0; i
< nParams
; i
++) {
2562 n
[3 + i
].f
= params
[i
];
2565 if (ctx
->ExecuteFlag
) {
2566 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2571 static void GLAPIENTRY
2572 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2576 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2577 save_Lightfv(light
, pname
, parray
);
2581 static void GLAPIENTRY
2582 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2589 fparam
[0] = INT_TO_FLOAT(params
[0]);
2590 fparam
[1] = INT_TO_FLOAT(params
[1]);
2591 fparam
[2] = INT_TO_FLOAT(params
[2]);
2592 fparam
[3] = INT_TO_FLOAT(params
[3]);
2595 fparam
[0] = (GLfloat
) params
[0];
2596 fparam
[1] = (GLfloat
) params
[1];
2597 fparam
[2] = (GLfloat
) params
[2];
2598 fparam
[3] = (GLfloat
) params
[3];
2600 case GL_SPOT_DIRECTION
:
2601 fparam
[0] = (GLfloat
) params
[0];
2602 fparam
[1] = (GLfloat
) params
[1];
2603 fparam
[2] = (GLfloat
) params
[2];
2605 case GL_SPOT_EXPONENT
:
2606 case GL_SPOT_CUTOFF
:
2607 case GL_CONSTANT_ATTENUATION
:
2608 case GL_LINEAR_ATTENUATION
:
2609 case GL_QUADRATIC_ATTENUATION
:
2610 fparam
[0] = (GLfloat
) params
[0];
2613 /* error will be caught later in gl_Lightfv */
2616 save_Lightfv(light
, pname
, fparam
);
2620 static void GLAPIENTRY
2621 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2625 parray
[1] = parray
[2] = parray
[3] = 0;
2626 save_Lightiv(light
, pname
, parray
);
2630 static void GLAPIENTRY
2631 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2633 GET_CURRENT_CONTEXT(ctx
);
2635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2636 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2644 if (ctx
->ExecuteFlag
) {
2645 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2650 static void GLAPIENTRY
2651 save_LightModelf(GLenum pname
, GLfloat param
)
2655 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2656 save_LightModelfv(pname
, parray
);
2660 static void GLAPIENTRY
2661 save_LightModeliv(GLenum pname
, const GLint
*params
)
2665 case GL_LIGHT_MODEL_AMBIENT
:
2666 fparam
[0] = INT_TO_FLOAT(params
[0]);
2667 fparam
[1] = INT_TO_FLOAT(params
[1]);
2668 fparam
[2] = INT_TO_FLOAT(params
[2]);
2669 fparam
[3] = INT_TO_FLOAT(params
[3]);
2671 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2672 case GL_LIGHT_MODEL_TWO_SIDE
:
2673 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2674 fparam
[0] = (GLfloat
) params
[0];
2680 /* Error will be caught later in gl_LightModelfv */
2681 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2683 save_LightModelfv(pname
, fparam
);
2687 static void GLAPIENTRY
2688 save_LightModeli(GLenum pname
, GLint param
)
2692 parray
[1] = parray
[2] = parray
[3] = 0;
2693 save_LightModeliv(pname
, parray
);
2697 static void GLAPIENTRY
2698 save_LineStipple(GLint factor
, GLushort pattern
)
2700 GET_CURRENT_CONTEXT(ctx
);
2702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2703 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2708 if (ctx
->ExecuteFlag
) {
2709 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2714 static void GLAPIENTRY
2715 save_LineWidth(GLfloat width
)
2717 GET_CURRENT_CONTEXT(ctx
);
2719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2720 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2724 if (ctx
->ExecuteFlag
) {
2725 CALL_LineWidth(ctx
->Exec
, (width
));
2730 static void GLAPIENTRY
2731 save_ListBase(GLuint base
)
2733 GET_CURRENT_CONTEXT(ctx
);
2735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2736 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2740 if (ctx
->ExecuteFlag
) {
2741 CALL_ListBase(ctx
->Exec
, (base
));
2746 static void GLAPIENTRY
2747 save_LoadIdentity(void)
2749 GET_CURRENT_CONTEXT(ctx
);
2750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2751 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2752 if (ctx
->ExecuteFlag
) {
2753 CALL_LoadIdentity(ctx
->Exec
, ());
2758 static void GLAPIENTRY
2759 save_LoadMatrixf(const GLfloat
* m
)
2761 GET_CURRENT_CONTEXT(ctx
);
2763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2764 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2767 for (i
= 0; i
< 16; i
++) {
2771 if (ctx
->ExecuteFlag
) {
2772 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2777 static void GLAPIENTRY
2778 save_LoadMatrixd(const GLdouble
* m
)
2782 for (i
= 0; i
< 16; i
++) {
2783 f
[i
] = (GLfloat
) m
[i
];
2785 save_LoadMatrixf(f
);
2789 static void GLAPIENTRY
2790 save_LoadName(GLuint name
)
2792 GET_CURRENT_CONTEXT(ctx
);
2794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2795 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_LoadName(ctx
->Exec
, (name
));
2805 static void GLAPIENTRY
2806 save_LogicOp(GLenum opcode
)
2808 GET_CURRENT_CONTEXT(ctx
);
2810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2811 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_LogicOp(ctx
->Exec
, (opcode
));
2821 static void GLAPIENTRY
2822 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2823 GLint order
, const GLdouble
* points
)
2825 GET_CURRENT_CONTEXT(ctx
);
2827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2828 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2830 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2832 n
[2].f
= (GLfloat
) u1
;
2833 n
[3].f
= (GLfloat
) u2
;
2834 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2836 n
[6].data
= (void *) pnts
;
2838 if (ctx
->ExecuteFlag
) {
2839 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2843 static void GLAPIENTRY
2844 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2845 GLint order
, const GLfloat
* points
)
2847 GET_CURRENT_CONTEXT(ctx
);
2849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2850 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2852 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2856 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2858 n
[6].data
= (void *) pnts
;
2860 if (ctx
->ExecuteFlag
) {
2861 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2866 static void GLAPIENTRY
2867 save_Map2d(GLenum target
,
2868 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2869 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2870 const GLdouble
* points
)
2872 GET_CURRENT_CONTEXT(ctx
);
2874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2875 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2877 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2878 vstride
, vorder
, points
);
2880 n
[2].f
= (GLfloat
) u1
;
2881 n
[3].f
= (GLfloat
) u2
;
2882 n
[4].f
= (GLfloat
) v1
;
2883 n
[5].f
= (GLfloat
) v2
;
2884 /* XXX verify these strides are correct */
2885 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2886 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2889 n
[10].data
= (void *) pnts
;
2891 if (ctx
->ExecuteFlag
) {
2892 CALL_Map2d(ctx
->Exec
, (target
,
2893 u1
, u2
, ustride
, uorder
,
2894 v1
, v2
, vstride
, vorder
, points
));
2899 static void GLAPIENTRY
2900 save_Map2f(GLenum target
,
2901 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2902 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2903 const GLfloat
* points
)
2905 GET_CURRENT_CONTEXT(ctx
);
2907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2908 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2910 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2911 vstride
, vorder
, points
);
2917 /* XXX verify these strides are correct */
2918 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2919 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2922 n
[10].data
= (void *) pnts
;
2924 if (ctx
->ExecuteFlag
) {
2925 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2926 v1
, v2
, vstride
, vorder
, points
));
2931 static void GLAPIENTRY
2932 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2934 GET_CURRENT_CONTEXT(ctx
);
2936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2937 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2943 if (ctx
->ExecuteFlag
) {
2944 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2949 static void GLAPIENTRY
2950 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2952 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2956 static void GLAPIENTRY
2957 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2958 GLint vn
, GLfloat v1
, GLfloat v2
)
2960 GET_CURRENT_CONTEXT(ctx
);
2962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2963 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2972 if (ctx
->ExecuteFlag
) {
2973 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2979 static void GLAPIENTRY
2980 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2981 GLint vn
, GLdouble v1
, GLdouble v2
)
2983 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2984 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2988 static void GLAPIENTRY
2989 save_MatrixMode(GLenum mode
)
2991 GET_CURRENT_CONTEXT(ctx
);
2993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2994 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2998 if (ctx
->ExecuteFlag
) {
2999 CALL_MatrixMode(ctx
->Exec
, (mode
));
3004 static void GLAPIENTRY
3005 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3007 GET_CURRENT_CONTEXT(ctx
);
3010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3011 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3014 n
[2].e
= internalFormat
;
3017 if (ctx
->ExecuteFlag
) {
3018 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3023 static void GLAPIENTRY
3024 save_MultMatrixf(const GLfloat
* m
)
3026 GET_CURRENT_CONTEXT(ctx
);
3028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3029 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3032 for (i
= 0; i
< 16; i
++) {
3036 if (ctx
->ExecuteFlag
) {
3037 CALL_MultMatrixf(ctx
->Exec
, (m
));
3042 static void GLAPIENTRY
3043 save_MultMatrixd(const GLdouble
* m
)
3047 for (i
= 0; i
< 16; i
++) {
3048 f
[i
] = (GLfloat
) m
[i
];
3050 save_MultMatrixf(f
);
3054 static void GLAPIENTRY
3055 save_NewList(GLuint name
, GLenum mode
)
3057 GET_CURRENT_CONTEXT(ctx
);
3058 /* It's an error to call this function while building a display list */
3059 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3066 static void GLAPIENTRY
3067 save_Ortho(GLdouble left
, GLdouble right
,
3068 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3070 GET_CURRENT_CONTEXT(ctx
);
3072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3073 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3075 n
[1].f
= (GLfloat
) left
;
3076 n
[2].f
= (GLfloat
) right
;
3077 n
[3].f
= (GLfloat
) bottom
;
3078 n
[4].f
= (GLfloat
) top
;
3079 n
[5].f
= (GLfloat
) nearval
;
3080 n
[6].f
= (GLfloat
) farval
;
3082 if (ctx
->ExecuteFlag
) {
3083 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3088 static void GLAPIENTRY
3089 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3091 GET_CURRENT_CONTEXT(ctx
);
3093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3094 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3098 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
3099 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3101 if (ctx
->ExecuteFlag
) {
3102 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3107 static void GLAPIENTRY
3108 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3110 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3112 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3113 for (i
= 0; i
< mapsize
; i
++) {
3114 fvalues
[i
] = (GLfloat
) values
[i
];
3118 for (i
= 0; i
< mapsize
; i
++) {
3119 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3122 save_PixelMapfv(map
, mapsize
, fvalues
);
3126 static void GLAPIENTRY
3127 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3129 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3131 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3132 for (i
= 0; i
< mapsize
; i
++) {
3133 fvalues
[i
] = (GLfloat
) values
[i
];
3137 for (i
= 0; i
< mapsize
; i
++) {
3138 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3141 save_PixelMapfv(map
, mapsize
, fvalues
);
3145 static void GLAPIENTRY
3146 save_PixelTransferf(GLenum pname
, GLfloat param
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3156 if (ctx
->ExecuteFlag
) {
3157 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3162 static void GLAPIENTRY
3163 save_PixelTransferi(GLenum pname
, GLint param
)
3165 save_PixelTransferf(pname
, (GLfloat
) param
);
3169 static void GLAPIENTRY
3170 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3172 GET_CURRENT_CONTEXT(ctx
);
3174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3175 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3180 if (ctx
->ExecuteFlag
) {
3181 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3186 static void GLAPIENTRY
3187 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3189 GET_CURRENT_CONTEXT(ctx
);
3191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3192 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3199 if (ctx
->ExecuteFlag
) {
3200 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3205 static void GLAPIENTRY
3206 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3210 parray
[1] = parray
[2] = 0.0F
;
3211 save_PointParameterfvEXT(pname
, parray
);
3214 static void GLAPIENTRY
3215 save_PointParameteriNV(GLenum pname
, GLint param
)
3218 parray
[0] = (GLfloat
) param
;
3219 parray
[1] = parray
[2] = 0.0F
;
3220 save_PointParameterfvEXT(pname
, parray
);
3223 static void GLAPIENTRY
3224 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3227 parray
[0] = (GLfloat
) param
[0];
3228 parray
[1] = parray
[2] = 0.0F
;
3229 save_PointParameterfvEXT(pname
, parray
);
3233 static void GLAPIENTRY
3234 save_PointSize(GLfloat size
)
3236 GET_CURRENT_CONTEXT(ctx
);
3238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3239 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_PointSize(ctx
->Exec
, (size
));
3249 static void GLAPIENTRY
3250 save_PolygonMode(GLenum face
, GLenum mode
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3266 static void GLAPIENTRY
3267 save_PolygonStipple(const GLubyte
* pattern
)
3269 GET_CURRENT_CONTEXT(ctx
);
3272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3274 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3276 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3277 pattern
, &ctx
->Unpack
);
3279 if (ctx
->ExecuteFlag
) {
3280 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3285 static void GLAPIENTRY
3286 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3288 GET_CURRENT_CONTEXT(ctx
);
3290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3291 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3296 if (ctx
->ExecuteFlag
) {
3297 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3302 static void GLAPIENTRY
3303 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3305 GET_CURRENT_CONTEXT(ctx
);
3306 /* XXX mult by DepthMaxF here??? */
3307 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3311 static void GLAPIENTRY
3312 save_PopAttrib(void)
3314 GET_CURRENT_CONTEXT(ctx
);
3315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3316 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3317 if (ctx
->ExecuteFlag
) {
3318 CALL_PopAttrib(ctx
->Exec
, ());
3323 static void GLAPIENTRY
3324 save_PopMatrix(void)
3326 GET_CURRENT_CONTEXT(ctx
);
3327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3328 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3329 if (ctx
->ExecuteFlag
) {
3330 CALL_PopMatrix(ctx
->Exec
, ());
3335 static void GLAPIENTRY
3338 GET_CURRENT_CONTEXT(ctx
);
3339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3340 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3341 if (ctx
->ExecuteFlag
) {
3342 CALL_PopName(ctx
->Exec
, ());
3347 static void GLAPIENTRY
3348 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3349 const GLclampf
* priorities
)
3351 GET_CURRENT_CONTEXT(ctx
);
3353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3355 for (i
= 0; i
< num
; i
++) {
3357 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3359 n
[1].ui
= textures
[i
];
3360 n
[2].f
= priorities
[i
];
3363 if (ctx
->ExecuteFlag
) {
3364 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3369 static void GLAPIENTRY
3370 save_PushAttrib(GLbitfield mask
)
3372 GET_CURRENT_CONTEXT(ctx
);
3374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3375 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3379 if (ctx
->ExecuteFlag
) {
3380 CALL_PushAttrib(ctx
->Exec
, (mask
));
3385 static void GLAPIENTRY
3386 save_PushMatrix(void)
3388 GET_CURRENT_CONTEXT(ctx
);
3389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3390 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3391 if (ctx
->ExecuteFlag
) {
3392 CALL_PushMatrix(ctx
->Exec
, ());
3397 static void GLAPIENTRY
3398 save_PushName(GLuint name
)
3400 GET_CURRENT_CONTEXT(ctx
);
3402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3403 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3407 if (ctx
->ExecuteFlag
) {
3408 CALL_PushName(ctx
->Exec
, (name
));
3413 static void GLAPIENTRY
3414 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3416 GET_CURRENT_CONTEXT(ctx
);
3418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3419 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3426 if (ctx
->ExecuteFlag
) {
3427 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3431 static void GLAPIENTRY
3432 save_RasterPos2d(GLdouble x
, GLdouble y
)
3434 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3437 static void GLAPIENTRY
3438 save_RasterPos2f(GLfloat x
, GLfloat y
)
3440 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3443 static void GLAPIENTRY
3444 save_RasterPos2i(GLint x
, GLint y
)
3446 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3449 static void GLAPIENTRY
3450 save_RasterPos2s(GLshort x
, GLshort y
)
3452 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3455 static void GLAPIENTRY
3456 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3458 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3461 static void GLAPIENTRY
3462 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3464 save_RasterPos4f(x
, y
, z
, 1.0F
);
3467 static void GLAPIENTRY
3468 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3470 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3473 static void GLAPIENTRY
3474 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3476 save_RasterPos4f(x
, y
, z
, 1.0F
);
3479 static void GLAPIENTRY
3480 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3482 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3485 static void GLAPIENTRY
3486 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3488 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3491 static void GLAPIENTRY
3492 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3494 save_RasterPos4f(x
, y
, z
, w
);
3497 static void GLAPIENTRY
3498 save_RasterPos2dv(const GLdouble
* v
)
3500 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3503 static void GLAPIENTRY
3504 save_RasterPos2fv(const GLfloat
* v
)
3506 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3509 static void GLAPIENTRY
3510 save_RasterPos2iv(const GLint
* v
)
3512 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3515 static void GLAPIENTRY
3516 save_RasterPos2sv(const GLshort
* v
)
3518 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3521 static void GLAPIENTRY
3522 save_RasterPos3dv(const GLdouble
* v
)
3524 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3527 static void GLAPIENTRY
3528 save_RasterPos3fv(const GLfloat
* v
)
3530 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3533 static void GLAPIENTRY
3534 save_RasterPos3iv(const GLint
* v
)
3536 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3539 static void GLAPIENTRY
3540 save_RasterPos3sv(const GLshort
* v
)
3542 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3545 static void GLAPIENTRY
3546 save_RasterPos4dv(const GLdouble
* v
)
3548 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3549 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3552 static void GLAPIENTRY
3553 save_RasterPos4fv(const GLfloat
* v
)
3555 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3558 static void GLAPIENTRY
3559 save_RasterPos4iv(const GLint
* v
)
3561 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3562 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3565 static void GLAPIENTRY
3566 save_RasterPos4sv(const GLshort
* v
)
3568 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3572 static void GLAPIENTRY
3573 save_PassThrough(GLfloat token
)
3575 GET_CURRENT_CONTEXT(ctx
);
3577 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3578 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3582 if (ctx
->ExecuteFlag
) {
3583 CALL_PassThrough(ctx
->Exec
, (token
));
3588 static void GLAPIENTRY
3589 save_ReadBuffer(GLenum mode
)
3591 GET_CURRENT_CONTEXT(ctx
);
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3598 if (ctx
->ExecuteFlag
) {
3599 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3604 static void GLAPIENTRY
3605 save_ResetHistogram(GLenum target
)
3607 GET_CURRENT_CONTEXT(ctx
);
3609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3610 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3614 if (ctx
->ExecuteFlag
) {
3615 CALL_ResetHistogram(ctx
->Exec
, (target
));
3620 static void GLAPIENTRY
3621 save_ResetMinmax(GLenum target
)
3623 GET_CURRENT_CONTEXT(ctx
);
3625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3626 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3630 if (ctx
->ExecuteFlag
) {
3631 CALL_ResetMinmax(ctx
->Exec
, (target
));
3636 static void GLAPIENTRY
3637 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3639 GET_CURRENT_CONTEXT(ctx
);
3641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3642 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3649 if (ctx
->ExecuteFlag
) {
3650 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3655 static void GLAPIENTRY
3656 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3658 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3662 static void GLAPIENTRY
3663 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3665 GET_CURRENT_CONTEXT(ctx
);
3667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3668 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3674 if (ctx
->ExecuteFlag
) {
3675 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3680 static void GLAPIENTRY
3681 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3683 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3687 static void GLAPIENTRY
3688 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3690 GET_CURRENT_CONTEXT(ctx
);
3692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3693 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3700 if (ctx
->ExecuteFlag
) {
3701 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3706 static void GLAPIENTRY
3707 save_ShadeModel(GLenum mode
)
3709 GET_CURRENT_CONTEXT(ctx
);
3711 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3713 if (ctx
->ExecuteFlag
) {
3714 CALL_ShadeModel(ctx
->Exec
, (mode
));
3717 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3720 SAVE_FLUSH_VERTICES(ctx
);
3722 /* Only save the value if we know the statechange will take effect:
3724 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3725 ctx
->ListState
.Current
.ShadeModel
= mode
;
3727 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3734 static void GLAPIENTRY
3735 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3737 GET_CURRENT_CONTEXT(ctx
);
3739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3740 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3746 if (ctx
->ExecuteFlag
) {
3747 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3752 static void GLAPIENTRY
3753 save_StencilMask(GLuint mask
)
3755 GET_CURRENT_CONTEXT(ctx
);
3757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3758 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3762 if (ctx
->ExecuteFlag
) {
3763 CALL_StencilMask(ctx
->Exec
, (mask
));
3768 static void GLAPIENTRY
3769 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3771 GET_CURRENT_CONTEXT(ctx
);
3773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3774 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3780 if (ctx
->ExecuteFlag
) {
3781 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3786 static void GLAPIENTRY
3787 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3789 GET_CURRENT_CONTEXT(ctx
);
3791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3792 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3799 if (ctx
->ExecuteFlag
) {
3800 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3805 static void GLAPIENTRY
3806 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3809 GET_CURRENT_CONTEXT(ctx
);
3811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3813 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3821 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3828 if (ctx
->ExecuteFlag
) {
3829 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3830 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3835 static void GLAPIENTRY
3836 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3838 GET_CURRENT_CONTEXT(ctx
);
3840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3841 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3846 if (ctx
->ExecuteFlag
) {
3847 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3852 static void GLAPIENTRY
3853 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3855 GET_CURRENT_CONTEXT(ctx
);
3857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3858 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3865 if (ctx
->ExecuteFlag
) {
3866 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3871 static void GLAPIENTRY
3872 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3874 GET_CURRENT_CONTEXT(ctx
);
3876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3877 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3881 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3889 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3892 if (ctx
->ExecuteFlag
) {
3893 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3898 static void GLAPIENTRY
3899 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3902 parray
[0] = (GLfloat
) param
;
3903 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3904 save_TexEnvfv(target
, pname
, parray
);
3908 static void GLAPIENTRY
3909 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3912 p
[0] = (GLfloat
) param
;
3913 p
[1] = p
[2] = p
[3] = 0.0F
;
3914 save_TexEnvfv(target
, pname
, p
);
3918 static void GLAPIENTRY
3919 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3922 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3923 p
[0] = INT_TO_FLOAT(param
[0]);
3924 p
[1] = INT_TO_FLOAT(param
[1]);
3925 p
[2] = INT_TO_FLOAT(param
[2]);
3926 p
[3] = INT_TO_FLOAT(param
[3]);
3929 p
[0] = (GLfloat
) param
[0];
3930 p
[1] = p
[2] = p
[3] = 0.0F
;
3932 save_TexEnvfv(target
, pname
, p
);
3936 static void GLAPIENTRY
3937 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3939 GET_CURRENT_CONTEXT(ctx
);
3941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3942 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3951 if (ctx
->ExecuteFlag
) {
3952 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3957 static void GLAPIENTRY
3958 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3961 p
[0] = (GLfloat
) params
[0];
3962 p
[1] = (GLfloat
) params
[1];
3963 p
[2] = (GLfloat
) params
[2];
3964 p
[3] = (GLfloat
) params
[3];
3965 save_TexGenfv(coord
, pname
, p
);
3969 static void GLAPIENTRY
3970 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3973 parray
[0] = (GLfloat
) param
;
3974 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3975 save_TexGenfv(coord
, pname
, parray
);
3979 static void GLAPIENTRY
3980 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3983 p
[0] = (GLfloat
) params
[0];
3984 p
[1] = (GLfloat
) params
[1];
3985 p
[2] = (GLfloat
) params
[2];
3986 p
[3] = (GLfloat
) params
[3];
3987 save_TexGenfv(coord
, pname
, p
);
3991 static void GLAPIENTRY
3992 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3996 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3997 save_TexGenfv(coord
, pname
, parray
);
4001 static void GLAPIENTRY
4002 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4006 parray
[1] = parray
[2] = parray
[3] = 0;
4007 save_TexGeniv(coord
, pname
, parray
);
4011 static void GLAPIENTRY
4012 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4014 GET_CURRENT_CONTEXT(ctx
);
4016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4017 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4026 if (ctx
->ExecuteFlag
) {
4027 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4032 static void GLAPIENTRY
4033 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4037 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4038 save_TexParameterfv(target
, pname
, parray
);
4042 static void GLAPIENTRY
4043 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4046 fparam
[0] = (GLfloat
) param
;
4047 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4048 save_TexParameterfv(target
, pname
, fparam
);
4052 static void GLAPIENTRY
4053 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4056 fparam
[0] = (GLfloat
) params
[0];
4057 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4058 save_TexParameterfv(target
, pname
, fparam
);
4062 static void GLAPIENTRY
4063 save_TexImage1D(GLenum target
,
4064 GLint level
, GLint components
,
4065 GLsizei width
, GLint border
,
4066 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4068 GET_CURRENT_CONTEXT(ctx
);
4069 if (target
== GL_PROXY_TEXTURE_1D
) {
4070 /* don't compile, execute immediately */
4071 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4072 border
, format
, type
, pixels
));
4076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4077 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4081 n
[3].i
= components
;
4082 n
[4].i
= (GLint
) width
;
4086 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4087 pixels
, &ctx
->Unpack
);
4089 if (ctx
->ExecuteFlag
) {
4090 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4091 border
, format
, type
, pixels
));
4097 static void GLAPIENTRY
4098 save_TexImage2D(GLenum target
,
4099 GLint level
, GLint components
,
4100 GLsizei width
, GLsizei height
, GLint border
,
4101 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4103 GET_CURRENT_CONTEXT(ctx
);
4104 if (target
== GL_PROXY_TEXTURE_2D
) {
4105 /* don't compile, execute immediately */
4106 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4107 height
, border
, format
, type
, pixels
));
4111 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4112 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4116 n
[3].i
= components
;
4117 n
[4].i
= (GLint
) width
;
4118 n
[5].i
= (GLint
) height
;
4122 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4123 pixels
, &ctx
->Unpack
);
4125 if (ctx
->ExecuteFlag
) {
4126 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4127 height
, border
, format
, type
, pixels
));
4133 static void GLAPIENTRY
4134 save_TexImage3D(GLenum target
,
4135 GLint level
, GLint internalFormat
,
4136 GLsizei width
, GLsizei height
, GLsizei depth
,
4138 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4140 GET_CURRENT_CONTEXT(ctx
);
4141 if (target
== GL_PROXY_TEXTURE_3D
) {
4142 /* don't compile, execute immediately */
4143 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4144 height
, depth
, border
, format
, type
,
4149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4150 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4154 n
[3].i
= (GLint
) internalFormat
;
4155 n
[4].i
= (GLint
) width
;
4156 n
[5].i
= (GLint
) height
;
4157 n
[6].i
= (GLint
) depth
;
4161 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4162 pixels
, &ctx
->Unpack
);
4164 if (ctx
->ExecuteFlag
) {
4165 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4166 height
, depth
, border
, format
, type
,
4173 static void GLAPIENTRY
4174 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4175 GLsizei width
, GLenum format
, GLenum type
,
4176 const GLvoid
* pixels
)
4178 GET_CURRENT_CONTEXT(ctx
);
4181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4183 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4188 n
[4].i
= (GLint
) width
;
4191 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4192 pixels
, &ctx
->Unpack
);
4194 if (ctx
->ExecuteFlag
) {
4195 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4196 format
, type
, pixels
));
4201 static void GLAPIENTRY
4202 save_TexSubImage2D(GLenum target
, GLint level
,
4203 GLint xoffset
, GLint yoffset
,
4204 GLsizei width
, GLsizei height
,
4205 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4207 GET_CURRENT_CONTEXT(ctx
);
4210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4212 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4218 n
[5].i
= (GLint
) width
;
4219 n
[6].i
= (GLint
) height
;
4222 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4223 pixels
, &ctx
->Unpack
);
4225 if (ctx
->ExecuteFlag
) {
4226 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4227 width
, height
, format
, type
, pixels
));
4232 static void GLAPIENTRY
4233 save_TexSubImage3D(GLenum target
, GLint level
,
4234 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4235 GLsizei width
, GLsizei height
, GLsizei depth
,
4236 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4238 GET_CURRENT_CONTEXT(ctx
);
4241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4243 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4250 n
[6].i
= (GLint
) width
;
4251 n
[7].i
= (GLint
) height
;
4252 n
[8].i
= (GLint
) depth
;
4255 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4256 pixels
, &ctx
->Unpack
);
4258 if (ctx
->ExecuteFlag
) {
4259 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4260 xoffset
, yoffset
, zoffset
,
4261 width
, height
, depth
, format
, type
,
4267 static void GLAPIENTRY
4268 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4270 GET_CURRENT_CONTEXT(ctx
);
4272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4273 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4279 if (ctx
->ExecuteFlag
) {
4280 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4285 static void GLAPIENTRY
4286 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4288 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4293 static void GLAPIENTRY
4294 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4296 GET_CURRENT_CONTEXT(ctx
);
4298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4299 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4303 n
[3].i
= (GLint
) width
;
4304 n
[4].i
= (GLint
) height
;
4306 if (ctx
->ExecuteFlag
) {
4307 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4312 static void GLAPIENTRY
4313 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4315 GET_CURRENT_CONTEXT(ctx
);
4317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4318 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4325 if (ctx
->ExecuteFlag
) {
4326 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4330 static void GLAPIENTRY
4331 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4333 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4336 static void GLAPIENTRY
4337 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4339 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4342 static void GLAPIENTRY
4343 save_WindowPos2iMESA(GLint x
, GLint y
)
4345 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4348 static void GLAPIENTRY
4349 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4351 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4354 static void GLAPIENTRY
4355 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4357 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4360 static void GLAPIENTRY
4361 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4363 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4366 static void GLAPIENTRY
4367 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4369 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4372 static void GLAPIENTRY
4373 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4375 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4378 static void GLAPIENTRY
4379 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4381 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4384 static void GLAPIENTRY
4385 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4387 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4390 static void GLAPIENTRY
4391 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4393 save_WindowPos4fMESA(x
, y
, z
, w
);
4396 static void GLAPIENTRY
4397 save_WindowPos2dvMESA(const GLdouble
* v
)
4399 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4402 static void GLAPIENTRY
4403 save_WindowPos2fvMESA(const GLfloat
* v
)
4405 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4408 static void GLAPIENTRY
4409 save_WindowPos2ivMESA(const GLint
* v
)
4411 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4414 static void GLAPIENTRY
4415 save_WindowPos2svMESA(const GLshort
* v
)
4417 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4420 static void GLAPIENTRY
4421 save_WindowPos3dvMESA(const GLdouble
* v
)
4423 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4426 static void GLAPIENTRY
4427 save_WindowPos3fvMESA(const GLfloat
* v
)
4429 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4432 static void GLAPIENTRY
4433 save_WindowPos3ivMESA(const GLint
* v
)
4435 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4438 static void GLAPIENTRY
4439 save_WindowPos3svMESA(const GLshort
* v
)
4441 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4444 static void GLAPIENTRY
4445 save_WindowPos4dvMESA(const GLdouble
* v
)
4447 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4448 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4451 static void GLAPIENTRY
4452 save_WindowPos4fvMESA(const GLfloat
* v
)
4454 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4457 static void GLAPIENTRY
4458 save_WindowPos4ivMESA(const GLint
* v
)
4460 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4461 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4464 static void GLAPIENTRY
4465 save_WindowPos4svMESA(const GLshort
* v
)
4467 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4472 /* GL_ARB_multitexture */
4473 static void GLAPIENTRY
4474 save_ActiveTextureARB(GLenum target
)
4476 GET_CURRENT_CONTEXT(ctx
);
4478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4479 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4483 if (ctx
->ExecuteFlag
) {
4484 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4489 /* GL_ARB_transpose_matrix */
4491 static void GLAPIENTRY
4492 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4495 _math_transposefd(tm
, m
);
4496 save_LoadMatrixf(tm
);
4500 static void GLAPIENTRY
4501 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4504 _math_transposef(tm
, m
);
4505 save_LoadMatrixf(tm
);
4509 static void GLAPIENTRY
4510 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4513 _math_transposefd(tm
, m
);
4514 save_MultMatrixf(tm
);
4518 static void GLAPIENTRY
4519 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4522 _math_transposef(tm
, m
);
4523 save_MultMatrixf(tm
);
4526 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4528 GET_CURRENT_CONTEXT(ctx
);
4534 image
= malloc(size
);
4536 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4539 memcpy(image
, data
, size
);
4545 /* GL_ARB_texture_compression */
4546 static void GLAPIENTRY
4547 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4548 GLenum internalFormat
, GLsizei width
,
4549 GLint border
, GLsizei imageSize
,
4550 const GLvoid
* data
)
4552 GET_CURRENT_CONTEXT(ctx
);
4553 if (target
== GL_PROXY_TEXTURE_1D
) {
4554 /* don't compile, execute immediately */
4555 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4556 width
, border
, imageSize
,
4561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4563 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4567 n
[3].e
= internalFormat
;
4568 n
[4].i
= (GLint
) width
;
4571 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4573 if (ctx
->ExecuteFlag
) {
4574 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4575 (target
, level
, internalFormat
, width
,
4576 border
, imageSize
, data
));
4582 static void GLAPIENTRY
4583 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4584 GLenum internalFormat
, GLsizei width
,
4585 GLsizei height
, GLint border
, GLsizei imageSize
,
4586 const GLvoid
* data
)
4588 GET_CURRENT_CONTEXT(ctx
);
4589 if (target
== GL_PROXY_TEXTURE_2D
) {
4590 /* don't compile, execute immediately */
4591 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4592 width
, height
, border
,
4597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4599 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4603 n
[3].e
= internalFormat
;
4604 n
[4].i
= (GLint
) width
;
4605 n
[5].i
= (GLint
) height
;
4608 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4610 if (ctx
->ExecuteFlag
) {
4611 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4612 (target
, level
, internalFormat
, width
,
4613 height
, border
, imageSize
, data
));
4619 static void GLAPIENTRY
4620 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4621 GLenum internalFormat
, GLsizei width
,
4622 GLsizei height
, GLsizei depth
, GLint border
,
4623 GLsizei imageSize
, const GLvoid
* data
)
4625 GET_CURRENT_CONTEXT(ctx
);
4626 if (target
== GL_PROXY_TEXTURE_3D
) {
4627 /* don't compile, execute immediately */
4628 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4629 width
, height
, depth
, border
,
4634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4636 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4640 n
[3].e
= internalFormat
;
4641 n
[4].i
= (GLint
) width
;
4642 n
[5].i
= (GLint
) height
;
4643 n
[6].i
= (GLint
) depth
;
4646 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4650 (target
, level
, internalFormat
, width
,
4651 height
, depth
, border
, imageSize
,
4658 static void GLAPIENTRY
4659 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4660 GLsizei width
, GLenum format
,
4661 GLsizei imageSize
, const GLvoid
* data
)
4664 GET_CURRENT_CONTEXT(ctx
);
4665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4667 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4672 n
[4].i
= (GLint
) width
;
4675 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4677 if (ctx
->ExecuteFlag
) {
4678 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4679 width
, format
, imageSize
,
4685 static void GLAPIENTRY
4686 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4687 GLint yoffset
, GLsizei width
, GLsizei height
,
4688 GLenum format
, GLsizei imageSize
,
4689 const GLvoid
* data
)
4692 GET_CURRENT_CONTEXT(ctx
);
4693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4695 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4701 n
[5].i
= (GLint
) width
;
4702 n
[6].i
= (GLint
) height
;
4705 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4707 if (ctx
->ExecuteFlag
) {
4708 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4709 (target
, level
, xoffset
, yoffset
, width
,
4710 height
, format
, imageSize
, data
));
4715 static void GLAPIENTRY
4716 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4717 GLint yoffset
, GLint zoffset
, GLsizei width
,
4718 GLsizei height
, GLsizei depth
, GLenum format
,
4719 GLsizei imageSize
, const GLvoid
* data
)
4722 GET_CURRENT_CONTEXT(ctx
);
4723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4725 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4732 n
[6].i
= (GLint
) width
;
4733 n
[7].i
= (GLint
) height
;
4734 n
[8].i
= (GLint
) depth
;
4736 n
[10].i
= imageSize
;
4737 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4739 if (ctx
->ExecuteFlag
) {
4740 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4741 (target
, level
, xoffset
, yoffset
,
4742 zoffset
, width
, height
, depth
, format
,
4748 /* GL_ARB_multisample */
4749 static void GLAPIENTRY
4750 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4752 GET_CURRENT_CONTEXT(ctx
);
4754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4755 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4760 if (ctx
->ExecuteFlag
) {
4761 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4767 * GL_NV_vertex_program
4769 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4770 static void GLAPIENTRY
4771 save_BindProgramNV(GLenum target
, GLuint id
)
4773 GET_CURRENT_CONTEXT(ctx
);
4775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4776 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4781 if (ctx
->ExecuteFlag
) {
4782 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4786 static void GLAPIENTRY
4787 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4788 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4790 GET_CURRENT_CONTEXT(ctx
);
4792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4793 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4802 if (ctx
->ExecuteFlag
) {
4803 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4808 static void GLAPIENTRY
4809 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4810 const GLfloat
*params
)
4812 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4813 params
[2], params
[3]);
4817 static void GLAPIENTRY
4818 save_ProgramEnvParameters4fvEXT(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_ENV_PARAMETER_ARB
, 6);
4843 if (ctx
->ExecuteFlag
) {
4844 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4849 static void GLAPIENTRY
4850 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4851 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4853 save_ProgramEnvParameter4fARB(target
, index
,
4855 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4859 static void GLAPIENTRY
4860 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4861 const GLdouble
*params
)
4863 save_ProgramEnvParameter4fARB(target
, index
,
4864 (GLfloat
) params
[0],
4865 (GLfloat
) params
[1],
4866 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4869 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4871 #if FEATURE_NV_vertex_program
4872 static void GLAPIENTRY
4873 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4878 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4887 if (ctx
->ExecuteFlag
) {
4888 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4893 static void GLAPIENTRY
4894 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4895 GLsizei num
, const GLdouble
*params
)
4898 for (i
= 0; i
< num
; i
++) {
4899 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4904 static void GLAPIENTRY
4905 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4906 GLsizei num
, const GLfloat
*params
)
4909 for (i
= 0; i
< num
; i
++) {
4910 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4915 static void GLAPIENTRY
4916 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4917 const GLubyte
* program
)
4919 GET_CURRENT_CONTEXT(ctx
);
4922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4924 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4926 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
4928 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4931 memcpy(programCopy
, program
, len
);
4935 n
[4].data
= programCopy
;
4937 if (ctx
->ExecuteFlag
) {
4938 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4943 static void GLAPIENTRY
4944 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4946 GET_CURRENT_CONTEXT(ctx
);
4949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4951 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4953 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
4955 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4958 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4962 if (ctx
->ExecuteFlag
) {
4963 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4968 static void GLAPIENTRY
4969 save_TrackMatrixNV(GLenum target
, GLuint address
,
4970 GLenum matrix
, GLenum transform
)
4972 GET_CURRENT_CONTEXT(ctx
);
4974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4975 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4982 if (ctx
->ExecuteFlag
) {
4983 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4986 #endif /* FEATURE_NV_vertex_program */
4990 * GL_NV_fragment_program
4992 #if FEATURE_NV_fragment_program
4993 static void GLAPIENTRY
4994 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4995 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4997 GET_CURRENT_CONTEXT(ctx
);
4999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5000 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5009 if (ctx
->ExecuteFlag
) {
5010 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5015 static void GLAPIENTRY
5016 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5017 const GLfloat
*params
)
5019 GET_CURRENT_CONTEXT(ctx
);
5021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5022 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5031 if (ctx
->ExecuteFlag
) {
5032 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5037 static void GLAPIENTRY
5038 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5039 const GLfloat
*params
)
5041 GET_CURRENT_CONTEXT(ctx
);
5043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5047 const GLfloat
* p
= params
;
5049 for (i
= 0 ; i
< count
; i
++) {
5050 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5063 if (ctx
->ExecuteFlag
) {
5064 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5069 static void GLAPIENTRY
5070 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5071 GLdouble x
, GLdouble y
,
5072 GLdouble z
, GLdouble w
)
5074 GET_CURRENT_CONTEXT(ctx
);
5076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5077 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5081 n
[3].f
= (GLfloat
) x
;
5082 n
[4].f
= (GLfloat
) y
;
5083 n
[5].f
= (GLfloat
) z
;
5084 n
[6].f
= (GLfloat
) w
;
5086 if (ctx
->ExecuteFlag
) {
5087 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5092 static void GLAPIENTRY
5093 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5094 const GLdouble
*params
)
5096 GET_CURRENT_CONTEXT(ctx
);
5098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5099 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5103 n
[3].f
= (GLfloat
) params
[0];
5104 n
[4].f
= (GLfloat
) params
[1];
5105 n
[5].f
= (GLfloat
) params
[2];
5106 n
[6].f
= (GLfloat
) params
[3];
5108 if (ctx
->ExecuteFlag
) {
5109 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5113 static void GLAPIENTRY
5114 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5115 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5117 GET_CURRENT_CONTEXT(ctx
);
5120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5122 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5124 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
5126 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5129 memcpy(nameCopy
, name
, len
);
5132 n
[3].data
= nameCopy
;
5138 if (ctx
->ExecuteFlag
) {
5139 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5144 static void GLAPIENTRY
5145 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5148 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5152 static void GLAPIENTRY
5153 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5154 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5156 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5157 (GLfloat
) z
, (GLfloat
) w
);
5161 static void GLAPIENTRY
5162 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5165 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5166 (GLfloat
) v
[1], (GLfloat
) v
[2],
5170 #endif /* FEATURE_NV_fragment_program */
5174 /* GL_EXT_stencil_two_side */
5175 static void GLAPIENTRY
5176 save_ActiveStencilFaceEXT(GLenum face
)
5178 GET_CURRENT_CONTEXT(ctx
);
5180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5181 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5185 if (ctx
->ExecuteFlag
) {
5186 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5191 /* GL_EXT_depth_bounds_test */
5192 static void GLAPIENTRY
5193 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5195 GET_CURRENT_CONTEXT(ctx
);
5197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5198 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5200 n
[1].f
= (GLfloat
) zmin
;
5201 n
[2].f
= (GLfloat
) zmax
;
5203 if (ctx
->ExecuteFlag
) {
5204 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5210 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5212 static void GLAPIENTRY
5213 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5214 const GLvoid
* string
)
5216 GET_CURRENT_CONTEXT(ctx
);
5219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5221 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5223 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5225 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5228 memcpy(programCopy
, string
, len
);
5232 n
[4].data
= programCopy
;
5234 if (ctx
->ExecuteFlag
) {
5235 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5239 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5242 #if FEATURE_queryobj
5244 static void GLAPIENTRY
5245 save_BeginQueryARB(GLenum target
, GLuint id
)
5247 GET_CURRENT_CONTEXT(ctx
);
5249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5250 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5255 if (ctx
->ExecuteFlag
) {
5256 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5261 static void GLAPIENTRY
5262 save_EndQueryARB(GLenum target
)
5264 GET_CURRENT_CONTEXT(ctx
);
5266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5267 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5271 if (ctx
->ExecuteFlag
) {
5272 CALL_EndQueryARB(ctx
->Exec
, (target
));
5276 #endif /* FEATURE_queryobj */
5279 static void GLAPIENTRY
5280 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5282 GET_CURRENT_CONTEXT(ctx
);
5284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5285 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5289 if (count
> MAX_DRAW_BUFFERS
)
5290 count
= MAX_DRAW_BUFFERS
;
5291 for (i
= 0; i
< count
; i
++) {
5292 n
[2 + i
].e
= buffers
[i
];
5295 if (ctx
->ExecuteFlag
) {
5296 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5300 static void GLAPIENTRY
5301 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5303 GET_CURRENT_CONTEXT(ctx
);
5306 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5314 if (ctx
->ExecuteFlag
) {
5315 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5319 static void GLAPIENTRY
5320 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5323 p
[0] = INT_TO_FLOAT(param
[0]);
5324 p
[1] = INT_TO_FLOAT(param
[1]);
5325 p
[2] = INT_TO_FLOAT(param
[2]);
5326 p
[3] = INT_TO_FLOAT(param
[3]);
5327 save_TexBumpParameterfvATI(pname
, p
);
5330 #if FEATURE_ATI_fragment_shader
5331 static void GLAPIENTRY
5332 save_BindFragmentShaderATI(GLuint id
)
5334 GET_CURRENT_CONTEXT(ctx
);
5337 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5341 if (ctx
->ExecuteFlag
) {
5342 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5346 static void GLAPIENTRY
5347 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5349 GET_CURRENT_CONTEXT(ctx
);
5352 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5360 if (ctx
->ExecuteFlag
) {
5361 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5366 static void GLAPIENTRY
5367 save_Attr1fNV(GLenum attr
, GLfloat x
)
5369 GET_CURRENT_CONTEXT(ctx
);
5371 SAVE_FLUSH_VERTICES(ctx
);
5372 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5378 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5379 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5380 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5382 if (ctx
->ExecuteFlag
) {
5383 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5387 static void GLAPIENTRY
5388 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5390 GET_CURRENT_CONTEXT(ctx
);
5392 SAVE_FLUSH_VERTICES(ctx
);
5393 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5400 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5401 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5402 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5404 if (ctx
->ExecuteFlag
) {
5405 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5409 static void GLAPIENTRY
5410 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5412 GET_CURRENT_CONTEXT(ctx
);
5414 SAVE_FLUSH_VERTICES(ctx
);
5415 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5423 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5424 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5425 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5427 if (ctx
->ExecuteFlag
) {
5428 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5432 static void GLAPIENTRY
5433 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5435 GET_CURRENT_CONTEXT(ctx
);
5437 SAVE_FLUSH_VERTICES(ctx
);
5438 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5447 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5448 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5449 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5451 if (ctx
->ExecuteFlag
) {
5452 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5457 static void GLAPIENTRY
5458 save_Attr1fARB(GLenum attr
, GLfloat x
)
5460 GET_CURRENT_CONTEXT(ctx
);
5462 SAVE_FLUSH_VERTICES(ctx
);
5463 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5469 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5470 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5471 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5473 if (ctx
->ExecuteFlag
) {
5474 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5478 static void GLAPIENTRY
5479 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5481 GET_CURRENT_CONTEXT(ctx
);
5483 SAVE_FLUSH_VERTICES(ctx
);
5484 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5491 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5492 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5493 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5495 if (ctx
->ExecuteFlag
) {
5496 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5500 static void GLAPIENTRY
5501 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5503 GET_CURRENT_CONTEXT(ctx
);
5505 SAVE_FLUSH_VERTICES(ctx
);
5506 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5514 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5515 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5516 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5518 if (ctx
->ExecuteFlag
) {
5519 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5523 static void GLAPIENTRY
5524 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5526 GET_CURRENT_CONTEXT(ctx
);
5528 SAVE_FLUSH_VERTICES(ctx
);
5529 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5538 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5539 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5540 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5542 if (ctx
->ExecuteFlag
) {
5543 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5548 static void GLAPIENTRY
5549 save_EvalCoord1f(GLfloat x
)
5551 GET_CURRENT_CONTEXT(ctx
);
5553 SAVE_FLUSH_VERTICES(ctx
);
5554 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5558 if (ctx
->ExecuteFlag
) {
5559 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5563 static void GLAPIENTRY
5564 save_EvalCoord1fv(const GLfloat
* v
)
5566 save_EvalCoord1f(v
[0]);
5569 static void GLAPIENTRY
5570 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5572 GET_CURRENT_CONTEXT(ctx
);
5574 SAVE_FLUSH_VERTICES(ctx
);
5575 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5580 if (ctx
->ExecuteFlag
) {
5581 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5585 static void GLAPIENTRY
5586 save_EvalCoord2fv(const GLfloat
* v
)
5588 save_EvalCoord2f(v
[0], v
[1]);
5592 static void GLAPIENTRY
5593 save_EvalPoint1(GLint x
)
5595 GET_CURRENT_CONTEXT(ctx
);
5597 SAVE_FLUSH_VERTICES(ctx
);
5598 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5602 if (ctx
->ExecuteFlag
) {
5603 CALL_EvalPoint1(ctx
->Exec
, (x
));
5607 static void GLAPIENTRY
5608 save_EvalPoint2(GLint x
, GLint y
)
5610 GET_CURRENT_CONTEXT(ctx
);
5612 SAVE_FLUSH_VERTICES(ctx
);
5613 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5618 if (ctx
->ExecuteFlag
) {
5619 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5623 static void GLAPIENTRY
5624 save_Indexf(GLfloat x
)
5626 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5629 static void GLAPIENTRY
5630 save_Indexfv(const GLfloat
* v
)
5632 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5635 static void GLAPIENTRY
5636 save_EdgeFlag(GLboolean x
)
5638 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5641 static inline GLboolean
compare4fv( const GLfloat
*a
,
5645 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5649 static void GLAPIENTRY
5650 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5652 GET_CURRENT_CONTEXT(ctx
);
5660 case GL_FRONT_AND_BACK
:
5663 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5672 case GL_AMBIENT_AND_DIFFUSE
:
5678 case GL_COLOR_INDEXES
:
5682 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5686 if (ctx
->ExecuteFlag
) {
5687 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5690 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5692 /* Try to eliminate redundant statechanges. Because it is legal to
5693 * call glMaterial even inside begin/end calls, don't need to worry
5694 * about ctx->Driver.CurrentSavePrimitive here.
5696 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5697 if (bitmask
& (1 << i
)) {
5698 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5699 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5700 bitmask
&= ~(1 << i
);
5703 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5704 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5709 /* If this call has effect, return early:
5714 SAVE_FLUSH_VERTICES(ctx
);
5716 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5720 for (i
= 0; i
< args
; i
++)
5721 n
[3 + i
].f
= param
[i
];
5725 static void GLAPIENTRY
5726 save_Begin(GLenum mode
)
5728 GET_CURRENT_CONTEXT(ctx
);
5730 GLboolean error
= GL_FALSE
;
5732 if (!_mesa_valid_prim_mode(ctx
, mode
)) {
5733 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
5736 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5737 /* Typically the first begin. This may raise an error on
5738 * playback, depending on whether CallList is issued from inside
5739 * a begin/end or not.
5741 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5743 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5744 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5747 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5752 /* Give the driver an opportunity to hook in an optimized
5753 * display list compiler.
5755 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5758 SAVE_FLUSH_VERTICES(ctx
);
5759 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5765 if (ctx
->ExecuteFlag
) {
5766 CALL_Begin(ctx
->Exec
, (mode
));
5770 static void GLAPIENTRY
5773 GET_CURRENT_CONTEXT(ctx
);
5774 SAVE_FLUSH_VERTICES(ctx
);
5775 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5776 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5777 if (ctx
->ExecuteFlag
) {
5778 CALL_End(ctx
->Exec
, ());
5782 static void GLAPIENTRY
5783 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5785 GET_CURRENT_CONTEXT(ctx
);
5787 SAVE_FLUSH_VERTICES(ctx
);
5788 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5795 if (ctx
->ExecuteFlag
) {
5796 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5801 static void GLAPIENTRY
5802 save_Vertex2f(GLfloat x
, GLfloat y
)
5804 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5807 static void GLAPIENTRY
5808 save_Vertex2fv(const GLfloat
* v
)
5810 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5813 static void GLAPIENTRY
5814 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5816 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5819 static void GLAPIENTRY
5820 save_Vertex3fv(const GLfloat
* v
)
5822 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5825 static void GLAPIENTRY
5826 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5828 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5831 static void GLAPIENTRY
5832 save_Vertex4fv(const GLfloat
* v
)
5834 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5837 static void GLAPIENTRY
5838 save_TexCoord1f(GLfloat x
)
5840 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5843 static void GLAPIENTRY
5844 save_TexCoord1fv(const GLfloat
* v
)
5846 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5849 static void GLAPIENTRY
5850 save_TexCoord2f(GLfloat x
, GLfloat y
)
5852 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5855 static void GLAPIENTRY
5856 save_TexCoord2fv(const GLfloat
* v
)
5858 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5861 static void GLAPIENTRY
5862 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5864 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5867 static void GLAPIENTRY
5868 save_TexCoord3fv(const GLfloat
* v
)
5870 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5873 static void GLAPIENTRY
5874 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5876 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5879 static void GLAPIENTRY
5880 save_TexCoord4fv(const GLfloat
* v
)
5882 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5885 static void GLAPIENTRY
5886 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5888 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5891 static void GLAPIENTRY
5892 save_Normal3fv(const GLfloat
* v
)
5894 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5897 static void GLAPIENTRY
5898 save_FogCoordfEXT(GLfloat x
)
5900 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5903 static void GLAPIENTRY
5904 save_FogCoordfvEXT(const GLfloat
* v
)
5906 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5909 static void GLAPIENTRY
5910 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5912 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5915 static void GLAPIENTRY
5916 save_Color3fv(const GLfloat
* v
)
5918 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5921 static void GLAPIENTRY
5922 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5924 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5927 static void GLAPIENTRY
5928 save_Color4fv(const GLfloat
* v
)
5930 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5933 static void GLAPIENTRY
5934 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5936 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5939 static void GLAPIENTRY
5940 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5942 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5946 /* Just call the respective ATTR for texcoord
5948 static void GLAPIENTRY
5949 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5951 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5952 save_Attr1fNV(attr
, x
);
5955 static void GLAPIENTRY
5956 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5958 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5959 save_Attr1fNV(attr
, v
[0]);
5962 static void GLAPIENTRY
5963 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5965 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5966 save_Attr2fNV(attr
, x
, y
);
5969 static void GLAPIENTRY
5970 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5972 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5973 save_Attr2fNV(attr
, v
[0], v
[1]);
5976 static void GLAPIENTRY
5977 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5979 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5980 save_Attr3fNV(attr
, x
, y
, z
);
5983 static void GLAPIENTRY
5984 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5986 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5987 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5990 static void GLAPIENTRY
5991 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5992 GLfloat z
, GLfloat w
)
5994 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5995 save_Attr4fNV(attr
, x
, y
, z
, w
);
5998 static void GLAPIENTRY
5999 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6001 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6002 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6007 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6013 GET_CURRENT_CONTEXT(ctx
);
6014 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6018 /* First level for NV_vertex_program:
6020 * Check for errors at compile time?.
6022 static void GLAPIENTRY
6023 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6025 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6026 save_Attr1fNV(index
, x
);
6031 static void GLAPIENTRY
6032 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6034 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6035 save_Attr1fNV(index
, v
[0]);
6040 static void GLAPIENTRY
6041 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6043 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6044 save_Attr2fNV(index
, x
, y
);
6049 static void GLAPIENTRY
6050 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6052 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6053 save_Attr2fNV(index
, v
[0], v
[1]);
6058 static void GLAPIENTRY
6059 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6061 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6062 save_Attr3fNV(index
, x
, y
, z
);
6067 static void GLAPIENTRY
6068 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6070 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6071 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6076 static void GLAPIENTRY
6077 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6078 GLfloat z
, GLfloat w
)
6080 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6081 save_Attr4fNV(index
, x
, y
, z
, w
);
6086 static void GLAPIENTRY
6087 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6089 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6090 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6098 static void GLAPIENTRY
6099 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6101 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6102 save_Attr1fARB(index
, x
);
6107 static void GLAPIENTRY
6108 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6110 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6111 save_Attr1fARB(index
, v
[0]);
6116 static void GLAPIENTRY
6117 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6119 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6120 save_Attr2fARB(index
, x
, y
);
6125 static void GLAPIENTRY
6126 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6128 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6129 save_Attr2fARB(index
, v
[0], v
[1]);
6134 static void GLAPIENTRY
6135 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6137 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6138 save_Attr3fARB(index
, x
, y
, z
);
6143 static void GLAPIENTRY
6144 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6146 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6147 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6152 static void GLAPIENTRY
6153 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6156 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6157 save_Attr4fARB(index
, x
, y
, z
, w
);
6162 static void GLAPIENTRY
6163 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6165 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6166 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6172 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6174 static void GLAPIENTRY
6175 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6177 GET_CURRENT_CONTEXT(ctx
);
6178 FLUSH_VERTICES(ctx
, 0);
6179 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6182 static GLint GLAPIENTRY
6183 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6185 GET_CURRENT_CONTEXT(ctx
);
6186 FLUSH_VERTICES(ctx
, 0);
6187 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6190 static GLint GLAPIENTRY
6191 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6193 GET_CURRENT_CONTEXT(ctx
);
6194 FLUSH_VERTICES(ctx
, 0);
6195 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6197 /* XXX more shader functions needed here */
6200 #if FEATURE_EXT_framebuffer_blit
6201 static void GLAPIENTRY
6202 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6203 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6204 GLbitfield mask
, GLenum filter
)
6206 GET_CURRENT_CONTEXT(ctx
);
6208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6209 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6222 if (ctx
->ExecuteFlag
) {
6223 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6224 dstX0
, dstY0
, dstX1
, dstY1
,
6231 /** GL_EXT_provoking_vertex */
6232 static void GLAPIENTRY
6233 save_ProvokingVertexEXT(GLenum mode
)
6235 GET_CURRENT_CONTEXT(ctx
);
6237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6238 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6242 if (ctx
->ExecuteFlag
) {
6243 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6244 _mesa_ProvokingVertexEXT(mode
);
6249 /** GL_EXT_transform_feedback */
6250 static void GLAPIENTRY
6251 save_BeginTransformFeedback(GLenum mode
)
6253 GET_CURRENT_CONTEXT(ctx
);
6255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6256 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6260 if (ctx
->ExecuteFlag
) {
6261 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6266 /** GL_EXT_transform_feedback */
6267 static void GLAPIENTRY
6268 save_EndTransformFeedback(void)
6270 GET_CURRENT_CONTEXT(ctx
);
6271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6272 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6273 if (ctx
->ExecuteFlag
) {
6274 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6278 static void GLAPIENTRY
6279 save_BindTransformFeedback(GLenum target
, GLuint name
)
6281 GET_CURRENT_CONTEXT(ctx
);
6283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6284 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6289 if (ctx
->ExecuteFlag
) {
6290 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6294 static void GLAPIENTRY
6295 save_PauseTransformFeedback(void)
6297 GET_CURRENT_CONTEXT(ctx
);
6298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6299 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6300 if (ctx
->ExecuteFlag
) {
6301 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6305 static void GLAPIENTRY
6306 save_ResumeTransformFeedback(void)
6308 GET_CURRENT_CONTEXT(ctx
);
6309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6310 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6311 if (ctx
->ExecuteFlag
) {
6312 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6316 static void GLAPIENTRY
6317 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6319 GET_CURRENT_CONTEXT(ctx
);
6321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6322 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6327 if (ctx
->ExecuteFlag
) {
6328 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6333 /* aka UseProgram() */
6334 static void GLAPIENTRY
6335 save_UseProgramObjectARB(GLhandleARB program
)
6337 GET_CURRENT_CONTEXT(ctx
);
6339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6340 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6344 if (ctx
->ExecuteFlag
) {
6345 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6350 static void GLAPIENTRY
6351 save_Uniform1fARB(GLint location
, GLfloat x
)
6353 GET_CURRENT_CONTEXT(ctx
);
6355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6356 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6361 if (ctx
->ExecuteFlag
) {
6362 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6367 static void GLAPIENTRY
6368 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6370 GET_CURRENT_CONTEXT(ctx
);
6372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6373 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6379 if (ctx
->ExecuteFlag
) {
6380 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6385 static void GLAPIENTRY
6386 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6388 GET_CURRENT_CONTEXT(ctx
);
6390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6391 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6398 if (ctx
->ExecuteFlag
) {
6399 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6404 static void GLAPIENTRY
6405 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6407 GET_CURRENT_CONTEXT(ctx
);
6409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6410 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6418 if (ctx
->ExecuteFlag
) {
6419 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6424 /** Return copy of memory */
6426 memdup(const void *src
, GLsizei bytes
)
6428 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6430 memcpy(b
, src
, bytes
);
6435 static void GLAPIENTRY
6436 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6438 GET_CURRENT_CONTEXT(ctx
);
6440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6441 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6445 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6447 if (ctx
->ExecuteFlag
) {
6448 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6452 static void GLAPIENTRY
6453 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6455 GET_CURRENT_CONTEXT(ctx
);
6457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6458 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6462 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6464 if (ctx
->ExecuteFlag
) {
6465 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6469 static void GLAPIENTRY
6470 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6472 GET_CURRENT_CONTEXT(ctx
);
6474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6475 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6479 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6481 if (ctx
->ExecuteFlag
) {
6482 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6486 static void GLAPIENTRY
6487 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6489 GET_CURRENT_CONTEXT(ctx
);
6491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6492 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6496 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6498 if (ctx
->ExecuteFlag
) {
6499 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6504 static void GLAPIENTRY
6505 save_Uniform1iARB(GLint location
, GLint x
)
6507 GET_CURRENT_CONTEXT(ctx
);
6509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6510 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6515 if (ctx
->ExecuteFlag
) {
6516 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6520 static void GLAPIENTRY
6521 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6523 GET_CURRENT_CONTEXT(ctx
);
6525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6532 if (ctx
->ExecuteFlag
) {
6533 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6537 static void GLAPIENTRY
6538 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6540 GET_CURRENT_CONTEXT(ctx
);
6542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6543 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6550 if (ctx
->ExecuteFlag
) {
6551 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6555 static void GLAPIENTRY
6556 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6558 GET_CURRENT_CONTEXT(ctx
);
6560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6561 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6569 if (ctx
->ExecuteFlag
) {
6570 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6576 static void GLAPIENTRY
6577 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6579 GET_CURRENT_CONTEXT(ctx
);
6581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6582 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6586 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6588 if (ctx
->ExecuteFlag
) {
6589 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6593 static void GLAPIENTRY
6594 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6596 GET_CURRENT_CONTEXT(ctx
);
6598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6599 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6603 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6605 if (ctx
->ExecuteFlag
) {
6606 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6610 static void GLAPIENTRY
6611 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6613 GET_CURRENT_CONTEXT(ctx
);
6615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6616 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6620 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6622 if (ctx
->ExecuteFlag
) {
6623 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6627 static void GLAPIENTRY
6628 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6630 GET_CURRENT_CONTEXT(ctx
);
6632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6633 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6637 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6639 if (ctx
->ExecuteFlag
) {
6640 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6646 static void GLAPIENTRY
6647 save_Uniform1ui(GLint location
, GLuint x
)
6649 GET_CURRENT_CONTEXT(ctx
);
6651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6652 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6657 if (ctx
->ExecuteFlag
) {
6658 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6662 static void GLAPIENTRY
6663 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6665 GET_CURRENT_CONTEXT(ctx
);
6667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6668 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6674 if (ctx
->ExecuteFlag
) {
6675 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6679 static void GLAPIENTRY
6680 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6682 GET_CURRENT_CONTEXT(ctx
);
6684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6685 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6692 if (ctx
->ExecuteFlag
) {
6693 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6697 static void GLAPIENTRY
6698 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6700 GET_CURRENT_CONTEXT(ctx
);
6702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6703 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6711 if (ctx
->ExecuteFlag
) {
6712 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6718 static void GLAPIENTRY
6719 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6721 GET_CURRENT_CONTEXT(ctx
);
6723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6724 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6728 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6730 if (ctx
->ExecuteFlag
) {
6731 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6735 static void GLAPIENTRY
6736 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6738 GET_CURRENT_CONTEXT(ctx
);
6740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6741 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6745 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6747 if (ctx
->ExecuteFlag
) {
6748 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6752 static void GLAPIENTRY
6753 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6755 GET_CURRENT_CONTEXT(ctx
);
6757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6758 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6762 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6764 if (ctx
->ExecuteFlag
) {
6765 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6769 static void GLAPIENTRY
6770 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6772 GET_CURRENT_CONTEXT(ctx
);
6774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6775 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6779 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6781 if (ctx
->ExecuteFlag
) {
6782 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6788 static void GLAPIENTRY
6789 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6792 GET_CURRENT_CONTEXT(ctx
);
6794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6795 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6800 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6802 if (ctx
->ExecuteFlag
) {
6803 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6807 static void GLAPIENTRY
6808 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6811 GET_CURRENT_CONTEXT(ctx
);
6813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6814 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6819 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6821 if (ctx
->ExecuteFlag
) {
6822 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6826 static void GLAPIENTRY
6827 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6830 GET_CURRENT_CONTEXT(ctx
);
6832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6833 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6838 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6840 if (ctx
->ExecuteFlag
) {
6841 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6846 static void GLAPIENTRY
6847 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6850 GET_CURRENT_CONTEXT(ctx
);
6852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6853 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6858 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6860 if (ctx
->ExecuteFlag
) {
6861 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6865 static void GLAPIENTRY
6866 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6869 GET_CURRENT_CONTEXT(ctx
);
6871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6872 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6877 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6879 if (ctx
->ExecuteFlag
) {
6880 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6885 static void GLAPIENTRY
6886 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6889 GET_CURRENT_CONTEXT(ctx
);
6891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6892 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6897 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6899 if (ctx
->ExecuteFlag
) {
6900 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6904 static void GLAPIENTRY
6905 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6908 GET_CURRENT_CONTEXT(ctx
);
6910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6911 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6916 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6918 if (ctx
->ExecuteFlag
) {
6919 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6924 static void GLAPIENTRY
6925 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6928 GET_CURRENT_CONTEXT(ctx
);
6930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6931 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6936 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6938 if (ctx
->ExecuteFlag
) {
6939 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6943 static void GLAPIENTRY
6944 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6947 GET_CURRENT_CONTEXT(ctx
);
6949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6950 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6955 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6957 if (ctx
->ExecuteFlag
) {
6958 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6962 static void GLAPIENTRY
6963 save_ClampColorARB(GLenum target
, GLenum clamp
)
6965 GET_CURRENT_CONTEXT(ctx
);
6967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6968 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
6973 if (ctx
->ExecuteFlag
) {
6974 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
6978 static void GLAPIENTRY
6979 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
6981 GET_CURRENT_CONTEXT(ctx
);
6983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6984 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
6989 if (ctx
->ExecuteFlag
) {
6990 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
6994 static void GLAPIENTRY
6995 save_ActiveProgramEXT(GLuint program
)
6997 GET_CURRENT_CONTEXT(ctx
);
6999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7000 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7004 if (ctx
->ExecuteFlag
) {
7005 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7009 /** GL_EXT_texture_integer */
7010 static void GLAPIENTRY
7011 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7013 GET_CURRENT_CONTEXT(ctx
);
7015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7016 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7023 if (ctx
->ExecuteFlag
) {
7024 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7028 /** GL_EXT_texture_integer */
7029 static void GLAPIENTRY
7030 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7032 GET_CURRENT_CONTEXT(ctx
);
7034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7035 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7042 if (ctx
->ExecuteFlag
) {
7043 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7047 /** GL_EXT_texture_integer */
7048 static void GLAPIENTRY
7049 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7051 GET_CURRENT_CONTEXT(ctx
);
7053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7054 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7063 if (ctx
->ExecuteFlag
) {
7064 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7068 /** GL_EXT_texture_integer */
7069 static void GLAPIENTRY
7070 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7072 GET_CURRENT_CONTEXT(ctx
);
7074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7075 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7079 n
[3].ui
= params
[0];
7080 n
[4].ui
= params
[1];
7081 n
[5].ui
= params
[2];
7082 n
[6].ui
= params
[3];
7084 if (ctx
->ExecuteFlag
) {
7085 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7089 /** GL_EXT_texture_integer */
7090 static void GLAPIENTRY
7091 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7093 GET_CURRENT_CONTEXT(ctx
);
7094 FLUSH_VERTICES(ctx
, 0);
7095 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7098 /** GL_EXT_texture_integer */
7099 static void GLAPIENTRY
7100 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7102 GET_CURRENT_CONTEXT(ctx
);
7103 FLUSH_VERTICES(ctx
, 0);
7104 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7108 /* GL_ARB_instanced_arrays */
7109 static void GLAPIENTRY
7110 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7112 GET_CURRENT_CONTEXT(ctx
);
7114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7115 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7120 if (ctx
->ExecuteFlag
) {
7121 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7126 /* GL_NV_texture_barrier */
7127 static void GLAPIENTRY
7128 save_TextureBarrierNV(void)
7130 GET_CURRENT_CONTEXT(ctx
);
7131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7132 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7133 if (ctx
->ExecuteFlag
) {
7134 CALL_TextureBarrierNV(ctx
->Exec
, ());
7139 /* GL_ARB_sampler_objects */
7140 static void GLAPIENTRY
7141 save_BindSampler(GLuint unit
, GLuint sampler
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7146 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7151 if (ctx
->ExecuteFlag
) {
7152 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7156 static void GLAPIENTRY
7157 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7160 GET_CURRENT_CONTEXT(ctx
);
7161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7162 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7167 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7173 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7176 if (ctx
->ExecuteFlag
) {
7177 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7181 static void GLAPIENTRY
7182 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7184 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7187 static void GLAPIENTRY
7188 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7191 GET_CURRENT_CONTEXT(ctx
);
7192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7193 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7198 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7204 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7207 if (ctx
->ExecuteFlag
) {
7208 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7212 static void GLAPIENTRY
7213 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7215 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7218 static void GLAPIENTRY
7219 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7222 GET_CURRENT_CONTEXT(ctx
);
7223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7224 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7229 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7235 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7238 if (ctx
->ExecuteFlag
) {
7239 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7243 static void GLAPIENTRY
7244 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7247 GET_CURRENT_CONTEXT(ctx
);
7248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7249 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7253 n
[3].ui
= params
[0];
7254 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7255 n
[4].ui
= params
[1];
7256 n
[5].ui
= params
[2];
7257 n
[6].ui
= params
[3];
7260 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7263 if (ctx
->ExecuteFlag
) {
7264 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7268 /* GL_ARB_geometry_shader4 */
7269 static void GLAPIENTRY
7270 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7275 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7281 if (ctx
->ExecuteFlag
) {
7282 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7286 static void GLAPIENTRY
7287 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7288 GLuint texture
, GLint level
)
7291 GET_CURRENT_CONTEXT(ctx
);
7292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7293 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7296 n
[2].e
= attachment
;
7300 if (ctx
->ExecuteFlag
) {
7301 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7305 static void GLAPIENTRY
7306 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7307 GLuint texture
, GLint level
, GLenum face
)
7310 GET_CURRENT_CONTEXT(ctx
);
7311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7312 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7315 n
[2].e
= attachment
;
7320 if (ctx
->ExecuteFlag
) {
7321 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7328 static void GLAPIENTRY
7329 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7332 GET_CURRENT_CONTEXT(ctx
);
7333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7334 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7336 union uint64_pair p
;
7340 n
[3].ui
= p
.uint32
[0];
7341 n
[4].ui
= p
.uint32
[1];
7343 if (ctx
->ExecuteFlag
) {
7344 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7349 /** GL_NV_conditional_render */
7350 static void GLAPIENTRY
7351 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7353 GET_CURRENT_CONTEXT(ctx
);
7355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7356 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7361 if (ctx
->ExecuteFlag
) {
7362 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7366 static void GLAPIENTRY
7367 save_EndConditionalRender(void)
7369 GET_CURRENT_CONTEXT(ctx
);
7370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7371 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7372 if (ctx
->ExecuteFlag
) {
7373 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7379 * Save an error-generating command into display list.
7381 * KW: Will appear in the list before the vertex buffer containing the
7382 * command that provoked the error. I don't see this as a problem.
7385 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7388 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7391 n
[2].data
= (void *) s
;
7397 * Compile an error into current display list.
7400 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7402 if (ctx
->CompileFlag
)
7403 save_error(ctx
, error
, s
);
7404 if (ctx
->ExecuteFlag
)
7405 _mesa_error(ctx
, error
, "%s", s
);
7410 * Test if ID names a display list.
7413 islist(struct gl_context
*ctx
, GLuint list
)
7415 if (list
> 0 && lookup_list(ctx
, list
)) {
7425 /**********************************************************************/
7426 /* Display list execution */
7427 /**********************************************************************/
7431 * Execute a display list. Note that the ListBase offset must have already
7432 * been added before calling this function. I.e. the list argument is
7433 * the absolute list number, not relative to ListBase.
7434 * \param list - display list number
7437 execute_list(struct gl_context
*ctx
, GLuint list
)
7439 struct gl_display_list
*dlist
;
7443 if (list
== 0 || !islist(ctx
, list
))
7446 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7447 /* raise an error? */
7451 dlist
= lookup_list(ctx
, list
);
7455 ctx
->ListState
.CallDepth
++;
7457 if (ctx
->Driver
.BeginCallList
)
7458 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7464 const OpCode opcode
= n
[0].opcode
;
7466 if (is_ext_opcode(opcode
)) {
7467 n
+= ext_opcode_execute(ctx
, n
);
7472 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7475 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7477 case OPCODE_ALPHA_FUNC
:
7478 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7480 case OPCODE_BIND_TEXTURE
:
7481 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7485 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7486 ctx
->Unpack
= ctx
->DefaultPacking
;
7487 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7488 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7489 (const GLubyte
*) n
[7].data
));
7490 ctx
->Unpack
= save
; /* restore */
7493 case OPCODE_BLEND_COLOR
:
7494 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7496 case OPCODE_BLEND_EQUATION
:
7497 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7499 case OPCODE_BLEND_EQUATION_SEPARATE
:
7500 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7502 case OPCODE_BLEND_FUNC_SEPARATE
:
7503 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7504 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7507 case OPCODE_BLEND_FUNC_I
:
7508 /* GL_ARB_draw_buffers_blend */
7509 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7511 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7512 /* GL_ARB_draw_buffers_blend */
7513 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7516 case OPCODE_BLEND_EQUATION_I
:
7517 /* GL_ARB_draw_buffers_blend */
7518 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7520 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7521 /* GL_ARB_draw_buffers_blend */
7522 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7523 (n
[1].ui
, n
[2].e
, n
[3].e
));
7526 case OPCODE_CALL_LIST
:
7527 /* Generated by glCallList(), don't add ListBase */
7528 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7529 execute_list(ctx
, n
[1].ui
);
7532 case OPCODE_CALL_LIST_OFFSET
:
7533 /* Generated by glCallLists() so we must add ListBase */
7535 /* user specified a bad data type at compile time */
7536 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7538 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7539 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7540 execute_list(ctx
, list
);
7544 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7546 case OPCODE_CLEAR_BUFFER_IV
:
7553 CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
7556 case OPCODE_CLEAR_BUFFER_UIV
:
7563 CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
7566 case OPCODE_CLEAR_BUFFER_FV
:
7573 CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
7576 case OPCODE_CLEAR_BUFFER_FI
:
7577 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
7579 case OPCODE_CLEAR_COLOR
:
7580 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7582 case OPCODE_CLEAR_ACCUM
:
7583 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7585 case OPCODE_CLEAR_DEPTH
:
7586 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7588 case OPCODE_CLEAR_INDEX
:
7589 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7591 case OPCODE_CLEAR_STENCIL
:
7592 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7594 case OPCODE_CLIP_PLANE
:
7601 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7604 case OPCODE_COLOR_MASK
:
7605 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7607 case OPCODE_COLOR_MASK_INDEXED
:
7608 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7611 case OPCODE_COLOR_MATERIAL
:
7612 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7614 case OPCODE_COLOR_TABLE
:
7616 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7617 ctx
->Unpack
= ctx
->DefaultPacking
;
7618 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7619 n
[5].e
, n
[6].data
));
7620 ctx
->Unpack
= save
; /* restore */
7623 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7630 CALL_ColorTableParameterfv(ctx
->Exec
,
7631 (n
[1].e
, n
[2].e
, params
));
7634 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7641 CALL_ColorTableParameteriv(ctx
->Exec
,
7642 (n
[1].e
, n
[2].e
, params
));
7645 case OPCODE_COLOR_SUB_TABLE
:
7647 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7648 ctx
->Unpack
= ctx
->DefaultPacking
;
7649 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7650 n
[4].e
, n
[5].e
, n
[6].data
));
7651 ctx
->Unpack
= save
; /* restore */
7654 case OPCODE_CONVOLUTION_FILTER_1D
:
7656 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7657 ctx
->Unpack
= ctx
->DefaultPacking
;
7658 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7661 ctx
->Unpack
= save
; /* restore */
7664 case OPCODE_CONVOLUTION_FILTER_2D
:
7666 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7667 ctx
->Unpack
= ctx
->DefaultPacking
;
7668 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7669 n
[4].i
, n
[5].e
, n
[6].e
,
7671 ctx
->Unpack
= save
; /* restore */
7674 case OPCODE_CONVOLUTION_PARAMETER_I
:
7675 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7677 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7684 CALL_ConvolutionParameteriv(ctx
->Exec
,
7685 (n
[1].e
, n
[2].e
, params
));
7688 case OPCODE_CONVOLUTION_PARAMETER_F
:
7689 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7691 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7698 CALL_ConvolutionParameterfv(ctx
->Exec
,
7699 (n
[1].e
, n
[2].e
, params
));
7702 case OPCODE_COPY_COLOR_SUB_TABLE
:
7703 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7704 n
[3].i
, n
[4].i
, n
[5].i
));
7706 case OPCODE_COPY_COLOR_TABLE
:
7707 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7708 n
[3].i
, n
[4].i
, n
[5].i
));
7710 case OPCODE_COPY_PIXELS
:
7711 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7712 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7715 case OPCODE_COPY_TEX_IMAGE1D
:
7716 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7717 n
[5].i
, n
[6].i
, n
[7].i
));
7719 case OPCODE_COPY_TEX_IMAGE2D
:
7720 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7721 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7723 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7724 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7725 n
[4].i
, n
[5].i
, n
[6].i
));
7727 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7728 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7729 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7732 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7733 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7734 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7737 case OPCODE_CULL_FACE
:
7738 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7740 case OPCODE_DEPTH_FUNC
:
7741 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7743 case OPCODE_DEPTH_MASK
:
7744 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7746 case OPCODE_DEPTH_RANGE
:
7747 CALL_DepthRange(ctx
->Exec
,
7748 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7750 case OPCODE_DISABLE
:
7751 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7753 case OPCODE_DISABLE_INDEXED
:
7754 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7756 case OPCODE_DRAW_BUFFER
:
7757 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7759 case OPCODE_DRAW_PIXELS
:
7761 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7762 ctx
->Unpack
= ctx
->DefaultPacking
;
7763 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7765 ctx
->Unpack
= save
; /* restore */
7769 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7771 case OPCODE_ENABLE_INDEXED
:
7772 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7774 case OPCODE_EVALMESH1
:
7775 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7777 case OPCODE_EVALMESH2
:
7778 CALL_EvalMesh2(ctx
->Exec
,
7779 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7788 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7791 case OPCODE_FRONT_FACE
:
7792 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7794 case OPCODE_FRUSTUM
:
7795 CALL_Frustum(ctx
->Exec
,
7796 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7799 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7801 case OPCODE_HISTOGRAM
:
7802 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7804 case OPCODE_INDEX_MASK
:
7805 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7807 case OPCODE_INIT_NAMES
:
7808 CALL_InitNames(ctx
->Exec
, ());
7817 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7820 case OPCODE_LIGHT_MODEL
:
7827 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7830 case OPCODE_LINE_STIPPLE
:
7831 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7833 case OPCODE_LINE_WIDTH
:
7834 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7836 case OPCODE_LIST_BASE
:
7837 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7839 case OPCODE_LOAD_IDENTITY
:
7840 CALL_LoadIdentity(ctx
->Exec
, ());
7842 case OPCODE_LOAD_MATRIX
:
7843 if (sizeof(Node
) == sizeof(GLfloat
)) {
7844 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7849 for (i
= 0; i
< 16; i
++) {
7852 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7855 case OPCODE_LOAD_NAME
:
7856 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7858 case OPCODE_LOGIC_OP
:
7859 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7863 GLenum target
= n
[1].e
;
7864 GLint ustride
= _mesa_evaluator_components(target
);
7865 GLint uorder
= n
[5].i
;
7866 GLfloat u1
= n
[2].f
;
7867 GLfloat u2
= n
[3].f
;
7868 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7869 (GLfloat
*) n
[6].data
));
7874 GLenum target
= n
[1].e
;
7875 GLfloat u1
= n
[2].f
;
7876 GLfloat u2
= n
[3].f
;
7877 GLfloat v1
= n
[4].f
;
7878 GLfloat v2
= n
[5].f
;
7879 GLint ustride
= n
[6].i
;
7880 GLint vstride
= n
[7].i
;
7881 GLint uorder
= n
[8].i
;
7882 GLint vorder
= n
[9].i
;
7883 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7884 v1
, v2
, vstride
, vorder
,
7885 (GLfloat
*) n
[10].data
));
7888 case OPCODE_MAPGRID1
:
7889 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7891 case OPCODE_MAPGRID2
:
7892 CALL_MapGrid2f(ctx
->Exec
,
7893 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7895 case OPCODE_MATRIX_MODE
:
7896 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7898 case OPCODE_MIN_MAX
:
7899 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7901 case OPCODE_MULT_MATRIX
:
7902 if (sizeof(Node
) == sizeof(GLfloat
)) {
7903 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7908 for (i
= 0; i
< 16; i
++) {
7911 CALL_MultMatrixf(ctx
->Exec
, (m
));
7915 CALL_Ortho(ctx
->Exec
,
7916 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7918 case OPCODE_PASSTHROUGH
:
7919 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7921 case OPCODE_PIXEL_MAP
:
7922 CALL_PixelMapfv(ctx
->Exec
,
7923 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7925 case OPCODE_PIXEL_TRANSFER
:
7926 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7928 case OPCODE_PIXEL_ZOOM
:
7929 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7931 case OPCODE_POINT_SIZE
:
7932 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7934 case OPCODE_POINT_PARAMETERS
:
7940 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7943 case OPCODE_POLYGON_MODE
:
7944 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7946 case OPCODE_POLYGON_STIPPLE
:
7948 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7949 ctx
->Unpack
= ctx
->DefaultPacking
;
7950 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7951 ctx
->Unpack
= save
; /* restore */
7954 case OPCODE_POLYGON_OFFSET
:
7955 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7957 case OPCODE_POP_ATTRIB
:
7958 CALL_PopAttrib(ctx
->Exec
, ());
7960 case OPCODE_POP_MATRIX
:
7961 CALL_PopMatrix(ctx
->Exec
, ());
7963 case OPCODE_POP_NAME
:
7964 CALL_PopName(ctx
->Exec
, ());
7966 case OPCODE_PRIORITIZE_TEXTURE
:
7967 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7969 case OPCODE_PUSH_ATTRIB
:
7970 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7972 case OPCODE_PUSH_MATRIX
:
7973 CALL_PushMatrix(ctx
->Exec
, ());
7975 case OPCODE_PUSH_NAME
:
7976 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7978 case OPCODE_RASTER_POS
:
7979 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7981 case OPCODE_READ_BUFFER
:
7982 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7984 case OPCODE_RESET_HISTOGRAM
:
7985 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7987 case OPCODE_RESET_MIN_MAX
:
7988 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7991 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7994 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7996 case OPCODE_SCISSOR
:
7997 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7999 case OPCODE_SHADE_MODEL
:
8000 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8002 case OPCODE_PROVOKING_VERTEX
:
8003 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8005 case OPCODE_STENCIL_FUNC
:
8006 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8008 case OPCODE_STENCIL_MASK
:
8009 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8011 case OPCODE_STENCIL_OP
:
8012 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8014 case OPCODE_STENCIL_FUNC_SEPARATE
:
8015 CALL_StencilFuncSeparate(ctx
->Exec
,
8016 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8018 case OPCODE_STENCIL_MASK_SEPARATE
:
8019 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8021 case OPCODE_STENCIL_OP_SEPARATE
:
8022 CALL_StencilOpSeparate(ctx
->Exec
,
8023 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8032 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8042 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8045 case OPCODE_TEXPARAMETER
:
8052 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8055 case OPCODE_TEX_IMAGE1D
:
8057 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8058 ctx
->Unpack
= ctx
->DefaultPacking
;
8059 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8061 n
[3].i
, /* components */
8063 n
[5].e
, /* border */
8064 n
[6].e
, /* format */
8067 ctx
->Unpack
= save
; /* restore */
8070 case OPCODE_TEX_IMAGE2D
:
8072 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8073 ctx
->Unpack
= ctx
->DefaultPacking
;
8074 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8076 n
[3].i
, /* components */
8078 n
[5].i
, /* height */
8079 n
[6].e
, /* border */
8080 n
[7].e
, /* format */
8083 ctx
->Unpack
= save
; /* restore */
8086 case OPCODE_TEX_IMAGE3D
:
8088 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8089 ctx
->Unpack
= ctx
->DefaultPacking
;
8090 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8092 n
[3].i
, /* components */
8094 n
[5].i
, /* height */
8096 n
[7].e
, /* border */
8097 n
[8].e
, /* format */
8100 ctx
->Unpack
= save
; /* restore */
8103 case OPCODE_TEX_SUB_IMAGE1D
:
8105 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8106 ctx
->Unpack
= ctx
->DefaultPacking
;
8107 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8109 n
[6].e
, n
[7].data
));
8110 ctx
->Unpack
= save
; /* restore */
8113 case OPCODE_TEX_SUB_IMAGE2D
:
8115 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8116 ctx
->Unpack
= ctx
->DefaultPacking
;
8117 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8119 n
[6].i
, n
[7].e
, n
[8].e
,
8121 ctx
->Unpack
= save
; /* restore */
8124 case OPCODE_TEX_SUB_IMAGE3D
:
8126 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8127 ctx
->Unpack
= ctx
->DefaultPacking
;
8128 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8129 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8130 n
[8].i
, n
[9].e
, n
[10].e
,
8132 ctx
->Unpack
= save
; /* restore */
8135 case OPCODE_TRANSLATE
:
8136 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8138 case OPCODE_VIEWPORT
:
8139 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8140 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8142 case OPCODE_WINDOW_POS
:
8143 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8145 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8146 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8148 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8149 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8150 n
[4].i
, n
[5].i
, n
[6].i
,
8153 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8154 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8155 n
[4].i
, n
[5].i
, n
[6].i
,
8156 n
[7].i
, n
[8].data
));
8158 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8159 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8160 n
[4].i
, n
[5].i
, n
[6].i
,
8164 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8165 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8166 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8167 n
[5].e
, n
[6].i
, n
[7].data
));
8169 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8170 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8171 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8172 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8175 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8176 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8177 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8178 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8179 n
[9].e
, n
[10].i
, n
[11].data
));
8181 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8182 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8184 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8185 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8187 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8188 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8189 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8192 #if FEATURE_NV_vertex_program
8193 case OPCODE_EXECUTE_PROGRAM_NV
:
8200 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8203 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8204 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8205 (GLuint
*) n
[2].data
));
8207 case OPCODE_LOAD_PROGRAM_NV
:
8208 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8209 (const GLubyte
*) n
[4].data
));
8211 case OPCODE_TRACK_MATRIX_NV
:
8212 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
8216 #if FEATURE_NV_fragment_program
8217 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8218 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8219 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8222 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8223 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8224 (const GLubyte
*) n
[3].
8225 data
, n
[4].f
, n
[5].f
,
8230 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8231 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8233 case OPCODE_DEPTH_BOUNDS_EXT
:
8234 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8236 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8237 case OPCODE_PROGRAM_STRING_ARB
:
8238 CALL_ProgramStringARB(ctx
->Exec
,
8239 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8242 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
8243 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8244 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8249 #if FEATURE_queryobj
8250 case OPCODE_BEGIN_QUERY_ARB
:
8251 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8253 case OPCODE_END_QUERY_ARB
:
8254 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8257 case OPCODE_DRAW_BUFFERS_ARB
:
8259 GLenum buffers
[MAX_DRAW_BUFFERS
];
8260 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8261 for (i
= 0; i
< count
; i
++)
8262 buffers
[i
] = n
[2 + i
].e
;
8263 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8266 #if FEATURE_EXT_framebuffer_blit
8267 case OPCODE_BLIT_FRAMEBUFFER
:
8268 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8269 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8274 case OPCODE_USE_PROGRAM
:
8275 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8277 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8278 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8280 case OPCODE_ACTIVE_PROGRAM_EXT
:
8281 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8283 case OPCODE_UNIFORM_1F
:
8284 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8286 case OPCODE_UNIFORM_2F
:
8287 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8289 case OPCODE_UNIFORM_3F
:
8290 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8292 case OPCODE_UNIFORM_4F
:
8293 CALL_Uniform4fARB(ctx
->Exec
,
8294 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8296 case OPCODE_UNIFORM_1FV
:
8297 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8299 case OPCODE_UNIFORM_2FV
:
8300 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8302 case OPCODE_UNIFORM_3FV
:
8303 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8305 case OPCODE_UNIFORM_4FV
:
8306 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8308 case OPCODE_UNIFORM_1I
:
8309 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8311 case OPCODE_UNIFORM_2I
:
8312 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8314 case OPCODE_UNIFORM_3I
:
8315 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8317 case OPCODE_UNIFORM_4I
:
8318 CALL_Uniform4iARB(ctx
->Exec
,
8319 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8321 case OPCODE_UNIFORM_1IV
:
8322 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8324 case OPCODE_UNIFORM_2IV
:
8325 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8327 case OPCODE_UNIFORM_3IV
:
8328 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8330 case OPCODE_UNIFORM_4IV
:
8331 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8333 case OPCODE_UNIFORM_1UI
:
8334 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8336 case OPCODE_UNIFORM_2UI
:
8337 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8339 case OPCODE_UNIFORM_3UI
:
8340 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8342 case OPCODE_UNIFORM_4UI
:
8343 /*CALL_Uniform4uiARB(ctx->Exec,
8344 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8347 case OPCODE_UNIFORM_1UIV
:
8348 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8350 case OPCODE_UNIFORM_2UIV
:
8351 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8353 case OPCODE_UNIFORM_3UIV
:
8354 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8356 case OPCODE_UNIFORM_4UIV
:
8357 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8359 case OPCODE_UNIFORM_MATRIX22
:
8360 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8361 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8363 case OPCODE_UNIFORM_MATRIX33
:
8364 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8365 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8367 case OPCODE_UNIFORM_MATRIX44
:
8368 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8369 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8371 case OPCODE_UNIFORM_MATRIX23
:
8372 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8373 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8375 case OPCODE_UNIFORM_MATRIX32
:
8376 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8377 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8379 case OPCODE_UNIFORM_MATRIX24
:
8380 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8381 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8383 case OPCODE_UNIFORM_MATRIX42
:
8384 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8385 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8387 case OPCODE_UNIFORM_MATRIX34
:
8388 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8389 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8391 case OPCODE_UNIFORM_MATRIX43
:
8392 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8393 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8396 case OPCODE_CLAMP_COLOR
:
8397 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8400 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8403 GLuint i
, pname
= n
[1].ui
;
8405 for (i
= 0; i
< 4; i
++)
8406 values
[i
] = n
[1 + i
].f
;
8407 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8410 #if FEATURE_ATI_fragment_shader
8411 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8412 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8414 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8417 GLuint i
, dst
= n
[1].ui
;
8419 for (i
= 0; i
< 4; i
++)
8420 values
[i
] = n
[1 + i
].f
;
8421 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8425 case OPCODE_ATTR_1F_NV
:
8426 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8428 case OPCODE_ATTR_2F_NV
:
8429 /* Really shouldn't have to do this - the Node structure
8430 * is convenient, but it would be better to store the data
8431 * packed appropriately so that it can be sent directly
8432 * on. With x86_64 becoming common, this will start to
8435 if (sizeof(Node
) == sizeof(GLfloat
))
8436 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8438 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8440 case OPCODE_ATTR_3F_NV
:
8441 if (sizeof(Node
) == sizeof(GLfloat
))
8442 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8444 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8447 case OPCODE_ATTR_4F_NV
:
8448 if (sizeof(Node
) == sizeof(GLfloat
))
8449 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8451 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8454 case OPCODE_ATTR_1F_ARB
:
8455 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8457 case OPCODE_ATTR_2F_ARB
:
8458 /* Really shouldn't have to do this - the Node structure
8459 * is convenient, but it would be better to store the data
8460 * packed appropriately so that it can be sent directly
8461 * on. With x86_64 becoming common, this will start to
8464 if (sizeof(Node
) == sizeof(GLfloat
))
8465 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8467 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8469 case OPCODE_ATTR_3F_ARB
:
8470 if (sizeof(Node
) == sizeof(GLfloat
))
8471 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8473 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8476 case OPCODE_ATTR_4F_ARB
:
8477 if (sizeof(Node
) == sizeof(GLfloat
))
8478 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8480 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8483 case OPCODE_MATERIAL
:
8484 if (sizeof(Node
) == sizeof(GLfloat
))
8485 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8492 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8496 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8499 CALL_End(ctx
->Exec
, ());
8502 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8504 case OPCODE_EVAL_C1
:
8505 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8507 case OPCODE_EVAL_C2
:
8508 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8510 case OPCODE_EVAL_P1
:
8511 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8513 case OPCODE_EVAL_P2
:
8514 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8517 /* GL_EXT_texture_integer */
8518 case OPCODE_CLEARCOLOR_I
:
8519 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8521 case OPCODE_CLEARCOLOR_UI
:
8522 CALL_ClearColorIuiEXT(ctx
->Exec
,
8523 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8525 case OPCODE_TEXPARAMETER_I
:
8532 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8535 case OPCODE_TEXPARAMETER_UI
:
8538 params
[0] = n
[3].ui
;
8539 params
[1] = n
[4].ui
;
8540 params
[2] = n
[5].ui
;
8541 params
[3] = n
[6].ui
;
8542 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8546 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8547 /* GL_ARB_instanced_arrays */
8548 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8551 case OPCODE_TEXTURE_BARRIER_NV
:
8552 CALL_TextureBarrierNV(ctx
->Exec
, ());
8555 /* GL_EXT/ARB_transform_feedback */
8556 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8557 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8559 case OPCODE_END_TRANSFORM_FEEDBACK
:
8560 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8562 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8563 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8565 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8566 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8568 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8569 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8571 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8572 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8576 case OPCODE_BIND_SAMPLER
:
8577 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8579 case OPCODE_SAMPLER_PARAMETERIV
:
8586 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8589 case OPCODE_SAMPLER_PARAMETERFV
:
8596 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8599 case OPCODE_SAMPLER_PARAMETERIIV
:
8606 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8609 case OPCODE_SAMPLER_PARAMETERUIV
:
8612 params
[0] = n
[3].ui
;
8613 params
[1] = n
[4].ui
;
8614 params
[2] = n
[5].ui
;
8615 params
[3] = n
[6].ui
;
8616 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8620 /* GL_ARB_geometry_shader4 */
8621 case OPCODE_PROGRAM_PARAMETERI
:
8622 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8624 case OPCODE_FRAMEBUFFER_TEXTURE
:
8625 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8628 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8629 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8630 n
[3].ui
, n
[4].i
, n
[5].e
));
8634 case OPCODE_WAIT_SYNC
:
8636 union uint64_pair p
;
8637 p
.uint32
[0] = n
[3].ui
;
8638 p
.uint32
[1] = n
[4].ui
;
8639 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8643 /* GL_NV_conditional_render */
8644 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8645 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8647 case OPCODE_END_CONDITIONAL_RENDER
:
8648 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8651 case OPCODE_CONTINUE
:
8652 n
= (Node
*) n
[1].next
;
8654 case OPCODE_END_OF_LIST
:
8660 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8662 _mesa_problem(ctx
, "%s", msg
);
8667 /* increment n to point to next compiled command */
8668 if (opcode
!= OPCODE_CONTINUE
) {
8669 n
+= InstSize
[opcode
];
8674 if (ctx
->Driver
.EndCallList
)
8675 ctx
->Driver
.EndCallList(ctx
);
8677 ctx
->ListState
.CallDepth
--;
8682 /**********************************************************************/
8684 /**********************************************************************/
8687 * Test if a display list number is valid.
8689 static GLboolean GLAPIENTRY
8690 _mesa_IsList(GLuint list
)
8692 GET_CURRENT_CONTEXT(ctx
);
8693 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8694 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8695 return islist(ctx
, list
);
8700 * Delete a sequence of consecutive display lists.
8702 static void GLAPIENTRY
8703 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8705 GET_CURRENT_CONTEXT(ctx
);
8707 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8708 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8711 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8714 for (i
= list
; i
< list
+ range
; i
++) {
8715 destroy_list(ctx
, i
);
8721 * Return a display list number, n, such that lists n through n+range-1
8724 static GLuint GLAPIENTRY
8725 _mesa_GenLists(GLsizei range
)
8727 GET_CURRENT_CONTEXT(ctx
);
8729 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8730 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8733 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8741 * Make this an atomic operation
8743 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8745 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8747 /* reserve the list IDs by with empty/dummy lists */
8749 for (i
= 0; i
< range
; i
++) {
8750 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8751 make_list(base
+ i
, 1));
8755 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8762 * Begin a new display list.
8764 static void GLAPIENTRY
8765 _mesa_NewList(GLuint name
, GLenum mode
)
8767 GET_CURRENT_CONTEXT(ctx
);
8769 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8770 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8772 if (MESA_VERBOSE
& VERBOSE_API
)
8773 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8774 _mesa_lookup_enum_by_nr(mode
));
8777 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8781 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8782 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8786 if (ctx
->ListState
.CurrentList
) {
8787 /* already compiling a display list */
8788 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8792 ctx
->CompileFlag
= GL_TRUE
;
8793 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8795 /* Reset acumulated list state:
8797 invalidate_saved_current_state( ctx
);
8799 /* Allocate new display list */
8800 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8801 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8802 ctx
->ListState
.CurrentPos
= 0;
8804 ctx
->Driver
.NewList(ctx
, name
, mode
);
8806 ctx
->CurrentDispatch
= ctx
->Save
;
8807 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8812 * End definition of current display list.
8814 static void GLAPIENTRY
8817 GET_CURRENT_CONTEXT(ctx
);
8818 SAVE_FLUSH_VERTICES(ctx
);
8819 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8821 if (MESA_VERBOSE
& VERBOSE_API
)
8822 _mesa_debug(ctx
, "glEndList\n");
8824 /* Check that a list is under construction */
8825 if (!ctx
->ListState
.CurrentList
) {
8826 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8830 /* Call before emitting END_OF_LIST, in case the driver wants to
8831 * emit opcodes itself.
8833 ctx
->Driver
.EndList(ctx
);
8835 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8837 /* Destroy old list, if any */
8838 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8840 /* Install the new list */
8841 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8842 ctx
->ListState
.CurrentList
->Name
,
8843 ctx
->ListState
.CurrentList
);
8846 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8847 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8849 ctx
->ListState
.CurrentList
= NULL
;
8850 ctx
->ExecuteFlag
= GL_TRUE
;
8851 ctx
->CompileFlag
= GL_FALSE
;
8853 ctx
->CurrentDispatch
= ctx
->Exec
;
8854 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8859 _mesa_CallList(GLuint list
)
8861 GLboolean save_compile_flag
;
8862 GET_CURRENT_CONTEXT(ctx
);
8863 FLUSH_CURRENT(ctx
, 0);
8865 if (MESA_VERBOSE
& VERBOSE_API
)
8866 _mesa_debug(ctx
, "glCallList %d\n", list
);
8869 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8874 mesa_print_display_list( list
);
8876 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
8877 * execute the display list, and restore the CompileFlag.
8879 save_compile_flag
= ctx
->CompileFlag
;
8880 if (save_compile_flag
) {
8881 ctx
->CompileFlag
= GL_FALSE
;
8884 execute_list(ctx
, list
);
8885 ctx
->CompileFlag
= save_compile_flag
;
8887 /* also restore API function pointers to point to "save" versions */
8888 if (save_compile_flag
) {
8889 ctx
->CurrentDispatch
= ctx
->Save
;
8890 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8896 * Execute glCallLists: call multiple display lists.
8899 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
8901 GET_CURRENT_CONTEXT(ctx
);
8903 GLboolean save_compile_flag
;
8905 if (MESA_VERBOSE
& VERBOSE_API
)
8906 _mesa_debug(ctx
, "glCallLists %d\n", n
);
8910 case GL_UNSIGNED_BYTE
:
8912 case GL_UNSIGNED_SHORT
:
8914 case GL_UNSIGNED_INT
:
8922 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
8926 /* Save the CompileFlag status, turn it off, execute display list,
8927 * and restore the CompileFlag.
8929 save_compile_flag
= ctx
->CompileFlag
;
8930 ctx
->CompileFlag
= GL_FALSE
;
8932 for (i
= 0; i
< n
; i
++) {
8933 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
8934 execute_list(ctx
, list
);
8937 ctx
->CompileFlag
= save_compile_flag
;
8939 /* also restore API function pointers to point to "save" versions */
8940 if (save_compile_flag
) {
8941 ctx
->CurrentDispatch
= ctx
->Save
;
8942 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8948 * Set the offset added to list numbers in glCallLists.
8950 static void GLAPIENTRY
8951 _mesa_ListBase(GLuint base
)
8953 GET_CURRENT_CONTEXT(ctx
);
8954 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8955 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8956 ctx
->List
.ListBase
= base
;
8960 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8962 static void GLAPIENTRY
8965 GET_CURRENT_CONTEXT(ctx
);
8966 FLUSH_VERTICES(ctx
, 0);
8967 CALL_Finish(ctx
->Exec
, ());
8970 static void GLAPIENTRY
8973 GET_CURRENT_CONTEXT(ctx
);
8974 FLUSH_VERTICES(ctx
, 0);
8975 CALL_Flush(ctx
->Exec
, ());
8978 static void GLAPIENTRY
8979 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8981 GET_CURRENT_CONTEXT(ctx
);
8982 FLUSH_VERTICES(ctx
, 0);
8983 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8986 static void GLAPIENTRY
8987 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8989 GET_CURRENT_CONTEXT(ctx
);
8990 FLUSH_VERTICES(ctx
, 0);
8991 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8994 static void GLAPIENTRY
8995 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8997 GET_CURRENT_CONTEXT(ctx
);
8998 FLUSH_VERTICES(ctx
, 0);
8999 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
9002 static GLenum GLAPIENTRY
9005 GET_CURRENT_CONTEXT(ctx
);
9006 FLUSH_VERTICES(ctx
, 0);
9007 return CALL_GetError(ctx
->Exec
, ());
9010 static void GLAPIENTRY
9011 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9013 GET_CURRENT_CONTEXT(ctx
);
9014 FLUSH_VERTICES(ctx
, 0);
9015 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9018 static void GLAPIENTRY
9019 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9021 GET_CURRENT_CONTEXT(ctx
);
9022 FLUSH_VERTICES(ctx
, 0);
9023 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9026 static void GLAPIENTRY
9027 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9029 GET_CURRENT_CONTEXT(ctx
);
9030 FLUSH_VERTICES(ctx
, 0);
9031 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9034 static void GLAPIENTRY
9035 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9037 GET_CURRENT_CONTEXT(ctx
);
9038 FLUSH_VERTICES(ctx
, 0);
9039 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9042 static void GLAPIENTRY
9043 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9045 GET_CURRENT_CONTEXT(ctx
);
9046 FLUSH_VERTICES(ctx
, 0);
9047 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9050 static void GLAPIENTRY
9051 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9053 GET_CURRENT_CONTEXT(ctx
);
9054 FLUSH_VERTICES(ctx
, 0);
9055 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9058 static void GLAPIENTRY
9059 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9061 GET_CURRENT_CONTEXT(ctx
);
9062 FLUSH_VERTICES(ctx
, 0);
9063 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9066 static void GLAPIENTRY
9067 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9069 GET_CURRENT_CONTEXT(ctx
);
9070 FLUSH_VERTICES(ctx
, 0);
9071 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9074 static void GLAPIENTRY
9075 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9077 GET_CURRENT_CONTEXT(ctx
);
9078 FLUSH_VERTICES(ctx
, 0);
9079 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9082 static void GLAPIENTRY
9083 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9085 GET_CURRENT_CONTEXT(ctx
);
9086 FLUSH_VERTICES(ctx
, 0);
9087 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9090 static void GLAPIENTRY
9091 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9093 GET_CURRENT_CONTEXT(ctx
);
9094 FLUSH_VERTICES(ctx
, 0);
9095 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9098 static void GLAPIENTRY
9099 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9101 GET_CURRENT_CONTEXT(ctx
);
9102 FLUSH_VERTICES(ctx
, 0);
9103 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9106 static void GLAPIENTRY
9107 exec_GetPolygonStipple(GLubyte
* dest
)
9109 GET_CURRENT_CONTEXT(ctx
);
9110 FLUSH_VERTICES(ctx
, 0);
9111 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9114 static const GLubyte
*GLAPIENTRY
9115 exec_GetString(GLenum name
)
9117 GET_CURRENT_CONTEXT(ctx
);
9118 FLUSH_VERTICES(ctx
, 0);
9119 return CALL_GetString(ctx
->Exec
, (name
));
9122 static void GLAPIENTRY
9123 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9125 GET_CURRENT_CONTEXT(ctx
);
9126 FLUSH_VERTICES(ctx
, 0);
9127 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9130 static void GLAPIENTRY
9131 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9133 GET_CURRENT_CONTEXT(ctx
);
9134 FLUSH_VERTICES(ctx
, 0);
9135 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9138 static void GLAPIENTRY
9139 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9141 GET_CURRENT_CONTEXT(ctx
);
9142 FLUSH_VERTICES(ctx
, 0);
9143 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9146 static void GLAPIENTRY
9147 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9149 GET_CURRENT_CONTEXT(ctx
);
9150 FLUSH_VERTICES(ctx
, 0);
9151 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9154 static void GLAPIENTRY
9155 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9157 GET_CURRENT_CONTEXT(ctx
);
9158 FLUSH_VERTICES(ctx
, 0);
9159 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9162 static void GLAPIENTRY
9163 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9164 GLenum type
, GLvoid
* pixels
)
9166 GET_CURRENT_CONTEXT(ctx
);
9167 FLUSH_VERTICES(ctx
, 0);
9168 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9171 static void GLAPIENTRY
9172 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9173 GLenum pname
, GLfloat
*params
)
9175 GET_CURRENT_CONTEXT(ctx
);
9176 FLUSH_VERTICES(ctx
, 0);
9177 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9180 static void GLAPIENTRY
9181 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9182 GLenum pname
, GLint
*params
)
9184 GET_CURRENT_CONTEXT(ctx
);
9185 FLUSH_VERTICES(ctx
, 0);
9186 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9189 static void GLAPIENTRY
9190 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9192 GET_CURRENT_CONTEXT(ctx
);
9193 FLUSH_VERTICES(ctx
, 0);
9194 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9197 static void GLAPIENTRY
9198 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9200 GET_CURRENT_CONTEXT(ctx
);
9201 FLUSH_VERTICES(ctx
, 0);
9202 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9205 static GLboolean GLAPIENTRY
9206 exec_IsEnabled(GLenum cap
)
9208 GET_CURRENT_CONTEXT(ctx
);
9209 FLUSH_VERTICES(ctx
, 0);
9210 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9213 static void GLAPIENTRY
9214 exec_PixelStoref(GLenum pname
, GLfloat param
)
9216 GET_CURRENT_CONTEXT(ctx
);
9217 FLUSH_VERTICES(ctx
, 0);
9218 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9221 static void GLAPIENTRY
9222 exec_PixelStorei(GLenum pname
, GLint param
)
9224 GET_CURRENT_CONTEXT(ctx
);
9225 FLUSH_VERTICES(ctx
, 0);
9226 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9229 static void GLAPIENTRY
9230 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9231 GLenum format
, GLenum type
, GLvoid
* pixels
)
9233 GET_CURRENT_CONTEXT(ctx
);
9234 FLUSH_VERTICES(ctx
, 0);
9235 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9238 static GLint GLAPIENTRY
9239 exec_RenderMode(GLenum mode
)
9241 GET_CURRENT_CONTEXT(ctx
);
9242 FLUSH_VERTICES(ctx
, 0);
9243 return CALL_RenderMode(ctx
->Exec
, (mode
));
9246 static void GLAPIENTRY
9247 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9249 GET_CURRENT_CONTEXT(ctx
);
9250 FLUSH_VERTICES(ctx
, 0);
9251 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9254 static void GLAPIENTRY
9255 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9257 GET_CURRENT_CONTEXT(ctx
);
9258 FLUSH_VERTICES(ctx
, 0);
9259 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9262 static GLboolean GLAPIENTRY
9263 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9264 GLboolean
* residences
)
9266 GET_CURRENT_CONTEXT(ctx
);
9267 FLUSH_VERTICES(ctx
, 0);
9268 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9271 static void GLAPIENTRY
9272 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9274 GET_CURRENT_CONTEXT(ctx
);
9275 FLUSH_VERTICES(ctx
, 0);
9276 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9279 static void GLAPIENTRY
9280 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9282 GET_CURRENT_CONTEXT(ctx
);
9283 FLUSH_VERTICES(ctx
, 0);
9284 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9287 static void GLAPIENTRY
9288 exec_DisableClientState(GLenum cap
)
9290 GET_CURRENT_CONTEXT(ctx
);
9291 FLUSH_VERTICES(ctx
, 0);
9292 CALL_DisableClientState(ctx
->Exec
, (cap
));
9295 static void GLAPIENTRY
9296 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9298 GET_CURRENT_CONTEXT(ctx
);
9299 FLUSH_VERTICES(ctx
, 0);
9300 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9303 static void GLAPIENTRY
9304 exec_EnableClientState(GLenum cap
)
9306 GET_CURRENT_CONTEXT(ctx
);
9307 FLUSH_VERTICES(ctx
, 0);
9308 CALL_EnableClientState(ctx
->Exec
, (cap
));
9311 static void GLAPIENTRY
9312 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9314 GET_CURRENT_CONTEXT(ctx
);
9315 FLUSH_VERTICES(ctx
, 0);
9316 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9319 static void GLAPIENTRY
9320 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9322 GET_CURRENT_CONTEXT(ctx
);
9323 FLUSH_VERTICES(ctx
, 0);
9324 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9327 static void GLAPIENTRY
9328 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9330 GET_CURRENT_CONTEXT(ctx
);
9331 FLUSH_VERTICES(ctx
, 0);
9332 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9335 static void GLAPIENTRY
9336 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9338 GET_CURRENT_CONTEXT(ctx
);
9339 FLUSH_VERTICES(ctx
, 0);
9340 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9343 static GLboolean GLAPIENTRY
9344 exec_IsTexture(GLuint texture
)
9346 GET_CURRENT_CONTEXT(ctx
);
9347 FLUSH_VERTICES(ctx
, 0);
9348 return CALL_IsTexture(ctx
->Exec
, (texture
));
9351 static void GLAPIENTRY
9352 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9354 GET_CURRENT_CONTEXT(ctx
);
9355 FLUSH_VERTICES(ctx
, 0);
9356 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9359 static void GLAPIENTRY
9360 exec_PopClientAttrib(void)
9362 GET_CURRENT_CONTEXT(ctx
);
9363 FLUSH_VERTICES(ctx
, 0);
9364 CALL_PopClientAttrib(ctx
->Exec
, ());
9367 static void GLAPIENTRY
9368 exec_PushClientAttrib(GLbitfield mask
)
9370 GET_CURRENT_CONTEXT(ctx
);
9371 FLUSH_VERTICES(ctx
, 0);
9372 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9375 static void GLAPIENTRY
9376 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9379 GET_CURRENT_CONTEXT(ctx
);
9380 FLUSH_VERTICES(ctx
, 0);
9381 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9384 static void GLAPIENTRY
9385 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9387 GET_CURRENT_CONTEXT(ctx
);
9388 FLUSH_VERTICES(ctx
, 0);
9389 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9392 static void GLAPIENTRY
9393 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9396 GET_CURRENT_CONTEXT(ctx
);
9397 FLUSH_VERTICES(ctx
, 0);
9398 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9401 static void GLAPIENTRY
9402 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9403 GLint x
, GLint y
, GLsizei width
)
9405 GET_CURRENT_CONTEXT(ctx
);
9406 FLUSH_VERTICES(ctx
, 0);
9407 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9408 (target
, internalFormat
, x
, y
, width
));
9411 static void GLAPIENTRY
9412 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9413 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9415 GET_CURRENT_CONTEXT(ctx
);
9416 FLUSH_VERTICES(ctx
, 0);
9417 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9418 (target
, internalFormat
, x
, y
, width
,
9422 static void GLAPIENTRY
9423 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9425 GET_CURRENT_CONTEXT(ctx
);
9426 FLUSH_VERTICES(ctx
, 0);
9427 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9430 static void GLAPIENTRY
9431 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9433 GET_CURRENT_CONTEXT(ctx
);
9434 FLUSH_VERTICES(ctx
, 0);
9435 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9438 static void GLAPIENTRY
9439 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9441 GET_CURRENT_CONTEXT(ctx
);
9442 FLUSH_VERTICES(ctx
, 0);
9443 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9446 static void GLAPIENTRY
9447 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9450 GET_CURRENT_CONTEXT(ctx
);
9451 FLUSH_VERTICES(ctx
, 0);
9452 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9455 static void GLAPIENTRY
9456 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9458 GET_CURRENT_CONTEXT(ctx
);
9459 FLUSH_VERTICES(ctx
, 0);
9460 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9463 static void GLAPIENTRY
9464 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9466 GET_CURRENT_CONTEXT(ctx
);
9467 FLUSH_VERTICES(ctx
, 0);
9468 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9471 static void GLAPIENTRY
9472 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9473 GLenum type
, GLvoid
*values
)
9475 GET_CURRENT_CONTEXT(ctx
);
9476 FLUSH_VERTICES(ctx
, 0);
9477 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9480 static void GLAPIENTRY
9481 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9483 GET_CURRENT_CONTEXT(ctx
);
9484 FLUSH_VERTICES(ctx
, 0);
9485 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9488 static void GLAPIENTRY
9489 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9491 GET_CURRENT_CONTEXT(ctx
);
9492 FLUSH_VERTICES(ctx
, 0);
9493 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9496 static void GLAPIENTRY
9497 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9498 GLenum type
, GLvoid
*values
)
9500 GET_CURRENT_CONTEXT(ctx
);
9501 FLUSH_VERTICES(ctx
, 0);
9502 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9505 static void GLAPIENTRY
9506 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9508 GET_CURRENT_CONTEXT(ctx
);
9509 FLUSH_VERTICES(ctx
, 0);
9510 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9513 static void GLAPIENTRY
9514 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9516 GET_CURRENT_CONTEXT(ctx
);
9517 FLUSH_VERTICES(ctx
, 0);
9518 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9521 static void GLAPIENTRY
9522 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9523 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9525 GET_CURRENT_CONTEXT(ctx
);
9526 FLUSH_VERTICES(ctx
, 0);
9527 CALL_GetSeparableFilter(ctx
->Exec
,
9528 (target
, format
, type
, row
, column
, span
));
9531 static void GLAPIENTRY
9532 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9533 GLsizei width
, GLsizei height
, GLenum format
,
9534 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9536 GET_CURRENT_CONTEXT(ctx
);
9537 FLUSH_VERTICES(ctx
, 0);
9538 CALL_SeparableFilter2D(ctx
->Exec
,
9539 (target
, internalFormat
, width
, height
, format
,
9540 type
, row
, column
));
9543 static void GLAPIENTRY
9544 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9545 GLsizei count
, const GLvoid
*ptr
)
9547 GET_CURRENT_CONTEXT(ctx
);
9548 FLUSH_VERTICES(ctx
, 0);
9549 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9552 static void GLAPIENTRY
9553 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9555 GET_CURRENT_CONTEXT(ctx
);
9556 FLUSH_VERTICES(ctx
, 0);
9557 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9560 static void GLAPIENTRY
9561 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9564 GET_CURRENT_CONTEXT(ctx
);
9565 FLUSH_VERTICES(ctx
, 0);
9566 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9569 static void GLAPIENTRY
9570 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9573 GET_CURRENT_CONTEXT(ctx
);
9574 FLUSH_VERTICES(ctx
, 0);
9575 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9578 static void GLAPIENTRY
9579 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9580 GLsizei count
, const GLvoid
*ptr
)
9582 GET_CURRENT_CONTEXT(ctx
);
9583 FLUSH_VERTICES(ctx
, 0);
9584 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9587 static void GLAPIENTRY
9588 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9589 GLsizei count
, const GLvoid
*ptr
)
9591 GET_CURRENT_CONTEXT(ctx
);
9592 FLUSH_VERTICES(ctx
, 0);
9593 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9596 static void GLAPIENTRY
9597 exec_LockArraysEXT(GLint first
, GLsizei count
)
9599 GET_CURRENT_CONTEXT(ctx
);
9600 FLUSH_VERTICES(ctx
, 0);
9601 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9604 static void GLAPIENTRY
9605 exec_UnlockArraysEXT(void)
9607 GET_CURRENT_CONTEXT(ctx
);
9608 FLUSH_VERTICES(ctx
, 0);
9609 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9612 static void GLAPIENTRY
9613 exec_ClientActiveTextureARB(GLenum target
)
9615 GET_CURRENT_CONTEXT(ctx
);
9616 FLUSH_VERTICES(ctx
, 0);
9617 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9620 static void GLAPIENTRY
9621 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9622 GLsizei stride
, const GLvoid
*ptr
)
9624 GET_CURRENT_CONTEXT(ctx
);
9625 FLUSH_VERTICES(ctx
, 0);
9626 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9629 static void GLAPIENTRY
9630 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9632 GET_CURRENT_CONTEXT(ctx
);
9633 FLUSH_VERTICES(ctx
, 0);
9634 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9637 /* GL_EXT_multi_draw_arrays */
9638 static void GLAPIENTRY
9639 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9640 const GLsizei
*count
, GLsizei primcount
)
9642 GET_CURRENT_CONTEXT(ctx
);
9643 FLUSH_VERTICES(ctx
, 0);
9644 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9647 /* GL_IBM_multimode_draw_arrays */
9648 static void GLAPIENTRY
9649 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9650 const GLsizei
* count
, GLsizei primcount
,
9653 GET_CURRENT_CONTEXT(ctx
);
9654 FLUSH_VERTICES(ctx
, 0);
9655 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9656 (mode
, first
, count
, primcount
, modestride
));
9659 /* GL_IBM_multimode_draw_arrays */
9660 static void GLAPIENTRY
9661 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9662 const GLsizei
* count
,
9664 const GLvoid
* const *indices
,
9665 GLsizei primcount
, GLint modestride
)
9667 GET_CURRENT_CONTEXT(ctx
);
9668 FLUSH_VERTICES(ctx
, 0);
9669 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9670 (mode
, count
, type
, indices
, primcount
,
9677 * Setup the given dispatch table to point to Mesa's display list
9678 * building functions.
9680 * This does not include any of the tnl functions - they are
9681 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9684 struct _glapi_table
*
9685 _mesa_create_save_table(void)
9687 struct _glapi_table
*table
;
9689 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9693 _mesa_loopback_init_api_table(table
);
9696 SET_Accum(table
, save_Accum
);
9697 SET_AlphaFunc(table
, save_AlphaFunc
);
9698 SET_Bitmap(table
, save_Bitmap
);
9699 SET_BlendFunc(table
, save_BlendFunc
);
9700 SET_CallList(table
, save_CallList
);
9701 SET_CallLists(table
, save_CallLists
);
9702 SET_Clear(table
, save_Clear
);
9703 SET_ClearAccum(table
, save_ClearAccum
);
9704 SET_ClearColor(table
, save_ClearColor
);
9705 SET_ClearDepth(table
, save_ClearDepth
);
9706 SET_ClearIndex(table
, save_ClearIndex
);
9707 SET_ClearStencil(table
, save_ClearStencil
);
9708 SET_ClipPlane(table
, save_ClipPlane
);
9709 SET_ColorMask(table
, save_ColorMask
);
9710 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9711 SET_ColorMaterial(table
, save_ColorMaterial
);
9712 SET_CopyPixels(table
, save_CopyPixels
);
9713 SET_CullFace(table
, save_CullFace
);
9714 SET_DeleteLists(table
, _mesa_DeleteLists
);
9715 SET_DepthFunc(table
, save_DepthFunc
);
9716 SET_DepthMask(table
, save_DepthMask
);
9717 SET_DepthRange(table
, save_DepthRange
);
9718 SET_Disable(table
, save_Disable
);
9719 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9720 SET_DrawBuffer(table
, save_DrawBuffer
);
9721 SET_DrawPixels(table
, save_DrawPixels
);
9722 SET_Enable(table
, save_Enable
);
9723 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9724 SET_EndList(table
, _mesa_EndList
);
9725 SET_EvalMesh1(table
, save_EvalMesh1
);
9726 SET_EvalMesh2(table
, save_EvalMesh2
);
9727 SET_Finish(table
, exec_Finish
);
9728 SET_Flush(table
, exec_Flush
);
9729 SET_Fogf(table
, save_Fogf
);
9730 SET_Fogfv(table
, save_Fogfv
);
9731 SET_Fogi(table
, save_Fogi
);
9732 SET_Fogiv(table
, save_Fogiv
);
9733 SET_FrontFace(table
, save_FrontFace
);
9734 SET_Frustum(table
, save_Frustum
);
9735 SET_GenLists(table
, _mesa_GenLists
);
9736 SET_GetBooleanv(table
, exec_GetBooleanv
);
9737 SET_GetClipPlane(table
, exec_GetClipPlane
);
9738 SET_GetDoublev(table
, exec_GetDoublev
);
9739 SET_GetError(table
, exec_GetError
);
9740 SET_GetFloatv(table
, exec_GetFloatv
);
9741 SET_GetIntegerv(table
, exec_GetIntegerv
);
9742 SET_GetLightfv(table
, exec_GetLightfv
);
9743 SET_GetLightiv(table
, exec_GetLightiv
);
9744 SET_GetMapdv(table
, exec_GetMapdv
);
9745 SET_GetMapfv(table
, exec_GetMapfv
);
9746 SET_GetMapiv(table
, exec_GetMapiv
);
9747 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9748 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9749 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9750 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9751 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9752 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9753 SET_GetString(table
, exec_GetString
);
9754 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9755 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9756 SET_GetTexGendv(table
, exec_GetTexGendv
);
9757 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9758 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9759 SET_GetTexImage(table
, exec_GetTexImage
);
9760 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9761 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9762 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9763 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9764 SET_Hint(table
, save_Hint
);
9765 SET_IndexMask(table
, save_IndexMask
);
9766 SET_InitNames(table
, save_InitNames
);
9767 SET_IsEnabled(table
, exec_IsEnabled
);
9768 SET_IsList(table
, _mesa_IsList
);
9769 SET_LightModelf(table
, save_LightModelf
);
9770 SET_LightModelfv(table
, save_LightModelfv
);
9771 SET_LightModeli(table
, save_LightModeli
);
9772 SET_LightModeliv(table
, save_LightModeliv
);
9773 SET_Lightf(table
, save_Lightf
);
9774 SET_Lightfv(table
, save_Lightfv
);
9775 SET_Lighti(table
, save_Lighti
);
9776 SET_Lightiv(table
, save_Lightiv
);
9777 SET_LineStipple(table
, save_LineStipple
);
9778 SET_LineWidth(table
, save_LineWidth
);
9779 SET_ListBase(table
, save_ListBase
);
9780 SET_LoadIdentity(table
, save_LoadIdentity
);
9781 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9782 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9783 SET_LoadName(table
, save_LoadName
);
9784 SET_LogicOp(table
, save_LogicOp
);
9785 SET_Map1d(table
, save_Map1d
);
9786 SET_Map1f(table
, save_Map1f
);
9787 SET_Map2d(table
, save_Map2d
);
9788 SET_Map2f(table
, save_Map2f
);
9789 SET_MapGrid1d(table
, save_MapGrid1d
);
9790 SET_MapGrid1f(table
, save_MapGrid1f
);
9791 SET_MapGrid2d(table
, save_MapGrid2d
);
9792 SET_MapGrid2f(table
, save_MapGrid2f
);
9793 SET_MatrixMode(table
, save_MatrixMode
);
9794 SET_MultMatrixd(table
, save_MultMatrixd
);
9795 SET_MultMatrixf(table
, save_MultMatrixf
);
9796 SET_NewList(table
, save_NewList
);
9797 SET_Ortho(table
, save_Ortho
);
9798 SET_PassThrough(table
, save_PassThrough
);
9799 SET_PixelMapfv(table
, save_PixelMapfv
);
9800 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9801 SET_PixelMapusv(table
, save_PixelMapusv
);
9802 SET_PixelStoref(table
, exec_PixelStoref
);
9803 SET_PixelStorei(table
, exec_PixelStorei
);
9804 SET_PixelTransferf(table
, save_PixelTransferf
);
9805 SET_PixelTransferi(table
, save_PixelTransferi
);
9806 SET_PixelZoom(table
, save_PixelZoom
);
9807 SET_PointSize(table
, save_PointSize
);
9808 SET_PolygonMode(table
, save_PolygonMode
);
9809 SET_PolygonOffset(table
, save_PolygonOffset
);
9810 SET_PolygonStipple(table
, save_PolygonStipple
);
9811 SET_PopAttrib(table
, save_PopAttrib
);
9812 SET_PopMatrix(table
, save_PopMatrix
);
9813 SET_PopName(table
, save_PopName
);
9814 SET_PushAttrib(table
, save_PushAttrib
);
9815 SET_PushMatrix(table
, save_PushMatrix
);
9816 SET_PushName(table
, save_PushName
);
9817 SET_RasterPos2d(table
, save_RasterPos2d
);
9818 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9819 SET_RasterPos2f(table
, save_RasterPos2f
);
9820 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9821 SET_RasterPos2i(table
, save_RasterPos2i
);
9822 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9823 SET_RasterPos2s(table
, save_RasterPos2s
);
9824 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9825 SET_RasterPos3d(table
, save_RasterPos3d
);
9826 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9827 SET_RasterPos3f(table
, save_RasterPos3f
);
9828 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9829 SET_RasterPos3i(table
, save_RasterPos3i
);
9830 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9831 SET_RasterPos3s(table
, save_RasterPos3s
);
9832 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9833 SET_RasterPos4d(table
, save_RasterPos4d
);
9834 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9835 SET_RasterPos4f(table
, save_RasterPos4f
);
9836 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9837 SET_RasterPos4i(table
, save_RasterPos4i
);
9838 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9839 SET_RasterPos4s(table
, save_RasterPos4s
);
9840 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9841 SET_ReadBuffer(table
, save_ReadBuffer
);
9842 SET_ReadPixels(table
, exec_ReadPixels
);
9843 SET_RenderMode(table
, exec_RenderMode
);
9844 SET_Rotated(table
, save_Rotated
);
9845 SET_Rotatef(table
, save_Rotatef
);
9846 SET_Scaled(table
, save_Scaled
);
9847 SET_Scalef(table
, save_Scalef
);
9848 SET_Scissor(table
, save_Scissor
);
9849 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9850 SET_SelectBuffer(table
, exec_SelectBuffer
);
9851 SET_ShadeModel(table
, save_ShadeModel
);
9852 SET_StencilFunc(table
, save_StencilFunc
);
9853 SET_StencilMask(table
, save_StencilMask
);
9854 SET_StencilOp(table
, save_StencilOp
);
9855 SET_TexEnvf(table
, save_TexEnvf
);
9856 SET_TexEnvfv(table
, save_TexEnvfv
);
9857 SET_TexEnvi(table
, save_TexEnvi
);
9858 SET_TexEnviv(table
, save_TexEnviv
);
9859 SET_TexGend(table
, save_TexGend
);
9860 SET_TexGendv(table
, save_TexGendv
);
9861 SET_TexGenf(table
, save_TexGenf
);
9862 SET_TexGenfv(table
, save_TexGenfv
);
9863 SET_TexGeni(table
, save_TexGeni
);
9864 SET_TexGeniv(table
, save_TexGeniv
);
9865 SET_TexImage1D(table
, save_TexImage1D
);
9866 SET_TexImage2D(table
, save_TexImage2D
);
9867 SET_TexParameterf(table
, save_TexParameterf
);
9868 SET_TexParameterfv(table
, save_TexParameterfv
);
9869 SET_TexParameteri(table
, save_TexParameteri
);
9870 SET_TexParameteriv(table
, save_TexParameteriv
);
9871 SET_Translated(table
, save_Translated
);
9872 SET_Translatef(table
, save_Translatef
);
9873 SET_Viewport(table
, save_Viewport
);
9876 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9877 SET_BindTexture(table
, save_BindTexture
);
9878 SET_ColorPointer(table
, exec_ColorPointer
);
9879 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9880 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9881 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9882 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9883 SET_DeleteTextures(table
, exec_DeleteTextures
);
9884 SET_DisableClientState(table
, exec_DisableClientState
);
9885 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9886 SET_EnableClientState(table
, exec_EnableClientState
);
9887 SET_GenTextures(table
, exec_GenTextures
);
9888 SET_GetPointerv(table
, exec_GetPointerv
);
9889 SET_IndexPointer(table
, exec_IndexPointer
);
9890 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
9891 SET_IsTexture(table
, exec_IsTexture
);
9892 SET_NormalPointer(table
, exec_NormalPointer
);
9893 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
9894 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9895 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
9896 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
9897 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9898 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9899 SET_VertexPointer(table
, exec_VertexPointer
);
9902 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9903 SET_TexImage3D(table
, save_TexImage3D
);
9904 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9907 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9908 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9909 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9911 /* ATI_separate_stencil */
9912 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9914 /* GL_ARB_imaging */
9915 /* Not all are supported */
9916 SET_BlendColor(table
, save_BlendColor
);
9917 SET_BlendEquation(table
, save_BlendEquation
);
9918 SET_ColorSubTable(table
, save_ColorSubTable
);
9919 SET_ColorTable(table
, save_ColorTable
);
9920 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
9921 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
9922 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
9923 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
9924 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
9925 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
9926 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
9927 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
9928 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
9929 SET_CopyColorTable(table
, save_CopyColorTable
);
9930 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
9931 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
9932 SET_GetColorTable(table
, exec_GetColorTable
);
9933 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
9934 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
9935 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
9936 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
9937 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
9938 SET_GetHistogram(table
, exec_GetHistogram
);
9939 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
9940 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
9941 SET_GetMinmax(table
, exec_GetMinmax
);
9942 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
9943 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
9944 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
9945 SET_Histogram(table
, save_Histogram
);
9946 SET_Minmax(table
, save_Minmax
);
9947 SET_ResetHistogram(table
, save_ResetHistogram
);
9948 SET_ResetMinmax(table
, save_ResetMinmax
);
9949 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
9951 /* 2. GL_EXT_blend_color */
9953 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9956 /* 3. GL_EXT_polygon_offset */
9957 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9959 /* 6. GL_EXT_texture3d */
9961 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9962 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9963 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9966 /* 14. GL_SGI_color_table */
9968 SET_ColorTableSGI(table
, save_ColorTable
);
9969 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9970 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9971 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9972 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9975 /* 30. GL_EXT_vertex_array */
9976 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9977 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9978 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9979 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9980 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9981 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9983 /* 37. GL_EXT_blend_minmax */
9985 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9988 /* 54. GL_EXT_point_parameters */
9989 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9990 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9992 /* 97. GL_EXT_compiled_vertex_array */
9993 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9994 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9996 /* 145. GL_EXT_secondary_color */
9997 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9999 /* 148. GL_EXT_multi_draw_arrays */
10000 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
10002 /* 149. GL_EXT_fog_coord */
10003 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10005 /* 173. GL_EXT_blend_func_separate */
10006 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10008 /* 196. GL_MESA_resize_buffers */
10009 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10011 /* 197. GL_MESA_window_pos */
10012 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10013 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10014 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10015 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10016 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10017 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10018 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10019 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10020 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10021 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10022 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10023 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10024 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10025 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10026 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10027 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10028 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10029 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10030 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10031 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10032 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10033 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10034 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10035 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10037 /* 200. GL_IBM_multimode_draw_arrays */
10038 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10039 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10041 #if FEATURE_NV_vertex_program
10042 /* 233. GL_NV_vertex_program */
10043 /* The following commands DO NOT go into display lists:
10044 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10045 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10047 SET_BindProgramNV(table
, save_BindProgramNV
);
10048 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10049 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10050 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10051 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10052 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10053 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10054 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10055 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10056 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10057 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
10058 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10059 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10060 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10061 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10062 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10063 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10064 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10065 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10066 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10067 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10068 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10069 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10070 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
10071 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10074 /* 244. GL_ATI_envmap_bumpmap */
10075 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10076 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10078 /* 245. GL_ATI_fragment_shader */
10079 #if FEATURE_ATI_fragment_shader
10080 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10081 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10084 /* 282. GL_NV_fragment_program */
10085 #if FEATURE_NV_fragment_program
10086 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10087 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10088 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10089 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10090 SET_GetProgramNamedParameterfvNV(table
,
10091 _mesa_GetProgramNamedParameterfvNV
);
10092 SET_GetProgramNamedParameterdvNV(table
,
10093 _mesa_GetProgramNamedParameterdvNV
);
10094 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10095 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10096 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10097 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10098 SET_GetProgramLocalParameterdvARB(table
,
10099 _mesa_GetProgramLocalParameterdvARB
);
10100 SET_GetProgramLocalParameterfvARB(table
,
10101 _mesa_GetProgramLocalParameterfvARB
);
10104 /* 262. GL_NV_point_sprite */
10105 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10106 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10108 /* 268. GL_EXT_stencil_two_side */
10109 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10111 /* 273. GL_APPLE_vertex_array_object */
10112 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10113 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10114 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10115 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10117 /* GL_ARB_vertex_array_object */
10118 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10119 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10121 /* ???. GL_EXT_depth_bounds_test */
10122 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10124 /* ARB 1. GL_ARB_multitexture */
10125 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10126 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10128 /* ARB 3. GL_ARB_transpose_matrix */
10129 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10130 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10131 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10132 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10134 /* ARB 5. GL_ARB_multisample */
10135 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10137 /* ARB 12. GL_ARB_texture_compression */
10138 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10139 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10140 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10141 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10142 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10143 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10144 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10146 /* ARB 14. GL_ARB_point_parameters */
10147 /* aliased with EXT_point_parameters functions */
10149 /* ARB 25. GL_ARB_window_pos */
10150 /* aliased with MESA_window_pos functions */
10152 /* ARB 26. GL_ARB_vertex_program */
10153 /* ARB 27. GL_ARB_fragment_program */
10154 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10155 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10156 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10157 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10158 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10159 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10160 SET_BindProgramNV(table
, save_BindProgramNV
);
10161 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10162 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10163 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10164 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10165 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10166 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10167 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10168 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10169 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10170 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10171 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10172 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10173 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10174 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10175 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10176 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10177 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10178 SET_GetProgramLocalParameterdvARB(table
,
10179 _mesa_GetProgramLocalParameterdvARB
);
10180 SET_GetProgramLocalParameterfvARB(table
,
10181 _mesa_GetProgramLocalParameterfvARB
);
10182 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10183 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10186 /* ARB 28. GL_ARB_vertex_buffer_object */
10187 #if FEATURE_ARB_vertex_buffer_object
10188 /* None of the extension's functions get compiled */
10189 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10190 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10191 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10192 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10193 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10194 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10195 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10196 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10197 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10198 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10199 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10202 #if FEATURE_queryobj
10203 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10204 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10205 SET_EndQueryARB(table
, save_EndQueryARB
);
10208 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10210 #if FEATURE_EXT_framebuffer_blit
10211 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10214 /* GL_ARB_shader_objects */
10215 _mesa_init_shader_dispatch(table
); /* Plug in glCreate/Delete/Get, etc */
10216 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10217 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10218 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10219 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10220 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10221 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10222 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10223 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10224 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10225 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10226 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10227 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10228 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10229 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10230 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10231 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10232 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10233 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10234 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10235 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10236 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10237 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10238 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10239 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10240 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10241 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10243 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10244 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10245 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10246 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10247 /* XXX additional functions need to be implemented here! */
10249 /* 299. GL_EXT_blend_equation_separate */
10250 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10252 /* GL_EXT_gpu_program_parameters */
10253 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10254 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10255 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10258 /* ARB 50. GL_ARB_map_buffer_range */
10259 #if FEATURE_ARB_map_buffer_range
10260 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10261 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10264 /* ARB 59. GL_ARB_copy_buffer */
10265 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10267 /* 364. GL_EXT_provoking_vertex */
10268 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10270 /* 371. GL_APPLE_object_purgeable */
10271 #if FEATURE_APPLE_object_purgeable
10272 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10273 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10274 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10277 /* GL_EXT_texture_integer */
10278 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10279 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10280 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10281 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10282 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10283 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10285 /* 377. GL_EXT_separate_shader_objects */
10286 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10287 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10289 /* GL_ARB_color_buffer_float */
10290 SET_ClampColorARB(table
, save_ClampColorARB
);
10291 SET_ClampColor(table
, save_ClampColorARB
);
10294 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10295 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10296 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10297 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10299 SET_Uniform1ui(table
, save_Uniform1ui
);
10300 SET_Uniform2ui(table
, save_Uniform2ui
);
10301 SET_Uniform3ui(table
, save_Uniform3ui
);
10302 SET_Uniform4ui(table
, save_Uniform4ui
);
10303 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10304 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10305 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10306 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10308 (void) save_Uniform1ui
;
10309 (void) save_Uniform2ui
;
10310 (void) save_Uniform3ui
;
10311 (void) save_Uniform4ui
;
10312 (void) save_Uniform1uiv
;
10313 (void) save_Uniform2uiv
;
10314 (void) save_Uniform3uiv
;
10315 (void) save_Uniform4uiv
;
10318 #if FEATURE_EXT_transform_feedback
10319 /* These are not compiled into display lists: */
10320 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10321 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10322 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10323 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10325 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10326 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10327 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10328 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10329 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10330 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10333 /* GL_ARB_instanced_arrays */
10334 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10336 /* GL_NV_texture_barrier */
10337 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10339 /* GL_ARB_sampler_objects */
10340 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10341 SET_BindSampler(table
, save_BindSampler
);
10342 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10343 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10344 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10345 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10346 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10347 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10349 /* GL_ARB_draw_buffer_blend */
10350 SET_BlendFunciARB(table
, save_BlendFunci
);
10351 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10352 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10353 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10355 /* GL_ARB_geometry_shader4 */
10356 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10357 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10358 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10360 /* GL_NV_conditional_render */
10361 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10362 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10365 _mesa_init_sync_dispatch(table
);
10366 SET_WaitSync(table
, save_WaitSync
);
10368 /* GL_ARB_texture_storage (no dlist support) */
10369 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10370 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10371 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10372 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10373 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10374 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10381 static const char *
10382 enum_string(GLenum k
)
10384 return _mesa_lookup_enum_by_nr(k
);
10389 * Print the commands in a display list. For debugging only.
10390 * TODO: many commands aren't handled yet.
10392 static void GLAPIENTRY
10393 print_list(struct gl_context
*ctx
, GLuint list
)
10395 struct gl_display_list
*dlist
;
10399 if (!islist(ctx
, list
)) {
10400 printf("%u is not a display list ID\n", list
);
10404 dlist
= lookup_list(ctx
, list
);
10410 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10412 done
= n
? GL_FALSE
: GL_TRUE
;
10414 const OpCode opcode
= n
[0].opcode
;
10416 if (is_ext_opcode(opcode
)) {
10417 n
+= ext_opcode_print(ctx
, n
);
10422 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10424 case OPCODE_BITMAP
:
10425 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10426 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10428 case OPCODE_CALL_LIST
:
10429 printf("CallList %d\n", (int) n
[1].ui
);
10431 case OPCODE_CALL_LIST_OFFSET
:
10432 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10433 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10435 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10436 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10437 enum_string(n
[1].e
), enum_string(n
[2].e
),
10438 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10440 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10441 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10442 enum_string(n
[1].e
), enum_string(n
[2].e
),
10443 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10445 case OPCODE_DISABLE
:
10446 printf("Disable %s\n", enum_string(n
[1].e
));
10448 case OPCODE_ENABLE
:
10449 printf("Enable %s\n", enum_string(n
[1].e
));
10451 case OPCODE_FRUSTUM
:
10452 printf("Frustum %g %g %g %g %g %g\n",
10453 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10455 case OPCODE_LINE_STIPPLE
:
10456 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10458 case OPCODE_LOAD_IDENTITY
:
10459 printf("LoadIdentity\n");
10461 case OPCODE_LOAD_MATRIX
:
10462 printf("LoadMatrix\n");
10463 printf(" %8f %8f %8f %8f\n",
10464 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10465 printf(" %8f %8f %8f %8f\n",
10466 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10467 printf(" %8f %8f %8f %8f\n",
10468 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10469 printf(" %8f %8f %8f %8f\n",
10470 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10472 case OPCODE_MULT_MATRIX
:
10473 printf("MultMatrix (or Rotate)\n");
10474 printf(" %8f %8f %8f %8f\n",
10475 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10476 printf(" %8f %8f %8f %8f\n",
10477 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10478 printf(" %8f %8f %8f %8f\n",
10479 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10480 printf(" %8f %8f %8f %8f\n",
10481 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10484 printf("Ortho %g %g %g %g %g %g\n",
10485 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10487 case OPCODE_POP_ATTRIB
:
10488 printf("PopAttrib\n");
10490 case OPCODE_POP_MATRIX
:
10491 printf("PopMatrix\n");
10493 case OPCODE_POP_NAME
:
10494 printf("PopName\n");
10496 case OPCODE_PUSH_ATTRIB
:
10497 printf("PushAttrib %x\n", n
[1].bf
);
10499 case OPCODE_PUSH_MATRIX
:
10500 printf("PushMatrix\n");
10502 case OPCODE_PUSH_NAME
:
10503 printf("PushName %d\n", (int) n
[1].ui
);
10505 case OPCODE_RASTER_POS
:
10506 printf("RasterPos %g %g %g %g\n",
10507 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10509 case OPCODE_ROTATE
:
10510 printf("Rotate %g %g %g %g\n",
10511 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10514 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10516 case OPCODE_TRANSLATE
:
10517 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10519 case OPCODE_BIND_TEXTURE
:
10520 printf("BindTexture %s %d\n",
10521 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10523 case OPCODE_SHADE_MODEL
:
10524 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10527 printf("Map1 %s %.3f %.3f %d %d\n",
10528 _mesa_lookup_enum_by_nr(n
[1].ui
),
10529 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10532 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10533 _mesa_lookup_enum_by_nr(n
[1].ui
),
10534 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10535 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10537 case OPCODE_MAPGRID1
:
10538 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10540 case OPCODE_MAPGRID2
:
10541 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10542 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10544 case OPCODE_EVALMESH1
:
10545 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10547 case OPCODE_EVALMESH2
:
10548 printf("EvalMesh2 %d %d %d %d\n",
10549 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10552 case OPCODE_ATTR_1F_NV
:
10553 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10555 case OPCODE_ATTR_2F_NV
:
10556 printf("ATTR_2F_NV attr %d: %f %f\n",
10557 n
[1].i
, n
[2].f
, n
[3].f
);
10559 case OPCODE_ATTR_3F_NV
:
10560 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10561 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10563 case OPCODE_ATTR_4F_NV
:
10564 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10565 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10567 case OPCODE_ATTR_1F_ARB
:
10568 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10570 case OPCODE_ATTR_2F_ARB
:
10571 printf("ATTR_2F_ARB attr %d: %f %f\n",
10572 n
[1].i
, n
[2].f
, n
[3].f
);
10574 case OPCODE_ATTR_3F_ARB
:
10575 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10576 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10578 case OPCODE_ATTR_4F_ARB
:
10579 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10580 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10583 case OPCODE_MATERIAL
:
10584 printf("MATERIAL %x %x: %f %f %f %f\n",
10585 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10588 printf("BEGIN %x\n", n
[1].i
);
10594 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10597 case OPCODE_EVAL_C1
:
10598 printf("EVAL_C1 %f\n", n
[1].f
);
10600 case OPCODE_EVAL_C2
:
10601 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10603 case OPCODE_EVAL_P1
:
10604 printf("EVAL_P1 %d\n", n
[1].i
);
10606 case OPCODE_EVAL_P2
:
10607 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10610 case OPCODE_PROVOKING_VERTEX
:
10611 printf("ProvokingVertex %s\n",
10612 _mesa_lookup_enum_by_nr(n
[1].ui
));
10616 * meta opcodes/commands
10619 printf("Error: %s %s\n",
10620 enum_string(n
[1].e
), (const char *) n
[2].data
);
10622 case OPCODE_CONTINUE
:
10623 printf("DISPLAY-LIST-CONTINUE\n");
10624 n
= (Node
*) n
[1].next
;
10626 case OPCODE_END_OF_LIST
:
10627 printf("END-LIST %u\n", list
);
10631 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10633 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10634 opcode
, (void *) n
);
10638 printf("command %d, %u operands\n", opcode
,
10642 /* increment n to point to next compiled command */
10643 if (opcode
!= OPCODE_CONTINUE
) {
10644 n
+= InstSize
[opcode
];
10653 * Clients may call this function to help debug display list problems.
10654 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10655 * changed, or break in the future without notice.
10658 mesa_print_display_list(GLuint list
)
10660 GET_CURRENT_CONTEXT(ctx
);
10661 print_list(ctx
, list
);
10665 /**********************************************************************/
10666 /***** Initialization *****/
10667 /**********************************************************************/
10670 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10672 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10674 vfmt
->Begin
= save_Begin
;
10676 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10678 vfmt
->Color3f
= save_Color3f
;
10679 vfmt
->Color3fv
= save_Color3fv
;
10680 vfmt
->Color4f
= save_Color4f
;
10681 vfmt
->Color4fv
= save_Color4fv
;
10682 vfmt
->EdgeFlag
= save_EdgeFlag
;
10683 vfmt
->End
= save_End
;
10685 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10687 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10688 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10689 vfmt
->Indexf
= save_Indexf
;
10690 vfmt
->Indexfv
= save_Indexfv
;
10691 vfmt
->Materialfv
= save_Materialfv
;
10692 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10693 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10694 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10695 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10696 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10697 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10698 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10699 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10700 vfmt
->Normal3f
= save_Normal3f
;
10701 vfmt
->Normal3fv
= save_Normal3fv
;
10702 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10703 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10704 vfmt
->TexCoord1f
= save_TexCoord1f
;
10705 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10706 vfmt
->TexCoord2f
= save_TexCoord2f
;
10707 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10708 vfmt
->TexCoord3f
= save_TexCoord3f
;
10709 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10710 vfmt
->TexCoord4f
= save_TexCoord4f
;
10711 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10712 vfmt
->Vertex2f
= save_Vertex2f
;
10713 vfmt
->Vertex2fv
= save_Vertex2fv
;
10714 vfmt
->Vertex3f
= save_Vertex3f
;
10715 vfmt
->Vertex3fv
= save_Vertex3fv
;
10716 vfmt
->Vertex4f
= save_Vertex4f
;
10717 vfmt
->Vertex4fv
= save_Vertex4fv
;
10718 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10719 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10720 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10721 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10722 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10723 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10724 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10725 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10726 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10727 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10728 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10729 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10730 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10731 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10732 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10733 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10735 vfmt
->Rectf
= save_Rectf
;
10737 /* The driver is required to implement these as
10738 * 1) They can probably do a better job.
10739 * 2) A lot of new mechanisms would have to be added to this module
10740 * to support it. That code would probably never get used,
10744 vfmt
->DrawArrays
= 0;
10745 vfmt
->DrawElements
= 0;
10746 vfmt
->DrawRangeElements
= 0;
10747 vfmt
->MultiDrawElemementsEXT
= 0;
10748 vfmt
->DrawElementsBaseVertex
= 0;
10749 vfmt
->DrawRangeElementsBaseVertex
= 0;
10750 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10756 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10757 const GLvertexformat
*vfmt
)
10759 SET_CallList(disp
, vfmt
->CallList
);
10760 SET_CallLists(disp
, vfmt
->CallLists
);
10764 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10766 SET_CallList(disp
, _mesa_CallList
);
10767 SET_CallLists(disp
, _mesa_CallLists
);
10769 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10770 SET_EndList(disp
, _mesa_EndList
);
10771 SET_GenLists(disp
, _mesa_GenLists
);
10772 SET_IsList(disp
, _mesa_IsList
);
10773 SET_ListBase(disp
, _mesa_ListBase
);
10774 SET_NewList(disp
, _mesa_NewList
);
10778 #endif /* FEATURE_dlist */
10782 * Initialize display list state for given context.
10785 _mesa_init_display_list(struct gl_context
*ctx
)
10787 static GLboolean tableInitialized
= GL_FALSE
;
10789 /* zero-out the instruction size table, just once */
10790 if (!tableInitialized
) {
10791 memset(InstSize
, 0, sizeof(InstSize
));
10792 tableInitialized
= GL_TRUE
;
10795 /* extension info */
10796 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10799 ctx
->ListState
.CallDepth
= 0;
10800 ctx
->ExecuteFlag
= GL_TRUE
;
10801 ctx
->CompileFlag
= GL_FALSE
;
10802 ctx
->ListState
.CurrentBlock
= NULL
;
10803 ctx
->ListState
.CurrentPos
= 0;
10805 /* Display List group */
10806 ctx
->List
.ListBase
= 0;
10809 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10815 _mesa_free_display_list_data(struct gl_context
*ctx
)
10817 free(ctx
->ListExt
);
10818 ctx
->ListExt
= NULL
;