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 #include "bufferobj.h"
49 #if FEATURE_EXT_framebuffer_object
52 #include "framebuffer.h"
53 #include "glapi/glapi.h"
61 #include "samplerobj.h"
62 #include "shaderapi.h"
65 #include "texstorage.h"
68 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
69 #include "arbprogram.h"
71 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
72 #include "nvprogram.h"
74 #if FEATURE_EXT_transform_feedback
75 #include "transformfeedback.h"
78 #include "math/m_matrix.h"
80 #include "main/dispatch.h"
85 * Other parts of Mesa (such as the VBO module) can plug into the display
86 * list system. This structure describes new display list instructions.
88 struct gl_list_instruction
91 void (*Execute
)( struct gl_context
*ctx
, void *data
);
92 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
93 void (*Print
)( struct gl_context
*ctx
, void *data
);
97 #define MAX_DLIST_EXT_OPCODES 16
100 * Used by device drivers to hook new commands into display lists.
102 struct gl_list_extensions
104 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
113 * \param ctx GL context.
115 * Checks if dd_function_table::SaveNeedFlush is marked to flush
116 * stored (save) vertices, and calls
117 * dd_function_table::SaveFlushVertices if so.
119 #define SAVE_FLUSH_VERTICES(ctx) \
121 if (ctx->Driver.SaveNeedFlush) \
122 ctx->Driver.SaveFlushVertices(ctx); \
127 * Macro to assert that the API call was made outside the
128 * glBegin()/glEnd() pair, with return value.
130 * \param ctx GL context.
131 * \param retval value to return value in case the assertion fails.
133 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
135 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
136 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
137 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
143 * Macro to assert that the API call was made outside the
144 * glBegin()/glEnd() pair.
146 * \param ctx GL context.
148 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
150 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
151 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
152 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
158 * Macro to assert that the API call was made outside the
159 * glBegin()/glEnd() pair and flush the vertices.
161 * \param ctx GL context.
163 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
165 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
166 SAVE_FLUSH_VERTICES(ctx); \
170 * Macro to assert that the API call was made outside the
171 * glBegin()/glEnd() pair and flush the vertices, with return value.
173 * \param ctx GL context.
174 * \param retval value to return value in case the assertion fails.
176 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
178 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
179 SAVE_FLUSH_VERTICES(ctx); \
185 * Display list opcodes.
187 * The fact that these identifiers are assigned consecutive
188 * integer values starting at 0 is very important, see InstSize array usage)
192 OPCODE_INVALID
= -1, /* Force signed enum */
198 OPCODE_BLEND_EQUATION
,
199 OPCODE_BLEND_EQUATION_SEPARATE
,
200 OPCODE_BLEND_FUNC_SEPARATE
,
202 OPCODE_BLEND_EQUATION_I
,
203 OPCODE_BLEND_EQUATION_SEPARATE_I
,
205 OPCODE_BLEND_FUNC_SEPARATE_I
,
208 OPCODE_CALL_LIST_OFFSET
,
214 OPCODE_CLEAR_STENCIL
,
215 OPCODE_CLEAR_BUFFER_IV
,
216 OPCODE_CLEAR_BUFFER_UIV
,
217 OPCODE_CLEAR_BUFFER_FV
,
218 OPCODE_CLEAR_BUFFER_FI
,
221 OPCODE_COLOR_MASK_INDEXED
,
222 OPCODE_COLOR_MATERIAL
,
224 OPCODE_COLOR_TABLE_PARAMETER_FV
,
225 OPCODE_COLOR_TABLE_PARAMETER_IV
,
226 OPCODE_COLOR_SUB_TABLE
,
227 OPCODE_CONVOLUTION_FILTER_1D
,
228 OPCODE_CONVOLUTION_FILTER_2D
,
229 OPCODE_CONVOLUTION_PARAMETER_I
,
230 OPCODE_CONVOLUTION_PARAMETER_IV
,
231 OPCODE_CONVOLUTION_PARAMETER_F
,
232 OPCODE_CONVOLUTION_PARAMETER_FV
,
233 OPCODE_COPY_COLOR_SUB_TABLE
,
234 OPCODE_COPY_COLOR_TABLE
,
236 OPCODE_COPY_TEX_IMAGE1D
,
237 OPCODE_COPY_TEX_IMAGE2D
,
238 OPCODE_COPY_TEX_SUB_IMAGE1D
,
239 OPCODE_COPY_TEX_SUB_IMAGE2D
,
240 OPCODE_COPY_TEX_SUB_IMAGE3D
,
246 OPCODE_DISABLE_INDEXED
,
250 OPCODE_ENABLE_INDEXED
,
265 OPCODE_LOAD_IDENTITY
,
279 OPCODE_PIXEL_TRANSFER
,
282 OPCODE_POINT_PARAMETERS
,
284 OPCODE_POLYGON_STIPPLE
,
285 OPCODE_POLYGON_OFFSET
,
289 OPCODE_PRIORITIZE_TEXTURE
,
295 OPCODE_RESET_HISTOGRAM
,
296 OPCODE_RESET_MIN_MAX
,
300 OPCODE_SELECT_TEXTURE_SGIS
,
301 OPCODE_SELECT_TEXTURE_COORD_SET
,
312 OPCODE_TEX_SUB_IMAGE1D
,
313 OPCODE_TEX_SUB_IMAGE2D
,
314 OPCODE_TEX_SUB_IMAGE3D
,
318 /* GL_ARB_multitexture */
319 OPCODE_ACTIVE_TEXTURE
,
320 /* GL_ARB_texture_compression */
321 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
322 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
323 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
324 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
325 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
326 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
327 /* GL_ARB_multisample */
328 OPCODE_SAMPLE_COVERAGE
,
329 /* GL_ARB_window_pos */
330 OPCODE_WINDOW_POS_ARB
,
331 /* GL_NV_vertex_program */
332 OPCODE_BIND_PROGRAM_NV
,
333 OPCODE_EXECUTE_PROGRAM_NV
,
334 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
335 OPCODE_LOAD_PROGRAM_NV
,
336 OPCODE_TRACK_MATRIX_NV
,
337 /* GL_NV_fragment_program */
338 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
339 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
340 /* GL_EXT_stencil_two_side */
341 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
342 /* GL_EXT_depth_bounds_test */
343 OPCODE_DEPTH_BOUNDS_EXT
,
344 /* GL_ARB_vertex/fragment_program */
345 OPCODE_PROGRAM_STRING_ARB
,
346 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
347 /* GL_ARB_occlusion_query */
348 OPCODE_BEGIN_QUERY_ARB
,
349 OPCODE_END_QUERY_ARB
,
350 /* GL_ARB_draw_buffers */
351 OPCODE_DRAW_BUFFERS_ARB
,
352 /* GL_ATI_fragment_shader */
353 OPCODE_TEX_BUMP_PARAMETER_ATI
,
354 /* GL_ATI_fragment_shader */
355 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
356 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
358 OPCODE_STENCIL_FUNC_SEPARATE
,
359 OPCODE_STENCIL_OP_SEPARATE
,
360 OPCODE_STENCIL_MASK_SEPARATE
,
362 /* GL_ARB_shader_objects */
380 OPCODE_UNIFORM_MATRIX22
,
381 OPCODE_UNIFORM_MATRIX33
,
382 OPCODE_UNIFORM_MATRIX44
,
383 OPCODE_UNIFORM_MATRIX23
,
384 OPCODE_UNIFORM_MATRIX32
,
385 OPCODE_UNIFORM_MATRIX24
,
386 OPCODE_UNIFORM_MATRIX42
,
387 OPCODE_UNIFORM_MATRIX34
,
388 OPCODE_UNIFORM_MATRIX43
,
400 /* GL_ARB_color_buffer_float */
403 /* GL_EXT_framebuffer_blit */
404 OPCODE_BLIT_FRAMEBUFFER
,
406 /* Vertex attributes -- fallback for when optimized display
407 * list build isn't active.
426 /* GL_EXT_provoking_vertex */
427 OPCODE_PROVOKING_VERTEX
,
429 /* GL_EXT_transform_feedback */
430 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
431 OPCODE_END_TRANSFORM_FEEDBACK
,
432 OPCODE_BIND_TRANSFORM_FEEDBACK
,
433 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
434 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
435 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
437 /* GL_EXT_texture_integer */
439 OPCODE_CLEARCOLOR_UI
,
440 OPCODE_TEXPARAMETER_I
,
441 OPCODE_TEXPARAMETER_UI
,
443 /* GL_EXT_separate_shader_objects */
444 OPCODE_ACTIVE_PROGRAM_EXT
,
445 OPCODE_USE_SHADER_PROGRAM_EXT
,
447 /* GL_ARB_instanced_arrays */
448 OPCODE_VERTEX_ATTRIB_DIVISOR
,
450 /* GL_NV_texture_barrier */
451 OPCODE_TEXTURE_BARRIER_NV
,
453 /* GL_ARB_sampler_object */
455 OPCODE_SAMPLER_PARAMETERIV
,
456 OPCODE_SAMPLER_PARAMETERFV
,
457 OPCODE_SAMPLER_PARAMETERIIV
,
458 OPCODE_SAMPLER_PARAMETERUIV
,
460 /* GL_ARB_geometry_shader4 */
461 OPCODE_PROGRAM_PARAMETERI
,
462 OPCODE_FRAMEBUFFER_TEXTURE
,
463 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
468 /* GL_NV_conditional_render */
469 OPCODE_BEGIN_CONDITIONAL_RENDER
,
470 OPCODE_END_CONDITIONAL_RENDER
,
472 /* ARB_timer_query */
473 OPCODE_QUERY_COUNTER
,
475 /* The following three are meta instructions */
476 OPCODE_ERROR
, /* raise compiled-in error */
487 * Display list instructions are stored as sequences of "nodes". Nodes
488 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
489 * are linked together with a pointer.
491 * Each instruction in the display list is stored as a sequence of
492 * contiguous nodes in memory.
493 * Each node is the union of a variety of data types.
508 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
512 typedef union gl_dlist_node Node
;
516 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
517 * environment. In 64-bit env, sizeof(Node)==8 anyway.
527 * How many nodes to allocate at a time.
529 * \note Reduced now that we hold vertices etc. elsewhere.
531 #define BLOCK_SIZE 256
536 * Number of nodes of storage needed for each instruction.
537 * Sizes for dynamically allocated opcodes are stored in the context struct.
539 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
545 void mesa_print_display_list(GLuint list
);
548 /**********************************************************************/
549 /***** Private *****/
550 /**********************************************************************/
554 * Make an empty display list. This is used by glGenLists() to
555 * reserve display list IDs.
557 static struct gl_display_list
*
558 make_list(GLuint name
, GLuint count
)
560 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
562 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
563 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
569 * Lookup function to just encapsulate casting.
571 static inline struct gl_display_list
*
572 lookup_list(struct gl_context
*ctx
, GLuint list
)
574 return (struct gl_display_list
*)
575 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
579 /** Is the given opcode an extension code? */
580 static inline GLboolean
581 is_ext_opcode(OpCode opcode
)
583 return (opcode
>= OPCODE_EXT_0
);
587 /** Destroy an extended opcode instruction */
589 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
591 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
593 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
594 step
= ctx
->ListExt
->Opcode
[i
].Size
;
599 /** Execute an extended opcode instruction */
601 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
603 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
605 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
606 step
= ctx
->ListExt
->Opcode
[i
].Size
;
611 /** Print an extended opcode instruction */
613 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
615 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
617 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
618 step
= ctx
->ListExt
->Opcode
[i
].Size
;
624 * Delete the named display list, but don't remove from hash table.
625 * \param dlist - display list pointer
628 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
633 n
= block
= dlist
->Head
;
635 done
= block
? GL_FALSE
: GL_TRUE
;
637 const OpCode opcode
= n
[0].opcode
;
639 /* check for extension opcodes first */
640 if (is_ext_opcode(opcode
)) {
641 n
+= ext_opcode_destroy(ctx
, n
);
645 /* for some commands, we need to free malloc'd memory */
648 n
+= InstSize
[n
[0].opcode
];
652 n
+= InstSize
[n
[0].opcode
];
654 case OPCODE_DRAW_PIXELS
:
656 n
+= InstSize
[n
[0].opcode
];
660 n
+= InstSize
[n
[0].opcode
];
662 case OPCODE_COLOR_TABLE
:
664 n
+= InstSize
[n
[0].opcode
];
666 case OPCODE_COLOR_SUB_TABLE
:
668 n
+= InstSize
[n
[0].opcode
];
670 case OPCODE_CONVOLUTION_FILTER_1D
:
672 n
+= InstSize
[n
[0].opcode
];
674 case OPCODE_CONVOLUTION_FILTER_2D
:
676 n
+= InstSize
[n
[0].opcode
];
678 case OPCODE_POLYGON_STIPPLE
:
680 n
+= InstSize
[n
[0].opcode
];
682 case OPCODE_TEX_IMAGE1D
:
684 n
+= InstSize
[n
[0].opcode
];
686 case OPCODE_TEX_IMAGE2D
:
688 n
+= InstSize
[n
[0].opcode
];
690 case OPCODE_TEX_IMAGE3D
:
692 n
+= InstSize
[n
[0].opcode
];
694 case OPCODE_TEX_SUB_IMAGE1D
:
696 n
+= InstSize
[n
[0].opcode
];
698 case OPCODE_TEX_SUB_IMAGE2D
:
700 n
+= InstSize
[n
[0].opcode
];
702 case OPCODE_TEX_SUB_IMAGE3D
:
704 n
+= InstSize
[n
[0].opcode
];
706 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
708 n
+= InstSize
[n
[0].opcode
];
710 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
712 n
+= InstSize
[n
[0].opcode
];
714 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
716 n
+= InstSize
[n
[0].opcode
];
718 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
720 n
+= InstSize
[n
[0].opcode
];
722 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
724 n
+= InstSize
[n
[0].opcode
];
726 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
728 n
+= InstSize
[n
[0].opcode
];
730 #if FEATURE_NV_vertex_program
731 case OPCODE_LOAD_PROGRAM_NV
:
732 free(n
[4].data
); /* program string */
733 n
+= InstSize
[n
[0].opcode
];
735 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
736 free(n
[2].data
); /* array of program ids */
737 n
+= InstSize
[n
[0].opcode
];
740 #if FEATURE_NV_fragment_program
741 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
742 free(n
[3].data
); /* parameter name */
743 n
+= InstSize
[n
[0].opcode
];
746 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
747 case OPCODE_PROGRAM_STRING_ARB
:
748 free(n
[4].data
); /* program string */
749 n
+= InstSize
[n
[0].opcode
];
752 case OPCODE_UNIFORM_1FV
:
753 case OPCODE_UNIFORM_2FV
:
754 case OPCODE_UNIFORM_3FV
:
755 case OPCODE_UNIFORM_4FV
:
756 case OPCODE_UNIFORM_1IV
:
757 case OPCODE_UNIFORM_2IV
:
758 case OPCODE_UNIFORM_3IV
:
759 case OPCODE_UNIFORM_4IV
:
760 case OPCODE_UNIFORM_1UIV
:
761 case OPCODE_UNIFORM_2UIV
:
762 case OPCODE_UNIFORM_3UIV
:
763 case OPCODE_UNIFORM_4UIV
:
765 n
+= InstSize
[n
[0].opcode
];
767 case OPCODE_UNIFORM_MATRIX22
:
768 case OPCODE_UNIFORM_MATRIX33
:
769 case OPCODE_UNIFORM_MATRIX44
:
770 case OPCODE_UNIFORM_MATRIX24
:
771 case OPCODE_UNIFORM_MATRIX42
:
772 case OPCODE_UNIFORM_MATRIX23
:
773 case OPCODE_UNIFORM_MATRIX32
:
774 case OPCODE_UNIFORM_MATRIX34
:
775 case OPCODE_UNIFORM_MATRIX43
:
777 n
+= InstSize
[n
[0].opcode
];
780 case OPCODE_CONTINUE
:
781 n
= (Node
*) n
[1].next
;
785 case OPCODE_END_OF_LIST
:
790 /* Most frequent case */
791 n
+= InstSize
[n
[0].opcode
];
802 * Destroy a display list and remove from hash table.
803 * \param list - display list number
806 destroy_list(struct gl_context
*ctx
, GLuint list
)
808 struct gl_display_list
*dlist
;
813 dlist
= lookup_list(ctx
, list
);
817 _mesa_delete_list(ctx
, dlist
);
818 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
823 * Translate the nth element of list from <type> to GLint.
826 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
838 bptr
= (GLbyte
*) list
;
839 return (GLint
) bptr
[n
];
840 case GL_UNSIGNED_BYTE
:
841 ubptr
= (GLubyte
*) list
;
842 return (GLint
) ubptr
[n
];
844 sptr
= (GLshort
*) list
;
845 return (GLint
) sptr
[n
];
846 case GL_UNSIGNED_SHORT
:
847 usptr
= (GLushort
*) list
;
848 return (GLint
) usptr
[n
];
850 iptr
= (GLint
*) list
;
852 case GL_UNSIGNED_INT
:
853 uiptr
= (GLuint
*) list
;
854 return (GLint
) uiptr
[n
];
856 fptr
= (GLfloat
*) list
;
857 return (GLint
) FLOORF(fptr
[n
]);
859 ubptr
= ((GLubyte
*) list
) + 2 * n
;
860 return (GLint
) ubptr
[0] * 256
863 ubptr
= ((GLubyte
*) list
) + 3 * n
;
864 return (GLint
) ubptr
[0] * 65536
865 + (GLint
) ubptr
[1] * 256
868 ubptr
= ((GLubyte
*) list
) + 4 * n
;
869 return (GLint
) ubptr
[0] * 16777216
870 + (GLint
) ubptr
[1] * 65536
871 + (GLint
) ubptr
[2] * 256
881 /**********************************************************************/
883 /**********************************************************************/
886 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
887 * If width < 0 or height < 0 or format or type are invalid we'll just
888 * return NULL. We will not generate an error since OpenGL command
889 * arguments aren't error-checked until the command is actually executed
890 * (not when they're compiled).
891 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
894 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
895 GLsizei width
, GLsizei height
, GLsizei depth
,
896 GLenum format
, GLenum type
, const GLvoid
* pixels
,
897 const struct gl_pixelstore_attrib
*unpack
)
899 if (width
<= 0 || height
<= 0) {
903 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
904 /* bad format and/or type */
908 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
912 if (type
== GL_BITMAP
)
913 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
915 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
916 format
, type
, pixels
, unpack
);
917 if (pixels
&& !image
) {
918 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
922 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
923 depth
, format
, type
, INT_MAX
, pixels
)) {
924 const GLubyte
*map
, *src
;
928 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
929 GL_MAP_READ_BIT
, unpack
->BufferObj
);
931 /* unable to map src buffer! */
932 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
936 src
= ADD_POINTERS(map
, pixels
);
937 if (type
== GL_BITMAP
)
938 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
940 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
941 format
, type
, src
, unpack
);
943 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
946 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
952 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
957 * Allocate space for a display list instruction (opcode + payload space).
958 * \param opcode the instruction opcode (OPCODE_* value)
959 * \param bytes instruction payload size (not counting opcode)
960 * \return pointer to allocated memory (the opcode space)
963 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
965 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
968 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
969 if (InstSize
[opcode
] == 0) {
970 /* save instruction size now */
971 InstSize
[opcode
] = numNodes
;
974 /* make sure instruction size agrees */
975 ASSERT(numNodes
== InstSize
[opcode
]);
979 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
980 /* This block is full. Allocate a new block and chain to it */
982 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
983 n
[0].opcode
= OPCODE_CONTINUE
;
984 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
986 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
989 n
[1].next
= (Node
*) newblock
;
990 ctx
->ListState
.CurrentBlock
= newblock
;
991 ctx
->ListState
.CurrentPos
= 0;
994 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
995 ctx
->ListState
.CurrentPos
+= numNodes
;
997 n
[0].opcode
= opcode
;
1005 * Allocate space for a display list instruction. Used by callers outside
1006 * this file for things like VBO vertex data.
1008 * \param opcode the instruction opcode (OPCODE_* value)
1009 * \param bytes instruction size in bytes, not counting opcode.
1010 * \return pointer to the usable data area (not including the internal
1014 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1016 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1018 return n
+ 1; /* return pointer to payload area, after opcode */
1025 * This function allows modules and drivers to get their own opcodes
1026 * for extending display list functionality.
1027 * \param ctx the rendering context
1028 * \param size number of bytes for storing the new display list command
1029 * \param execute function to execute the new display list command
1030 * \param destroy function to destroy the new display list command
1031 * \param print function to print the new display list command
1032 * \return the new opcode number or -1 if error
1035 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1037 void (*execute
) (struct gl_context
*, void *),
1038 void (*destroy
) (struct gl_context
*, void *),
1039 void (*print
) (struct gl_context
*, void *))
1041 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1042 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1043 ctx
->ListExt
->Opcode
[i
].Size
=
1044 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1045 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1046 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1047 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1048 return i
+ OPCODE_EXT_0
;
1055 * Allocate space for a display list instruction. The space is basically
1056 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1057 * function parameter, node[2] is the second parameter, etc.
1059 * \param opcode one of OPCODE_x
1060 * \param nparams number of function parameters
1061 * \return pointer to start of instruction space
1063 static inline Node
*
1064 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1066 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1072 * Display List compilation functions
1074 static void GLAPIENTRY
1075 save_Accum(GLenum op
, GLfloat value
)
1077 GET_CURRENT_CONTEXT(ctx
);
1079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1080 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1085 if (ctx
->ExecuteFlag
) {
1086 CALL_Accum(ctx
->Exec
, (op
, value
));
1091 static void GLAPIENTRY
1092 save_AlphaFunc(GLenum func
, GLclampf ref
)
1094 GET_CURRENT_CONTEXT(ctx
);
1096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1097 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1100 n
[2].f
= (GLfloat
) ref
;
1102 if (ctx
->ExecuteFlag
) {
1103 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1108 static void GLAPIENTRY
1109 save_BindTexture(GLenum target
, GLuint texture
)
1111 GET_CURRENT_CONTEXT(ctx
);
1113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1114 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1119 if (ctx
->ExecuteFlag
) {
1120 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1125 static void GLAPIENTRY
1126 save_Bitmap(GLsizei width
, GLsizei height
,
1127 GLfloat xorig
, GLfloat yorig
,
1128 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1130 GET_CURRENT_CONTEXT(ctx
);
1132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1133 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1135 n
[1].i
= (GLint
) width
;
1136 n
[2].i
= (GLint
) height
;
1141 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1142 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1144 if (ctx
->ExecuteFlag
) {
1145 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1146 xorig
, yorig
, xmove
, ymove
, pixels
));
1151 static void GLAPIENTRY
1152 save_BlendEquation(GLenum mode
)
1154 GET_CURRENT_CONTEXT(ctx
);
1156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1157 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1161 if (ctx
->ExecuteFlag
) {
1162 CALL_BlendEquation(ctx
->Exec
, (mode
));
1167 static void GLAPIENTRY
1168 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1170 GET_CURRENT_CONTEXT(ctx
);
1172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1173 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1178 if (ctx
->ExecuteFlag
) {
1179 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1184 static void GLAPIENTRY
1185 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1186 GLenum sfactorA
, GLenum dfactorA
)
1188 GET_CURRENT_CONTEXT(ctx
);
1190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1191 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1193 n
[1].e
= sfactorRGB
;
1194 n
[2].e
= dfactorRGB
;
1198 if (ctx
->ExecuteFlag
) {
1199 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1200 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1205 static void GLAPIENTRY
1206 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1208 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1212 static void GLAPIENTRY
1213 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1215 GET_CURRENT_CONTEXT(ctx
);
1217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1218 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1225 if (ctx
->ExecuteFlag
) {
1226 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1230 /* GL_ARB_draw_buffers_blend */
1231 static void GLAPIENTRY
1232 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1233 GLenum sfactorA
, GLenum dfactorA
)
1235 GET_CURRENT_CONTEXT(ctx
);
1237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1238 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1241 n
[2].e
= sfactorRGB
;
1242 n
[3].e
= dfactorRGB
;
1246 if (ctx
->ExecuteFlag
) {
1247 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1248 sfactorA
, dfactorA
));
1252 /* GL_ARB_draw_buffers_blend */
1253 static void GLAPIENTRY
1254 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1256 GET_CURRENT_CONTEXT(ctx
);
1258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1259 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1265 if (ctx
->ExecuteFlag
) {
1266 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1270 /* GL_ARB_draw_buffers_blend */
1271 static void GLAPIENTRY
1272 save_BlendEquationi(GLuint buf
, GLenum mode
)
1274 GET_CURRENT_CONTEXT(ctx
);
1276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1277 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1282 if (ctx
->ExecuteFlag
) {
1283 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1287 /* GL_ARB_draw_buffers_blend */
1288 static void GLAPIENTRY
1289 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1291 GET_CURRENT_CONTEXT(ctx
);
1293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1294 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1300 if (ctx
->ExecuteFlag
) {
1301 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1306 /* GL_ARB_draw_instanced. */
1307 static void GLAPIENTRY
1308 save_DrawArraysInstancedARB(GLenum mode
,
1313 GET_CURRENT_CONTEXT(ctx
);
1314 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1315 "glDrawArraysInstanced() during display list compile");
1318 static void GLAPIENTRY
1319 save_DrawElementsInstancedARB(GLenum mode
,
1322 const GLvoid
*indices
,
1325 GET_CURRENT_CONTEXT(ctx
);
1326 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1327 "glDrawElementsInstanced() during display list compile");
1330 static void GLAPIENTRY
1331 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1334 const GLvoid
*indices
,
1338 GET_CURRENT_CONTEXT(ctx
);
1339 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1340 "glDrawElementsInstancedBaseVertex() during display list compile");
1343 /* GL_ARB_base_instance. */
1344 static void GLAPIENTRY
1345 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1349 GLuint baseinstance
)
1351 GET_CURRENT_CONTEXT(ctx
);
1352 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1353 "glDrawArraysInstancedBaseInstance() during display list compile");
1356 static void APIENTRY
1357 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1360 const void *indices
,
1362 GLuint baseinstance
)
1364 GET_CURRENT_CONTEXT(ctx
);
1365 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1366 "glDrawElementsInstancedBaseInstance() during display list compile");
1369 static void APIENTRY
1370 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1373 const void *indices
,
1376 GLuint baseinstance
)
1378 GET_CURRENT_CONTEXT(ctx
);
1379 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1380 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1383 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1387 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1388 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1390 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1391 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1393 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1395 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1398 static void GLAPIENTRY
1399 save_CallList(GLuint list
)
1401 GET_CURRENT_CONTEXT(ctx
);
1403 SAVE_FLUSH_VERTICES(ctx
);
1405 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1410 /* After this, we don't know what state we're in. Invalidate all
1411 * cached information previously gathered:
1413 invalidate_saved_current_state( ctx
);
1415 if (ctx
->ExecuteFlag
) {
1416 _mesa_CallList(list
);
1421 static void GLAPIENTRY
1422 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1424 GET_CURRENT_CONTEXT(ctx
);
1426 GLboolean typeErrorFlag
;
1428 SAVE_FLUSH_VERTICES(ctx
);
1432 case GL_UNSIGNED_BYTE
:
1434 case GL_UNSIGNED_SHORT
:
1436 case GL_UNSIGNED_INT
:
1441 typeErrorFlag
= GL_FALSE
;
1444 typeErrorFlag
= GL_TRUE
;
1447 for (i
= 0; i
< num
; i
++) {
1448 GLint list
= translate_id(i
, type
, lists
);
1449 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1452 n
[2].b
= typeErrorFlag
;
1456 /* After this, we don't know what state we're in. Invalidate all
1457 * cached information previously gathered:
1459 invalidate_saved_current_state( ctx
);
1461 if (ctx
->ExecuteFlag
) {
1462 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1467 static void GLAPIENTRY
1468 save_Clear(GLbitfield mask
)
1470 GET_CURRENT_CONTEXT(ctx
);
1472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1473 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1477 if (ctx
->ExecuteFlag
) {
1478 CALL_Clear(ctx
->Exec
, (mask
));
1483 static void GLAPIENTRY
1484 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1486 GET_CURRENT_CONTEXT(ctx
);
1488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1489 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1492 n
[2].i
= drawbuffer
;
1494 if (buffer
== GL_COLOR
) {
1505 if (ctx
->ExecuteFlag
) {
1506 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1511 static void GLAPIENTRY
1512 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1514 GET_CURRENT_CONTEXT(ctx
);
1516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1517 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1520 n
[2].i
= drawbuffer
;
1522 if (buffer
== GL_COLOR
) {
1533 if (ctx
->ExecuteFlag
) {
1534 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1539 static void GLAPIENTRY
1540 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1542 GET_CURRENT_CONTEXT(ctx
);
1544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1545 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1548 n
[2].i
= drawbuffer
;
1550 if (buffer
== GL_COLOR
) {
1561 if (ctx
->ExecuteFlag
) {
1562 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1567 static void GLAPIENTRY
1568 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1569 GLfloat depth
, GLint stencil
)
1571 GET_CURRENT_CONTEXT(ctx
);
1573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1574 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1577 n
[2].i
= drawbuffer
;
1581 if (ctx
->ExecuteFlag
) {
1582 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1587 static void GLAPIENTRY
1588 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1590 GET_CURRENT_CONTEXT(ctx
);
1592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1593 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1600 if (ctx
->ExecuteFlag
) {
1601 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1606 static void GLAPIENTRY
1607 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1609 GET_CURRENT_CONTEXT(ctx
);
1611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1612 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1619 if (ctx
->ExecuteFlag
) {
1620 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1625 static void GLAPIENTRY
1626 save_ClearDepth(GLclampd depth
)
1628 GET_CURRENT_CONTEXT(ctx
);
1630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1631 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1633 n
[1].f
= (GLfloat
) depth
;
1635 if (ctx
->ExecuteFlag
) {
1636 CALL_ClearDepth(ctx
->Exec
, (depth
));
1641 static void GLAPIENTRY
1642 save_ClearIndex(GLfloat c
)
1644 GET_CURRENT_CONTEXT(ctx
);
1646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1647 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1651 if (ctx
->ExecuteFlag
) {
1652 CALL_ClearIndex(ctx
->Exec
, (c
));
1657 static void GLAPIENTRY
1658 save_ClearStencil(GLint s
)
1660 GET_CURRENT_CONTEXT(ctx
);
1662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1663 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1667 if (ctx
->ExecuteFlag
) {
1668 CALL_ClearStencil(ctx
->Exec
, (s
));
1673 static void GLAPIENTRY
1674 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1676 GET_CURRENT_CONTEXT(ctx
);
1678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1679 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1682 n
[2].f
= (GLfloat
) equ
[0];
1683 n
[3].f
= (GLfloat
) equ
[1];
1684 n
[4].f
= (GLfloat
) equ
[2];
1685 n
[5].f
= (GLfloat
) equ
[3];
1687 if (ctx
->ExecuteFlag
) {
1688 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1694 static void GLAPIENTRY
1695 save_ColorMask(GLboolean red
, GLboolean green
,
1696 GLboolean blue
, GLboolean alpha
)
1698 GET_CURRENT_CONTEXT(ctx
);
1700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1701 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1708 if (ctx
->ExecuteFlag
) {
1709 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1714 static void GLAPIENTRY
1715 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1716 GLboolean blue
, GLboolean alpha
)
1718 GET_CURRENT_CONTEXT(ctx
);
1720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1721 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1729 if (ctx
->ExecuteFlag
) {
1730 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1735 static void GLAPIENTRY
1736 save_ColorMaterial(GLenum face
, GLenum mode
)
1738 GET_CURRENT_CONTEXT(ctx
);
1740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1742 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1747 if (ctx
->ExecuteFlag
) {
1748 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1753 static void GLAPIENTRY
1754 save_ColorTable(GLenum target
, GLenum internalFormat
,
1755 GLsizei width
, GLenum format
, GLenum type
,
1756 const GLvoid
* table
)
1758 GET_CURRENT_CONTEXT(ctx
);
1759 if (_mesa_is_proxy_texture(target
)) {
1760 /* execute immediately */
1761 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1762 format
, type
, table
));
1766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1767 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1770 n
[2].e
= internalFormat
;
1774 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1777 if (ctx
->ExecuteFlag
) {
1778 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1779 format
, type
, table
));
1786 static void GLAPIENTRY
1787 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1788 const GLfloat
*params
)
1790 GET_CURRENT_CONTEXT(ctx
);
1793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1795 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1800 if (pname
== GL_COLOR_TABLE_SGI
||
1801 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1802 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1809 if (ctx
->ExecuteFlag
) {
1810 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1815 static void GLAPIENTRY
1816 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1818 GET_CURRENT_CONTEXT(ctx
);
1821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1823 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1828 if (pname
== GL_COLOR_TABLE_SGI
||
1829 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1830 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1837 if (ctx
->ExecuteFlag
) {
1838 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1844 static void GLAPIENTRY
1845 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1846 GLenum format
, GLenum type
, const GLvoid
* table
)
1848 GET_CURRENT_CONTEXT(ctx
);
1850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1851 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1858 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1861 if (ctx
->ExecuteFlag
) {
1862 CALL_ColorSubTable(ctx
->Exec
,
1863 (target
, start
, count
, format
, type
, table
));
1868 static void GLAPIENTRY
1869 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1870 GLint x
, GLint y
, GLsizei width
)
1872 GET_CURRENT_CONTEXT(ctx
);
1875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1876 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1884 if (ctx
->ExecuteFlag
) {
1885 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1890 static void GLAPIENTRY
1891 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1892 GLint x
, GLint y
, GLsizei width
)
1894 GET_CURRENT_CONTEXT(ctx
);
1897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1898 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1901 n
[2].e
= internalformat
;
1906 if (ctx
->ExecuteFlag
) {
1907 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1912 static void GLAPIENTRY
1913 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1914 GLenum format
, GLenum type
, const GLvoid
* filter
)
1916 GET_CURRENT_CONTEXT(ctx
);
1919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1921 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1924 n
[2].e
= internalFormat
;
1928 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1931 if (ctx
->ExecuteFlag
) {
1932 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1933 format
, type
, filter
));
1938 static void GLAPIENTRY
1939 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1940 GLsizei width
, GLsizei height
, GLenum format
,
1941 GLenum type
, const GLvoid
* filter
)
1943 GET_CURRENT_CONTEXT(ctx
);
1946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1948 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1951 n
[2].e
= internalFormat
;
1956 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1959 if (ctx
->ExecuteFlag
) {
1960 CALL_ConvolutionFilter2D(ctx
->Exec
,
1961 (target
, internalFormat
, width
, height
, format
,
1967 static void GLAPIENTRY
1968 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1970 GET_CURRENT_CONTEXT(ctx
);
1972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1973 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1979 if (ctx
->ExecuteFlag
) {
1980 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1985 static void GLAPIENTRY
1986 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1988 GET_CURRENT_CONTEXT(ctx
);
1990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1991 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1996 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1997 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1998 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2004 n
[4].i
= n
[5].i
= n
[6].i
= 0;
2007 if (ctx
->ExecuteFlag
) {
2008 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
2013 static void GLAPIENTRY
2014 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
2016 GET_CURRENT_CONTEXT(ctx
);
2018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2019 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
2025 if (ctx
->ExecuteFlag
) {
2026 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
2031 static void GLAPIENTRY
2032 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
2033 const GLfloat
*params
)
2035 GET_CURRENT_CONTEXT(ctx
);
2037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2038 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
2043 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
2044 pname
== GL_CONVOLUTION_FILTER_SCALE
||
2045 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2051 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
2054 if (ctx
->ExecuteFlag
) {
2055 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
2060 static void GLAPIENTRY
2061 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2063 GET_CURRENT_CONTEXT(ctx
);
2065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2066 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2070 n
[3].i
= (GLint
) width
;
2071 n
[4].i
= (GLint
) height
;
2074 if (ctx
->ExecuteFlag
) {
2075 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2081 static void GLAPIENTRY
2082 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2083 GLint x
, GLint y
, GLsizei width
, GLint border
)
2085 GET_CURRENT_CONTEXT(ctx
);
2087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2088 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2092 n
[3].e
= internalformat
;
2098 if (ctx
->ExecuteFlag
) {
2099 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2100 x
, y
, width
, border
));
2105 static void GLAPIENTRY
2106 save_CopyTexImage2D(GLenum target
, GLint level
,
2107 GLenum internalformat
,
2108 GLint x
, GLint y
, GLsizei width
,
2109 GLsizei height
, GLint border
)
2111 GET_CURRENT_CONTEXT(ctx
);
2113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2114 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2118 n
[3].e
= internalformat
;
2125 if (ctx
->ExecuteFlag
) {
2126 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2127 x
, y
, width
, height
, border
));
2133 static void GLAPIENTRY
2134 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2135 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2137 GET_CURRENT_CONTEXT(ctx
);
2139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2140 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2149 if (ctx
->ExecuteFlag
) {
2150 CALL_CopyTexSubImage1D(ctx
->Exec
,
2151 (target
, level
, xoffset
, x
, y
, width
));
2156 static void GLAPIENTRY
2157 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2158 GLint xoffset
, GLint yoffset
,
2159 GLint x
, GLint y
, GLsizei width
, GLint height
)
2161 GET_CURRENT_CONTEXT(ctx
);
2163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2164 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2175 if (ctx
->ExecuteFlag
) {
2176 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2177 x
, y
, width
, height
));
2182 static void GLAPIENTRY
2183 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2184 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2185 GLint x
, GLint y
, GLsizei width
, GLint height
)
2187 GET_CURRENT_CONTEXT(ctx
);
2189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2190 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2202 if (ctx
->ExecuteFlag
) {
2203 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2204 xoffset
, yoffset
, zoffset
,
2205 x
, y
, width
, height
));
2210 static void GLAPIENTRY
2211 save_CullFace(GLenum mode
)
2213 GET_CURRENT_CONTEXT(ctx
);
2215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2216 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2220 if (ctx
->ExecuteFlag
) {
2221 CALL_CullFace(ctx
->Exec
, (mode
));
2226 static void GLAPIENTRY
2227 save_DepthFunc(GLenum func
)
2229 GET_CURRENT_CONTEXT(ctx
);
2231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2232 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2236 if (ctx
->ExecuteFlag
) {
2237 CALL_DepthFunc(ctx
->Exec
, (func
));
2242 static void GLAPIENTRY
2243 save_DepthMask(GLboolean mask
)
2245 GET_CURRENT_CONTEXT(ctx
);
2247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2248 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2252 if (ctx
->ExecuteFlag
) {
2253 CALL_DepthMask(ctx
->Exec
, (mask
));
2258 static void GLAPIENTRY
2259 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2261 GET_CURRENT_CONTEXT(ctx
);
2263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2264 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2266 n
[1].f
= (GLfloat
) nearval
;
2267 n
[2].f
= (GLfloat
) farval
;
2269 if (ctx
->ExecuteFlag
) {
2270 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2275 static void GLAPIENTRY
2276 save_Disable(GLenum cap
)
2278 GET_CURRENT_CONTEXT(ctx
);
2280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2281 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2285 if (ctx
->ExecuteFlag
) {
2286 CALL_Disable(ctx
->Exec
, (cap
));
2291 static void GLAPIENTRY
2292 save_DisableIndexed(GLuint index
, GLenum cap
)
2294 GET_CURRENT_CONTEXT(ctx
);
2296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2297 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2302 if (ctx
->ExecuteFlag
) {
2303 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2308 static void GLAPIENTRY
2309 save_DrawBuffer(GLenum mode
)
2311 GET_CURRENT_CONTEXT(ctx
);
2313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2314 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2324 static void GLAPIENTRY
2325 save_DrawPixels(GLsizei width
, GLsizei height
,
2326 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2328 GET_CURRENT_CONTEXT(ctx
);
2331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2333 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2339 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2340 pixels
, &ctx
->Unpack
);
2342 if (ctx
->ExecuteFlag
) {
2343 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2349 static void GLAPIENTRY
2350 save_Enable(GLenum cap
)
2352 GET_CURRENT_CONTEXT(ctx
);
2354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2355 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2359 if (ctx
->ExecuteFlag
) {
2360 CALL_Enable(ctx
->Exec
, (cap
));
2366 static void GLAPIENTRY
2367 save_EnableIndexed(GLuint index
, GLenum cap
)
2369 GET_CURRENT_CONTEXT(ctx
);
2371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2372 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2377 if (ctx
->ExecuteFlag
) {
2378 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2384 static void GLAPIENTRY
2385 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2387 GET_CURRENT_CONTEXT(ctx
);
2389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2390 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2396 if (ctx
->ExecuteFlag
) {
2397 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2402 static void GLAPIENTRY
2403 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2405 GET_CURRENT_CONTEXT(ctx
);
2407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2408 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2416 if (ctx
->ExecuteFlag
) {
2417 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2424 static void GLAPIENTRY
2425 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2427 GET_CURRENT_CONTEXT(ctx
);
2429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2430 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2438 if (ctx
->ExecuteFlag
) {
2439 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2444 static void GLAPIENTRY
2445 save_Fogf(GLenum pname
, GLfloat param
)
2449 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2450 save_Fogfv(pname
, parray
);
2454 static void GLAPIENTRY
2455 save_Fogiv(GLenum pname
, const GLint
*params
)
2460 case GL_FOG_DENSITY
:
2464 p
[0] = (GLfloat
) *params
;
2470 p
[0] = INT_TO_FLOAT(params
[0]);
2471 p
[1] = INT_TO_FLOAT(params
[1]);
2472 p
[2] = INT_TO_FLOAT(params
[2]);
2473 p
[3] = INT_TO_FLOAT(params
[3]);
2476 /* Error will be caught later in gl_Fogfv */
2477 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2479 save_Fogfv(pname
, p
);
2483 static void GLAPIENTRY
2484 save_Fogi(GLenum pname
, GLint param
)
2488 parray
[1] = parray
[2] = parray
[3] = 0;
2489 save_Fogiv(pname
, parray
);
2493 static void GLAPIENTRY
2494 save_FrontFace(GLenum mode
)
2496 GET_CURRENT_CONTEXT(ctx
);
2498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2499 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2503 if (ctx
->ExecuteFlag
) {
2504 CALL_FrontFace(ctx
->Exec
, (mode
));
2509 static void GLAPIENTRY
2510 save_Frustum(GLdouble left
, GLdouble right
,
2511 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2513 GET_CURRENT_CONTEXT(ctx
);
2515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2516 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2518 n
[1].f
= (GLfloat
) left
;
2519 n
[2].f
= (GLfloat
) right
;
2520 n
[3].f
= (GLfloat
) bottom
;
2521 n
[4].f
= (GLfloat
) top
;
2522 n
[5].f
= (GLfloat
) nearval
;
2523 n
[6].f
= (GLfloat
) farval
;
2525 if (ctx
->ExecuteFlag
) {
2526 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2531 static void GLAPIENTRY
2532 save_Hint(GLenum target
, GLenum mode
)
2534 GET_CURRENT_CONTEXT(ctx
);
2536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2537 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2542 if (ctx
->ExecuteFlag
) {
2543 CALL_Hint(ctx
->Exec
, (target
, mode
));
2548 static void GLAPIENTRY
2549 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2552 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2560 n
[3].e
= internalFormat
;
2563 if (ctx
->ExecuteFlag
) {
2564 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2569 static void GLAPIENTRY
2570 save_IndexMask(GLuint mask
)
2572 GET_CURRENT_CONTEXT(ctx
);
2574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2575 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2579 if (ctx
->ExecuteFlag
) {
2580 CALL_IndexMask(ctx
->Exec
, (mask
));
2585 static void GLAPIENTRY
2586 save_InitNames(void)
2588 GET_CURRENT_CONTEXT(ctx
);
2589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2590 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2591 if (ctx
->ExecuteFlag
) {
2592 CALL_InitNames(ctx
->Exec
, ());
2597 static void GLAPIENTRY
2598 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2600 GET_CURRENT_CONTEXT(ctx
);
2602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2603 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2621 case GL_SPOT_DIRECTION
:
2624 case GL_SPOT_EXPONENT
:
2627 case GL_SPOT_CUTOFF
:
2630 case GL_CONSTANT_ATTENUATION
:
2633 case GL_LINEAR_ATTENUATION
:
2636 case GL_QUADRATIC_ATTENUATION
:
2642 for (i
= 0; i
< nParams
; i
++) {
2643 n
[3 + i
].f
= params
[i
];
2646 if (ctx
->ExecuteFlag
) {
2647 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2652 static void GLAPIENTRY
2653 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2657 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2658 save_Lightfv(light
, pname
, parray
);
2662 static void GLAPIENTRY
2663 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2670 fparam
[0] = INT_TO_FLOAT(params
[0]);
2671 fparam
[1] = INT_TO_FLOAT(params
[1]);
2672 fparam
[2] = INT_TO_FLOAT(params
[2]);
2673 fparam
[3] = INT_TO_FLOAT(params
[3]);
2676 fparam
[0] = (GLfloat
) params
[0];
2677 fparam
[1] = (GLfloat
) params
[1];
2678 fparam
[2] = (GLfloat
) params
[2];
2679 fparam
[3] = (GLfloat
) params
[3];
2681 case GL_SPOT_DIRECTION
:
2682 fparam
[0] = (GLfloat
) params
[0];
2683 fparam
[1] = (GLfloat
) params
[1];
2684 fparam
[2] = (GLfloat
) params
[2];
2686 case GL_SPOT_EXPONENT
:
2687 case GL_SPOT_CUTOFF
:
2688 case GL_CONSTANT_ATTENUATION
:
2689 case GL_LINEAR_ATTENUATION
:
2690 case GL_QUADRATIC_ATTENUATION
:
2691 fparam
[0] = (GLfloat
) params
[0];
2694 /* error will be caught later in gl_Lightfv */
2697 save_Lightfv(light
, pname
, fparam
);
2701 static void GLAPIENTRY
2702 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2706 parray
[1] = parray
[2] = parray
[3] = 0;
2707 save_Lightiv(light
, pname
, parray
);
2711 static void GLAPIENTRY
2712 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2714 GET_CURRENT_CONTEXT(ctx
);
2716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2717 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2725 if (ctx
->ExecuteFlag
) {
2726 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2731 static void GLAPIENTRY
2732 save_LightModelf(GLenum pname
, GLfloat param
)
2736 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2737 save_LightModelfv(pname
, parray
);
2741 static void GLAPIENTRY
2742 save_LightModeliv(GLenum pname
, const GLint
*params
)
2746 case GL_LIGHT_MODEL_AMBIENT
:
2747 fparam
[0] = INT_TO_FLOAT(params
[0]);
2748 fparam
[1] = INT_TO_FLOAT(params
[1]);
2749 fparam
[2] = INT_TO_FLOAT(params
[2]);
2750 fparam
[3] = INT_TO_FLOAT(params
[3]);
2752 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2753 case GL_LIGHT_MODEL_TWO_SIDE
:
2754 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2755 fparam
[0] = (GLfloat
) params
[0];
2761 /* Error will be caught later in gl_LightModelfv */
2762 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2764 save_LightModelfv(pname
, fparam
);
2768 static void GLAPIENTRY
2769 save_LightModeli(GLenum pname
, GLint param
)
2773 parray
[1] = parray
[2] = parray
[3] = 0;
2774 save_LightModeliv(pname
, parray
);
2778 static void GLAPIENTRY
2779 save_LineStipple(GLint factor
, GLushort pattern
)
2781 GET_CURRENT_CONTEXT(ctx
);
2783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2784 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2789 if (ctx
->ExecuteFlag
) {
2790 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2795 static void GLAPIENTRY
2796 save_LineWidth(GLfloat width
)
2798 GET_CURRENT_CONTEXT(ctx
);
2800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2801 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2805 if (ctx
->ExecuteFlag
) {
2806 CALL_LineWidth(ctx
->Exec
, (width
));
2811 static void GLAPIENTRY
2812 save_ListBase(GLuint base
)
2814 GET_CURRENT_CONTEXT(ctx
);
2816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2817 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2821 if (ctx
->ExecuteFlag
) {
2822 CALL_ListBase(ctx
->Exec
, (base
));
2827 static void GLAPIENTRY
2828 save_LoadIdentity(void)
2830 GET_CURRENT_CONTEXT(ctx
);
2831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2832 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2833 if (ctx
->ExecuteFlag
) {
2834 CALL_LoadIdentity(ctx
->Exec
, ());
2839 static void GLAPIENTRY
2840 save_LoadMatrixf(const GLfloat
* m
)
2842 GET_CURRENT_CONTEXT(ctx
);
2844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2845 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2848 for (i
= 0; i
< 16; i
++) {
2852 if (ctx
->ExecuteFlag
) {
2853 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2858 static void GLAPIENTRY
2859 save_LoadMatrixd(const GLdouble
* m
)
2863 for (i
= 0; i
< 16; i
++) {
2864 f
[i
] = (GLfloat
) m
[i
];
2866 save_LoadMatrixf(f
);
2870 static void GLAPIENTRY
2871 save_LoadName(GLuint name
)
2873 GET_CURRENT_CONTEXT(ctx
);
2875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2876 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2880 if (ctx
->ExecuteFlag
) {
2881 CALL_LoadName(ctx
->Exec
, (name
));
2886 static void GLAPIENTRY
2887 save_LogicOp(GLenum opcode
)
2889 GET_CURRENT_CONTEXT(ctx
);
2891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2892 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2896 if (ctx
->ExecuteFlag
) {
2897 CALL_LogicOp(ctx
->Exec
, (opcode
));
2902 static void GLAPIENTRY
2903 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2904 GLint order
, const GLdouble
* points
)
2906 GET_CURRENT_CONTEXT(ctx
);
2908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2909 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2911 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2913 n
[2].f
= (GLfloat
) u1
;
2914 n
[3].f
= (GLfloat
) u2
;
2915 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2917 n
[6].data
= (void *) pnts
;
2919 if (ctx
->ExecuteFlag
) {
2920 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2924 static void GLAPIENTRY
2925 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2926 GLint order
, const GLfloat
* points
)
2928 GET_CURRENT_CONTEXT(ctx
);
2930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2931 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2933 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2937 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2939 n
[6].data
= (void *) pnts
;
2941 if (ctx
->ExecuteFlag
) {
2942 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2947 static void GLAPIENTRY
2948 save_Map2d(GLenum target
,
2949 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2950 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2951 const GLdouble
* points
)
2953 GET_CURRENT_CONTEXT(ctx
);
2955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2956 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2958 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2959 vstride
, vorder
, points
);
2961 n
[2].f
= (GLfloat
) u1
;
2962 n
[3].f
= (GLfloat
) u2
;
2963 n
[4].f
= (GLfloat
) v1
;
2964 n
[5].f
= (GLfloat
) v2
;
2965 /* XXX verify these strides are correct */
2966 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2967 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2970 n
[10].data
= (void *) pnts
;
2972 if (ctx
->ExecuteFlag
) {
2973 CALL_Map2d(ctx
->Exec
, (target
,
2974 u1
, u2
, ustride
, uorder
,
2975 v1
, v2
, vstride
, vorder
, points
));
2980 static void GLAPIENTRY
2981 save_Map2f(GLenum target
,
2982 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2983 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2984 const GLfloat
* points
)
2986 GET_CURRENT_CONTEXT(ctx
);
2988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2989 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2991 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2992 vstride
, vorder
, points
);
2998 /* XXX verify these strides are correct */
2999 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3000 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3003 n
[10].data
= (void *) pnts
;
3005 if (ctx
->ExecuteFlag
) {
3006 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3007 v1
, v2
, vstride
, vorder
, points
));
3012 static void GLAPIENTRY
3013 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3015 GET_CURRENT_CONTEXT(ctx
);
3017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3018 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3024 if (ctx
->ExecuteFlag
) {
3025 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3030 static void GLAPIENTRY
3031 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3033 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3037 static void GLAPIENTRY
3038 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3039 GLint vn
, GLfloat v1
, GLfloat v2
)
3041 GET_CURRENT_CONTEXT(ctx
);
3043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3044 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3053 if (ctx
->ExecuteFlag
) {
3054 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3060 static void GLAPIENTRY
3061 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3062 GLint vn
, GLdouble v1
, GLdouble v2
)
3064 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3065 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3069 static void GLAPIENTRY
3070 save_MatrixMode(GLenum mode
)
3072 GET_CURRENT_CONTEXT(ctx
);
3074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3075 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3079 if (ctx
->ExecuteFlag
) {
3080 CALL_MatrixMode(ctx
->Exec
, (mode
));
3085 static void GLAPIENTRY
3086 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3088 GET_CURRENT_CONTEXT(ctx
);
3091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3092 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3095 n
[2].e
= internalFormat
;
3098 if (ctx
->ExecuteFlag
) {
3099 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3104 static void GLAPIENTRY
3105 save_MultMatrixf(const GLfloat
* m
)
3107 GET_CURRENT_CONTEXT(ctx
);
3109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3110 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3113 for (i
= 0; i
< 16; i
++) {
3117 if (ctx
->ExecuteFlag
) {
3118 CALL_MultMatrixf(ctx
->Exec
, (m
));
3123 static void GLAPIENTRY
3124 save_MultMatrixd(const GLdouble
* m
)
3128 for (i
= 0; i
< 16; i
++) {
3129 f
[i
] = (GLfloat
) m
[i
];
3131 save_MultMatrixf(f
);
3135 static void GLAPIENTRY
3136 save_NewList(GLuint name
, GLenum mode
)
3138 GET_CURRENT_CONTEXT(ctx
);
3139 /* It's an error to call this function while building a display list */
3140 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3147 static void GLAPIENTRY
3148 save_Ortho(GLdouble left
, GLdouble right
,
3149 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3151 GET_CURRENT_CONTEXT(ctx
);
3153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3154 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3156 n
[1].f
= (GLfloat
) left
;
3157 n
[2].f
= (GLfloat
) right
;
3158 n
[3].f
= (GLfloat
) bottom
;
3159 n
[4].f
= (GLfloat
) top
;
3160 n
[5].f
= (GLfloat
) nearval
;
3161 n
[6].f
= (GLfloat
) farval
;
3163 if (ctx
->ExecuteFlag
) {
3164 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3169 static void GLAPIENTRY
3170 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3172 GET_CURRENT_CONTEXT(ctx
);
3174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3175 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3179 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
3180 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3182 if (ctx
->ExecuteFlag
) {
3183 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3188 static void GLAPIENTRY
3189 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3191 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3193 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3194 for (i
= 0; i
< mapsize
; i
++) {
3195 fvalues
[i
] = (GLfloat
) values
[i
];
3199 for (i
= 0; i
< mapsize
; i
++) {
3200 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3203 save_PixelMapfv(map
, mapsize
, fvalues
);
3207 static void GLAPIENTRY
3208 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3210 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3212 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3213 for (i
= 0; i
< mapsize
; i
++) {
3214 fvalues
[i
] = (GLfloat
) values
[i
];
3218 for (i
= 0; i
< mapsize
; i
++) {
3219 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3222 save_PixelMapfv(map
, mapsize
, fvalues
);
3226 static void GLAPIENTRY
3227 save_PixelTransferf(GLenum pname
, GLfloat param
)
3229 GET_CURRENT_CONTEXT(ctx
);
3231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3232 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3237 if (ctx
->ExecuteFlag
) {
3238 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3243 static void GLAPIENTRY
3244 save_PixelTransferi(GLenum pname
, GLint param
)
3246 save_PixelTransferf(pname
, (GLfloat
) param
);
3250 static void GLAPIENTRY
3251 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3253 GET_CURRENT_CONTEXT(ctx
);
3255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3256 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3261 if (ctx
->ExecuteFlag
) {
3262 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3267 static void GLAPIENTRY
3268 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3270 GET_CURRENT_CONTEXT(ctx
);
3272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3273 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3280 if (ctx
->ExecuteFlag
) {
3281 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3286 static void GLAPIENTRY
3287 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3291 parray
[1] = parray
[2] = 0.0F
;
3292 save_PointParameterfvEXT(pname
, parray
);
3295 static void GLAPIENTRY
3296 save_PointParameteriNV(GLenum pname
, GLint param
)
3299 parray
[0] = (GLfloat
) param
;
3300 parray
[1] = parray
[2] = 0.0F
;
3301 save_PointParameterfvEXT(pname
, parray
);
3304 static void GLAPIENTRY
3305 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3308 parray
[0] = (GLfloat
) param
[0];
3309 parray
[1] = parray
[2] = 0.0F
;
3310 save_PointParameterfvEXT(pname
, parray
);
3314 static void GLAPIENTRY
3315 save_PointSize(GLfloat size
)
3317 GET_CURRENT_CONTEXT(ctx
);
3319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3320 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3324 if (ctx
->ExecuteFlag
) {
3325 CALL_PointSize(ctx
->Exec
, (size
));
3330 static void GLAPIENTRY
3331 save_PolygonMode(GLenum face
, GLenum mode
)
3333 GET_CURRENT_CONTEXT(ctx
);
3335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3336 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3341 if (ctx
->ExecuteFlag
) {
3342 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3347 static void GLAPIENTRY
3348 save_PolygonStipple(const GLubyte
* pattern
)
3350 GET_CURRENT_CONTEXT(ctx
);
3353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3355 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3357 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3358 pattern
, &ctx
->Unpack
);
3360 if (ctx
->ExecuteFlag
) {
3361 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3366 static void GLAPIENTRY
3367 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3369 GET_CURRENT_CONTEXT(ctx
);
3371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3372 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3377 if (ctx
->ExecuteFlag
) {
3378 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3383 static void GLAPIENTRY
3384 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3386 GET_CURRENT_CONTEXT(ctx
);
3387 /* XXX mult by DepthMaxF here??? */
3388 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3392 static void GLAPIENTRY
3393 save_PopAttrib(void)
3395 GET_CURRENT_CONTEXT(ctx
);
3396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3397 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3398 if (ctx
->ExecuteFlag
) {
3399 CALL_PopAttrib(ctx
->Exec
, ());
3404 static void GLAPIENTRY
3405 save_PopMatrix(void)
3407 GET_CURRENT_CONTEXT(ctx
);
3408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3409 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3410 if (ctx
->ExecuteFlag
) {
3411 CALL_PopMatrix(ctx
->Exec
, ());
3416 static void GLAPIENTRY
3419 GET_CURRENT_CONTEXT(ctx
);
3420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3421 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3422 if (ctx
->ExecuteFlag
) {
3423 CALL_PopName(ctx
->Exec
, ());
3428 static void GLAPIENTRY
3429 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3430 const GLclampf
* priorities
)
3432 GET_CURRENT_CONTEXT(ctx
);
3434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3436 for (i
= 0; i
< num
; i
++) {
3438 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3440 n
[1].ui
= textures
[i
];
3441 n
[2].f
= priorities
[i
];
3444 if (ctx
->ExecuteFlag
) {
3445 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3450 static void GLAPIENTRY
3451 save_PushAttrib(GLbitfield mask
)
3453 GET_CURRENT_CONTEXT(ctx
);
3455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3456 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3460 if (ctx
->ExecuteFlag
) {
3461 CALL_PushAttrib(ctx
->Exec
, (mask
));
3466 static void GLAPIENTRY
3467 save_PushMatrix(void)
3469 GET_CURRENT_CONTEXT(ctx
);
3470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3471 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3472 if (ctx
->ExecuteFlag
) {
3473 CALL_PushMatrix(ctx
->Exec
, ());
3478 static void GLAPIENTRY
3479 save_PushName(GLuint name
)
3481 GET_CURRENT_CONTEXT(ctx
);
3483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3484 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3488 if (ctx
->ExecuteFlag
) {
3489 CALL_PushName(ctx
->Exec
, (name
));
3494 static void GLAPIENTRY
3495 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3497 GET_CURRENT_CONTEXT(ctx
);
3499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3500 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3507 if (ctx
->ExecuteFlag
) {
3508 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3512 static void GLAPIENTRY
3513 save_RasterPos2d(GLdouble x
, GLdouble y
)
3515 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3518 static void GLAPIENTRY
3519 save_RasterPos2f(GLfloat x
, GLfloat y
)
3521 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3524 static void GLAPIENTRY
3525 save_RasterPos2i(GLint x
, GLint y
)
3527 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3530 static void GLAPIENTRY
3531 save_RasterPos2s(GLshort x
, GLshort y
)
3533 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3536 static void GLAPIENTRY
3537 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3539 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3542 static void GLAPIENTRY
3543 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3545 save_RasterPos4f(x
, y
, z
, 1.0F
);
3548 static void GLAPIENTRY
3549 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3551 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3554 static void GLAPIENTRY
3555 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3557 save_RasterPos4f(x
, y
, z
, 1.0F
);
3560 static void GLAPIENTRY
3561 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3563 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3566 static void GLAPIENTRY
3567 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3569 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3572 static void GLAPIENTRY
3573 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3575 save_RasterPos4f(x
, y
, z
, w
);
3578 static void GLAPIENTRY
3579 save_RasterPos2dv(const GLdouble
* v
)
3581 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3584 static void GLAPIENTRY
3585 save_RasterPos2fv(const GLfloat
* v
)
3587 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3590 static void GLAPIENTRY
3591 save_RasterPos2iv(const GLint
* v
)
3593 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3596 static void GLAPIENTRY
3597 save_RasterPos2sv(const GLshort
* v
)
3599 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3602 static void GLAPIENTRY
3603 save_RasterPos3dv(const GLdouble
* v
)
3605 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3608 static void GLAPIENTRY
3609 save_RasterPos3fv(const GLfloat
* v
)
3611 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3614 static void GLAPIENTRY
3615 save_RasterPos3iv(const GLint
* v
)
3617 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3620 static void GLAPIENTRY
3621 save_RasterPos3sv(const GLshort
* v
)
3623 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3626 static void GLAPIENTRY
3627 save_RasterPos4dv(const GLdouble
* v
)
3629 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3630 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3633 static void GLAPIENTRY
3634 save_RasterPos4fv(const GLfloat
* v
)
3636 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3639 static void GLAPIENTRY
3640 save_RasterPos4iv(const GLint
* v
)
3642 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3643 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3646 static void GLAPIENTRY
3647 save_RasterPos4sv(const GLshort
* v
)
3649 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3653 static void GLAPIENTRY
3654 save_PassThrough(GLfloat token
)
3656 GET_CURRENT_CONTEXT(ctx
);
3658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3659 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3663 if (ctx
->ExecuteFlag
) {
3664 CALL_PassThrough(ctx
->Exec
, (token
));
3669 static void GLAPIENTRY
3670 save_ReadBuffer(GLenum mode
)
3672 GET_CURRENT_CONTEXT(ctx
);
3674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3675 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3679 if (ctx
->ExecuteFlag
) {
3680 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3685 static void GLAPIENTRY
3686 save_ResetHistogram(GLenum target
)
3688 GET_CURRENT_CONTEXT(ctx
);
3690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3691 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3695 if (ctx
->ExecuteFlag
) {
3696 CALL_ResetHistogram(ctx
->Exec
, (target
));
3701 static void GLAPIENTRY
3702 save_ResetMinmax(GLenum target
)
3704 GET_CURRENT_CONTEXT(ctx
);
3706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3707 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3711 if (ctx
->ExecuteFlag
) {
3712 CALL_ResetMinmax(ctx
->Exec
, (target
));
3717 static void GLAPIENTRY
3718 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3720 GET_CURRENT_CONTEXT(ctx
);
3722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3723 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3730 if (ctx
->ExecuteFlag
) {
3731 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3736 static void GLAPIENTRY
3737 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3739 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3743 static void GLAPIENTRY
3744 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3746 GET_CURRENT_CONTEXT(ctx
);
3748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3749 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3755 if (ctx
->ExecuteFlag
) {
3756 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3761 static void GLAPIENTRY
3762 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3764 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3768 static void GLAPIENTRY
3769 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3771 GET_CURRENT_CONTEXT(ctx
);
3773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3774 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3781 if (ctx
->ExecuteFlag
) {
3782 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3787 static void GLAPIENTRY
3788 save_ShadeModel(GLenum mode
)
3790 GET_CURRENT_CONTEXT(ctx
);
3792 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3794 if (ctx
->ExecuteFlag
) {
3795 CALL_ShadeModel(ctx
->Exec
, (mode
));
3798 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3801 SAVE_FLUSH_VERTICES(ctx
);
3803 /* Only save the value if we know the statechange will take effect:
3805 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3806 ctx
->ListState
.Current
.ShadeModel
= mode
;
3808 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3815 static void GLAPIENTRY
3816 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3818 GET_CURRENT_CONTEXT(ctx
);
3820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3821 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3827 if (ctx
->ExecuteFlag
) {
3828 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3833 static void GLAPIENTRY
3834 save_StencilMask(GLuint mask
)
3836 GET_CURRENT_CONTEXT(ctx
);
3838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3839 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3843 if (ctx
->ExecuteFlag
) {
3844 CALL_StencilMask(ctx
->Exec
, (mask
));
3849 static void GLAPIENTRY
3850 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3852 GET_CURRENT_CONTEXT(ctx
);
3854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3855 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3861 if (ctx
->ExecuteFlag
) {
3862 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3867 static void GLAPIENTRY
3868 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3870 GET_CURRENT_CONTEXT(ctx
);
3872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3873 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3880 if (ctx
->ExecuteFlag
) {
3881 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3886 static void GLAPIENTRY
3887 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3890 GET_CURRENT_CONTEXT(ctx
);
3892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3894 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3902 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3909 if (ctx
->ExecuteFlag
) {
3910 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3911 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3916 static void GLAPIENTRY
3917 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3919 GET_CURRENT_CONTEXT(ctx
);
3921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3922 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3927 if (ctx
->ExecuteFlag
) {
3928 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3933 static void GLAPIENTRY
3934 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3936 GET_CURRENT_CONTEXT(ctx
);
3938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3939 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3946 if (ctx
->ExecuteFlag
) {
3947 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3952 static void GLAPIENTRY
3953 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3955 GET_CURRENT_CONTEXT(ctx
);
3957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3958 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3962 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3970 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3973 if (ctx
->ExecuteFlag
) {
3974 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3979 static void GLAPIENTRY
3980 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3983 parray
[0] = (GLfloat
) param
;
3984 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3985 save_TexEnvfv(target
, pname
, parray
);
3989 static void GLAPIENTRY
3990 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3993 p
[0] = (GLfloat
) param
;
3994 p
[1] = p
[2] = p
[3] = 0.0F
;
3995 save_TexEnvfv(target
, pname
, p
);
3999 static void GLAPIENTRY
4000 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4003 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4004 p
[0] = INT_TO_FLOAT(param
[0]);
4005 p
[1] = INT_TO_FLOAT(param
[1]);
4006 p
[2] = INT_TO_FLOAT(param
[2]);
4007 p
[3] = INT_TO_FLOAT(param
[3]);
4010 p
[0] = (GLfloat
) param
[0];
4011 p
[1] = p
[2] = p
[3] = 0.0F
;
4013 save_TexEnvfv(target
, pname
, p
);
4017 static void GLAPIENTRY
4018 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4020 GET_CURRENT_CONTEXT(ctx
);
4022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4023 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4032 if (ctx
->ExecuteFlag
) {
4033 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4038 static void GLAPIENTRY
4039 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4042 p
[0] = (GLfloat
) params
[0];
4043 p
[1] = (GLfloat
) params
[1];
4044 p
[2] = (GLfloat
) params
[2];
4045 p
[3] = (GLfloat
) params
[3];
4046 save_TexGenfv(coord
, pname
, p
);
4050 static void GLAPIENTRY
4051 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4054 parray
[0] = (GLfloat
) param
;
4055 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4056 save_TexGenfv(coord
, pname
, parray
);
4060 static void GLAPIENTRY
4061 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4064 p
[0] = (GLfloat
) params
[0];
4065 p
[1] = (GLfloat
) params
[1];
4066 p
[2] = (GLfloat
) params
[2];
4067 p
[3] = (GLfloat
) params
[3];
4068 save_TexGenfv(coord
, pname
, p
);
4072 static void GLAPIENTRY
4073 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4077 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4078 save_TexGenfv(coord
, pname
, parray
);
4082 static void GLAPIENTRY
4083 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4087 parray
[1] = parray
[2] = parray
[3] = 0;
4088 save_TexGeniv(coord
, pname
, parray
);
4092 static void GLAPIENTRY
4093 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4095 GET_CURRENT_CONTEXT(ctx
);
4097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4098 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4107 if (ctx
->ExecuteFlag
) {
4108 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4113 static void GLAPIENTRY
4114 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4118 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4119 save_TexParameterfv(target
, pname
, parray
);
4123 static void GLAPIENTRY
4124 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4127 fparam
[0] = (GLfloat
) param
;
4128 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4129 save_TexParameterfv(target
, pname
, fparam
);
4133 static void GLAPIENTRY
4134 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4137 fparam
[0] = (GLfloat
) params
[0];
4138 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4139 save_TexParameterfv(target
, pname
, fparam
);
4143 static void GLAPIENTRY
4144 save_TexImage1D(GLenum target
,
4145 GLint level
, GLint components
,
4146 GLsizei width
, GLint border
,
4147 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4149 GET_CURRENT_CONTEXT(ctx
);
4150 if (target
== GL_PROXY_TEXTURE_1D
) {
4151 /* don't compile, execute immediately */
4152 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4153 border
, format
, type
, pixels
));
4157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4158 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4162 n
[3].i
= components
;
4163 n
[4].i
= (GLint
) width
;
4167 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4168 pixels
, &ctx
->Unpack
);
4170 if (ctx
->ExecuteFlag
) {
4171 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4172 border
, format
, type
, pixels
));
4178 static void GLAPIENTRY
4179 save_TexImage2D(GLenum target
,
4180 GLint level
, GLint components
,
4181 GLsizei width
, GLsizei height
, GLint border
,
4182 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4184 GET_CURRENT_CONTEXT(ctx
);
4185 if (target
== GL_PROXY_TEXTURE_2D
) {
4186 /* don't compile, execute immediately */
4187 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4188 height
, border
, format
, type
, pixels
));
4192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4193 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4197 n
[3].i
= components
;
4198 n
[4].i
= (GLint
) width
;
4199 n
[5].i
= (GLint
) height
;
4203 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4204 pixels
, &ctx
->Unpack
);
4206 if (ctx
->ExecuteFlag
) {
4207 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4208 height
, border
, format
, type
, pixels
));
4214 static void GLAPIENTRY
4215 save_TexImage3D(GLenum target
,
4216 GLint level
, GLint internalFormat
,
4217 GLsizei width
, GLsizei height
, GLsizei depth
,
4219 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4221 GET_CURRENT_CONTEXT(ctx
);
4222 if (target
== GL_PROXY_TEXTURE_3D
) {
4223 /* don't compile, execute immediately */
4224 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4225 height
, depth
, border
, format
, type
,
4230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4231 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4235 n
[3].i
= (GLint
) internalFormat
;
4236 n
[4].i
= (GLint
) width
;
4237 n
[5].i
= (GLint
) height
;
4238 n
[6].i
= (GLint
) depth
;
4242 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4243 pixels
, &ctx
->Unpack
);
4245 if (ctx
->ExecuteFlag
) {
4246 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4247 height
, depth
, border
, format
, type
,
4254 static void GLAPIENTRY
4255 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4256 GLsizei width
, GLenum format
, GLenum type
,
4257 const GLvoid
* pixels
)
4259 GET_CURRENT_CONTEXT(ctx
);
4262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4264 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4269 n
[4].i
= (GLint
) width
;
4272 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4273 pixels
, &ctx
->Unpack
);
4275 if (ctx
->ExecuteFlag
) {
4276 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4277 format
, type
, pixels
));
4282 static void GLAPIENTRY
4283 save_TexSubImage2D(GLenum target
, GLint level
,
4284 GLint xoffset
, GLint yoffset
,
4285 GLsizei width
, GLsizei height
,
4286 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4288 GET_CURRENT_CONTEXT(ctx
);
4291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4293 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4299 n
[5].i
= (GLint
) width
;
4300 n
[6].i
= (GLint
) height
;
4303 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4304 pixels
, &ctx
->Unpack
);
4306 if (ctx
->ExecuteFlag
) {
4307 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4308 width
, height
, format
, type
, pixels
));
4313 static void GLAPIENTRY
4314 save_TexSubImage3D(GLenum target
, GLint level
,
4315 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4316 GLsizei width
, GLsizei height
, GLsizei depth
,
4317 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4319 GET_CURRENT_CONTEXT(ctx
);
4322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4324 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4331 n
[6].i
= (GLint
) width
;
4332 n
[7].i
= (GLint
) height
;
4333 n
[8].i
= (GLint
) depth
;
4336 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4337 pixels
, &ctx
->Unpack
);
4339 if (ctx
->ExecuteFlag
) {
4340 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4341 xoffset
, yoffset
, zoffset
,
4342 width
, height
, depth
, format
, type
,
4348 static void GLAPIENTRY
4349 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4351 GET_CURRENT_CONTEXT(ctx
);
4353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4354 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4360 if (ctx
->ExecuteFlag
) {
4361 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4366 static void GLAPIENTRY
4367 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4369 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4374 static void GLAPIENTRY
4375 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4377 GET_CURRENT_CONTEXT(ctx
);
4379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4380 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4384 n
[3].i
= (GLint
) width
;
4385 n
[4].i
= (GLint
) height
;
4387 if (ctx
->ExecuteFlag
) {
4388 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4393 static void GLAPIENTRY
4394 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4396 GET_CURRENT_CONTEXT(ctx
);
4398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4399 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4406 if (ctx
->ExecuteFlag
) {
4407 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4411 static void GLAPIENTRY
4412 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4414 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4417 static void GLAPIENTRY
4418 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4420 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4423 static void GLAPIENTRY
4424 save_WindowPos2iMESA(GLint x
, GLint y
)
4426 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4429 static void GLAPIENTRY
4430 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4432 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4435 static void GLAPIENTRY
4436 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4438 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4441 static void GLAPIENTRY
4442 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4444 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4447 static void GLAPIENTRY
4448 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4450 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4453 static void GLAPIENTRY
4454 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4456 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4459 static void GLAPIENTRY
4460 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4462 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4465 static void GLAPIENTRY
4466 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4468 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4471 static void GLAPIENTRY
4472 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4474 save_WindowPos4fMESA(x
, y
, z
, w
);
4477 static void GLAPIENTRY
4478 save_WindowPos2dvMESA(const GLdouble
* v
)
4480 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4483 static void GLAPIENTRY
4484 save_WindowPos2fvMESA(const GLfloat
* v
)
4486 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4489 static void GLAPIENTRY
4490 save_WindowPos2ivMESA(const GLint
* v
)
4492 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4495 static void GLAPIENTRY
4496 save_WindowPos2svMESA(const GLshort
* v
)
4498 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4501 static void GLAPIENTRY
4502 save_WindowPos3dvMESA(const GLdouble
* v
)
4504 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4507 static void GLAPIENTRY
4508 save_WindowPos3fvMESA(const GLfloat
* v
)
4510 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4513 static void GLAPIENTRY
4514 save_WindowPos3ivMESA(const GLint
* v
)
4516 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4519 static void GLAPIENTRY
4520 save_WindowPos3svMESA(const GLshort
* v
)
4522 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4525 static void GLAPIENTRY
4526 save_WindowPos4dvMESA(const GLdouble
* v
)
4528 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4529 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4532 static void GLAPIENTRY
4533 save_WindowPos4fvMESA(const GLfloat
* v
)
4535 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4538 static void GLAPIENTRY
4539 save_WindowPos4ivMESA(const GLint
* v
)
4541 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4542 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4545 static void GLAPIENTRY
4546 save_WindowPos4svMESA(const GLshort
* v
)
4548 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4553 /* GL_ARB_multitexture */
4554 static void GLAPIENTRY
4555 save_ActiveTextureARB(GLenum target
)
4557 GET_CURRENT_CONTEXT(ctx
);
4559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4560 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4564 if (ctx
->ExecuteFlag
) {
4565 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4570 /* GL_ARB_transpose_matrix */
4572 static void GLAPIENTRY
4573 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4576 _math_transposefd(tm
, m
);
4577 save_LoadMatrixf(tm
);
4581 static void GLAPIENTRY
4582 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4585 _math_transposef(tm
, m
);
4586 save_LoadMatrixf(tm
);
4590 static void GLAPIENTRY
4591 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4594 _math_transposefd(tm
, m
);
4595 save_MultMatrixf(tm
);
4599 static void GLAPIENTRY
4600 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4603 _math_transposef(tm
, m
);
4604 save_MultMatrixf(tm
);
4607 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4609 GET_CURRENT_CONTEXT(ctx
);
4615 image
= malloc(size
);
4617 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4620 memcpy(image
, data
, size
);
4626 /* GL_ARB_texture_compression */
4627 static void GLAPIENTRY
4628 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4629 GLenum internalFormat
, GLsizei width
,
4630 GLint border
, GLsizei imageSize
,
4631 const GLvoid
* data
)
4633 GET_CURRENT_CONTEXT(ctx
);
4634 if (target
== GL_PROXY_TEXTURE_1D
) {
4635 /* don't compile, execute immediately */
4636 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4637 width
, border
, imageSize
,
4642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4644 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4648 n
[3].e
= internalFormat
;
4649 n
[4].i
= (GLint
) width
;
4652 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4654 if (ctx
->ExecuteFlag
) {
4655 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4656 (target
, level
, internalFormat
, width
,
4657 border
, imageSize
, data
));
4663 static void GLAPIENTRY
4664 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4665 GLenum internalFormat
, GLsizei width
,
4666 GLsizei height
, GLint border
, GLsizei imageSize
,
4667 const GLvoid
* data
)
4669 GET_CURRENT_CONTEXT(ctx
);
4670 if (target
== GL_PROXY_TEXTURE_2D
) {
4671 /* don't compile, execute immediately */
4672 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4673 width
, height
, border
,
4678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4680 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4684 n
[3].e
= internalFormat
;
4685 n
[4].i
= (GLint
) width
;
4686 n
[5].i
= (GLint
) height
;
4689 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4691 if (ctx
->ExecuteFlag
) {
4692 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4693 (target
, level
, internalFormat
, width
,
4694 height
, border
, imageSize
, data
));
4700 static void GLAPIENTRY
4701 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4702 GLenum internalFormat
, GLsizei width
,
4703 GLsizei height
, GLsizei depth
, GLint border
,
4704 GLsizei imageSize
, const GLvoid
* data
)
4706 GET_CURRENT_CONTEXT(ctx
);
4707 if (target
== GL_PROXY_TEXTURE_3D
) {
4708 /* don't compile, execute immediately */
4709 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4710 width
, height
, depth
, border
,
4715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4717 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4721 n
[3].e
= internalFormat
;
4722 n
[4].i
= (GLint
) width
;
4723 n
[5].i
= (GLint
) height
;
4724 n
[6].i
= (GLint
) depth
;
4727 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4729 if (ctx
->ExecuteFlag
) {
4730 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4731 (target
, level
, internalFormat
, width
,
4732 height
, depth
, border
, imageSize
,
4739 static void GLAPIENTRY
4740 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4741 GLsizei width
, GLenum format
,
4742 GLsizei imageSize
, const GLvoid
* data
)
4745 GET_CURRENT_CONTEXT(ctx
);
4746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4748 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4753 n
[4].i
= (GLint
) width
;
4756 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4758 if (ctx
->ExecuteFlag
) {
4759 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4760 width
, format
, imageSize
,
4766 static void GLAPIENTRY
4767 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4768 GLint yoffset
, GLsizei width
, GLsizei height
,
4769 GLenum format
, GLsizei imageSize
,
4770 const GLvoid
* data
)
4773 GET_CURRENT_CONTEXT(ctx
);
4774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4776 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4782 n
[5].i
= (GLint
) width
;
4783 n
[6].i
= (GLint
) height
;
4786 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4788 if (ctx
->ExecuteFlag
) {
4789 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4790 (target
, level
, xoffset
, yoffset
, width
,
4791 height
, format
, imageSize
, data
));
4796 static void GLAPIENTRY
4797 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4798 GLint yoffset
, GLint zoffset
, GLsizei width
,
4799 GLsizei height
, GLsizei depth
, GLenum format
,
4800 GLsizei imageSize
, const GLvoid
* data
)
4803 GET_CURRENT_CONTEXT(ctx
);
4804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4806 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4813 n
[6].i
= (GLint
) width
;
4814 n
[7].i
= (GLint
) height
;
4815 n
[8].i
= (GLint
) depth
;
4817 n
[10].i
= imageSize
;
4818 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4820 if (ctx
->ExecuteFlag
) {
4821 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4822 (target
, level
, xoffset
, yoffset
,
4823 zoffset
, width
, height
, depth
, format
,
4829 /* GL_ARB_multisample */
4830 static void GLAPIENTRY
4831 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4833 GET_CURRENT_CONTEXT(ctx
);
4835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4836 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4841 if (ctx
->ExecuteFlag
) {
4842 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4848 * GL_NV_vertex_program
4850 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4851 static void GLAPIENTRY
4852 save_BindProgramNV(GLenum target
, GLuint id
)
4854 GET_CURRENT_CONTEXT(ctx
);
4856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4857 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4862 if (ctx
->ExecuteFlag
) {
4863 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4867 static void GLAPIENTRY
4868 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4869 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4871 GET_CURRENT_CONTEXT(ctx
);
4873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4874 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4883 if (ctx
->ExecuteFlag
) {
4884 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4889 static void GLAPIENTRY
4890 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4891 const GLfloat
*params
)
4893 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4894 params
[2], params
[3]);
4898 static void GLAPIENTRY
4899 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4900 const GLfloat
* params
)
4902 GET_CURRENT_CONTEXT(ctx
);
4904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4908 const GLfloat
* p
= params
;
4910 for (i
= 0 ; i
< count
; i
++) {
4911 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4924 if (ctx
->ExecuteFlag
) {
4925 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4930 static void GLAPIENTRY
4931 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4932 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4934 save_ProgramEnvParameter4fARB(target
, index
,
4936 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4940 static void GLAPIENTRY
4941 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4942 const GLdouble
*params
)
4944 save_ProgramEnvParameter4fARB(target
, index
,
4945 (GLfloat
) params
[0],
4946 (GLfloat
) params
[1],
4947 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4950 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4952 #if FEATURE_NV_vertex_program
4953 static void GLAPIENTRY
4954 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4956 GET_CURRENT_CONTEXT(ctx
);
4958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4959 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4968 if (ctx
->ExecuteFlag
) {
4969 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4974 static void GLAPIENTRY
4975 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4976 GLsizei num
, const GLdouble
*params
)
4979 for (i
= 0; i
< num
; i
++) {
4980 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4985 static void GLAPIENTRY
4986 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4987 GLsizei num
, const GLfloat
*params
)
4990 for (i
= 0; i
< num
; i
++) {
4991 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4996 static void GLAPIENTRY
4997 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4998 const GLubyte
* program
)
5000 GET_CURRENT_CONTEXT(ctx
);
5003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5005 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
5007 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5009 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
5012 memcpy(programCopy
, program
, len
);
5016 n
[4].data
= programCopy
;
5018 if (ctx
->ExecuteFlag
) {
5019 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
5024 static void GLAPIENTRY
5025 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
5027 GET_CURRENT_CONTEXT(ctx
);
5030 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5032 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
5034 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
5036 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
5039 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
5043 if (ctx
->ExecuteFlag
) {
5044 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
5049 static void GLAPIENTRY
5050 save_TrackMatrixNV(GLenum target
, GLuint address
,
5051 GLenum matrix
, GLenum transform
)
5053 GET_CURRENT_CONTEXT(ctx
);
5055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5056 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
5063 if (ctx
->ExecuteFlag
) {
5064 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
5067 #endif /* FEATURE_NV_vertex_program */
5071 * GL_NV_fragment_program
5073 #if FEATURE_NV_fragment_program
5074 static void GLAPIENTRY
5075 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5076 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5078 GET_CURRENT_CONTEXT(ctx
);
5080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5081 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5090 if (ctx
->ExecuteFlag
) {
5091 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5096 static void GLAPIENTRY
5097 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5098 const GLfloat
*params
)
5100 GET_CURRENT_CONTEXT(ctx
);
5102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5103 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5112 if (ctx
->ExecuteFlag
) {
5113 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5118 static void GLAPIENTRY
5119 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5120 const GLfloat
*params
)
5122 GET_CURRENT_CONTEXT(ctx
);
5124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5128 const GLfloat
* p
= params
;
5130 for (i
= 0 ; i
< count
; i
++) {
5131 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5144 if (ctx
->ExecuteFlag
) {
5145 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5150 static void GLAPIENTRY
5151 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5152 GLdouble x
, GLdouble y
,
5153 GLdouble z
, GLdouble w
)
5155 GET_CURRENT_CONTEXT(ctx
);
5157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5158 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5162 n
[3].f
= (GLfloat
) x
;
5163 n
[4].f
= (GLfloat
) y
;
5164 n
[5].f
= (GLfloat
) z
;
5165 n
[6].f
= (GLfloat
) w
;
5167 if (ctx
->ExecuteFlag
) {
5168 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5173 static void GLAPIENTRY
5174 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5175 const GLdouble
*params
)
5177 GET_CURRENT_CONTEXT(ctx
);
5179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5180 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5184 n
[3].f
= (GLfloat
) params
[0];
5185 n
[4].f
= (GLfloat
) params
[1];
5186 n
[5].f
= (GLfloat
) params
[2];
5187 n
[6].f
= (GLfloat
) params
[3];
5189 if (ctx
->ExecuteFlag
) {
5190 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5194 static void GLAPIENTRY
5195 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5196 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5198 GET_CURRENT_CONTEXT(ctx
);
5201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5203 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5205 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
5207 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5210 memcpy(nameCopy
, name
, len
);
5213 n
[3].data
= nameCopy
;
5219 if (ctx
->ExecuteFlag
) {
5220 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5225 static void GLAPIENTRY
5226 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5229 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5233 static void GLAPIENTRY
5234 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5235 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5237 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5238 (GLfloat
) z
, (GLfloat
) w
);
5242 static void GLAPIENTRY
5243 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5246 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5247 (GLfloat
) v
[1], (GLfloat
) v
[2],
5251 #endif /* FEATURE_NV_fragment_program */
5255 /* GL_EXT_stencil_two_side */
5256 static void GLAPIENTRY
5257 save_ActiveStencilFaceEXT(GLenum face
)
5259 GET_CURRENT_CONTEXT(ctx
);
5261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5262 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5266 if (ctx
->ExecuteFlag
) {
5267 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5272 /* GL_EXT_depth_bounds_test */
5273 static void GLAPIENTRY
5274 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5276 GET_CURRENT_CONTEXT(ctx
);
5278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5279 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5281 n
[1].f
= (GLfloat
) zmin
;
5282 n
[2].f
= (GLfloat
) zmax
;
5284 if (ctx
->ExecuteFlag
) {
5285 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5291 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5293 static void GLAPIENTRY
5294 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5295 const GLvoid
* string
)
5297 GET_CURRENT_CONTEXT(ctx
);
5300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5302 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5304 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5306 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5309 memcpy(programCopy
, string
, len
);
5313 n
[4].data
= programCopy
;
5315 if (ctx
->ExecuteFlag
) {
5316 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5320 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5323 #if FEATURE_queryobj
5325 static void GLAPIENTRY
5326 save_BeginQueryARB(GLenum target
, GLuint id
)
5328 GET_CURRENT_CONTEXT(ctx
);
5330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5331 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5336 if (ctx
->ExecuteFlag
) {
5337 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5342 static void GLAPIENTRY
5343 save_EndQueryARB(GLenum target
)
5345 GET_CURRENT_CONTEXT(ctx
);
5347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5348 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5352 if (ctx
->ExecuteFlag
) {
5353 CALL_EndQueryARB(ctx
->Exec
, (target
));
5358 static void GLAPIENTRY
5359 save_QueryCounter(GLuint id
, GLenum target
)
5361 GET_CURRENT_CONTEXT(ctx
);
5363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5364 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5369 if (ctx
->ExecuteFlag
) {
5370 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5374 #endif /* FEATURE_queryobj */
5377 static void GLAPIENTRY
5378 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5380 GET_CURRENT_CONTEXT(ctx
);
5382 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5383 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5387 if (count
> MAX_DRAW_BUFFERS
)
5388 count
= MAX_DRAW_BUFFERS
;
5389 for (i
= 0; i
< count
; i
++) {
5390 n
[2 + i
].e
= buffers
[i
];
5393 if (ctx
->ExecuteFlag
) {
5394 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5398 static void GLAPIENTRY
5399 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5401 GET_CURRENT_CONTEXT(ctx
);
5404 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5412 if (ctx
->ExecuteFlag
) {
5413 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5417 static void GLAPIENTRY
5418 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5421 p
[0] = INT_TO_FLOAT(param
[0]);
5422 p
[1] = INT_TO_FLOAT(param
[1]);
5423 p
[2] = INT_TO_FLOAT(param
[2]);
5424 p
[3] = INT_TO_FLOAT(param
[3]);
5425 save_TexBumpParameterfvATI(pname
, p
);
5428 #if FEATURE_ATI_fragment_shader
5429 static void GLAPIENTRY
5430 save_BindFragmentShaderATI(GLuint id
)
5432 GET_CURRENT_CONTEXT(ctx
);
5435 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5439 if (ctx
->ExecuteFlag
) {
5440 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5444 static void GLAPIENTRY
5445 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5447 GET_CURRENT_CONTEXT(ctx
);
5450 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5458 if (ctx
->ExecuteFlag
) {
5459 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5464 static void GLAPIENTRY
5465 save_Attr1fNV(GLenum attr
, GLfloat x
)
5467 GET_CURRENT_CONTEXT(ctx
);
5469 SAVE_FLUSH_VERTICES(ctx
);
5470 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5476 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5477 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5478 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5480 if (ctx
->ExecuteFlag
) {
5481 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5485 static void GLAPIENTRY
5486 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5488 GET_CURRENT_CONTEXT(ctx
);
5490 SAVE_FLUSH_VERTICES(ctx
);
5491 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5498 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5499 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5500 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5502 if (ctx
->ExecuteFlag
) {
5503 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5507 static void GLAPIENTRY
5508 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5510 GET_CURRENT_CONTEXT(ctx
);
5512 SAVE_FLUSH_VERTICES(ctx
);
5513 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5521 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5522 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5523 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5525 if (ctx
->ExecuteFlag
) {
5526 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5530 static void GLAPIENTRY
5531 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5533 GET_CURRENT_CONTEXT(ctx
);
5535 SAVE_FLUSH_VERTICES(ctx
);
5536 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5545 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5546 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5547 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5549 if (ctx
->ExecuteFlag
) {
5550 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5555 static void GLAPIENTRY
5556 save_Attr1fARB(GLenum attr
, GLfloat x
)
5558 GET_CURRENT_CONTEXT(ctx
);
5560 SAVE_FLUSH_VERTICES(ctx
);
5561 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5567 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5568 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5569 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5571 if (ctx
->ExecuteFlag
) {
5572 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5576 static void GLAPIENTRY
5577 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5579 GET_CURRENT_CONTEXT(ctx
);
5581 SAVE_FLUSH_VERTICES(ctx
);
5582 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5589 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5590 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5591 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5593 if (ctx
->ExecuteFlag
) {
5594 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5598 static void GLAPIENTRY
5599 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5601 GET_CURRENT_CONTEXT(ctx
);
5603 SAVE_FLUSH_VERTICES(ctx
);
5604 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5612 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5613 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5614 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5616 if (ctx
->ExecuteFlag
) {
5617 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5621 static void GLAPIENTRY
5622 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5624 GET_CURRENT_CONTEXT(ctx
);
5626 SAVE_FLUSH_VERTICES(ctx
);
5627 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5636 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5637 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5638 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5640 if (ctx
->ExecuteFlag
) {
5641 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5646 static void GLAPIENTRY
5647 save_EvalCoord1f(GLfloat x
)
5649 GET_CURRENT_CONTEXT(ctx
);
5651 SAVE_FLUSH_VERTICES(ctx
);
5652 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5656 if (ctx
->ExecuteFlag
) {
5657 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5661 static void GLAPIENTRY
5662 save_EvalCoord1fv(const GLfloat
* v
)
5664 save_EvalCoord1f(v
[0]);
5667 static void GLAPIENTRY
5668 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5670 GET_CURRENT_CONTEXT(ctx
);
5672 SAVE_FLUSH_VERTICES(ctx
);
5673 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5678 if (ctx
->ExecuteFlag
) {
5679 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5683 static void GLAPIENTRY
5684 save_EvalCoord2fv(const GLfloat
* v
)
5686 save_EvalCoord2f(v
[0], v
[1]);
5690 static void GLAPIENTRY
5691 save_EvalPoint1(GLint x
)
5693 GET_CURRENT_CONTEXT(ctx
);
5695 SAVE_FLUSH_VERTICES(ctx
);
5696 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5700 if (ctx
->ExecuteFlag
) {
5701 CALL_EvalPoint1(ctx
->Exec
, (x
));
5705 static void GLAPIENTRY
5706 save_EvalPoint2(GLint x
, GLint y
)
5708 GET_CURRENT_CONTEXT(ctx
);
5710 SAVE_FLUSH_VERTICES(ctx
);
5711 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5716 if (ctx
->ExecuteFlag
) {
5717 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5721 static void GLAPIENTRY
5722 save_Indexf(GLfloat x
)
5724 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5727 static void GLAPIENTRY
5728 save_Indexfv(const GLfloat
* v
)
5730 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5733 static void GLAPIENTRY
5734 save_EdgeFlag(GLboolean x
)
5736 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5741 * Compare 'count' elements of vectors 'a' and 'b'.
5742 * \return GL_TRUE if equal, GL_FALSE if different.
5744 static inline GLboolean
5745 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5747 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5752 * This glMaterial function is used for glMaterial calls that are outside
5753 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5755 static void GLAPIENTRY
5756 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5758 GET_CURRENT_CONTEXT(ctx
);
5766 case GL_FRONT_AND_BACK
:
5769 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5778 case GL_AMBIENT_AND_DIFFUSE
:
5784 case GL_COLOR_INDEXES
:
5788 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5792 if (ctx
->ExecuteFlag
) {
5793 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5796 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5798 /* Try to eliminate redundant statechanges. Because it is legal to
5799 * call glMaterial even inside begin/end calls, don't need to worry
5800 * about ctx->Driver.CurrentSavePrimitive here.
5802 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5803 if (bitmask
& (1 << i
)) {
5804 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5805 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5806 /* no change in material value */
5807 bitmask
&= ~(1 << i
);
5810 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5811 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5816 /* If this call has no effect, return early */
5820 SAVE_FLUSH_VERTICES(ctx
);
5822 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5826 for (i
= 0; i
< args
; i
++)
5827 n
[3 + i
].f
= param
[i
];
5831 static void GLAPIENTRY
5832 save_Begin(GLenum mode
)
5834 GET_CURRENT_CONTEXT(ctx
);
5836 GLboolean error
= GL_FALSE
;
5838 if (mode
> GL_POLYGON
) {
5839 _mesa_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode=%x)", mode
);
5842 if (ctx
->ExecuteFlag
) {
5843 if (!_mesa_valid_prim_mode(ctx
, mode
, "glBegin")) {
5848 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5849 /* Typically the first begin. This may raise an error on
5850 * playback, depending on whether CallList is issued from inside
5851 * a begin/end or not.
5853 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5855 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5856 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5859 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5864 /* Give the driver an opportunity to hook in an optimized
5865 * display list compiler.
5867 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5870 SAVE_FLUSH_VERTICES(ctx
);
5871 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5877 if (ctx
->ExecuteFlag
) {
5878 CALL_Begin(ctx
->Exec
, (mode
));
5882 static void GLAPIENTRY
5885 GET_CURRENT_CONTEXT(ctx
);
5886 SAVE_FLUSH_VERTICES(ctx
);
5887 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5888 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5889 if (ctx
->ExecuteFlag
) {
5890 CALL_End(ctx
->Exec
, ());
5894 static void GLAPIENTRY
5895 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5897 GET_CURRENT_CONTEXT(ctx
);
5899 SAVE_FLUSH_VERTICES(ctx
);
5900 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5907 if (ctx
->ExecuteFlag
) {
5908 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5913 static void GLAPIENTRY
5914 save_Vertex2f(GLfloat x
, GLfloat y
)
5916 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5919 static void GLAPIENTRY
5920 save_Vertex2fv(const GLfloat
* v
)
5922 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5925 static void GLAPIENTRY
5926 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5928 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5931 static void GLAPIENTRY
5932 save_Vertex3fv(const GLfloat
* v
)
5934 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5937 static void GLAPIENTRY
5938 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5940 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5943 static void GLAPIENTRY
5944 save_Vertex4fv(const GLfloat
* v
)
5946 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5949 static void GLAPIENTRY
5950 save_TexCoord1f(GLfloat x
)
5952 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5955 static void GLAPIENTRY
5956 save_TexCoord1fv(const GLfloat
* v
)
5958 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5961 static void GLAPIENTRY
5962 save_TexCoord2f(GLfloat x
, GLfloat y
)
5964 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5967 static void GLAPIENTRY
5968 save_TexCoord2fv(const GLfloat
* v
)
5970 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5973 static void GLAPIENTRY
5974 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5976 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5979 static void GLAPIENTRY
5980 save_TexCoord3fv(const GLfloat
* v
)
5982 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5985 static void GLAPIENTRY
5986 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5988 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5991 static void GLAPIENTRY
5992 save_TexCoord4fv(const GLfloat
* v
)
5994 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5997 static void GLAPIENTRY
5998 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6000 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6003 static void GLAPIENTRY
6004 save_Normal3fv(const GLfloat
* v
)
6006 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6009 static void GLAPIENTRY
6010 save_FogCoordfEXT(GLfloat x
)
6012 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6015 static void GLAPIENTRY
6016 save_FogCoordfvEXT(const GLfloat
* v
)
6018 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6021 static void GLAPIENTRY
6022 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6024 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6027 static void GLAPIENTRY
6028 save_Color3fv(const GLfloat
* v
)
6030 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6033 static void GLAPIENTRY
6034 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6036 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6039 static void GLAPIENTRY
6040 save_Color4fv(const GLfloat
* v
)
6042 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6045 static void GLAPIENTRY
6046 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6048 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6051 static void GLAPIENTRY
6052 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6054 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6058 /* Just call the respective ATTR for texcoord
6060 static void GLAPIENTRY
6061 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6063 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6064 save_Attr1fNV(attr
, x
);
6067 static void GLAPIENTRY
6068 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6070 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6071 save_Attr1fNV(attr
, v
[0]);
6074 static void GLAPIENTRY
6075 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6077 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6078 save_Attr2fNV(attr
, x
, y
);
6081 static void GLAPIENTRY
6082 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6084 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6085 save_Attr2fNV(attr
, v
[0], v
[1]);
6088 static void GLAPIENTRY
6089 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6091 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6092 save_Attr3fNV(attr
, x
, y
, z
);
6095 static void GLAPIENTRY
6096 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6098 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6099 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6102 static void GLAPIENTRY
6103 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6104 GLfloat z
, GLfloat w
)
6106 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6107 save_Attr4fNV(attr
, x
, y
, z
, w
);
6110 static void GLAPIENTRY
6111 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6113 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6114 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6119 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6125 GET_CURRENT_CONTEXT(ctx
);
6126 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6130 /* First level for NV_vertex_program:
6132 * Check for errors at compile time?.
6134 static void GLAPIENTRY
6135 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6137 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6138 save_Attr1fNV(index
, x
);
6143 static void GLAPIENTRY
6144 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6146 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6147 save_Attr1fNV(index
, v
[0]);
6152 static void GLAPIENTRY
6153 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6155 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6156 save_Attr2fNV(index
, x
, y
);
6161 static void GLAPIENTRY
6162 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6164 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6165 save_Attr2fNV(index
, v
[0], v
[1]);
6170 static void GLAPIENTRY
6171 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6173 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6174 save_Attr3fNV(index
, x
, y
, z
);
6179 static void GLAPIENTRY
6180 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6182 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6183 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6188 static void GLAPIENTRY
6189 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6190 GLfloat z
, GLfloat w
)
6192 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6193 save_Attr4fNV(index
, x
, y
, z
, w
);
6198 static void GLAPIENTRY
6199 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6201 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6202 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6210 static void GLAPIENTRY
6211 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6213 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6214 save_Attr1fARB(index
, x
);
6219 static void GLAPIENTRY
6220 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6222 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6223 save_Attr1fARB(index
, v
[0]);
6228 static void GLAPIENTRY
6229 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6231 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6232 save_Attr2fARB(index
, x
, y
);
6237 static void GLAPIENTRY
6238 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6240 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6241 save_Attr2fARB(index
, v
[0], v
[1]);
6246 static void GLAPIENTRY
6247 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6249 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6250 save_Attr3fARB(index
, x
, y
, z
);
6255 static void GLAPIENTRY
6256 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6258 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6259 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6264 static void GLAPIENTRY
6265 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6268 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6269 save_Attr4fARB(index
, x
, y
, z
, w
);
6274 static void GLAPIENTRY
6275 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6277 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6278 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6284 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6286 static void GLAPIENTRY
6287 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6289 GET_CURRENT_CONTEXT(ctx
);
6290 FLUSH_VERTICES(ctx
, 0);
6291 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6294 static GLint GLAPIENTRY
6295 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6297 GET_CURRENT_CONTEXT(ctx
);
6298 FLUSH_VERTICES(ctx
, 0);
6299 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6302 static GLint GLAPIENTRY
6303 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6305 GET_CURRENT_CONTEXT(ctx
);
6306 FLUSH_VERTICES(ctx
, 0);
6307 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6309 /* XXX more shader functions needed here */
6312 #if FEATURE_EXT_framebuffer_blit
6313 static void GLAPIENTRY
6314 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6315 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6316 GLbitfield mask
, GLenum filter
)
6318 GET_CURRENT_CONTEXT(ctx
);
6320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6321 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6334 if (ctx
->ExecuteFlag
) {
6335 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6336 dstX0
, dstY0
, dstX1
, dstY1
,
6343 /** GL_EXT_provoking_vertex */
6344 static void GLAPIENTRY
6345 save_ProvokingVertexEXT(GLenum mode
)
6347 GET_CURRENT_CONTEXT(ctx
);
6349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6350 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6354 if (ctx
->ExecuteFlag
) {
6355 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6356 _mesa_ProvokingVertexEXT(mode
);
6361 /** GL_EXT_transform_feedback */
6362 static void GLAPIENTRY
6363 save_BeginTransformFeedback(GLenum mode
)
6365 GET_CURRENT_CONTEXT(ctx
);
6367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6368 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6372 if (ctx
->ExecuteFlag
) {
6373 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6378 /** GL_EXT_transform_feedback */
6379 static void GLAPIENTRY
6380 save_EndTransformFeedback(void)
6382 GET_CURRENT_CONTEXT(ctx
);
6383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6384 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6385 if (ctx
->ExecuteFlag
) {
6386 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6390 static void GLAPIENTRY
6391 save_BindTransformFeedback(GLenum target
, GLuint name
)
6393 GET_CURRENT_CONTEXT(ctx
);
6395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6396 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6401 if (ctx
->ExecuteFlag
) {
6402 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6406 static void GLAPIENTRY
6407 save_PauseTransformFeedback(void)
6409 GET_CURRENT_CONTEXT(ctx
);
6410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6411 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6412 if (ctx
->ExecuteFlag
) {
6413 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6417 static void GLAPIENTRY
6418 save_ResumeTransformFeedback(void)
6420 GET_CURRENT_CONTEXT(ctx
);
6421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6422 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6423 if (ctx
->ExecuteFlag
) {
6424 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6428 static void GLAPIENTRY
6429 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6431 GET_CURRENT_CONTEXT(ctx
);
6433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6434 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6439 if (ctx
->ExecuteFlag
) {
6440 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6445 /* aka UseProgram() */
6446 static void GLAPIENTRY
6447 save_UseProgramObjectARB(GLhandleARB program
)
6449 GET_CURRENT_CONTEXT(ctx
);
6451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6452 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6456 if (ctx
->ExecuteFlag
) {
6457 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6462 static void GLAPIENTRY
6463 save_Uniform1fARB(GLint location
, GLfloat x
)
6465 GET_CURRENT_CONTEXT(ctx
);
6467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6468 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6473 if (ctx
->ExecuteFlag
) {
6474 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6479 static void GLAPIENTRY
6480 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6482 GET_CURRENT_CONTEXT(ctx
);
6484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6485 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6491 if (ctx
->ExecuteFlag
) {
6492 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6497 static void GLAPIENTRY
6498 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6500 GET_CURRENT_CONTEXT(ctx
);
6502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6503 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6510 if (ctx
->ExecuteFlag
) {
6511 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6516 static void GLAPIENTRY
6517 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6519 GET_CURRENT_CONTEXT(ctx
);
6521 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6522 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6530 if (ctx
->ExecuteFlag
) {
6531 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6536 /** Return copy of memory */
6538 memdup(const void *src
, GLsizei bytes
)
6540 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6542 memcpy(b
, src
, bytes
);
6547 static void GLAPIENTRY
6548 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6550 GET_CURRENT_CONTEXT(ctx
);
6552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6553 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6557 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6559 if (ctx
->ExecuteFlag
) {
6560 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6564 static void GLAPIENTRY
6565 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6567 GET_CURRENT_CONTEXT(ctx
);
6569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6570 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6574 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6576 if (ctx
->ExecuteFlag
) {
6577 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6581 static void GLAPIENTRY
6582 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6584 GET_CURRENT_CONTEXT(ctx
);
6586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6587 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6591 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6593 if (ctx
->ExecuteFlag
) {
6594 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6598 static void GLAPIENTRY
6599 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6601 GET_CURRENT_CONTEXT(ctx
);
6603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6604 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6608 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6610 if (ctx
->ExecuteFlag
) {
6611 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6616 static void GLAPIENTRY
6617 save_Uniform1iARB(GLint location
, GLint x
)
6619 GET_CURRENT_CONTEXT(ctx
);
6621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6622 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6627 if (ctx
->ExecuteFlag
) {
6628 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6632 static void GLAPIENTRY
6633 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6635 GET_CURRENT_CONTEXT(ctx
);
6637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6638 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6644 if (ctx
->ExecuteFlag
) {
6645 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6649 static void GLAPIENTRY
6650 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6652 GET_CURRENT_CONTEXT(ctx
);
6654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6655 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6662 if (ctx
->ExecuteFlag
) {
6663 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6667 static void GLAPIENTRY
6668 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6670 GET_CURRENT_CONTEXT(ctx
);
6672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6673 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6681 if (ctx
->ExecuteFlag
) {
6682 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6688 static void GLAPIENTRY
6689 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6691 GET_CURRENT_CONTEXT(ctx
);
6693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6694 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6698 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6700 if (ctx
->ExecuteFlag
) {
6701 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6705 static void GLAPIENTRY
6706 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6708 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6715 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6717 if (ctx
->ExecuteFlag
) {
6718 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6722 static void GLAPIENTRY
6723 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6725 GET_CURRENT_CONTEXT(ctx
);
6727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6728 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6732 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6734 if (ctx
->ExecuteFlag
) {
6735 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6739 static void GLAPIENTRY
6740 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6742 GET_CURRENT_CONTEXT(ctx
);
6744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6745 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6749 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6751 if (ctx
->ExecuteFlag
) {
6752 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6758 static void GLAPIENTRY
6759 save_Uniform1ui(GLint location
, GLuint x
)
6761 GET_CURRENT_CONTEXT(ctx
);
6763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6764 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6769 if (ctx
->ExecuteFlag
) {
6770 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6774 static void GLAPIENTRY
6775 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6777 GET_CURRENT_CONTEXT(ctx
);
6779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6780 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6786 if (ctx
->ExecuteFlag
) {
6787 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6791 static void GLAPIENTRY
6792 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6794 GET_CURRENT_CONTEXT(ctx
);
6796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6797 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6804 if (ctx
->ExecuteFlag
) {
6805 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6809 static void GLAPIENTRY
6810 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6812 GET_CURRENT_CONTEXT(ctx
);
6814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6815 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6823 if (ctx
->ExecuteFlag
) {
6824 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6830 static void GLAPIENTRY
6831 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6833 GET_CURRENT_CONTEXT(ctx
);
6835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6836 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6840 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6842 if (ctx
->ExecuteFlag
) {
6843 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6847 static void GLAPIENTRY
6848 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6850 GET_CURRENT_CONTEXT(ctx
);
6852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6853 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6857 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6859 if (ctx
->ExecuteFlag
) {
6860 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6864 static void GLAPIENTRY
6865 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6867 GET_CURRENT_CONTEXT(ctx
);
6869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6870 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6874 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6876 if (ctx
->ExecuteFlag
) {
6877 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6881 static void GLAPIENTRY
6882 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6884 GET_CURRENT_CONTEXT(ctx
);
6886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6887 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6891 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6893 if (ctx
->ExecuteFlag
) {
6894 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6900 static void GLAPIENTRY
6901 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6904 GET_CURRENT_CONTEXT(ctx
);
6906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6907 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6912 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6914 if (ctx
->ExecuteFlag
) {
6915 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6919 static void GLAPIENTRY
6920 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6923 GET_CURRENT_CONTEXT(ctx
);
6925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6926 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6931 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6933 if (ctx
->ExecuteFlag
) {
6934 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6938 static void GLAPIENTRY
6939 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6942 GET_CURRENT_CONTEXT(ctx
);
6944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6945 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6950 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6952 if (ctx
->ExecuteFlag
) {
6953 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6958 static void GLAPIENTRY
6959 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6962 GET_CURRENT_CONTEXT(ctx
);
6964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6965 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6970 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6972 if (ctx
->ExecuteFlag
) {
6973 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6977 static void GLAPIENTRY
6978 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6981 GET_CURRENT_CONTEXT(ctx
);
6983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6984 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6989 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6991 if (ctx
->ExecuteFlag
) {
6992 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6997 static void GLAPIENTRY
6998 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7001 GET_CURRENT_CONTEXT(ctx
);
7003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7004 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
7009 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
7011 if (ctx
->ExecuteFlag
) {
7012 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7016 static void GLAPIENTRY
7017 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7020 GET_CURRENT_CONTEXT(ctx
);
7022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7023 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
7028 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
7030 if (ctx
->ExecuteFlag
) {
7031 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7036 static void GLAPIENTRY
7037 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7040 GET_CURRENT_CONTEXT(ctx
);
7042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7043 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
7048 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
7050 if (ctx
->ExecuteFlag
) {
7051 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7055 static void GLAPIENTRY
7056 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7059 GET_CURRENT_CONTEXT(ctx
);
7061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7062 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
7067 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
7069 if (ctx
->ExecuteFlag
) {
7070 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7074 static void GLAPIENTRY
7075 save_ClampColorARB(GLenum target
, GLenum clamp
)
7077 GET_CURRENT_CONTEXT(ctx
);
7079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7080 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7085 if (ctx
->ExecuteFlag
) {
7086 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
7090 static void GLAPIENTRY
7091 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
7093 GET_CURRENT_CONTEXT(ctx
);
7095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7096 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
7101 if (ctx
->ExecuteFlag
) {
7102 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
7106 static void GLAPIENTRY
7107 save_ActiveProgramEXT(GLuint program
)
7109 GET_CURRENT_CONTEXT(ctx
);
7111 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7112 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7116 if (ctx
->ExecuteFlag
) {
7117 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7121 /** GL_EXT_texture_integer */
7122 static void GLAPIENTRY
7123 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7125 GET_CURRENT_CONTEXT(ctx
);
7127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7128 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7135 if (ctx
->ExecuteFlag
) {
7136 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7140 /** GL_EXT_texture_integer */
7141 static void GLAPIENTRY
7142 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7144 GET_CURRENT_CONTEXT(ctx
);
7146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7147 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7154 if (ctx
->ExecuteFlag
) {
7155 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7159 /** GL_EXT_texture_integer */
7160 static void GLAPIENTRY
7161 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7163 GET_CURRENT_CONTEXT(ctx
);
7165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7166 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7175 if (ctx
->ExecuteFlag
) {
7176 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7180 /** GL_EXT_texture_integer */
7181 static void GLAPIENTRY
7182 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7184 GET_CURRENT_CONTEXT(ctx
);
7186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7187 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7191 n
[3].ui
= params
[0];
7192 n
[4].ui
= params
[1];
7193 n
[5].ui
= params
[2];
7194 n
[6].ui
= params
[3];
7196 if (ctx
->ExecuteFlag
) {
7197 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7201 /** GL_EXT_texture_integer */
7202 static void GLAPIENTRY
7203 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7205 GET_CURRENT_CONTEXT(ctx
);
7206 FLUSH_VERTICES(ctx
, 0);
7207 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7210 /** GL_EXT_texture_integer */
7211 static void GLAPIENTRY
7212 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7214 GET_CURRENT_CONTEXT(ctx
);
7215 FLUSH_VERTICES(ctx
, 0);
7216 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7220 /* GL_ARB_instanced_arrays */
7221 static void GLAPIENTRY
7222 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7224 GET_CURRENT_CONTEXT(ctx
);
7226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7227 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7232 if (ctx
->ExecuteFlag
) {
7233 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7238 /* GL_NV_texture_barrier */
7239 static void GLAPIENTRY
7240 save_TextureBarrierNV(void)
7242 GET_CURRENT_CONTEXT(ctx
);
7243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7244 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7245 if (ctx
->ExecuteFlag
) {
7246 CALL_TextureBarrierNV(ctx
->Exec
, ());
7251 /* GL_ARB_sampler_objects */
7252 static void GLAPIENTRY
7253 save_BindSampler(GLuint unit
, GLuint sampler
)
7256 GET_CURRENT_CONTEXT(ctx
);
7257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7258 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7263 if (ctx
->ExecuteFlag
) {
7264 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7268 static void GLAPIENTRY
7269 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7272 GET_CURRENT_CONTEXT(ctx
);
7273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7274 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7279 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7285 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7288 if (ctx
->ExecuteFlag
) {
7289 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7293 static void GLAPIENTRY
7294 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7296 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7299 static void GLAPIENTRY
7300 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7303 GET_CURRENT_CONTEXT(ctx
);
7304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7305 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7310 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7316 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7319 if (ctx
->ExecuteFlag
) {
7320 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7324 static void GLAPIENTRY
7325 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7327 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7330 static void GLAPIENTRY
7331 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7334 GET_CURRENT_CONTEXT(ctx
);
7335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7336 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7341 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7347 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7350 if (ctx
->ExecuteFlag
) {
7351 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7355 static void GLAPIENTRY
7356 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7359 GET_CURRENT_CONTEXT(ctx
);
7360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7361 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7365 n
[3].ui
= params
[0];
7366 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7367 n
[4].ui
= params
[1];
7368 n
[5].ui
= params
[2];
7369 n
[6].ui
= params
[3];
7372 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7375 if (ctx
->ExecuteFlag
) {
7376 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7380 /* GL_ARB_geometry_shader4 */
7381 static void GLAPIENTRY
7382 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7385 GET_CURRENT_CONTEXT(ctx
);
7386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7387 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7393 if (ctx
->ExecuteFlag
) {
7394 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7398 static void GLAPIENTRY
7399 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7400 GLuint texture
, GLint level
)
7403 GET_CURRENT_CONTEXT(ctx
);
7404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7405 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7408 n
[2].e
= attachment
;
7412 if (ctx
->ExecuteFlag
) {
7413 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7417 static void GLAPIENTRY
7418 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7419 GLuint texture
, GLint level
, GLenum face
)
7422 GET_CURRENT_CONTEXT(ctx
);
7423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7424 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7427 n
[2].e
= attachment
;
7432 if (ctx
->ExecuteFlag
) {
7433 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7440 static void GLAPIENTRY
7441 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7444 GET_CURRENT_CONTEXT(ctx
);
7445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7446 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7448 union uint64_pair p
;
7452 n
[3].ui
= p
.uint32
[0];
7453 n
[4].ui
= p
.uint32
[1];
7455 if (ctx
->ExecuteFlag
) {
7456 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7461 /** GL_NV_conditional_render */
7462 static void GLAPIENTRY
7463 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7465 GET_CURRENT_CONTEXT(ctx
);
7467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7468 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7473 if (ctx
->ExecuteFlag
) {
7474 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7478 static void GLAPIENTRY
7479 save_EndConditionalRender(void)
7481 GET_CURRENT_CONTEXT(ctx
);
7482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7483 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7484 if (ctx
->ExecuteFlag
) {
7485 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7491 * Save an error-generating command into display list.
7493 * KW: Will appear in the list before the vertex buffer containing the
7494 * command that provoked the error. I don't see this as a problem.
7497 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7500 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7503 n
[2].data
= (void *) s
;
7509 * Compile an error into current display list.
7512 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7514 if (ctx
->CompileFlag
)
7515 save_error(ctx
, error
, s
);
7516 if (ctx
->ExecuteFlag
)
7517 _mesa_error(ctx
, error
, "%s", s
);
7522 * Test if ID names a display list.
7525 islist(struct gl_context
*ctx
, GLuint list
)
7527 if (list
> 0 && lookup_list(ctx
, list
)) {
7537 /**********************************************************************/
7538 /* Display list execution */
7539 /**********************************************************************/
7543 * Execute a display list. Note that the ListBase offset must have already
7544 * been added before calling this function. I.e. the list argument is
7545 * the absolute list number, not relative to ListBase.
7546 * \param list - display list number
7549 execute_list(struct gl_context
*ctx
, GLuint list
)
7551 struct gl_display_list
*dlist
;
7555 if (list
== 0 || !islist(ctx
, list
))
7558 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7559 /* raise an error? */
7563 dlist
= lookup_list(ctx
, list
);
7567 ctx
->ListState
.CallDepth
++;
7569 if (ctx
->Driver
.BeginCallList
)
7570 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7576 const OpCode opcode
= n
[0].opcode
;
7578 if (is_ext_opcode(opcode
)) {
7579 n
+= ext_opcode_execute(ctx
, n
);
7584 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7587 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7589 case OPCODE_ALPHA_FUNC
:
7590 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7592 case OPCODE_BIND_TEXTURE
:
7593 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7597 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7598 ctx
->Unpack
= ctx
->DefaultPacking
;
7599 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7600 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7601 (const GLubyte
*) n
[7].data
));
7602 ctx
->Unpack
= save
; /* restore */
7605 case OPCODE_BLEND_COLOR
:
7606 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7608 case OPCODE_BLEND_EQUATION
:
7609 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7611 case OPCODE_BLEND_EQUATION_SEPARATE
:
7612 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7614 case OPCODE_BLEND_FUNC_SEPARATE
:
7615 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7616 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7619 case OPCODE_BLEND_FUNC_I
:
7620 /* GL_ARB_draw_buffers_blend */
7621 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7623 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7624 /* GL_ARB_draw_buffers_blend */
7625 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7628 case OPCODE_BLEND_EQUATION_I
:
7629 /* GL_ARB_draw_buffers_blend */
7630 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7632 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7633 /* GL_ARB_draw_buffers_blend */
7634 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7635 (n
[1].ui
, n
[2].e
, n
[3].e
));
7638 case OPCODE_CALL_LIST
:
7639 /* Generated by glCallList(), don't add ListBase */
7640 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7641 execute_list(ctx
, n
[1].ui
);
7644 case OPCODE_CALL_LIST_OFFSET
:
7645 /* Generated by glCallLists() so we must add ListBase */
7647 /* user specified a bad data type at compile time */
7648 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7650 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7651 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7652 execute_list(ctx
, list
);
7656 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7658 case OPCODE_CLEAR_BUFFER_IV
:
7665 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7668 case OPCODE_CLEAR_BUFFER_UIV
:
7675 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7678 case OPCODE_CLEAR_BUFFER_FV
:
7685 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7688 case OPCODE_CLEAR_BUFFER_FI
:
7689 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7691 case OPCODE_CLEAR_COLOR
:
7692 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7694 case OPCODE_CLEAR_ACCUM
:
7695 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7697 case OPCODE_CLEAR_DEPTH
:
7698 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7700 case OPCODE_CLEAR_INDEX
:
7701 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7703 case OPCODE_CLEAR_STENCIL
:
7704 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7706 case OPCODE_CLIP_PLANE
:
7713 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7716 case OPCODE_COLOR_MASK
:
7717 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7719 case OPCODE_COLOR_MASK_INDEXED
:
7720 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7723 case OPCODE_COLOR_MATERIAL
:
7724 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7726 case OPCODE_COLOR_TABLE
:
7728 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7729 ctx
->Unpack
= ctx
->DefaultPacking
;
7730 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7731 n
[5].e
, n
[6].data
));
7732 ctx
->Unpack
= save
; /* restore */
7735 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7742 CALL_ColorTableParameterfv(ctx
->Exec
,
7743 (n
[1].e
, n
[2].e
, params
));
7746 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7753 CALL_ColorTableParameteriv(ctx
->Exec
,
7754 (n
[1].e
, n
[2].e
, params
));
7757 case OPCODE_COLOR_SUB_TABLE
:
7759 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7760 ctx
->Unpack
= ctx
->DefaultPacking
;
7761 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7762 n
[4].e
, n
[5].e
, n
[6].data
));
7763 ctx
->Unpack
= save
; /* restore */
7766 case OPCODE_CONVOLUTION_FILTER_1D
:
7768 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7769 ctx
->Unpack
= ctx
->DefaultPacking
;
7770 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7773 ctx
->Unpack
= save
; /* restore */
7776 case OPCODE_CONVOLUTION_FILTER_2D
:
7778 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7779 ctx
->Unpack
= ctx
->DefaultPacking
;
7780 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7781 n
[4].i
, n
[5].e
, n
[6].e
,
7783 ctx
->Unpack
= save
; /* restore */
7786 case OPCODE_CONVOLUTION_PARAMETER_I
:
7787 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7789 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7796 CALL_ConvolutionParameteriv(ctx
->Exec
,
7797 (n
[1].e
, n
[2].e
, params
));
7800 case OPCODE_CONVOLUTION_PARAMETER_F
:
7801 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7803 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7810 CALL_ConvolutionParameterfv(ctx
->Exec
,
7811 (n
[1].e
, n
[2].e
, params
));
7814 case OPCODE_COPY_COLOR_SUB_TABLE
:
7815 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7816 n
[3].i
, n
[4].i
, n
[5].i
));
7818 case OPCODE_COPY_COLOR_TABLE
:
7819 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7820 n
[3].i
, n
[4].i
, n
[5].i
));
7822 case OPCODE_COPY_PIXELS
:
7823 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7824 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7827 case OPCODE_COPY_TEX_IMAGE1D
:
7828 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7829 n
[5].i
, n
[6].i
, n
[7].i
));
7831 case OPCODE_COPY_TEX_IMAGE2D
:
7832 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7833 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7835 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7836 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7837 n
[4].i
, n
[5].i
, n
[6].i
));
7839 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7840 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7841 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7844 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7845 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7846 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7849 case OPCODE_CULL_FACE
:
7850 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7852 case OPCODE_DEPTH_FUNC
:
7853 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7855 case OPCODE_DEPTH_MASK
:
7856 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7858 case OPCODE_DEPTH_RANGE
:
7859 CALL_DepthRange(ctx
->Exec
,
7860 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7862 case OPCODE_DISABLE
:
7863 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7865 case OPCODE_DISABLE_INDEXED
:
7866 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7868 case OPCODE_DRAW_BUFFER
:
7869 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7871 case OPCODE_DRAW_PIXELS
:
7873 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7874 ctx
->Unpack
= ctx
->DefaultPacking
;
7875 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7877 ctx
->Unpack
= save
; /* restore */
7881 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7883 case OPCODE_ENABLE_INDEXED
:
7884 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7886 case OPCODE_EVALMESH1
:
7887 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7889 case OPCODE_EVALMESH2
:
7890 CALL_EvalMesh2(ctx
->Exec
,
7891 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7900 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7903 case OPCODE_FRONT_FACE
:
7904 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7906 case OPCODE_FRUSTUM
:
7907 CALL_Frustum(ctx
->Exec
,
7908 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7911 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7913 case OPCODE_HISTOGRAM
:
7914 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7916 case OPCODE_INDEX_MASK
:
7917 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7919 case OPCODE_INIT_NAMES
:
7920 CALL_InitNames(ctx
->Exec
, ());
7929 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7932 case OPCODE_LIGHT_MODEL
:
7939 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7942 case OPCODE_LINE_STIPPLE
:
7943 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7945 case OPCODE_LINE_WIDTH
:
7946 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7948 case OPCODE_LIST_BASE
:
7949 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7951 case OPCODE_LOAD_IDENTITY
:
7952 CALL_LoadIdentity(ctx
->Exec
, ());
7954 case OPCODE_LOAD_MATRIX
:
7955 if (sizeof(Node
) == sizeof(GLfloat
)) {
7956 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7961 for (i
= 0; i
< 16; i
++) {
7964 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7967 case OPCODE_LOAD_NAME
:
7968 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7970 case OPCODE_LOGIC_OP
:
7971 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7975 GLenum target
= n
[1].e
;
7976 GLint ustride
= _mesa_evaluator_components(target
);
7977 GLint uorder
= n
[5].i
;
7978 GLfloat u1
= n
[2].f
;
7979 GLfloat u2
= n
[3].f
;
7980 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7981 (GLfloat
*) n
[6].data
));
7986 GLenum target
= n
[1].e
;
7987 GLfloat u1
= n
[2].f
;
7988 GLfloat u2
= n
[3].f
;
7989 GLfloat v1
= n
[4].f
;
7990 GLfloat v2
= n
[5].f
;
7991 GLint ustride
= n
[6].i
;
7992 GLint vstride
= n
[7].i
;
7993 GLint uorder
= n
[8].i
;
7994 GLint vorder
= n
[9].i
;
7995 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7996 v1
, v2
, vstride
, vorder
,
7997 (GLfloat
*) n
[10].data
));
8000 case OPCODE_MAPGRID1
:
8001 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8003 case OPCODE_MAPGRID2
:
8004 CALL_MapGrid2f(ctx
->Exec
,
8005 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8007 case OPCODE_MATRIX_MODE
:
8008 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8010 case OPCODE_MIN_MAX
:
8011 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
8013 case OPCODE_MULT_MATRIX
:
8014 if (sizeof(Node
) == sizeof(GLfloat
)) {
8015 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8020 for (i
= 0; i
< 16; i
++) {
8023 CALL_MultMatrixf(ctx
->Exec
, (m
));
8027 CALL_Ortho(ctx
->Exec
,
8028 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8030 case OPCODE_PASSTHROUGH
:
8031 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8033 case OPCODE_PIXEL_MAP
:
8034 CALL_PixelMapfv(ctx
->Exec
,
8035 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
8037 case OPCODE_PIXEL_TRANSFER
:
8038 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8040 case OPCODE_PIXEL_ZOOM
:
8041 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8043 case OPCODE_POINT_SIZE
:
8044 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8046 case OPCODE_POINT_PARAMETERS
:
8052 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
8055 case OPCODE_POLYGON_MODE
:
8056 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8058 case OPCODE_POLYGON_STIPPLE
:
8060 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8061 ctx
->Unpack
= ctx
->DefaultPacking
;
8062 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
8063 ctx
->Unpack
= save
; /* restore */
8066 case OPCODE_POLYGON_OFFSET
:
8067 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8069 case OPCODE_POP_ATTRIB
:
8070 CALL_PopAttrib(ctx
->Exec
, ());
8072 case OPCODE_POP_MATRIX
:
8073 CALL_PopMatrix(ctx
->Exec
, ());
8075 case OPCODE_POP_NAME
:
8076 CALL_PopName(ctx
->Exec
, ());
8078 case OPCODE_PRIORITIZE_TEXTURE
:
8079 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8081 case OPCODE_PUSH_ATTRIB
:
8082 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8084 case OPCODE_PUSH_MATRIX
:
8085 CALL_PushMatrix(ctx
->Exec
, ());
8087 case OPCODE_PUSH_NAME
:
8088 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8090 case OPCODE_RASTER_POS
:
8091 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8093 case OPCODE_READ_BUFFER
:
8094 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8096 case OPCODE_RESET_HISTOGRAM
:
8097 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
8099 case OPCODE_RESET_MIN_MAX
:
8100 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
8103 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8106 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8108 case OPCODE_SCISSOR
:
8109 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8111 case OPCODE_SHADE_MODEL
:
8112 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8114 case OPCODE_PROVOKING_VERTEX
:
8115 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8117 case OPCODE_STENCIL_FUNC
:
8118 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8120 case OPCODE_STENCIL_MASK
:
8121 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8123 case OPCODE_STENCIL_OP
:
8124 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8126 case OPCODE_STENCIL_FUNC_SEPARATE
:
8127 CALL_StencilFuncSeparate(ctx
->Exec
,
8128 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8130 case OPCODE_STENCIL_MASK_SEPARATE
:
8131 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8133 case OPCODE_STENCIL_OP_SEPARATE
:
8134 CALL_StencilOpSeparate(ctx
->Exec
,
8135 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8144 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8154 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8157 case OPCODE_TEXPARAMETER
:
8164 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8167 case OPCODE_TEX_IMAGE1D
:
8169 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8170 ctx
->Unpack
= ctx
->DefaultPacking
;
8171 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8173 n
[3].i
, /* components */
8175 n
[5].e
, /* border */
8176 n
[6].e
, /* format */
8179 ctx
->Unpack
= save
; /* restore */
8182 case OPCODE_TEX_IMAGE2D
:
8184 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8185 ctx
->Unpack
= ctx
->DefaultPacking
;
8186 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8188 n
[3].i
, /* components */
8190 n
[5].i
, /* height */
8191 n
[6].e
, /* border */
8192 n
[7].e
, /* format */
8195 ctx
->Unpack
= save
; /* restore */
8198 case OPCODE_TEX_IMAGE3D
:
8200 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8201 ctx
->Unpack
= ctx
->DefaultPacking
;
8202 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8204 n
[3].i
, /* components */
8206 n
[5].i
, /* height */
8208 n
[7].e
, /* border */
8209 n
[8].e
, /* format */
8212 ctx
->Unpack
= save
; /* restore */
8215 case OPCODE_TEX_SUB_IMAGE1D
:
8217 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8218 ctx
->Unpack
= ctx
->DefaultPacking
;
8219 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8221 n
[6].e
, n
[7].data
));
8222 ctx
->Unpack
= save
; /* restore */
8225 case OPCODE_TEX_SUB_IMAGE2D
:
8227 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8228 ctx
->Unpack
= ctx
->DefaultPacking
;
8229 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8231 n
[6].i
, n
[7].e
, n
[8].e
,
8233 ctx
->Unpack
= save
; /* restore */
8236 case OPCODE_TEX_SUB_IMAGE3D
:
8238 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8239 ctx
->Unpack
= ctx
->DefaultPacking
;
8240 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8241 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8242 n
[8].i
, n
[9].e
, n
[10].e
,
8244 ctx
->Unpack
= save
; /* restore */
8247 case OPCODE_TRANSLATE
:
8248 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8250 case OPCODE_VIEWPORT
:
8251 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8252 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8254 case OPCODE_WINDOW_POS
:
8255 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8257 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8258 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8260 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8261 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8262 n
[4].i
, n
[5].i
, n
[6].i
,
8265 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8266 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8267 n
[4].i
, n
[5].i
, n
[6].i
,
8268 n
[7].i
, n
[8].data
));
8270 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8271 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8272 n
[4].i
, n
[5].i
, n
[6].i
,
8276 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8277 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8278 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8279 n
[5].e
, n
[6].i
, n
[7].data
));
8281 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8282 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8283 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8284 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8287 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8288 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8289 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8290 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8291 n
[9].e
, n
[10].i
, n
[11].data
));
8293 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8294 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8296 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8297 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8299 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8300 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8301 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8304 #if FEATURE_NV_vertex_program
8305 case OPCODE_EXECUTE_PROGRAM_NV
:
8312 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8315 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8316 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8317 (GLuint
*) n
[2].data
));
8319 case OPCODE_LOAD_PROGRAM_NV
:
8320 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8321 (const GLubyte
*) n
[4].data
));
8323 case OPCODE_TRACK_MATRIX_NV
:
8324 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
8328 #if FEATURE_NV_fragment_program
8329 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8330 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8331 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8334 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8335 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8336 (const GLubyte
*) n
[3].
8337 data
, n
[4].f
, n
[5].f
,
8342 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8343 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8345 case OPCODE_DEPTH_BOUNDS_EXT
:
8346 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8348 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8349 case OPCODE_PROGRAM_STRING_ARB
:
8350 CALL_ProgramStringARB(ctx
->Exec
,
8351 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8354 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
8355 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8356 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8361 #if FEATURE_queryobj
8362 case OPCODE_BEGIN_QUERY_ARB
:
8363 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8365 case OPCODE_END_QUERY_ARB
:
8366 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8368 case OPCODE_QUERY_COUNTER
:
8369 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8372 case OPCODE_DRAW_BUFFERS_ARB
:
8374 GLenum buffers
[MAX_DRAW_BUFFERS
];
8375 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8376 for (i
= 0; i
< count
; i
++)
8377 buffers
[i
] = n
[2 + i
].e
;
8378 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8381 #if FEATURE_EXT_framebuffer_blit
8382 case OPCODE_BLIT_FRAMEBUFFER
:
8383 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8384 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8389 case OPCODE_USE_PROGRAM
:
8390 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8392 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8393 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8395 case OPCODE_ACTIVE_PROGRAM_EXT
:
8396 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8398 case OPCODE_UNIFORM_1F
:
8399 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8401 case OPCODE_UNIFORM_2F
:
8402 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8404 case OPCODE_UNIFORM_3F
:
8405 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8407 case OPCODE_UNIFORM_4F
:
8408 CALL_Uniform4fARB(ctx
->Exec
,
8409 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8411 case OPCODE_UNIFORM_1FV
:
8412 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8414 case OPCODE_UNIFORM_2FV
:
8415 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8417 case OPCODE_UNIFORM_3FV
:
8418 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8420 case OPCODE_UNIFORM_4FV
:
8421 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8423 case OPCODE_UNIFORM_1I
:
8424 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8426 case OPCODE_UNIFORM_2I
:
8427 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8429 case OPCODE_UNIFORM_3I
:
8430 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8432 case OPCODE_UNIFORM_4I
:
8433 CALL_Uniform4iARB(ctx
->Exec
,
8434 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8436 case OPCODE_UNIFORM_1IV
:
8437 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8439 case OPCODE_UNIFORM_2IV
:
8440 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8442 case OPCODE_UNIFORM_3IV
:
8443 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8445 case OPCODE_UNIFORM_4IV
:
8446 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8448 case OPCODE_UNIFORM_1UI
:
8449 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8451 case OPCODE_UNIFORM_2UI
:
8452 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8454 case OPCODE_UNIFORM_3UI
:
8455 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8457 case OPCODE_UNIFORM_4UI
:
8458 /*CALL_Uniform4uiARB(ctx->Exec,
8459 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8462 case OPCODE_UNIFORM_1UIV
:
8463 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8465 case OPCODE_UNIFORM_2UIV
:
8466 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8468 case OPCODE_UNIFORM_3UIV
:
8469 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8471 case OPCODE_UNIFORM_4UIV
:
8472 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8474 case OPCODE_UNIFORM_MATRIX22
:
8475 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8476 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8478 case OPCODE_UNIFORM_MATRIX33
:
8479 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8480 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8482 case OPCODE_UNIFORM_MATRIX44
:
8483 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8484 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8486 case OPCODE_UNIFORM_MATRIX23
:
8487 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8488 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8490 case OPCODE_UNIFORM_MATRIX32
:
8491 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8492 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8494 case OPCODE_UNIFORM_MATRIX24
:
8495 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8496 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8498 case OPCODE_UNIFORM_MATRIX42
:
8499 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8500 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8502 case OPCODE_UNIFORM_MATRIX34
:
8503 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8504 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8506 case OPCODE_UNIFORM_MATRIX43
:
8507 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8508 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8511 case OPCODE_CLAMP_COLOR
:
8512 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8515 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8518 GLuint i
, pname
= n
[1].ui
;
8520 for (i
= 0; i
< 4; i
++)
8521 values
[i
] = n
[1 + i
].f
;
8522 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8525 #if FEATURE_ATI_fragment_shader
8526 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8527 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8529 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8532 GLuint i
, dst
= n
[1].ui
;
8534 for (i
= 0; i
< 4; i
++)
8535 values
[i
] = n
[1 + i
].f
;
8536 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8540 case OPCODE_ATTR_1F_NV
:
8541 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8543 case OPCODE_ATTR_2F_NV
:
8544 /* Really shouldn't have to do this - the Node structure
8545 * is convenient, but it would be better to store the data
8546 * packed appropriately so that it can be sent directly
8547 * on. With x86_64 becoming common, this will start to
8550 if (sizeof(Node
) == sizeof(GLfloat
))
8551 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8553 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8555 case OPCODE_ATTR_3F_NV
:
8556 if (sizeof(Node
) == sizeof(GLfloat
))
8557 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8559 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8562 case OPCODE_ATTR_4F_NV
:
8563 if (sizeof(Node
) == sizeof(GLfloat
))
8564 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8566 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8569 case OPCODE_ATTR_1F_ARB
:
8570 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8572 case OPCODE_ATTR_2F_ARB
:
8573 /* Really shouldn't have to do this - the Node structure
8574 * is convenient, but it would be better to store the data
8575 * packed appropriately so that it can be sent directly
8576 * on. With x86_64 becoming common, this will start to
8579 if (sizeof(Node
) == sizeof(GLfloat
))
8580 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8582 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8584 case OPCODE_ATTR_3F_ARB
:
8585 if (sizeof(Node
) == sizeof(GLfloat
))
8586 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8588 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8591 case OPCODE_ATTR_4F_ARB
:
8592 if (sizeof(Node
) == sizeof(GLfloat
))
8593 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8595 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8598 case OPCODE_MATERIAL
:
8599 if (sizeof(Node
) == sizeof(GLfloat
))
8600 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8607 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8611 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8614 CALL_End(ctx
->Exec
, ());
8617 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8619 case OPCODE_EVAL_C1
:
8620 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8622 case OPCODE_EVAL_C2
:
8623 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8625 case OPCODE_EVAL_P1
:
8626 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8628 case OPCODE_EVAL_P2
:
8629 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8632 /* GL_EXT_texture_integer */
8633 case OPCODE_CLEARCOLOR_I
:
8634 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8636 case OPCODE_CLEARCOLOR_UI
:
8637 CALL_ClearColorIuiEXT(ctx
->Exec
,
8638 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8640 case OPCODE_TEXPARAMETER_I
:
8647 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8650 case OPCODE_TEXPARAMETER_UI
:
8653 params
[0] = n
[3].ui
;
8654 params
[1] = n
[4].ui
;
8655 params
[2] = n
[5].ui
;
8656 params
[3] = n
[6].ui
;
8657 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8661 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8662 /* GL_ARB_instanced_arrays */
8663 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8666 case OPCODE_TEXTURE_BARRIER_NV
:
8667 CALL_TextureBarrierNV(ctx
->Exec
, ());
8670 /* GL_EXT/ARB_transform_feedback */
8671 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8672 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8674 case OPCODE_END_TRANSFORM_FEEDBACK
:
8675 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8677 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8678 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8680 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8681 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8683 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8684 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8686 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8687 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8691 case OPCODE_BIND_SAMPLER
:
8692 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8694 case OPCODE_SAMPLER_PARAMETERIV
:
8701 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8704 case OPCODE_SAMPLER_PARAMETERFV
:
8711 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8714 case OPCODE_SAMPLER_PARAMETERIIV
:
8721 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8724 case OPCODE_SAMPLER_PARAMETERUIV
:
8727 params
[0] = n
[3].ui
;
8728 params
[1] = n
[4].ui
;
8729 params
[2] = n
[5].ui
;
8730 params
[3] = n
[6].ui
;
8731 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8735 /* GL_ARB_geometry_shader4 */
8736 case OPCODE_PROGRAM_PARAMETERI
:
8737 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8739 case OPCODE_FRAMEBUFFER_TEXTURE
:
8740 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8743 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8744 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8745 n
[3].ui
, n
[4].i
, n
[5].e
));
8749 case OPCODE_WAIT_SYNC
:
8751 union uint64_pair p
;
8752 p
.uint32
[0] = n
[3].ui
;
8753 p
.uint32
[1] = n
[4].ui
;
8754 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8758 /* GL_NV_conditional_render */
8759 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8760 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8762 case OPCODE_END_CONDITIONAL_RENDER
:
8763 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8766 case OPCODE_CONTINUE
:
8767 n
= (Node
*) n
[1].next
;
8769 case OPCODE_END_OF_LIST
:
8775 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8777 _mesa_problem(ctx
, "%s", msg
);
8782 /* increment n to point to next compiled command */
8783 if (opcode
!= OPCODE_CONTINUE
) {
8784 n
+= InstSize
[opcode
];
8789 if (ctx
->Driver
.EndCallList
)
8790 ctx
->Driver
.EndCallList(ctx
);
8792 ctx
->ListState
.CallDepth
--;
8797 /**********************************************************************/
8799 /**********************************************************************/
8802 * Test if a display list number is valid.
8804 static GLboolean GLAPIENTRY
8805 _mesa_IsList(GLuint list
)
8807 GET_CURRENT_CONTEXT(ctx
);
8808 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8809 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8810 return islist(ctx
, list
);
8815 * Delete a sequence of consecutive display lists.
8817 static void GLAPIENTRY
8818 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8820 GET_CURRENT_CONTEXT(ctx
);
8822 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8823 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8826 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8829 for (i
= list
; i
< list
+ range
; i
++) {
8830 destroy_list(ctx
, i
);
8836 * Return a display list number, n, such that lists n through n+range-1
8839 static GLuint GLAPIENTRY
8840 _mesa_GenLists(GLsizei range
)
8842 GET_CURRENT_CONTEXT(ctx
);
8844 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8845 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8848 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8856 * Make this an atomic operation
8858 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8860 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8862 /* reserve the list IDs by with empty/dummy lists */
8864 for (i
= 0; i
< range
; i
++) {
8865 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8866 make_list(base
+ i
, 1));
8870 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8877 * Begin a new display list.
8879 static void GLAPIENTRY
8880 _mesa_NewList(GLuint name
, GLenum mode
)
8882 GET_CURRENT_CONTEXT(ctx
);
8884 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8885 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8887 if (MESA_VERBOSE
& VERBOSE_API
)
8888 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8889 _mesa_lookup_enum_by_nr(mode
));
8892 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8896 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8897 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8901 if (ctx
->ListState
.CurrentList
) {
8902 /* already compiling a display list */
8903 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8907 ctx
->CompileFlag
= GL_TRUE
;
8908 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8910 /* Reset acumulated list state:
8912 invalidate_saved_current_state( ctx
);
8914 /* Allocate new display list */
8915 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8916 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8917 ctx
->ListState
.CurrentPos
= 0;
8919 ctx
->Driver
.NewList(ctx
, name
, mode
);
8921 ctx
->CurrentDispatch
= ctx
->Save
;
8922 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8927 * End definition of current display list.
8929 static void GLAPIENTRY
8932 GET_CURRENT_CONTEXT(ctx
);
8933 SAVE_FLUSH_VERTICES(ctx
);
8934 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8936 if (MESA_VERBOSE
& VERBOSE_API
)
8937 _mesa_debug(ctx
, "glEndList\n");
8939 /* Check that a list is under construction */
8940 if (!ctx
->ListState
.CurrentList
) {
8941 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8945 /* Call before emitting END_OF_LIST, in case the driver wants to
8946 * emit opcodes itself.
8948 ctx
->Driver
.EndList(ctx
);
8950 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8952 /* Destroy old list, if any */
8953 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8955 /* Install the new list */
8956 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8957 ctx
->ListState
.CurrentList
->Name
,
8958 ctx
->ListState
.CurrentList
);
8961 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8962 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8964 ctx
->ListState
.CurrentList
= NULL
;
8965 ctx
->ExecuteFlag
= GL_TRUE
;
8966 ctx
->CompileFlag
= GL_FALSE
;
8968 ctx
->CurrentDispatch
= ctx
->Exec
;
8969 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8974 _mesa_CallList(GLuint list
)
8976 GLboolean save_compile_flag
;
8977 GET_CURRENT_CONTEXT(ctx
);
8978 FLUSH_CURRENT(ctx
, 0);
8980 if (MESA_VERBOSE
& VERBOSE_API
)
8981 _mesa_debug(ctx
, "glCallList %d\n", list
);
8984 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8989 mesa_print_display_list( list
);
8991 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
8992 * execute the display list, and restore the CompileFlag.
8994 save_compile_flag
= ctx
->CompileFlag
;
8995 if (save_compile_flag
) {
8996 ctx
->CompileFlag
= GL_FALSE
;
8999 execute_list(ctx
, list
);
9000 ctx
->CompileFlag
= save_compile_flag
;
9002 /* also restore API function pointers to point to "save" versions */
9003 if (save_compile_flag
) {
9004 ctx
->CurrentDispatch
= ctx
->Save
;
9005 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9011 * Execute glCallLists: call multiple display lists.
9014 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9016 GET_CURRENT_CONTEXT(ctx
);
9018 GLboolean save_compile_flag
;
9020 if (MESA_VERBOSE
& VERBOSE_API
)
9021 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9025 case GL_UNSIGNED_BYTE
:
9027 case GL_UNSIGNED_SHORT
:
9029 case GL_UNSIGNED_INT
:
9037 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9041 /* Save the CompileFlag status, turn it off, execute display list,
9042 * and restore the CompileFlag.
9044 save_compile_flag
= ctx
->CompileFlag
;
9045 ctx
->CompileFlag
= GL_FALSE
;
9047 for (i
= 0; i
< n
; i
++) {
9048 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9049 execute_list(ctx
, list
);
9052 ctx
->CompileFlag
= save_compile_flag
;
9054 /* also restore API function pointers to point to "save" versions */
9055 if (save_compile_flag
) {
9056 ctx
->CurrentDispatch
= ctx
->Save
;
9057 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9063 * Set the offset added to list numbers in glCallLists.
9065 static void GLAPIENTRY
9066 _mesa_ListBase(GLuint base
)
9068 GET_CURRENT_CONTEXT(ctx
);
9069 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9070 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9071 ctx
->List
.ListBase
= base
;
9075 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
9077 static void GLAPIENTRY
9080 GET_CURRENT_CONTEXT(ctx
);
9081 FLUSH_VERTICES(ctx
, 0);
9082 CALL_Finish(ctx
->Exec
, ());
9085 static void GLAPIENTRY
9088 GET_CURRENT_CONTEXT(ctx
);
9089 FLUSH_VERTICES(ctx
, 0);
9090 CALL_Flush(ctx
->Exec
, ());
9093 static void GLAPIENTRY
9094 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
9096 GET_CURRENT_CONTEXT(ctx
);
9097 FLUSH_VERTICES(ctx
, 0);
9098 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
9101 static void GLAPIENTRY
9102 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
9104 GET_CURRENT_CONTEXT(ctx
);
9105 FLUSH_VERTICES(ctx
, 0);
9106 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
9109 static void GLAPIENTRY
9110 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
9112 GET_CURRENT_CONTEXT(ctx
);
9113 FLUSH_VERTICES(ctx
, 0);
9114 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
9117 static GLenum GLAPIENTRY
9120 GET_CURRENT_CONTEXT(ctx
);
9121 FLUSH_VERTICES(ctx
, 0);
9122 return CALL_GetError(ctx
->Exec
, ());
9125 static void GLAPIENTRY
9126 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9128 GET_CURRENT_CONTEXT(ctx
);
9129 FLUSH_VERTICES(ctx
, 0);
9130 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9133 static void GLAPIENTRY
9134 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9136 GET_CURRENT_CONTEXT(ctx
);
9137 FLUSH_VERTICES(ctx
, 0);
9138 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9141 static void GLAPIENTRY
9142 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9144 GET_CURRENT_CONTEXT(ctx
);
9145 FLUSH_VERTICES(ctx
, 0);
9146 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9149 static void GLAPIENTRY
9150 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9152 GET_CURRENT_CONTEXT(ctx
);
9153 FLUSH_VERTICES(ctx
, 0);
9154 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9157 static void GLAPIENTRY
9158 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9160 GET_CURRENT_CONTEXT(ctx
);
9161 FLUSH_VERTICES(ctx
, 0);
9162 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9165 static void GLAPIENTRY
9166 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9168 GET_CURRENT_CONTEXT(ctx
);
9169 FLUSH_VERTICES(ctx
, 0);
9170 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9173 static void GLAPIENTRY
9174 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9176 GET_CURRENT_CONTEXT(ctx
);
9177 FLUSH_VERTICES(ctx
, 0);
9178 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9181 static void GLAPIENTRY
9182 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9184 GET_CURRENT_CONTEXT(ctx
);
9185 FLUSH_VERTICES(ctx
, 0);
9186 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9189 static void GLAPIENTRY
9190 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9192 GET_CURRENT_CONTEXT(ctx
);
9193 FLUSH_VERTICES(ctx
, 0);
9194 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9197 static void GLAPIENTRY
9198 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9200 GET_CURRENT_CONTEXT(ctx
);
9201 FLUSH_VERTICES(ctx
, 0);
9202 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9205 static void GLAPIENTRY
9206 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9208 GET_CURRENT_CONTEXT(ctx
);
9209 FLUSH_VERTICES(ctx
, 0);
9210 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9213 static void GLAPIENTRY
9214 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9216 GET_CURRENT_CONTEXT(ctx
);
9217 FLUSH_VERTICES(ctx
, 0);
9218 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9221 static void GLAPIENTRY
9222 exec_GetPolygonStipple(GLubyte
* dest
)
9224 GET_CURRENT_CONTEXT(ctx
);
9225 FLUSH_VERTICES(ctx
, 0);
9226 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9229 static const GLubyte
*GLAPIENTRY
9230 exec_GetString(GLenum name
)
9232 GET_CURRENT_CONTEXT(ctx
);
9233 FLUSH_VERTICES(ctx
, 0);
9234 return CALL_GetString(ctx
->Exec
, (name
));
9237 static void GLAPIENTRY
9238 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9240 GET_CURRENT_CONTEXT(ctx
);
9241 FLUSH_VERTICES(ctx
, 0);
9242 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9245 static void GLAPIENTRY
9246 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9248 GET_CURRENT_CONTEXT(ctx
);
9249 FLUSH_VERTICES(ctx
, 0);
9250 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9253 static void GLAPIENTRY
9254 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9256 GET_CURRENT_CONTEXT(ctx
);
9257 FLUSH_VERTICES(ctx
, 0);
9258 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9261 static void GLAPIENTRY
9262 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9264 GET_CURRENT_CONTEXT(ctx
);
9265 FLUSH_VERTICES(ctx
, 0);
9266 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9269 static void GLAPIENTRY
9270 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9272 GET_CURRENT_CONTEXT(ctx
);
9273 FLUSH_VERTICES(ctx
, 0);
9274 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9277 static void GLAPIENTRY
9278 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9279 GLenum type
, GLvoid
* pixels
)
9281 GET_CURRENT_CONTEXT(ctx
);
9282 FLUSH_VERTICES(ctx
, 0);
9283 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9286 static void GLAPIENTRY
9287 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9288 GLenum pname
, GLfloat
*params
)
9290 GET_CURRENT_CONTEXT(ctx
);
9291 FLUSH_VERTICES(ctx
, 0);
9292 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9295 static void GLAPIENTRY
9296 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9297 GLenum pname
, GLint
*params
)
9299 GET_CURRENT_CONTEXT(ctx
);
9300 FLUSH_VERTICES(ctx
, 0);
9301 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9304 static void GLAPIENTRY
9305 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9307 GET_CURRENT_CONTEXT(ctx
);
9308 FLUSH_VERTICES(ctx
, 0);
9309 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9312 static void GLAPIENTRY
9313 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9315 GET_CURRENT_CONTEXT(ctx
);
9316 FLUSH_VERTICES(ctx
, 0);
9317 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9320 static GLboolean GLAPIENTRY
9321 exec_IsEnabled(GLenum cap
)
9323 GET_CURRENT_CONTEXT(ctx
);
9324 FLUSH_VERTICES(ctx
, 0);
9325 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9328 static void GLAPIENTRY
9329 exec_PixelStoref(GLenum pname
, GLfloat param
)
9331 GET_CURRENT_CONTEXT(ctx
);
9332 FLUSH_VERTICES(ctx
, 0);
9333 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9336 static void GLAPIENTRY
9337 exec_PixelStorei(GLenum pname
, GLint param
)
9339 GET_CURRENT_CONTEXT(ctx
);
9340 FLUSH_VERTICES(ctx
, 0);
9341 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9344 static void GLAPIENTRY
9345 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9346 GLenum format
, GLenum type
, GLvoid
* pixels
)
9348 GET_CURRENT_CONTEXT(ctx
);
9349 FLUSH_VERTICES(ctx
, 0);
9350 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9353 static GLint GLAPIENTRY
9354 exec_RenderMode(GLenum mode
)
9356 GET_CURRENT_CONTEXT(ctx
);
9357 FLUSH_VERTICES(ctx
, 0);
9358 return CALL_RenderMode(ctx
->Exec
, (mode
));
9361 static void GLAPIENTRY
9362 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9364 GET_CURRENT_CONTEXT(ctx
);
9365 FLUSH_VERTICES(ctx
, 0);
9366 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9369 static void GLAPIENTRY
9370 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9372 GET_CURRENT_CONTEXT(ctx
);
9373 FLUSH_VERTICES(ctx
, 0);
9374 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9377 static GLboolean GLAPIENTRY
9378 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9379 GLboolean
* residences
)
9381 GET_CURRENT_CONTEXT(ctx
);
9382 FLUSH_VERTICES(ctx
, 0);
9383 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9386 static void GLAPIENTRY
9387 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9389 GET_CURRENT_CONTEXT(ctx
);
9390 FLUSH_VERTICES(ctx
, 0);
9391 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9394 static void GLAPIENTRY
9395 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9397 GET_CURRENT_CONTEXT(ctx
);
9398 FLUSH_VERTICES(ctx
, 0);
9399 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9402 static void GLAPIENTRY
9403 exec_DisableClientState(GLenum cap
)
9405 GET_CURRENT_CONTEXT(ctx
);
9406 FLUSH_VERTICES(ctx
, 0);
9407 CALL_DisableClientState(ctx
->Exec
, (cap
));
9410 static void GLAPIENTRY
9411 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9413 GET_CURRENT_CONTEXT(ctx
);
9414 FLUSH_VERTICES(ctx
, 0);
9415 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9418 static void GLAPIENTRY
9419 exec_EnableClientState(GLenum cap
)
9421 GET_CURRENT_CONTEXT(ctx
);
9422 FLUSH_VERTICES(ctx
, 0);
9423 CALL_EnableClientState(ctx
->Exec
, (cap
));
9426 static void GLAPIENTRY
9427 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9429 GET_CURRENT_CONTEXT(ctx
);
9430 FLUSH_VERTICES(ctx
, 0);
9431 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9434 static void GLAPIENTRY
9435 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9437 GET_CURRENT_CONTEXT(ctx
);
9438 FLUSH_VERTICES(ctx
, 0);
9439 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9442 static void GLAPIENTRY
9443 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9445 GET_CURRENT_CONTEXT(ctx
);
9446 FLUSH_VERTICES(ctx
, 0);
9447 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9450 static void GLAPIENTRY
9451 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9453 GET_CURRENT_CONTEXT(ctx
);
9454 FLUSH_VERTICES(ctx
, 0);
9455 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9458 static GLboolean GLAPIENTRY
9459 exec_IsTexture(GLuint texture
)
9461 GET_CURRENT_CONTEXT(ctx
);
9462 FLUSH_VERTICES(ctx
, 0);
9463 return CALL_IsTexture(ctx
->Exec
, (texture
));
9466 static void GLAPIENTRY
9467 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9469 GET_CURRENT_CONTEXT(ctx
);
9470 FLUSH_VERTICES(ctx
, 0);
9471 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9474 static void GLAPIENTRY
9475 exec_PopClientAttrib(void)
9477 GET_CURRENT_CONTEXT(ctx
);
9478 FLUSH_VERTICES(ctx
, 0);
9479 CALL_PopClientAttrib(ctx
->Exec
, ());
9482 static void GLAPIENTRY
9483 exec_PushClientAttrib(GLbitfield mask
)
9485 GET_CURRENT_CONTEXT(ctx
);
9486 FLUSH_VERTICES(ctx
, 0);
9487 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9490 static void GLAPIENTRY
9491 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9494 GET_CURRENT_CONTEXT(ctx
);
9495 FLUSH_VERTICES(ctx
, 0);
9496 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9499 static void GLAPIENTRY
9500 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9502 GET_CURRENT_CONTEXT(ctx
);
9503 FLUSH_VERTICES(ctx
, 0);
9504 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9507 static void GLAPIENTRY
9508 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9511 GET_CURRENT_CONTEXT(ctx
);
9512 FLUSH_VERTICES(ctx
, 0);
9513 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9516 static void GLAPIENTRY
9517 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9518 GLint x
, GLint y
, GLsizei width
)
9520 GET_CURRENT_CONTEXT(ctx
);
9521 FLUSH_VERTICES(ctx
, 0);
9522 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9523 (target
, internalFormat
, x
, y
, width
));
9526 static void GLAPIENTRY
9527 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9528 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9530 GET_CURRENT_CONTEXT(ctx
);
9531 FLUSH_VERTICES(ctx
, 0);
9532 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9533 (target
, internalFormat
, x
, y
, width
,
9537 static void GLAPIENTRY
9538 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9540 GET_CURRENT_CONTEXT(ctx
);
9541 FLUSH_VERTICES(ctx
, 0);
9542 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9545 static void GLAPIENTRY
9546 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9548 GET_CURRENT_CONTEXT(ctx
);
9549 FLUSH_VERTICES(ctx
, 0);
9550 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9553 static void GLAPIENTRY
9554 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9556 GET_CURRENT_CONTEXT(ctx
);
9557 FLUSH_VERTICES(ctx
, 0);
9558 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9561 static void GLAPIENTRY
9562 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9565 GET_CURRENT_CONTEXT(ctx
);
9566 FLUSH_VERTICES(ctx
, 0);
9567 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9570 static void GLAPIENTRY
9571 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9573 GET_CURRENT_CONTEXT(ctx
);
9574 FLUSH_VERTICES(ctx
, 0);
9575 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9578 static void GLAPIENTRY
9579 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9581 GET_CURRENT_CONTEXT(ctx
);
9582 FLUSH_VERTICES(ctx
, 0);
9583 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9586 static void GLAPIENTRY
9587 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9588 GLenum type
, GLvoid
*values
)
9590 GET_CURRENT_CONTEXT(ctx
);
9591 FLUSH_VERTICES(ctx
, 0);
9592 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9595 static void GLAPIENTRY
9596 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9598 GET_CURRENT_CONTEXT(ctx
);
9599 FLUSH_VERTICES(ctx
, 0);
9600 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9603 static void GLAPIENTRY
9604 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9606 GET_CURRENT_CONTEXT(ctx
);
9607 FLUSH_VERTICES(ctx
, 0);
9608 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9611 static void GLAPIENTRY
9612 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9613 GLenum type
, GLvoid
*values
)
9615 GET_CURRENT_CONTEXT(ctx
);
9616 FLUSH_VERTICES(ctx
, 0);
9617 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9620 static void GLAPIENTRY
9621 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9623 GET_CURRENT_CONTEXT(ctx
);
9624 FLUSH_VERTICES(ctx
, 0);
9625 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9628 static void GLAPIENTRY
9629 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9631 GET_CURRENT_CONTEXT(ctx
);
9632 FLUSH_VERTICES(ctx
, 0);
9633 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9636 static void GLAPIENTRY
9637 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9638 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9640 GET_CURRENT_CONTEXT(ctx
);
9641 FLUSH_VERTICES(ctx
, 0);
9642 CALL_GetSeparableFilter(ctx
->Exec
,
9643 (target
, format
, type
, row
, column
, span
));
9646 static void GLAPIENTRY
9647 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9648 GLsizei width
, GLsizei height
, GLenum format
,
9649 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9651 GET_CURRENT_CONTEXT(ctx
);
9652 FLUSH_VERTICES(ctx
, 0);
9653 CALL_SeparableFilter2D(ctx
->Exec
,
9654 (target
, internalFormat
, width
, height
, format
,
9655 type
, row
, column
));
9658 static void GLAPIENTRY
9659 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9660 GLsizei count
, const GLvoid
*ptr
)
9662 GET_CURRENT_CONTEXT(ctx
);
9663 FLUSH_VERTICES(ctx
, 0);
9664 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9667 static void GLAPIENTRY
9668 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9670 GET_CURRENT_CONTEXT(ctx
);
9671 FLUSH_VERTICES(ctx
, 0);
9672 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9675 static void GLAPIENTRY
9676 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9679 GET_CURRENT_CONTEXT(ctx
);
9680 FLUSH_VERTICES(ctx
, 0);
9681 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9684 static void GLAPIENTRY
9685 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9688 GET_CURRENT_CONTEXT(ctx
);
9689 FLUSH_VERTICES(ctx
, 0);
9690 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9693 static void GLAPIENTRY
9694 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9695 GLsizei count
, const GLvoid
*ptr
)
9697 GET_CURRENT_CONTEXT(ctx
);
9698 FLUSH_VERTICES(ctx
, 0);
9699 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9702 static void GLAPIENTRY
9703 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9704 GLsizei count
, const GLvoid
*ptr
)
9706 GET_CURRENT_CONTEXT(ctx
);
9707 FLUSH_VERTICES(ctx
, 0);
9708 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9711 static void GLAPIENTRY
9712 exec_LockArraysEXT(GLint first
, GLsizei count
)
9714 GET_CURRENT_CONTEXT(ctx
);
9715 FLUSH_VERTICES(ctx
, 0);
9716 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9719 static void GLAPIENTRY
9720 exec_UnlockArraysEXT(void)
9722 GET_CURRENT_CONTEXT(ctx
);
9723 FLUSH_VERTICES(ctx
, 0);
9724 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9727 static void GLAPIENTRY
9728 exec_ClientActiveTextureARB(GLenum target
)
9730 GET_CURRENT_CONTEXT(ctx
);
9731 FLUSH_VERTICES(ctx
, 0);
9732 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9735 static void GLAPIENTRY
9736 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9737 GLsizei stride
, const GLvoid
*ptr
)
9739 GET_CURRENT_CONTEXT(ctx
);
9740 FLUSH_VERTICES(ctx
, 0);
9741 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9744 static void GLAPIENTRY
9745 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9747 GET_CURRENT_CONTEXT(ctx
);
9748 FLUSH_VERTICES(ctx
, 0);
9749 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9752 /* GL_EXT_multi_draw_arrays */
9753 static void GLAPIENTRY
9754 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9755 const GLsizei
*count
, GLsizei primcount
)
9757 GET_CURRENT_CONTEXT(ctx
);
9758 FLUSH_VERTICES(ctx
, 0);
9759 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9762 /* GL_IBM_multimode_draw_arrays */
9763 static void GLAPIENTRY
9764 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9765 const GLsizei
* count
, GLsizei primcount
,
9768 GET_CURRENT_CONTEXT(ctx
);
9769 FLUSH_VERTICES(ctx
, 0);
9770 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9771 (mode
, first
, count
, primcount
, modestride
));
9774 /* GL_IBM_multimode_draw_arrays */
9775 static void GLAPIENTRY
9776 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9777 const GLsizei
* count
,
9779 const GLvoid
* const *indices
,
9780 GLsizei primcount
, GLint modestride
)
9782 GET_CURRENT_CONTEXT(ctx
);
9783 FLUSH_VERTICES(ctx
, 0);
9784 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9785 (mode
, count
, type
, indices
, primcount
,
9790 * Setup the given dispatch table to point to Mesa's display list
9791 * building functions.
9793 * This does not include any of the tnl functions - they are
9794 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9797 struct _glapi_table
*
9798 _mesa_create_save_table(void)
9800 struct _glapi_table
*table
;
9802 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9806 _mesa_loopback_init_api_table(table
);
9809 SET_Accum(table
, save_Accum
);
9810 SET_AlphaFunc(table
, save_AlphaFunc
);
9811 SET_Bitmap(table
, save_Bitmap
);
9812 SET_BlendFunc(table
, save_BlendFunc
);
9813 SET_CallList(table
, save_CallList
);
9814 SET_CallLists(table
, save_CallLists
);
9815 SET_Clear(table
, save_Clear
);
9816 SET_ClearAccum(table
, save_ClearAccum
);
9817 SET_ClearColor(table
, save_ClearColor
);
9818 SET_ClearDepth(table
, save_ClearDepth
);
9819 SET_ClearIndex(table
, save_ClearIndex
);
9820 SET_ClearStencil(table
, save_ClearStencil
);
9821 SET_ClipPlane(table
, save_ClipPlane
);
9822 SET_ColorMask(table
, save_ColorMask
);
9823 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9824 SET_ColorMaterial(table
, save_ColorMaterial
);
9825 SET_CopyPixels(table
, save_CopyPixels
);
9826 SET_CullFace(table
, save_CullFace
);
9827 SET_DeleteLists(table
, _mesa_DeleteLists
);
9828 SET_DepthFunc(table
, save_DepthFunc
);
9829 SET_DepthMask(table
, save_DepthMask
);
9830 SET_DepthRange(table
, save_DepthRange
);
9831 SET_Disable(table
, save_Disable
);
9832 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9833 SET_DrawBuffer(table
, save_DrawBuffer
);
9834 SET_DrawPixels(table
, save_DrawPixels
);
9835 SET_Enable(table
, save_Enable
);
9836 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9837 SET_EndList(table
, _mesa_EndList
);
9838 SET_EvalMesh1(table
, save_EvalMesh1
);
9839 SET_EvalMesh2(table
, save_EvalMesh2
);
9840 SET_Finish(table
, exec_Finish
);
9841 SET_Flush(table
, exec_Flush
);
9842 SET_Fogf(table
, save_Fogf
);
9843 SET_Fogfv(table
, save_Fogfv
);
9844 SET_Fogi(table
, save_Fogi
);
9845 SET_Fogiv(table
, save_Fogiv
);
9846 SET_FrontFace(table
, save_FrontFace
);
9847 SET_Frustum(table
, save_Frustum
);
9848 SET_GenLists(table
, _mesa_GenLists
);
9849 SET_GetBooleanv(table
, exec_GetBooleanv
);
9850 SET_GetClipPlane(table
, exec_GetClipPlane
);
9851 SET_GetDoublev(table
, exec_GetDoublev
);
9852 SET_GetError(table
, exec_GetError
);
9853 SET_GetFloatv(table
, exec_GetFloatv
);
9854 SET_GetIntegerv(table
, exec_GetIntegerv
);
9855 SET_GetLightfv(table
, exec_GetLightfv
);
9856 SET_GetLightiv(table
, exec_GetLightiv
);
9857 SET_GetMapdv(table
, exec_GetMapdv
);
9858 SET_GetMapfv(table
, exec_GetMapfv
);
9859 SET_GetMapiv(table
, exec_GetMapiv
);
9860 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9861 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9862 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9863 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9864 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9865 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9866 SET_GetString(table
, exec_GetString
);
9867 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9868 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9869 SET_GetTexGendv(table
, exec_GetTexGendv
);
9870 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9871 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9872 SET_GetTexImage(table
, exec_GetTexImage
);
9873 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9874 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9875 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9876 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9877 SET_Hint(table
, save_Hint
);
9878 SET_IndexMask(table
, save_IndexMask
);
9879 SET_InitNames(table
, save_InitNames
);
9880 SET_IsEnabled(table
, exec_IsEnabled
);
9881 SET_IsList(table
, _mesa_IsList
);
9882 SET_LightModelf(table
, save_LightModelf
);
9883 SET_LightModelfv(table
, save_LightModelfv
);
9884 SET_LightModeli(table
, save_LightModeli
);
9885 SET_LightModeliv(table
, save_LightModeliv
);
9886 SET_Lightf(table
, save_Lightf
);
9887 SET_Lightfv(table
, save_Lightfv
);
9888 SET_Lighti(table
, save_Lighti
);
9889 SET_Lightiv(table
, save_Lightiv
);
9890 SET_LineStipple(table
, save_LineStipple
);
9891 SET_LineWidth(table
, save_LineWidth
);
9892 SET_ListBase(table
, save_ListBase
);
9893 SET_LoadIdentity(table
, save_LoadIdentity
);
9894 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9895 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9896 SET_LoadName(table
, save_LoadName
);
9897 SET_LogicOp(table
, save_LogicOp
);
9898 SET_Map1d(table
, save_Map1d
);
9899 SET_Map1f(table
, save_Map1f
);
9900 SET_Map2d(table
, save_Map2d
);
9901 SET_Map2f(table
, save_Map2f
);
9902 SET_MapGrid1d(table
, save_MapGrid1d
);
9903 SET_MapGrid1f(table
, save_MapGrid1f
);
9904 SET_MapGrid2d(table
, save_MapGrid2d
);
9905 SET_MapGrid2f(table
, save_MapGrid2f
);
9906 SET_MatrixMode(table
, save_MatrixMode
);
9907 SET_MultMatrixd(table
, save_MultMatrixd
);
9908 SET_MultMatrixf(table
, save_MultMatrixf
);
9909 SET_NewList(table
, save_NewList
);
9910 SET_Ortho(table
, save_Ortho
);
9911 SET_PassThrough(table
, save_PassThrough
);
9912 SET_PixelMapfv(table
, save_PixelMapfv
);
9913 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9914 SET_PixelMapusv(table
, save_PixelMapusv
);
9915 SET_PixelStoref(table
, exec_PixelStoref
);
9916 SET_PixelStorei(table
, exec_PixelStorei
);
9917 SET_PixelTransferf(table
, save_PixelTransferf
);
9918 SET_PixelTransferi(table
, save_PixelTransferi
);
9919 SET_PixelZoom(table
, save_PixelZoom
);
9920 SET_PointSize(table
, save_PointSize
);
9921 SET_PolygonMode(table
, save_PolygonMode
);
9922 SET_PolygonOffset(table
, save_PolygonOffset
);
9923 SET_PolygonStipple(table
, save_PolygonStipple
);
9924 SET_PopAttrib(table
, save_PopAttrib
);
9925 SET_PopMatrix(table
, save_PopMatrix
);
9926 SET_PopName(table
, save_PopName
);
9927 SET_PushAttrib(table
, save_PushAttrib
);
9928 SET_PushMatrix(table
, save_PushMatrix
);
9929 SET_PushName(table
, save_PushName
);
9930 SET_RasterPos2d(table
, save_RasterPos2d
);
9931 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9932 SET_RasterPos2f(table
, save_RasterPos2f
);
9933 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9934 SET_RasterPos2i(table
, save_RasterPos2i
);
9935 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9936 SET_RasterPos2s(table
, save_RasterPos2s
);
9937 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9938 SET_RasterPos3d(table
, save_RasterPos3d
);
9939 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9940 SET_RasterPos3f(table
, save_RasterPos3f
);
9941 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9942 SET_RasterPos3i(table
, save_RasterPos3i
);
9943 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9944 SET_RasterPos3s(table
, save_RasterPos3s
);
9945 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9946 SET_RasterPos4d(table
, save_RasterPos4d
);
9947 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9948 SET_RasterPos4f(table
, save_RasterPos4f
);
9949 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9950 SET_RasterPos4i(table
, save_RasterPos4i
);
9951 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9952 SET_RasterPos4s(table
, save_RasterPos4s
);
9953 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9954 SET_ReadBuffer(table
, save_ReadBuffer
);
9955 SET_ReadPixels(table
, exec_ReadPixels
);
9956 SET_RenderMode(table
, exec_RenderMode
);
9957 SET_Rotated(table
, save_Rotated
);
9958 SET_Rotatef(table
, save_Rotatef
);
9959 SET_Scaled(table
, save_Scaled
);
9960 SET_Scalef(table
, save_Scalef
);
9961 SET_Scissor(table
, save_Scissor
);
9962 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9963 SET_SelectBuffer(table
, exec_SelectBuffer
);
9964 SET_ShadeModel(table
, save_ShadeModel
);
9965 SET_StencilFunc(table
, save_StencilFunc
);
9966 SET_StencilMask(table
, save_StencilMask
);
9967 SET_StencilOp(table
, save_StencilOp
);
9968 SET_TexEnvf(table
, save_TexEnvf
);
9969 SET_TexEnvfv(table
, save_TexEnvfv
);
9970 SET_TexEnvi(table
, save_TexEnvi
);
9971 SET_TexEnviv(table
, save_TexEnviv
);
9972 SET_TexGend(table
, save_TexGend
);
9973 SET_TexGendv(table
, save_TexGendv
);
9974 SET_TexGenf(table
, save_TexGenf
);
9975 SET_TexGenfv(table
, save_TexGenfv
);
9976 SET_TexGeni(table
, save_TexGeni
);
9977 SET_TexGeniv(table
, save_TexGeniv
);
9978 SET_TexImage1D(table
, save_TexImage1D
);
9979 SET_TexImage2D(table
, save_TexImage2D
);
9980 SET_TexParameterf(table
, save_TexParameterf
);
9981 SET_TexParameterfv(table
, save_TexParameterfv
);
9982 SET_TexParameteri(table
, save_TexParameteri
);
9983 SET_TexParameteriv(table
, save_TexParameteriv
);
9984 SET_Translated(table
, save_Translated
);
9985 SET_Translatef(table
, save_Translatef
);
9986 SET_Viewport(table
, save_Viewport
);
9989 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9990 SET_BindTexture(table
, save_BindTexture
);
9991 SET_ColorPointer(table
, exec_ColorPointer
);
9992 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9993 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9994 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9995 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9996 SET_DeleteTextures(table
, exec_DeleteTextures
);
9997 SET_DisableClientState(table
, exec_DisableClientState
);
9998 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9999 SET_EnableClientState(table
, exec_EnableClientState
);
10000 SET_GenTextures(table
, exec_GenTextures
);
10001 SET_GetPointerv(table
, exec_GetPointerv
);
10002 SET_IndexPointer(table
, exec_IndexPointer
);
10003 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
10004 SET_IsTexture(table
, exec_IsTexture
);
10005 SET_NormalPointer(table
, exec_NormalPointer
);
10006 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
10007 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
10008 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
10009 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
10010 SET_TexSubImage1D(table
, save_TexSubImage1D
);
10011 SET_TexSubImage2D(table
, save_TexSubImage2D
);
10012 SET_VertexPointer(table
, exec_VertexPointer
);
10015 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
10016 SET_TexImage3D(table
, save_TexImage3D
);
10017 SET_TexSubImage3D(table
, save_TexSubImage3D
);
10020 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
10021 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
10022 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
10024 /* ATI_separate_stencil */
10025 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
10027 /* GL_ARB_imaging */
10028 /* Not all are supported */
10029 SET_BlendColor(table
, save_BlendColor
);
10030 SET_BlendEquation(table
, save_BlendEquation
);
10031 SET_ColorSubTable(table
, save_ColorSubTable
);
10032 SET_ColorTable(table
, save_ColorTable
);
10033 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
10034 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
10035 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
10036 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
10037 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
10038 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
10039 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
10040 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
10041 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
10042 SET_CopyColorTable(table
, save_CopyColorTable
);
10043 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
10044 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
10045 SET_GetColorTable(table
, exec_GetColorTable
);
10046 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
10047 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
10048 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
10049 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
10050 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
10051 SET_GetHistogram(table
, exec_GetHistogram
);
10052 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
10053 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
10054 SET_GetMinmax(table
, exec_GetMinmax
);
10055 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
10056 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
10057 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
10058 SET_Histogram(table
, save_Histogram
);
10059 SET_Minmax(table
, save_Minmax
);
10060 SET_ResetHistogram(table
, save_ResetHistogram
);
10061 SET_ResetMinmax(table
, save_ResetMinmax
);
10062 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
10064 /* 2. GL_EXT_blend_color */
10066 SET_BlendColorEXT(table
, save_BlendColorEXT
);
10069 /* 3. GL_EXT_polygon_offset */
10070 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
10072 /* 6. GL_EXT_texture3d */
10074 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
10075 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
10076 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
10079 /* 14. GL_SGI_color_table */
10081 SET_ColorTableSGI(table
, save_ColorTable
);
10082 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
10083 SET_GetColorTableSGI(table
, exec_GetColorTable
);
10084 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
10085 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
10088 /* 30. GL_EXT_vertex_array */
10089 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
10090 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
10091 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
10092 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
10093 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
10094 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
10096 /* 37. GL_EXT_blend_minmax */
10098 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
10101 /* 54. GL_EXT_point_parameters */
10102 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
10103 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
10105 /* 97. GL_EXT_compiled_vertex_array */
10106 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
10107 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
10109 /* 145. GL_EXT_secondary_color */
10110 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
10112 /* 148. GL_EXT_multi_draw_arrays */
10113 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
10115 /* 149. GL_EXT_fog_coord */
10116 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10118 /* 173. GL_EXT_blend_func_separate */
10119 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10121 /* 196. GL_MESA_resize_buffers */
10122 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10124 /* 197. GL_MESA_window_pos */
10125 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10126 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10127 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10128 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10129 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10130 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10131 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10132 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10133 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10134 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10135 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10136 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10137 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10138 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10139 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10140 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10141 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10142 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10143 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10144 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10145 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10146 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10147 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10148 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10150 /* 200. GL_IBM_multimode_draw_arrays */
10151 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10152 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10154 #if FEATURE_NV_vertex_program
10155 /* 233. GL_NV_vertex_program */
10156 /* The following commands DO NOT go into display lists:
10157 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10158 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10160 SET_BindProgramNV(table
, save_BindProgramNV
);
10161 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10162 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10163 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10164 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10165 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10166 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10167 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10168 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10169 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10170 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
10171 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10172 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10173 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10174 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10175 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10176 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10177 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10178 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10179 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10180 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10181 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10182 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10183 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
10184 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10187 /* 244. GL_ATI_envmap_bumpmap */
10188 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10189 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10191 /* 245. GL_ATI_fragment_shader */
10192 #if FEATURE_ATI_fragment_shader
10193 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10194 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10197 /* 282. GL_NV_fragment_program */
10198 #if FEATURE_NV_fragment_program
10199 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10200 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10201 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10202 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10203 SET_GetProgramNamedParameterfvNV(table
,
10204 _mesa_GetProgramNamedParameterfvNV
);
10205 SET_GetProgramNamedParameterdvNV(table
,
10206 _mesa_GetProgramNamedParameterdvNV
);
10207 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10208 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10209 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10210 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10211 SET_GetProgramLocalParameterdvARB(table
,
10212 _mesa_GetProgramLocalParameterdvARB
);
10213 SET_GetProgramLocalParameterfvARB(table
,
10214 _mesa_GetProgramLocalParameterfvARB
);
10217 /* 262. GL_NV_point_sprite */
10218 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10219 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10221 /* 268. GL_EXT_stencil_two_side */
10222 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10224 /* 273. GL_APPLE_vertex_array_object */
10225 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10226 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10227 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10228 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10230 /* 310. GL_EXT_framebuffer_object */
10231 SET_GenFramebuffersEXT(table
, _mesa_GenFramebuffersEXT
);
10232 SET_BindFramebufferEXT(table
, _mesa_BindFramebufferEXT
);
10233 SET_DeleteFramebuffersEXT(table
, _mesa_DeleteFramebuffersEXT
);
10234 SET_CheckFramebufferStatusEXT(table
, _mesa_CheckFramebufferStatusEXT
);
10235 SET_GenRenderbuffersEXT(table
, _mesa_GenRenderbuffersEXT
);
10236 SET_BindRenderbufferEXT(table
, _mesa_BindRenderbufferEXT
);
10237 SET_DeleteRenderbuffersEXT(table
, _mesa_DeleteRenderbuffersEXT
);
10238 SET_RenderbufferStorageEXT(table
, _mesa_RenderbufferStorageEXT
);
10239 SET_FramebufferTexture1DEXT(table
, _mesa_FramebufferTexture1DEXT
);
10240 SET_FramebufferTexture2DEXT(table
, _mesa_FramebufferTexture2DEXT
);
10241 SET_FramebufferTexture3DEXT(table
, _mesa_FramebufferTexture3DEXT
);
10242 SET_FramebufferRenderbufferEXT(table
, _mesa_FramebufferRenderbufferEXT
);
10243 SET_GenerateMipmapEXT(table
, _mesa_GenerateMipmapEXT
);
10245 /* 317. GL_EXT_framebuffer_multisample */
10246 SET_RenderbufferStorageMultisample(table
, _mesa_RenderbufferStorageMultisample
);
10248 /* GL_ARB_vertex_array_object */
10249 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10250 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10252 /* ???. GL_EXT_depth_bounds_test */
10253 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10255 /* ARB 1. GL_ARB_multitexture */
10256 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10257 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10259 /* ARB 3. GL_ARB_transpose_matrix */
10260 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10261 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10262 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10263 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10265 /* ARB 5. GL_ARB_multisample */
10266 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10268 /* ARB 12. GL_ARB_texture_compression */
10269 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10270 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10271 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10272 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10273 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10274 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10275 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10277 /* ARB 14. GL_ARB_point_parameters */
10278 /* aliased with EXT_point_parameters functions */
10280 /* ARB 25. GL_ARB_window_pos */
10281 /* aliased with MESA_window_pos functions */
10283 /* ARB 26. GL_ARB_vertex_program */
10284 /* ARB 27. GL_ARB_fragment_program */
10285 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10286 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10287 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10288 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10289 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10290 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10291 SET_BindProgramNV(table
, save_BindProgramNV
);
10292 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10293 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10294 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10295 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10296 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10297 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10298 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10299 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10300 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10301 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10302 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10303 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10304 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10305 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10306 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10307 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10308 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10309 SET_GetProgramLocalParameterdvARB(table
,
10310 _mesa_GetProgramLocalParameterdvARB
);
10311 SET_GetProgramLocalParameterfvARB(table
,
10312 _mesa_GetProgramLocalParameterfvARB
);
10313 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10314 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10317 /* ARB 28. GL_ARB_vertex_buffer_object */
10318 /* None of the extension's functions get compiled */
10319 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10320 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10321 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10322 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10323 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10324 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10325 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10326 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10327 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10328 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10329 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10331 #if FEATURE_queryobj
10332 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10333 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10334 SET_EndQueryARB(table
, save_EndQueryARB
);
10335 SET_QueryCounter(table
, save_QueryCounter
);
10338 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10340 #if FEATURE_EXT_framebuffer_blit
10341 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10344 /* GL_ARB_shader_objects */
10345 _mesa_init_shader_dispatch(table
); /* Plug in glCreate/Delete/Get, etc */
10346 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10347 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10348 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10349 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10350 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10351 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10352 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10353 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10354 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10355 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10356 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10357 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10358 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10359 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10360 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10361 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10362 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10363 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10364 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10365 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10366 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10367 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10368 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10369 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10370 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10371 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10373 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10374 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10375 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10376 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10377 /* XXX additional functions need to be implemented here! */
10379 /* 299. GL_EXT_blend_equation_separate */
10380 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10382 /* GL_EXT_gpu_program_parameters */
10383 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10384 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10385 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10388 /* ARB 50. GL_ARB_map_buffer_range */
10389 #if FEATURE_ARB_map_buffer_range
10390 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10391 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10394 /* ARB 51. GL_ARB_texture_buffer_object */
10395 SET_TexBufferARB(table
, _mesa_TexBuffer
); /* no dlist save */
10397 /* ARB 59. GL_ARB_copy_buffer */
10398 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10400 /* 364. GL_EXT_provoking_vertex */
10401 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10403 /* 371. GL_APPLE_object_purgeable */
10404 #if FEATURE_APPLE_object_purgeable
10405 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10406 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10407 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10410 /* GL_EXT_texture_integer */
10411 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10412 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10413 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10414 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10415 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10416 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10418 /* 377. GL_EXT_separate_shader_objects */
10419 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10420 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10422 /* GL_ARB_color_buffer_float */
10423 SET_ClampColorARB(table
, save_ClampColorARB
);
10424 SET_ClampColor(table
, save_ClampColorARB
);
10427 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10428 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10429 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10430 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10432 SET_Uniform1ui(table
, save_Uniform1ui
);
10433 SET_Uniform2ui(table
, save_Uniform2ui
);
10434 SET_Uniform3ui(table
, save_Uniform3ui
);
10435 SET_Uniform4ui(table
, save_Uniform4ui
);
10436 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10437 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10438 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10439 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10441 (void) save_Uniform1ui
;
10442 (void) save_Uniform2ui
;
10443 (void) save_Uniform3ui
;
10444 (void) save_Uniform4ui
;
10445 (void) save_Uniform1uiv
;
10446 (void) save_Uniform2uiv
;
10447 (void) save_Uniform3uiv
;
10448 (void) save_Uniform4uiv
;
10451 #if FEATURE_EXT_transform_feedback
10452 /* These are not compiled into display lists: */
10453 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10454 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10455 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10456 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10458 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10459 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10460 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10461 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10462 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10463 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10466 /* GL_ARB_instanced_arrays */
10467 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10469 /* GL_NV_texture_barrier */
10470 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10472 /* GL_ARB_sampler_objects */
10473 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10474 SET_BindSampler(table
, save_BindSampler
);
10475 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10476 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10477 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10478 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10479 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10480 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10482 /* GL_ARB_draw_buffer_blend */
10483 SET_BlendFunciARB(table
, save_BlendFunci
);
10484 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10485 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10486 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10488 /* GL_ARB_geometry_shader4 */
10489 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10490 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10491 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10493 /* GL_NV_conditional_render */
10494 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10495 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10498 _mesa_init_sync_dispatch(table
);
10499 SET_WaitSync(table
, save_WaitSync
);
10501 /* GL_ARB_texture_storage (no dlist support) */
10502 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10503 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10504 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10505 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10506 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10507 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10509 /* GL_ARB_debug_output (no dlist support) */
10510 _mesa_init_errors_dispatch(table
);
10512 /* GL_NV_primitive_restart */
10513 SET_PrimitiveRestartIndexNV(table
, _mesa_PrimitiveRestartIndex
);
10520 static const char *
10521 enum_string(GLenum k
)
10523 return _mesa_lookup_enum_by_nr(k
);
10528 * Print the commands in a display list. For debugging only.
10529 * TODO: many commands aren't handled yet.
10531 static void GLAPIENTRY
10532 print_list(struct gl_context
*ctx
, GLuint list
)
10534 struct gl_display_list
*dlist
;
10538 if (!islist(ctx
, list
)) {
10539 printf("%u is not a display list ID\n", list
);
10543 dlist
= lookup_list(ctx
, list
);
10549 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10551 done
= n
? GL_FALSE
: GL_TRUE
;
10553 const OpCode opcode
= n
[0].opcode
;
10555 if (is_ext_opcode(opcode
)) {
10556 n
+= ext_opcode_print(ctx
, n
);
10561 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10563 case OPCODE_BITMAP
:
10564 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10565 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10567 case OPCODE_CALL_LIST
:
10568 printf("CallList %d\n", (int) n
[1].ui
);
10570 case OPCODE_CALL_LIST_OFFSET
:
10571 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10572 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10574 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10575 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10576 enum_string(n
[1].e
), enum_string(n
[2].e
),
10577 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10579 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10580 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10581 enum_string(n
[1].e
), enum_string(n
[2].e
),
10582 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10584 case OPCODE_DISABLE
:
10585 printf("Disable %s\n", enum_string(n
[1].e
));
10587 case OPCODE_ENABLE
:
10588 printf("Enable %s\n", enum_string(n
[1].e
));
10590 case OPCODE_FRUSTUM
:
10591 printf("Frustum %g %g %g %g %g %g\n",
10592 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10594 case OPCODE_LINE_STIPPLE
:
10595 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10597 case OPCODE_LOAD_IDENTITY
:
10598 printf("LoadIdentity\n");
10600 case OPCODE_LOAD_MATRIX
:
10601 printf("LoadMatrix\n");
10602 printf(" %8f %8f %8f %8f\n",
10603 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10604 printf(" %8f %8f %8f %8f\n",
10605 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10606 printf(" %8f %8f %8f %8f\n",
10607 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10608 printf(" %8f %8f %8f %8f\n",
10609 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10611 case OPCODE_MULT_MATRIX
:
10612 printf("MultMatrix (or Rotate)\n");
10613 printf(" %8f %8f %8f %8f\n",
10614 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10615 printf(" %8f %8f %8f %8f\n",
10616 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10617 printf(" %8f %8f %8f %8f\n",
10618 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10619 printf(" %8f %8f %8f %8f\n",
10620 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10623 printf("Ortho %g %g %g %g %g %g\n",
10624 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10626 case OPCODE_POP_ATTRIB
:
10627 printf("PopAttrib\n");
10629 case OPCODE_POP_MATRIX
:
10630 printf("PopMatrix\n");
10632 case OPCODE_POP_NAME
:
10633 printf("PopName\n");
10635 case OPCODE_PUSH_ATTRIB
:
10636 printf("PushAttrib %x\n", n
[1].bf
);
10638 case OPCODE_PUSH_MATRIX
:
10639 printf("PushMatrix\n");
10641 case OPCODE_PUSH_NAME
:
10642 printf("PushName %d\n", (int) n
[1].ui
);
10644 case OPCODE_RASTER_POS
:
10645 printf("RasterPos %g %g %g %g\n",
10646 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10648 case OPCODE_ROTATE
:
10649 printf("Rotate %g %g %g %g\n",
10650 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10653 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10655 case OPCODE_TRANSLATE
:
10656 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10658 case OPCODE_BIND_TEXTURE
:
10659 printf("BindTexture %s %d\n",
10660 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10662 case OPCODE_SHADE_MODEL
:
10663 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10666 printf("Map1 %s %.3f %.3f %d %d\n",
10667 _mesa_lookup_enum_by_nr(n
[1].ui
),
10668 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10671 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10672 _mesa_lookup_enum_by_nr(n
[1].ui
),
10673 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10674 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10676 case OPCODE_MAPGRID1
:
10677 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10679 case OPCODE_MAPGRID2
:
10680 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10681 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10683 case OPCODE_EVALMESH1
:
10684 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10686 case OPCODE_EVALMESH2
:
10687 printf("EvalMesh2 %d %d %d %d\n",
10688 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10691 case OPCODE_ATTR_1F_NV
:
10692 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10694 case OPCODE_ATTR_2F_NV
:
10695 printf("ATTR_2F_NV attr %d: %f %f\n",
10696 n
[1].i
, n
[2].f
, n
[3].f
);
10698 case OPCODE_ATTR_3F_NV
:
10699 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10700 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10702 case OPCODE_ATTR_4F_NV
:
10703 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10704 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10706 case OPCODE_ATTR_1F_ARB
:
10707 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10709 case OPCODE_ATTR_2F_ARB
:
10710 printf("ATTR_2F_ARB attr %d: %f %f\n",
10711 n
[1].i
, n
[2].f
, n
[3].f
);
10713 case OPCODE_ATTR_3F_ARB
:
10714 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10715 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10717 case OPCODE_ATTR_4F_ARB
:
10718 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10719 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10722 case OPCODE_MATERIAL
:
10723 printf("MATERIAL %x %x: %f %f %f %f\n",
10724 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10727 printf("BEGIN %x\n", n
[1].i
);
10733 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10736 case OPCODE_EVAL_C1
:
10737 printf("EVAL_C1 %f\n", n
[1].f
);
10739 case OPCODE_EVAL_C2
:
10740 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10742 case OPCODE_EVAL_P1
:
10743 printf("EVAL_P1 %d\n", n
[1].i
);
10745 case OPCODE_EVAL_P2
:
10746 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10749 case OPCODE_PROVOKING_VERTEX
:
10750 printf("ProvokingVertex %s\n",
10751 _mesa_lookup_enum_by_nr(n
[1].ui
));
10755 * meta opcodes/commands
10758 printf("Error: %s %s\n",
10759 enum_string(n
[1].e
), (const char *) n
[2].data
);
10761 case OPCODE_CONTINUE
:
10762 printf("DISPLAY-LIST-CONTINUE\n");
10763 n
= (Node
*) n
[1].next
;
10765 case OPCODE_END_OF_LIST
:
10766 printf("END-LIST %u\n", list
);
10770 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10772 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10773 opcode
, (void *) n
);
10777 printf("command %d, %u operands\n", opcode
,
10781 /* increment n to point to next compiled command */
10782 if (opcode
!= OPCODE_CONTINUE
) {
10783 n
+= InstSize
[opcode
];
10792 * Clients may call this function to help debug display list problems.
10793 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10794 * changed, or break in the future without notice.
10797 mesa_print_display_list(GLuint list
)
10799 GET_CURRENT_CONTEXT(ctx
);
10800 print_list(ctx
, list
);
10804 /**********************************************************************/
10805 /***** Initialization *****/
10806 /**********************************************************************/
10809 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10811 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10813 vfmt
->Begin
= save_Begin
;
10815 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10817 vfmt
->Color3f
= save_Color3f
;
10818 vfmt
->Color3fv
= save_Color3fv
;
10819 vfmt
->Color4f
= save_Color4f
;
10820 vfmt
->Color4fv
= save_Color4fv
;
10821 vfmt
->EdgeFlag
= save_EdgeFlag
;
10822 vfmt
->End
= save_End
;
10824 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10826 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10827 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10828 vfmt
->Indexf
= save_Indexf
;
10829 vfmt
->Indexfv
= save_Indexfv
;
10830 vfmt
->Materialfv
= save_Materialfv
;
10831 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10832 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10833 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10834 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10835 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10836 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10837 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10838 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10839 vfmt
->Normal3f
= save_Normal3f
;
10840 vfmt
->Normal3fv
= save_Normal3fv
;
10841 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10842 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10843 vfmt
->TexCoord1f
= save_TexCoord1f
;
10844 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10845 vfmt
->TexCoord2f
= save_TexCoord2f
;
10846 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10847 vfmt
->TexCoord3f
= save_TexCoord3f
;
10848 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10849 vfmt
->TexCoord4f
= save_TexCoord4f
;
10850 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10851 vfmt
->Vertex2f
= save_Vertex2f
;
10852 vfmt
->Vertex2fv
= save_Vertex2fv
;
10853 vfmt
->Vertex3f
= save_Vertex3f
;
10854 vfmt
->Vertex3fv
= save_Vertex3fv
;
10855 vfmt
->Vertex4f
= save_Vertex4f
;
10856 vfmt
->Vertex4fv
= save_Vertex4fv
;
10857 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10858 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10859 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10860 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10861 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10862 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10863 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10864 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10865 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10866 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10867 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10868 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10869 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10870 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10871 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10872 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10874 vfmt
->Rectf
= save_Rectf
;
10876 /* GL_ARB_draw_instanced */
10877 vfmt
->DrawArraysInstanced
= save_DrawArraysInstancedARB
;
10878 vfmt
->DrawElementsInstanced
= save_DrawElementsInstancedARB
;
10880 /* GL_ARB_draw_elements_base_vertex */
10881 vfmt
->DrawElementsInstancedBaseVertex
= save_DrawElementsInstancedBaseVertexARB
;
10883 /* GL_ARB_base_instance */
10884 vfmt
->DrawArraysInstancedBaseInstance
= save_DrawArraysInstancedBaseInstance
;
10885 vfmt
->DrawElementsInstancedBaseInstance
= save_DrawElementsInstancedBaseInstance
;
10886 vfmt
->DrawElementsInstancedBaseVertexBaseInstance
= save_DrawElementsInstancedBaseVertexBaseInstance
;
10888 /* The driver is required to implement these as
10889 * 1) They can probably do a better job.
10890 * 2) A lot of new mechanisms would have to be added to this module
10891 * to support it. That code would probably never get used,
10895 vfmt
->DrawArrays
= 0;
10896 vfmt
->DrawElements
= 0;
10897 vfmt
->DrawRangeElements
= 0;
10898 vfmt
->MultiDrawElemementsEXT
= 0;
10899 vfmt
->DrawElementsBaseVertex
= 0;
10900 vfmt
->DrawRangeElementsBaseVertex
= 0;
10901 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10907 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10908 const GLvertexformat
*vfmt
)
10910 SET_CallList(disp
, vfmt
->CallList
);
10911 SET_CallLists(disp
, vfmt
->CallLists
);
10915 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10917 SET_CallList(disp
, _mesa_CallList
);
10918 SET_CallLists(disp
, _mesa_CallLists
);
10920 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10921 SET_EndList(disp
, _mesa_EndList
);
10922 SET_GenLists(disp
, _mesa_GenLists
);
10923 SET_IsList(disp
, _mesa_IsList
);
10924 SET_ListBase(disp
, _mesa_ListBase
);
10925 SET_NewList(disp
, _mesa_NewList
);
10929 #endif /* FEATURE_dlist */
10933 * Initialize display list state for given context.
10936 _mesa_init_display_list(struct gl_context
*ctx
)
10938 static GLboolean tableInitialized
= GL_FALSE
;
10940 /* zero-out the instruction size table, just once */
10941 if (!tableInitialized
) {
10942 memset(InstSize
, 0, sizeof(InstSize
));
10943 tableInitialized
= GL_TRUE
;
10946 /* extension info */
10947 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10950 ctx
->ListState
.CallDepth
= 0;
10951 ctx
->ExecuteFlag
= GL_TRUE
;
10952 ctx
->CompileFlag
= GL_FALSE
;
10953 ctx
->ListState
.CurrentBlock
= NULL
;
10954 ctx
->ListState
.CurrentPos
= 0;
10956 /* Display List group */
10957 ctx
->List
.ListBase
= 0;
10960 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10966 _mesa_free_display_list_data(struct gl_context
*ctx
)
10968 free(ctx
->ListExt
);
10969 ctx
->ListExt
= NULL
;