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 /* The following three are meta instructions */
473 OPCODE_ERROR
, /* raise compiled-in error */
484 * Display list instructions are stored as sequences of "nodes". Nodes
485 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
486 * are linked together with a pointer.
488 * Each instruction in the display list is stored as a sequence of
489 * contiguous nodes in memory.
490 * Each node is the union of a variety of data types.
505 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
509 typedef union gl_dlist_node Node
;
513 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
514 * environment. In 64-bit env, sizeof(Node)==8 anyway.
524 * How many nodes to allocate at a time.
526 * \note Reduced now that we hold vertices etc. elsewhere.
528 #define BLOCK_SIZE 256
533 * Number of nodes of storage needed for each instruction.
534 * Sizes for dynamically allocated opcodes are stored in the context struct.
536 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
542 void mesa_print_display_list(GLuint list
);
545 /**********************************************************************/
546 /***** Private *****/
547 /**********************************************************************/
551 * Make an empty display list. This is used by glGenLists() to
552 * reserve display list IDs.
554 static struct gl_display_list
*
555 make_list(GLuint name
, GLuint count
)
557 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
559 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
560 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
566 * Lookup function to just encapsulate casting.
568 static inline struct gl_display_list
*
569 lookup_list(struct gl_context
*ctx
, GLuint list
)
571 return (struct gl_display_list
*)
572 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
576 /** Is the given opcode an extension code? */
577 static inline GLboolean
578 is_ext_opcode(OpCode opcode
)
580 return (opcode
>= OPCODE_EXT_0
);
584 /** Destroy an extended opcode instruction */
586 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
588 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
590 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
591 step
= ctx
->ListExt
->Opcode
[i
].Size
;
596 /** Execute an extended opcode instruction */
598 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
600 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
602 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
603 step
= ctx
->ListExt
->Opcode
[i
].Size
;
608 /** Print an extended opcode instruction */
610 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
612 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
614 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
615 step
= ctx
->ListExt
->Opcode
[i
].Size
;
621 * Delete the named display list, but don't remove from hash table.
622 * \param dlist - display list pointer
625 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
630 n
= block
= dlist
->Head
;
632 done
= block
? GL_FALSE
: GL_TRUE
;
634 const OpCode opcode
= n
[0].opcode
;
636 /* check for extension opcodes first */
637 if (is_ext_opcode(opcode
)) {
638 n
+= ext_opcode_destroy(ctx
, n
);
642 /* for some commands, we need to free malloc'd memory */
645 n
+= InstSize
[n
[0].opcode
];
649 n
+= InstSize
[n
[0].opcode
];
651 case OPCODE_DRAW_PIXELS
:
653 n
+= InstSize
[n
[0].opcode
];
657 n
+= InstSize
[n
[0].opcode
];
659 case OPCODE_COLOR_TABLE
:
661 n
+= InstSize
[n
[0].opcode
];
663 case OPCODE_COLOR_SUB_TABLE
:
665 n
+= InstSize
[n
[0].opcode
];
667 case OPCODE_CONVOLUTION_FILTER_1D
:
669 n
+= InstSize
[n
[0].opcode
];
671 case OPCODE_CONVOLUTION_FILTER_2D
:
673 n
+= InstSize
[n
[0].opcode
];
675 case OPCODE_POLYGON_STIPPLE
:
677 n
+= InstSize
[n
[0].opcode
];
679 case OPCODE_TEX_IMAGE1D
:
681 n
+= InstSize
[n
[0].opcode
];
683 case OPCODE_TEX_IMAGE2D
:
685 n
+= InstSize
[n
[0].opcode
];
687 case OPCODE_TEX_IMAGE3D
:
689 n
+= InstSize
[n
[0].opcode
];
691 case OPCODE_TEX_SUB_IMAGE1D
:
693 n
+= InstSize
[n
[0].opcode
];
695 case OPCODE_TEX_SUB_IMAGE2D
:
697 n
+= InstSize
[n
[0].opcode
];
699 case OPCODE_TEX_SUB_IMAGE3D
:
701 n
+= InstSize
[n
[0].opcode
];
703 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
705 n
+= InstSize
[n
[0].opcode
];
707 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
709 n
+= InstSize
[n
[0].opcode
];
711 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
713 n
+= InstSize
[n
[0].opcode
];
715 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
717 n
+= InstSize
[n
[0].opcode
];
719 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
721 n
+= InstSize
[n
[0].opcode
];
723 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
725 n
+= InstSize
[n
[0].opcode
];
727 #if FEATURE_NV_vertex_program
728 case OPCODE_LOAD_PROGRAM_NV
:
729 free(n
[4].data
); /* program string */
730 n
+= InstSize
[n
[0].opcode
];
732 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
733 free(n
[2].data
); /* array of program ids */
734 n
+= InstSize
[n
[0].opcode
];
737 #if FEATURE_NV_fragment_program
738 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
739 free(n
[3].data
); /* parameter name */
740 n
+= InstSize
[n
[0].opcode
];
743 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
744 case OPCODE_PROGRAM_STRING_ARB
:
745 free(n
[4].data
); /* program string */
746 n
+= InstSize
[n
[0].opcode
];
749 case OPCODE_UNIFORM_1FV
:
750 case OPCODE_UNIFORM_2FV
:
751 case OPCODE_UNIFORM_3FV
:
752 case OPCODE_UNIFORM_4FV
:
753 case OPCODE_UNIFORM_1IV
:
754 case OPCODE_UNIFORM_2IV
:
755 case OPCODE_UNIFORM_3IV
:
756 case OPCODE_UNIFORM_4IV
:
757 case OPCODE_UNIFORM_1UIV
:
758 case OPCODE_UNIFORM_2UIV
:
759 case OPCODE_UNIFORM_3UIV
:
760 case OPCODE_UNIFORM_4UIV
:
762 n
+= InstSize
[n
[0].opcode
];
764 case OPCODE_UNIFORM_MATRIX22
:
765 case OPCODE_UNIFORM_MATRIX33
:
766 case OPCODE_UNIFORM_MATRIX44
:
767 case OPCODE_UNIFORM_MATRIX24
:
768 case OPCODE_UNIFORM_MATRIX42
:
769 case OPCODE_UNIFORM_MATRIX23
:
770 case OPCODE_UNIFORM_MATRIX32
:
771 case OPCODE_UNIFORM_MATRIX34
:
772 case OPCODE_UNIFORM_MATRIX43
:
774 n
+= InstSize
[n
[0].opcode
];
777 case OPCODE_CONTINUE
:
778 n
= (Node
*) n
[1].next
;
782 case OPCODE_END_OF_LIST
:
787 /* Most frequent case */
788 n
+= InstSize
[n
[0].opcode
];
799 * Destroy a display list and remove from hash table.
800 * \param list - display list number
803 destroy_list(struct gl_context
*ctx
, GLuint list
)
805 struct gl_display_list
*dlist
;
810 dlist
= lookup_list(ctx
, list
);
814 _mesa_delete_list(ctx
, dlist
);
815 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
820 * Translate the nth element of list from <type> to GLint.
823 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
835 bptr
= (GLbyte
*) list
;
836 return (GLint
) bptr
[n
];
837 case GL_UNSIGNED_BYTE
:
838 ubptr
= (GLubyte
*) list
;
839 return (GLint
) ubptr
[n
];
841 sptr
= (GLshort
*) list
;
842 return (GLint
) sptr
[n
];
843 case GL_UNSIGNED_SHORT
:
844 usptr
= (GLushort
*) list
;
845 return (GLint
) usptr
[n
];
847 iptr
= (GLint
*) list
;
849 case GL_UNSIGNED_INT
:
850 uiptr
= (GLuint
*) list
;
851 return (GLint
) uiptr
[n
];
853 fptr
= (GLfloat
*) list
;
854 return (GLint
) FLOORF(fptr
[n
]);
856 ubptr
= ((GLubyte
*) list
) + 2 * n
;
857 return (GLint
) ubptr
[0] * 256
860 ubptr
= ((GLubyte
*) list
) + 3 * n
;
861 return (GLint
) ubptr
[0] * 65536
862 + (GLint
) ubptr
[1] * 256
865 ubptr
= ((GLubyte
*) list
) + 4 * n
;
866 return (GLint
) ubptr
[0] * 16777216
867 + (GLint
) ubptr
[1] * 65536
868 + (GLint
) ubptr
[2] * 256
878 /**********************************************************************/
880 /**********************************************************************/
883 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
884 * If width < 0 or height < 0 or format or type are invalid we'll just
885 * return NULL. We will not generate an error since OpenGL command
886 * arguments aren't error-checked until the command is actually executed
887 * (not when they're compiled).
888 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
891 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
892 GLsizei width
, GLsizei height
, GLsizei depth
,
893 GLenum format
, GLenum type
, const GLvoid
* pixels
,
894 const struct gl_pixelstore_attrib
*unpack
)
896 if (width
<= 0 || height
<= 0) {
900 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
901 /* bad format and/or type */
905 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
909 if (type
== GL_BITMAP
)
910 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
912 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
913 format
, type
, pixels
, unpack
);
914 if (pixels
&& !image
) {
915 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
919 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
920 depth
, format
, type
, INT_MAX
, pixels
)) {
921 const GLubyte
*map
, *src
;
925 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
926 GL_MAP_READ_BIT
, unpack
->BufferObj
);
928 /* unable to map src buffer! */
929 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
933 src
= ADD_POINTERS(map
, pixels
);
934 if (type
== GL_BITMAP
)
935 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
937 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
938 format
, type
, src
, unpack
);
940 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
943 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
949 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
954 * Allocate space for a display list instruction (opcode + payload space).
955 * \param opcode the instruction opcode (OPCODE_* value)
956 * \param bytes instruction payload size (not counting opcode)
957 * \return pointer to allocated memory (the opcode space)
960 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
962 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
965 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
966 if (InstSize
[opcode
] == 0) {
967 /* save instruction size now */
968 InstSize
[opcode
] = numNodes
;
971 /* make sure instruction size agrees */
972 ASSERT(numNodes
== InstSize
[opcode
]);
976 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
977 /* This block is full. Allocate a new block and chain to it */
979 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
980 n
[0].opcode
= OPCODE_CONTINUE
;
981 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
983 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
986 n
[1].next
= (Node
*) newblock
;
987 ctx
->ListState
.CurrentBlock
= newblock
;
988 ctx
->ListState
.CurrentPos
= 0;
991 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
992 ctx
->ListState
.CurrentPos
+= numNodes
;
994 n
[0].opcode
= opcode
;
1002 * Allocate space for a display list instruction. Used by callers outside
1003 * this file for things like VBO vertex data.
1005 * \param opcode the instruction opcode (OPCODE_* value)
1006 * \param bytes instruction size in bytes, not counting opcode.
1007 * \return pointer to the usable data area (not including the internal
1011 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1013 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1015 return n
+ 1; /* return pointer to payload area, after opcode */
1022 * This function allows modules and drivers to get their own opcodes
1023 * for extending display list functionality.
1024 * \param ctx the rendering context
1025 * \param size number of bytes for storing the new display list command
1026 * \param execute function to execute the new display list command
1027 * \param destroy function to destroy the new display list command
1028 * \param print function to print the new display list command
1029 * \return the new opcode number or -1 if error
1032 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1034 void (*execute
) (struct gl_context
*, void *),
1035 void (*destroy
) (struct gl_context
*, void *),
1036 void (*print
) (struct gl_context
*, void *))
1038 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1039 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1040 ctx
->ListExt
->Opcode
[i
].Size
=
1041 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1042 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1043 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1044 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1045 return i
+ OPCODE_EXT_0
;
1052 * Allocate space for a display list instruction. The space is basically
1053 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1054 * function parameter, node[2] is the second parameter, etc.
1056 * \param opcode one of OPCODE_x
1057 * \param nparams number of function parameters
1058 * \return pointer to start of instruction space
1060 static inline Node
*
1061 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1063 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1069 * Display List compilation functions
1071 static void GLAPIENTRY
1072 save_Accum(GLenum op
, GLfloat value
)
1074 GET_CURRENT_CONTEXT(ctx
);
1076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1077 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1082 if (ctx
->ExecuteFlag
) {
1083 CALL_Accum(ctx
->Exec
, (op
, value
));
1088 static void GLAPIENTRY
1089 save_AlphaFunc(GLenum func
, GLclampf ref
)
1091 GET_CURRENT_CONTEXT(ctx
);
1093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1094 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1097 n
[2].f
= (GLfloat
) ref
;
1099 if (ctx
->ExecuteFlag
) {
1100 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1105 static void GLAPIENTRY
1106 save_BindTexture(GLenum target
, GLuint texture
)
1108 GET_CURRENT_CONTEXT(ctx
);
1110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1111 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1116 if (ctx
->ExecuteFlag
) {
1117 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1122 static void GLAPIENTRY
1123 save_Bitmap(GLsizei width
, GLsizei height
,
1124 GLfloat xorig
, GLfloat yorig
,
1125 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1127 GET_CURRENT_CONTEXT(ctx
);
1129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1130 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1132 n
[1].i
= (GLint
) width
;
1133 n
[2].i
= (GLint
) height
;
1138 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1139 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1141 if (ctx
->ExecuteFlag
) {
1142 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1143 xorig
, yorig
, xmove
, ymove
, pixels
));
1148 static void GLAPIENTRY
1149 save_BlendEquation(GLenum mode
)
1151 GET_CURRENT_CONTEXT(ctx
);
1153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1154 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1158 if (ctx
->ExecuteFlag
) {
1159 CALL_BlendEquation(ctx
->Exec
, (mode
));
1164 static void GLAPIENTRY
1165 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1167 GET_CURRENT_CONTEXT(ctx
);
1169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1170 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1175 if (ctx
->ExecuteFlag
) {
1176 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1181 static void GLAPIENTRY
1182 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1183 GLenum sfactorA
, GLenum dfactorA
)
1185 GET_CURRENT_CONTEXT(ctx
);
1187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1188 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1190 n
[1].e
= sfactorRGB
;
1191 n
[2].e
= dfactorRGB
;
1195 if (ctx
->ExecuteFlag
) {
1196 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1197 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1202 static void GLAPIENTRY
1203 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1205 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1209 static void GLAPIENTRY
1210 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1212 GET_CURRENT_CONTEXT(ctx
);
1214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1215 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1222 if (ctx
->ExecuteFlag
) {
1223 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1227 /* GL_ARB_draw_buffers_blend */
1228 static void GLAPIENTRY
1229 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1230 GLenum sfactorA
, GLenum dfactorA
)
1232 GET_CURRENT_CONTEXT(ctx
);
1234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1235 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1238 n
[2].e
= sfactorRGB
;
1239 n
[3].e
= dfactorRGB
;
1243 if (ctx
->ExecuteFlag
) {
1244 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1245 sfactorA
, dfactorA
));
1249 /* GL_ARB_draw_buffers_blend */
1250 static void GLAPIENTRY
1251 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1253 GET_CURRENT_CONTEXT(ctx
);
1255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1256 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1262 if (ctx
->ExecuteFlag
) {
1263 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1267 /* GL_ARB_draw_buffers_blend */
1268 static void GLAPIENTRY
1269 save_BlendEquationi(GLuint buf
, GLenum mode
)
1271 GET_CURRENT_CONTEXT(ctx
);
1273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1274 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1279 if (ctx
->ExecuteFlag
) {
1280 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1284 /* GL_ARB_draw_buffers_blend */
1285 static void GLAPIENTRY
1286 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1288 GET_CURRENT_CONTEXT(ctx
);
1290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1291 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1297 if (ctx
->ExecuteFlag
) {
1298 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1303 /* GL_ARB_draw_instanced. */
1304 static void GLAPIENTRY
1305 save_DrawArraysInstancedARB(GLenum mode
,
1310 GET_CURRENT_CONTEXT(ctx
);
1311 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1312 "glDrawArraysInstanced() during display list compile");
1315 static void GLAPIENTRY
1316 save_DrawElementsInstancedARB(GLenum mode
,
1319 const GLvoid
*indices
,
1322 GET_CURRENT_CONTEXT(ctx
);
1323 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1324 "glDrawElementsInstanced() during display list compile");
1327 static void GLAPIENTRY
1328 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1331 const GLvoid
*indices
,
1335 GET_CURRENT_CONTEXT(ctx
);
1336 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1337 "glDrawElementsInstancedBaseVertex() during display list compile");
1340 /* GL_ARB_base_instance. */
1341 static void GLAPIENTRY
1342 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1346 GLuint baseinstance
)
1348 GET_CURRENT_CONTEXT(ctx
);
1349 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1350 "glDrawArraysInstancedBaseInstance() during display list compile");
1353 static void APIENTRY
1354 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1357 const void *indices
,
1359 GLuint baseinstance
)
1361 GET_CURRENT_CONTEXT(ctx
);
1362 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1363 "glDrawElementsInstancedBaseInstance() during display list compile");
1366 static void APIENTRY
1367 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1370 const void *indices
,
1373 GLuint baseinstance
)
1375 GET_CURRENT_CONTEXT(ctx
);
1376 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1377 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1380 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1384 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1385 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1387 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1388 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1390 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1392 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1395 static void GLAPIENTRY
1396 save_CallList(GLuint list
)
1398 GET_CURRENT_CONTEXT(ctx
);
1400 SAVE_FLUSH_VERTICES(ctx
);
1402 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1407 /* After this, we don't know what state we're in. Invalidate all
1408 * cached information previously gathered:
1410 invalidate_saved_current_state( ctx
);
1412 if (ctx
->ExecuteFlag
) {
1413 _mesa_CallList(list
);
1418 static void GLAPIENTRY
1419 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1421 GET_CURRENT_CONTEXT(ctx
);
1423 GLboolean typeErrorFlag
;
1425 SAVE_FLUSH_VERTICES(ctx
);
1429 case GL_UNSIGNED_BYTE
:
1431 case GL_UNSIGNED_SHORT
:
1433 case GL_UNSIGNED_INT
:
1438 typeErrorFlag
= GL_FALSE
;
1441 typeErrorFlag
= GL_TRUE
;
1444 for (i
= 0; i
< num
; i
++) {
1445 GLint list
= translate_id(i
, type
, lists
);
1446 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1449 n
[2].b
= typeErrorFlag
;
1453 /* After this, we don't know what state we're in. Invalidate all
1454 * cached information previously gathered:
1456 invalidate_saved_current_state( ctx
);
1458 if (ctx
->ExecuteFlag
) {
1459 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1464 static void GLAPIENTRY
1465 save_Clear(GLbitfield mask
)
1467 GET_CURRENT_CONTEXT(ctx
);
1469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1470 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1474 if (ctx
->ExecuteFlag
) {
1475 CALL_Clear(ctx
->Exec
, (mask
));
1480 static void GLAPIENTRY
1481 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1483 GET_CURRENT_CONTEXT(ctx
);
1485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1486 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1489 n
[2].i
= drawbuffer
;
1491 if (buffer
== GL_COLOR
) {
1502 if (ctx
->ExecuteFlag
) {
1503 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1508 static void GLAPIENTRY
1509 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1511 GET_CURRENT_CONTEXT(ctx
);
1513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1514 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1517 n
[2].i
= drawbuffer
;
1519 if (buffer
== GL_COLOR
) {
1530 if (ctx
->ExecuteFlag
) {
1531 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1536 static void GLAPIENTRY
1537 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1539 GET_CURRENT_CONTEXT(ctx
);
1541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1542 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1545 n
[2].i
= drawbuffer
;
1547 if (buffer
== GL_COLOR
) {
1558 if (ctx
->ExecuteFlag
) {
1559 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1564 static void GLAPIENTRY
1565 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1566 GLfloat depth
, GLint stencil
)
1568 GET_CURRENT_CONTEXT(ctx
);
1570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1571 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1574 n
[2].i
= drawbuffer
;
1578 if (ctx
->ExecuteFlag
) {
1579 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1584 static void GLAPIENTRY
1585 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1587 GET_CURRENT_CONTEXT(ctx
);
1589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1590 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1597 if (ctx
->ExecuteFlag
) {
1598 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1603 static void GLAPIENTRY
1604 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1606 GET_CURRENT_CONTEXT(ctx
);
1608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1609 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1616 if (ctx
->ExecuteFlag
) {
1617 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1622 static void GLAPIENTRY
1623 save_ClearDepth(GLclampd depth
)
1625 GET_CURRENT_CONTEXT(ctx
);
1627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1628 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1630 n
[1].f
= (GLfloat
) depth
;
1632 if (ctx
->ExecuteFlag
) {
1633 CALL_ClearDepth(ctx
->Exec
, (depth
));
1638 static void GLAPIENTRY
1639 save_ClearIndex(GLfloat c
)
1641 GET_CURRENT_CONTEXT(ctx
);
1643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1644 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1648 if (ctx
->ExecuteFlag
) {
1649 CALL_ClearIndex(ctx
->Exec
, (c
));
1654 static void GLAPIENTRY
1655 save_ClearStencil(GLint s
)
1657 GET_CURRENT_CONTEXT(ctx
);
1659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1660 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1664 if (ctx
->ExecuteFlag
) {
1665 CALL_ClearStencil(ctx
->Exec
, (s
));
1670 static void GLAPIENTRY
1671 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1673 GET_CURRENT_CONTEXT(ctx
);
1675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1676 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1679 n
[2].f
= (GLfloat
) equ
[0];
1680 n
[3].f
= (GLfloat
) equ
[1];
1681 n
[4].f
= (GLfloat
) equ
[2];
1682 n
[5].f
= (GLfloat
) equ
[3];
1684 if (ctx
->ExecuteFlag
) {
1685 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1691 static void GLAPIENTRY
1692 save_ColorMask(GLboolean red
, GLboolean green
,
1693 GLboolean blue
, GLboolean alpha
)
1695 GET_CURRENT_CONTEXT(ctx
);
1697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1698 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1705 if (ctx
->ExecuteFlag
) {
1706 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1711 static void GLAPIENTRY
1712 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1713 GLboolean blue
, GLboolean alpha
)
1715 GET_CURRENT_CONTEXT(ctx
);
1717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1718 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1726 if (ctx
->ExecuteFlag
) {
1727 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1732 static void GLAPIENTRY
1733 save_ColorMaterial(GLenum face
, GLenum mode
)
1735 GET_CURRENT_CONTEXT(ctx
);
1737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1739 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1744 if (ctx
->ExecuteFlag
) {
1745 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1750 static void GLAPIENTRY
1751 save_ColorTable(GLenum target
, GLenum internalFormat
,
1752 GLsizei width
, GLenum format
, GLenum type
,
1753 const GLvoid
* table
)
1755 GET_CURRENT_CONTEXT(ctx
);
1756 if (_mesa_is_proxy_texture(target
)) {
1757 /* execute immediately */
1758 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1759 format
, type
, table
));
1763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1764 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1767 n
[2].e
= internalFormat
;
1771 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1774 if (ctx
->ExecuteFlag
) {
1775 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1776 format
, type
, table
));
1783 static void GLAPIENTRY
1784 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1785 const GLfloat
*params
)
1787 GET_CURRENT_CONTEXT(ctx
);
1790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1792 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1797 if (pname
== GL_COLOR_TABLE_SGI
||
1798 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1799 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1806 if (ctx
->ExecuteFlag
) {
1807 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1812 static void GLAPIENTRY
1813 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1815 GET_CURRENT_CONTEXT(ctx
);
1818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1820 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1825 if (pname
== GL_COLOR_TABLE_SGI
||
1826 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1827 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1834 if (ctx
->ExecuteFlag
) {
1835 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1841 static void GLAPIENTRY
1842 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1843 GLenum format
, GLenum type
, const GLvoid
* table
)
1845 GET_CURRENT_CONTEXT(ctx
);
1847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1848 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1855 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1858 if (ctx
->ExecuteFlag
) {
1859 CALL_ColorSubTable(ctx
->Exec
,
1860 (target
, start
, count
, format
, type
, table
));
1865 static void GLAPIENTRY
1866 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1867 GLint x
, GLint y
, GLsizei width
)
1869 GET_CURRENT_CONTEXT(ctx
);
1872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1873 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1881 if (ctx
->ExecuteFlag
) {
1882 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1887 static void GLAPIENTRY
1888 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1889 GLint x
, GLint y
, GLsizei width
)
1891 GET_CURRENT_CONTEXT(ctx
);
1894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1895 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1898 n
[2].e
= internalformat
;
1903 if (ctx
->ExecuteFlag
) {
1904 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1909 static void GLAPIENTRY
1910 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1911 GLenum format
, GLenum type
, const GLvoid
* filter
)
1913 GET_CURRENT_CONTEXT(ctx
);
1916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1918 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1921 n
[2].e
= internalFormat
;
1925 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1928 if (ctx
->ExecuteFlag
) {
1929 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1930 format
, type
, filter
));
1935 static void GLAPIENTRY
1936 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1937 GLsizei width
, GLsizei height
, GLenum format
,
1938 GLenum type
, const GLvoid
* filter
)
1940 GET_CURRENT_CONTEXT(ctx
);
1943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1945 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1948 n
[2].e
= internalFormat
;
1953 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1956 if (ctx
->ExecuteFlag
) {
1957 CALL_ConvolutionFilter2D(ctx
->Exec
,
1958 (target
, internalFormat
, width
, height
, format
,
1964 static void GLAPIENTRY
1965 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1967 GET_CURRENT_CONTEXT(ctx
);
1969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1970 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1976 if (ctx
->ExecuteFlag
) {
1977 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1982 static void GLAPIENTRY
1983 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1985 GET_CURRENT_CONTEXT(ctx
);
1987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1988 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1993 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1994 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1995 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2001 n
[4].i
= n
[5].i
= n
[6].i
= 0;
2004 if (ctx
->ExecuteFlag
) {
2005 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
2010 static void GLAPIENTRY
2011 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
2013 GET_CURRENT_CONTEXT(ctx
);
2015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2016 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
2022 if (ctx
->ExecuteFlag
) {
2023 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
2028 static void GLAPIENTRY
2029 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
2030 const GLfloat
*params
)
2032 GET_CURRENT_CONTEXT(ctx
);
2034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2035 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
2040 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
2041 pname
== GL_CONVOLUTION_FILTER_SCALE
||
2042 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2048 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
2051 if (ctx
->ExecuteFlag
) {
2052 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
2057 static void GLAPIENTRY
2058 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2060 GET_CURRENT_CONTEXT(ctx
);
2062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2063 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2067 n
[3].i
= (GLint
) width
;
2068 n
[4].i
= (GLint
) height
;
2071 if (ctx
->ExecuteFlag
) {
2072 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2078 static void GLAPIENTRY
2079 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2080 GLint x
, GLint y
, GLsizei width
, GLint border
)
2082 GET_CURRENT_CONTEXT(ctx
);
2084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2085 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2089 n
[3].e
= internalformat
;
2095 if (ctx
->ExecuteFlag
) {
2096 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2097 x
, y
, width
, border
));
2102 static void GLAPIENTRY
2103 save_CopyTexImage2D(GLenum target
, GLint level
,
2104 GLenum internalformat
,
2105 GLint x
, GLint y
, GLsizei width
,
2106 GLsizei height
, GLint border
)
2108 GET_CURRENT_CONTEXT(ctx
);
2110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2111 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2115 n
[3].e
= internalformat
;
2122 if (ctx
->ExecuteFlag
) {
2123 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2124 x
, y
, width
, height
, border
));
2130 static void GLAPIENTRY
2131 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2132 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2134 GET_CURRENT_CONTEXT(ctx
);
2136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2137 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2146 if (ctx
->ExecuteFlag
) {
2147 CALL_CopyTexSubImage1D(ctx
->Exec
,
2148 (target
, level
, xoffset
, x
, y
, width
));
2153 static void GLAPIENTRY
2154 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2155 GLint xoffset
, GLint yoffset
,
2156 GLint x
, GLint y
, GLsizei width
, GLint height
)
2158 GET_CURRENT_CONTEXT(ctx
);
2160 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2161 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2172 if (ctx
->ExecuteFlag
) {
2173 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2174 x
, y
, width
, height
));
2179 static void GLAPIENTRY
2180 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2181 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2182 GLint x
, GLint y
, GLsizei width
, GLint height
)
2184 GET_CURRENT_CONTEXT(ctx
);
2186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2187 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2199 if (ctx
->ExecuteFlag
) {
2200 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2201 xoffset
, yoffset
, zoffset
,
2202 x
, y
, width
, height
));
2207 static void GLAPIENTRY
2208 save_CullFace(GLenum mode
)
2210 GET_CURRENT_CONTEXT(ctx
);
2212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2213 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2217 if (ctx
->ExecuteFlag
) {
2218 CALL_CullFace(ctx
->Exec
, (mode
));
2223 static void GLAPIENTRY
2224 save_DepthFunc(GLenum func
)
2226 GET_CURRENT_CONTEXT(ctx
);
2228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2229 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2233 if (ctx
->ExecuteFlag
) {
2234 CALL_DepthFunc(ctx
->Exec
, (func
));
2239 static void GLAPIENTRY
2240 save_DepthMask(GLboolean mask
)
2242 GET_CURRENT_CONTEXT(ctx
);
2244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2245 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2249 if (ctx
->ExecuteFlag
) {
2250 CALL_DepthMask(ctx
->Exec
, (mask
));
2255 static void GLAPIENTRY
2256 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2258 GET_CURRENT_CONTEXT(ctx
);
2260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2261 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2263 n
[1].f
= (GLfloat
) nearval
;
2264 n
[2].f
= (GLfloat
) farval
;
2266 if (ctx
->ExecuteFlag
) {
2267 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2272 static void GLAPIENTRY
2273 save_Disable(GLenum cap
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2282 if (ctx
->ExecuteFlag
) {
2283 CALL_Disable(ctx
->Exec
, (cap
));
2288 static void GLAPIENTRY
2289 save_DisableIndexed(GLuint index
, GLenum cap
)
2291 GET_CURRENT_CONTEXT(ctx
);
2293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2294 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2299 if (ctx
->ExecuteFlag
) {
2300 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2305 static void GLAPIENTRY
2306 save_DrawBuffer(GLenum mode
)
2308 GET_CURRENT_CONTEXT(ctx
);
2310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2311 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2315 if (ctx
->ExecuteFlag
) {
2316 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2321 static void GLAPIENTRY
2322 save_DrawPixels(GLsizei width
, GLsizei height
,
2323 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2325 GET_CURRENT_CONTEXT(ctx
);
2328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2336 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2337 pixels
, &ctx
->Unpack
);
2339 if (ctx
->ExecuteFlag
) {
2340 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2346 static void GLAPIENTRY
2347 save_Enable(GLenum cap
)
2349 GET_CURRENT_CONTEXT(ctx
);
2351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2352 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2356 if (ctx
->ExecuteFlag
) {
2357 CALL_Enable(ctx
->Exec
, (cap
));
2363 static void GLAPIENTRY
2364 save_EnableIndexed(GLuint index
, GLenum cap
)
2366 GET_CURRENT_CONTEXT(ctx
);
2368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2369 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2374 if (ctx
->ExecuteFlag
) {
2375 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2381 static void GLAPIENTRY
2382 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2384 GET_CURRENT_CONTEXT(ctx
);
2386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2387 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2393 if (ctx
->ExecuteFlag
) {
2394 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2399 static void GLAPIENTRY
2400 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2402 GET_CURRENT_CONTEXT(ctx
);
2404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2405 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2413 if (ctx
->ExecuteFlag
) {
2414 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2421 static void GLAPIENTRY
2422 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2424 GET_CURRENT_CONTEXT(ctx
);
2426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2427 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2435 if (ctx
->ExecuteFlag
) {
2436 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2441 static void GLAPIENTRY
2442 save_Fogf(GLenum pname
, GLfloat param
)
2446 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2447 save_Fogfv(pname
, parray
);
2451 static void GLAPIENTRY
2452 save_Fogiv(GLenum pname
, const GLint
*params
)
2457 case GL_FOG_DENSITY
:
2461 p
[0] = (GLfloat
) *params
;
2467 p
[0] = INT_TO_FLOAT(params
[0]);
2468 p
[1] = INT_TO_FLOAT(params
[1]);
2469 p
[2] = INT_TO_FLOAT(params
[2]);
2470 p
[3] = INT_TO_FLOAT(params
[3]);
2473 /* Error will be caught later in gl_Fogfv */
2474 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2476 save_Fogfv(pname
, p
);
2480 static void GLAPIENTRY
2481 save_Fogi(GLenum pname
, GLint param
)
2485 parray
[1] = parray
[2] = parray
[3] = 0;
2486 save_Fogiv(pname
, parray
);
2490 static void GLAPIENTRY
2491 save_FrontFace(GLenum mode
)
2493 GET_CURRENT_CONTEXT(ctx
);
2495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2496 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2500 if (ctx
->ExecuteFlag
) {
2501 CALL_FrontFace(ctx
->Exec
, (mode
));
2506 static void GLAPIENTRY
2507 save_Frustum(GLdouble left
, GLdouble right
,
2508 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2510 GET_CURRENT_CONTEXT(ctx
);
2512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2513 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2515 n
[1].f
= (GLfloat
) left
;
2516 n
[2].f
= (GLfloat
) right
;
2517 n
[3].f
= (GLfloat
) bottom
;
2518 n
[4].f
= (GLfloat
) top
;
2519 n
[5].f
= (GLfloat
) nearval
;
2520 n
[6].f
= (GLfloat
) farval
;
2522 if (ctx
->ExecuteFlag
) {
2523 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2528 static void GLAPIENTRY
2529 save_Hint(GLenum target
, GLenum mode
)
2531 GET_CURRENT_CONTEXT(ctx
);
2533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2534 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2539 if (ctx
->ExecuteFlag
) {
2540 CALL_Hint(ctx
->Exec
, (target
, mode
));
2545 static void GLAPIENTRY
2546 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2549 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2557 n
[3].e
= internalFormat
;
2560 if (ctx
->ExecuteFlag
) {
2561 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2566 static void GLAPIENTRY
2567 save_IndexMask(GLuint mask
)
2569 GET_CURRENT_CONTEXT(ctx
);
2571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2572 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2576 if (ctx
->ExecuteFlag
) {
2577 CALL_IndexMask(ctx
->Exec
, (mask
));
2582 static void GLAPIENTRY
2583 save_InitNames(void)
2585 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2588 if (ctx
->ExecuteFlag
) {
2589 CALL_InitNames(ctx
->Exec
, ());
2594 static void GLAPIENTRY
2595 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2597 GET_CURRENT_CONTEXT(ctx
);
2599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2600 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2618 case GL_SPOT_DIRECTION
:
2621 case GL_SPOT_EXPONENT
:
2624 case GL_SPOT_CUTOFF
:
2627 case GL_CONSTANT_ATTENUATION
:
2630 case GL_LINEAR_ATTENUATION
:
2633 case GL_QUADRATIC_ATTENUATION
:
2639 for (i
= 0; i
< nParams
; i
++) {
2640 n
[3 + i
].f
= params
[i
];
2643 if (ctx
->ExecuteFlag
) {
2644 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2649 static void GLAPIENTRY
2650 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2654 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2655 save_Lightfv(light
, pname
, parray
);
2659 static void GLAPIENTRY
2660 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2667 fparam
[0] = INT_TO_FLOAT(params
[0]);
2668 fparam
[1] = INT_TO_FLOAT(params
[1]);
2669 fparam
[2] = INT_TO_FLOAT(params
[2]);
2670 fparam
[3] = INT_TO_FLOAT(params
[3]);
2673 fparam
[0] = (GLfloat
) params
[0];
2674 fparam
[1] = (GLfloat
) params
[1];
2675 fparam
[2] = (GLfloat
) params
[2];
2676 fparam
[3] = (GLfloat
) params
[3];
2678 case GL_SPOT_DIRECTION
:
2679 fparam
[0] = (GLfloat
) params
[0];
2680 fparam
[1] = (GLfloat
) params
[1];
2681 fparam
[2] = (GLfloat
) params
[2];
2683 case GL_SPOT_EXPONENT
:
2684 case GL_SPOT_CUTOFF
:
2685 case GL_CONSTANT_ATTENUATION
:
2686 case GL_LINEAR_ATTENUATION
:
2687 case GL_QUADRATIC_ATTENUATION
:
2688 fparam
[0] = (GLfloat
) params
[0];
2691 /* error will be caught later in gl_Lightfv */
2694 save_Lightfv(light
, pname
, fparam
);
2698 static void GLAPIENTRY
2699 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2703 parray
[1] = parray
[2] = parray
[3] = 0;
2704 save_Lightiv(light
, pname
, parray
);
2708 static void GLAPIENTRY
2709 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2711 GET_CURRENT_CONTEXT(ctx
);
2713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2714 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2722 if (ctx
->ExecuteFlag
) {
2723 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2728 static void GLAPIENTRY
2729 save_LightModelf(GLenum pname
, GLfloat param
)
2733 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2734 save_LightModelfv(pname
, parray
);
2738 static void GLAPIENTRY
2739 save_LightModeliv(GLenum pname
, const GLint
*params
)
2743 case GL_LIGHT_MODEL_AMBIENT
:
2744 fparam
[0] = INT_TO_FLOAT(params
[0]);
2745 fparam
[1] = INT_TO_FLOAT(params
[1]);
2746 fparam
[2] = INT_TO_FLOAT(params
[2]);
2747 fparam
[3] = INT_TO_FLOAT(params
[3]);
2749 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2750 case GL_LIGHT_MODEL_TWO_SIDE
:
2751 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2752 fparam
[0] = (GLfloat
) params
[0];
2758 /* Error will be caught later in gl_LightModelfv */
2759 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2761 save_LightModelfv(pname
, fparam
);
2765 static void GLAPIENTRY
2766 save_LightModeli(GLenum pname
, GLint param
)
2770 parray
[1] = parray
[2] = parray
[3] = 0;
2771 save_LightModeliv(pname
, parray
);
2775 static void GLAPIENTRY
2776 save_LineStipple(GLint factor
, GLushort pattern
)
2778 GET_CURRENT_CONTEXT(ctx
);
2780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2781 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2786 if (ctx
->ExecuteFlag
) {
2787 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2792 static void GLAPIENTRY
2793 save_LineWidth(GLfloat width
)
2795 GET_CURRENT_CONTEXT(ctx
);
2797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2798 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2802 if (ctx
->ExecuteFlag
) {
2803 CALL_LineWidth(ctx
->Exec
, (width
));
2808 static void GLAPIENTRY
2809 save_ListBase(GLuint base
)
2811 GET_CURRENT_CONTEXT(ctx
);
2813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2814 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2818 if (ctx
->ExecuteFlag
) {
2819 CALL_ListBase(ctx
->Exec
, (base
));
2824 static void GLAPIENTRY
2825 save_LoadIdentity(void)
2827 GET_CURRENT_CONTEXT(ctx
);
2828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2829 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2830 if (ctx
->ExecuteFlag
) {
2831 CALL_LoadIdentity(ctx
->Exec
, ());
2836 static void GLAPIENTRY
2837 save_LoadMatrixf(const GLfloat
* m
)
2839 GET_CURRENT_CONTEXT(ctx
);
2841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2842 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2845 for (i
= 0; i
< 16; i
++) {
2849 if (ctx
->ExecuteFlag
) {
2850 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2855 static void GLAPIENTRY
2856 save_LoadMatrixd(const GLdouble
* m
)
2860 for (i
= 0; i
< 16; i
++) {
2861 f
[i
] = (GLfloat
) m
[i
];
2863 save_LoadMatrixf(f
);
2867 static void GLAPIENTRY
2868 save_LoadName(GLuint name
)
2870 GET_CURRENT_CONTEXT(ctx
);
2872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2873 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2877 if (ctx
->ExecuteFlag
) {
2878 CALL_LoadName(ctx
->Exec
, (name
));
2883 static void GLAPIENTRY
2884 save_LogicOp(GLenum opcode
)
2886 GET_CURRENT_CONTEXT(ctx
);
2888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2889 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2893 if (ctx
->ExecuteFlag
) {
2894 CALL_LogicOp(ctx
->Exec
, (opcode
));
2899 static void GLAPIENTRY
2900 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2901 GLint order
, const GLdouble
* points
)
2903 GET_CURRENT_CONTEXT(ctx
);
2905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2906 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2908 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2910 n
[2].f
= (GLfloat
) u1
;
2911 n
[3].f
= (GLfloat
) u2
;
2912 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2914 n
[6].data
= (void *) pnts
;
2916 if (ctx
->ExecuteFlag
) {
2917 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2921 static void GLAPIENTRY
2922 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2923 GLint order
, const GLfloat
* points
)
2925 GET_CURRENT_CONTEXT(ctx
);
2927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2928 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2930 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2934 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2936 n
[6].data
= (void *) pnts
;
2938 if (ctx
->ExecuteFlag
) {
2939 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2944 static void GLAPIENTRY
2945 save_Map2d(GLenum target
,
2946 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2947 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2948 const GLdouble
* points
)
2950 GET_CURRENT_CONTEXT(ctx
);
2952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2953 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2955 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2956 vstride
, vorder
, points
);
2958 n
[2].f
= (GLfloat
) u1
;
2959 n
[3].f
= (GLfloat
) u2
;
2960 n
[4].f
= (GLfloat
) v1
;
2961 n
[5].f
= (GLfloat
) v2
;
2962 /* XXX verify these strides are correct */
2963 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2964 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2967 n
[10].data
= (void *) pnts
;
2969 if (ctx
->ExecuteFlag
) {
2970 CALL_Map2d(ctx
->Exec
, (target
,
2971 u1
, u2
, ustride
, uorder
,
2972 v1
, v2
, vstride
, vorder
, points
));
2977 static void GLAPIENTRY
2978 save_Map2f(GLenum target
,
2979 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2980 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2981 const GLfloat
* points
)
2983 GET_CURRENT_CONTEXT(ctx
);
2985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2986 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2988 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2989 vstride
, vorder
, points
);
2995 /* XXX verify these strides are correct */
2996 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2997 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3000 n
[10].data
= (void *) pnts
;
3002 if (ctx
->ExecuteFlag
) {
3003 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3004 v1
, v2
, vstride
, vorder
, points
));
3009 static void GLAPIENTRY
3010 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3012 GET_CURRENT_CONTEXT(ctx
);
3014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3015 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3021 if (ctx
->ExecuteFlag
) {
3022 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3027 static void GLAPIENTRY
3028 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3030 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3034 static void GLAPIENTRY
3035 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3036 GLint vn
, GLfloat v1
, GLfloat v2
)
3038 GET_CURRENT_CONTEXT(ctx
);
3040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3041 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3050 if (ctx
->ExecuteFlag
) {
3051 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3057 static void GLAPIENTRY
3058 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3059 GLint vn
, GLdouble v1
, GLdouble v2
)
3061 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3062 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3066 static void GLAPIENTRY
3067 save_MatrixMode(GLenum mode
)
3069 GET_CURRENT_CONTEXT(ctx
);
3071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3072 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3076 if (ctx
->ExecuteFlag
) {
3077 CALL_MatrixMode(ctx
->Exec
, (mode
));
3082 static void GLAPIENTRY
3083 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3085 GET_CURRENT_CONTEXT(ctx
);
3088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3089 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3092 n
[2].e
= internalFormat
;
3095 if (ctx
->ExecuteFlag
) {
3096 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3101 static void GLAPIENTRY
3102 save_MultMatrixf(const GLfloat
* m
)
3104 GET_CURRENT_CONTEXT(ctx
);
3106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3107 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3110 for (i
= 0; i
< 16; i
++) {
3114 if (ctx
->ExecuteFlag
) {
3115 CALL_MultMatrixf(ctx
->Exec
, (m
));
3120 static void GLAPIENTRY
3121 save_MultMatrixd(const GLdouble
* m
)
3125 for (i
= 0; i
< 16; i
++) {
3126 f
[i
] = (GLfloat
) m
[i
];
3128 save_MultMatrixf(f
);
3132 static void GLAPIENTRY
3133 save_NewList(GLuint name
, GLenum mode
)
3135 GET_CURRENT_CONTEXT(ctx
);
3136 /* It's an error to call this function while building a display list */
3137 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3144 static void GLAPIENTRY
3145 save_Ortho(GLdouble left
, GLdouble right
,
3146 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3153 n
[1].f
= (GLfloat
) left
;
3154 n
[2].f
= (GLfloat
) right
;
3155 n
[3].f
= (GLfloat
) bottom
;
3156 n
[4].f
= (GLfloat
) top
;
3157 n
[5].f
= (GLfloat
) nearval
;
3158 n
[6].f
= (GLfloat
) farval
;
3160 if (ctx
->ExecuteFlag
) {
3161 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3166 static void GLAPIENTRY
3167 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3169 GET_CURRENT_CONTEXT(ctx
);
3171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3172 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3176 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
3177 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3179 if (ctx
->ExecuteFlag
) {
3180 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3185 static void GLAPIENTRY
3186 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3188 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3190 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3191 for (i
= 0; i
< mapsize
; i
++) {
3192 fvalues
[i
] = (GLfloat
) values
[i
];
3196 for (i
= 0; i
< mapsize
; i
++) {
3197 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3200 save_PixelMapfv(map
, mapsize
, fvalues
);
3204 static void GLAPIENTRY
3205 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3207 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3209 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3210 for (i
= 0; i
< mapsize
; i
++) {
3211 fvalues
[i
] = (GLfloat
) values
[i
];
3215 for (i
= 0; i
< mapsize
; i
++) {
3216 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3219 save_PixelMapfv(map
, mapsize
, fvalues
);
3223 static void GLAPIENTRY
3224 save_PixelTransferf(GLenum pname
, GLfloat param
)
3226 GET_CURRENT_CONTEXT(ctx
);
3228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3229 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3234 if (ctx
->ExecuteFlag
) {
3235 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3240 static void GLAPIENTRY
3241 save_PixelTransferi(GLenum pname
, GLint param
)
3243 save_PixelTransferf(pname
, (GLfloat
) param
);
3247 static void GLAPIENTRY
3248 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3250 GET_CURRENT_CONTEXT(ctx
);
3252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3253 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3264 static void GLAPIENTRY
3265 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3267 GET_CURRENT_CONTEXT(ctx
);
3269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3270 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3277 if (ctx
->ExecuteFlag
) {
3278 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3283 static void GLAPIENTRY
3284 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3288 parray
[1] = parray
[2] = 0.0F
;
3289 save_PointParameterfvEXT(pname
, parray
);
3292 static void GLAPIENTRY
3293 save_PointParameteriNV(GLenum pname
, GLint param
)
3296 parray
[0] = (GLfloat
) param
;
3297 parray
[1] = parray
[2] = 0.0F
;
3298 save_PointParameterfvEXT(pname
, parray
);
3301 static void GLAPIENTRY
3302 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3305 parray
[0] = (GLfloat
) param
[0];
3306 parray
[1] = parray
[2] = 0.0F
;
3307 save_PointParameterfvEXT(pname
, parray
);
3311 static void GLAPIENTRY
3312 save_PointSize(GLfloat size
)
3314 GET_CURRENT_CONTEXT(ctx
);
3316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3317 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3321 if (ctx
->ExecuteFlag
) {
3322 CALL_PointSize(ctx
->Exec
, (size
));
3327 static void GLAPIENTRY
3328 save_PolygonMode(GLenum face
, GLenum mode
)
3330 GET_CURRENT_CONTEXT(ctx
);
3332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3333 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3338 if (ctx
->ExecuteFlag
) {
3339 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3344 static void GLAPIENTRY
3345 save_PolygonStipple(const GLubyte
* pattern
)
3347 GET_CURRENT_CONTEXT(ctx
);
3350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3352 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3354 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3355 pattern
, &ctx
->Unpack
);
3357 if (ctx
->ExecuteFlag
) {
3358 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3363 static void GLAPIENTRY
3364 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3366 GET_CURRENT_CONTEXT(ctx
);
3368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3369 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3374 if (ctx
->ExecuteFlag
) {
3375 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3380 static void GLAPIENTRY
3381 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3383 GET_CURRENT_CONTEXT(ctx
);
3384 /* XXX mult by DepthMaxF here??? */
3385 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3389 static void GLAPIENTRY
3390 save_PopAttrib(void)
3392 GET_CURRENT_CONTEXT(ctx
);
3393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3394 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3395 if (ctx
->ExecuteFlag
) {
3396 CALL_PopAttrib(ctx
->Exec
, ());
3401 static void GLAPIENTRY
3402 save_PopMatrix(void)
3404 GET_CURRENT_CONTEXT(ctx
);
3405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3406 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3407 if (ctx
->ExecuteFlag
) {
3408 CALL_PopMatrix(ctx
->Exec
, ());
3413 static void GLAPIENTRY
3416 GET_CURRENT_CONTEXT(ctx
);
3417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3418 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3419 if (ctx
->ExecuteFlag
) {
3420 CALL_PopName(ctx
->Exec
, ());
3425 static void GLAPIENTRY
3426 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3427 const GLclampf
* priorities
)
3429 GET_CURRENT_CONTEXT(ctx
);
3431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3433 for (i
= 0; i
< num
; i
++) {
3435 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3437 n
[1].ui
= textures
[i
];
3438 n
[2].f
= priorities
[i
];
3441 if (ctx
->ExecuteFlag
) {
3442 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3447 static void GLAPIENTRY
3448 save_PushAttrib(GLbitfield mask
)
3450 GET_CURRENT_CONTEXT(ctx
);
3452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3453 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3457 if (ctx
->ExecuteFlag
) {
3458 CALL_PushAttrib(ctx
->Exec
, (mask
));
3463 static void GLAPIENTRY
3464 save_PushMatrix(void)
3466 GET_CURRENT_CONTEXT(ctx
);
3467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3468 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3469 if (ctx
->ExecuteFlag
) {
3470 CALL_PushMatrix(ctx
->Exec
, ());
3475 static void GLAPIENTRY
3476 save_PushName(GLuint name
)
3478 GET_CURRENT_CONTEXT(ctx
);
3480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3481 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3485 if (ctx
->ExecuteFlag
) {
3486 CALL_PushName(ctx
->Exec
, (name
));
3491 static void GLAPIENTRY
3492 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3494 GET_CURRENT_CONTEXT(ctx
);
3496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3497 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3504 if (ctx
->ExecuteFlag
) {
3505 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3509 static void GLAPIENTRY
3510 save_RasterPos2d(GLdouble x
, GLdouble y
)
3512 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3515 static void GLAPIENTRY
3516 save_RasterPos2f(GLfloat x
, GLfloat y
)
3518 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3521 static void GLAPIENTRY
3522 save_RasterPos2i(GLint x
, GLint y
)
3524 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3527 static void GLAPIENTRY
3528 save_RasterPos2s(GLshort x
, GLshort y
)
3530 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3533 static void GLAPIENTRY
3534 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3536 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3539 static void GLAPIENTRY
3540 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3542 save_RasterPos4f(x
, y
, z
, 1.0F
);
3545 static void GLAPIENTRY
3546 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3548 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3551 static void GLAPIENTRY
3552 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3554 save_RasterPos4f(x
, y
, z
, 1.0F
);
3557 static void GLAPIENTRY
3558 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3560 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3563 static void GLAPIENTRY
3564 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3566 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3569 static void GLAPIENTRY
3570 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3572 save_RasterPos4f(x
, y
, z
, w
);
3575 static void GLAPIENTRY
3576 save_RasterPos2dv(const GLdouble
* v
)
3578 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3581 static void GLAPIENTRY
3582 save_RasterPos2fv(const GLfloat
* v
)
3584 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3587 static void GLAPIENTRY
3588 save_RasterPos2iv(const GLint
* v
)
3590 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3593 static void GLAPIENTRY
3594 save_RasterPos2sv(const GLshort
* v
)
3596 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3599 static void GLAPIENTRY
3600 save_RasterPos3dv(const GLdouble
* v
)
3602 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3605 static void GLAPIENTRY
3606 save_RasterPos3fv(const GLfloat
* v
)
3608 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3611 static void GLAPIENTRY
3612 save_RasterPos3iv(const GLint
* v
)
3614 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3617 static void GLAPIENTRY
3618 save_RasterPos3sv(const GLshort
* v
)
3620 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3623 static void GLAPIENTRY
3624 save_RasterPos4dv(const GLdouble
* v
)
3626 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3627 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3630 static void GLAPIENTRY
3631 save_RasterPos4fv(const GLfloat
* v
)
3633 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3636 static void GLAPIENTRY
3637 save_RasterPos4iv(const GLint
* v
)
3639 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3640 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3643 static void GLAPIENTRY
3644 save_RasterPos4sv(const GLshort
* v
)
3646 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3650 static void GLAPIENTRY
3651 save_PassThrough(GLfloat token
)
3653 GET_CURRENT_CONTEXT(ctx
);
3655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3656 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3660 if (ctx
->ExecuteFlag
) {
3661 CALL_PassThrough(ctx
->Exec
, (token
));
3666 static void GLAPIENTRY
3667 save_ReadBuffer(GLenum mode
)
3669 GET_CURRENT_CONTEXT(ctx
);
3671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3672 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3676 if (ctx
->ExecuteFlag
) {
3677 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3682 static void GLAPIENTRY
3683 save_ResetHistogram(GLenum target
)
3685 GET_CURRENT_CONTEXT(ctx
);
3687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3688 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3692 if (ctx
->ExecuteFlag
) {
3693 CALL_ResetHistogram(ctx
->Exec
, (target
));
3698 static void GLAPIENTRY
3699 save_ResetMinmax(GLenum target
)
3701 GET_CURRENT_CONTEXT(ctx
);
3703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3704 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3708 if (ctx
->ExecuteFlag
) {
3709 CALL_ResetMinmax(ctx
->Exec
, (target
));
3714 static void GLAPIENTRY
3715 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3717 GET_CURRENT_CONTEXT(ctx
);
3719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3720 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3727 if (ctx
->ExecuteFlag
) {
3728 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3733 static void GLAPIENTRY
3734 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3736 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3740 static void GLAPIENTRY
3741 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3743 GET_CURRENT_CONTEXT(ctx
);
3745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3746 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3752 if (ctx
->ExecuteFlag
) {
3753 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3758 static void GLAPIENTRY
3759 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3761 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3765 static void GLAPIENTRY
3766 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3768 GET_CURRENT_CONTEXT(ctx
);
3770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3771 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3778 if (ctx
->ExecuteFlag
) {
3779 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3784 static void GLAPIENTRY
3785 save_ShadeModel(GLenum mode
)
3787 GET_CURRENT_CONTEXT(ctx
);
3789 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3791 if (ctx
->ExecuteFlag
) {
3792 CALL_ShadeModel(ctx
->Exec
, (mode
));
3795 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3798 SAVE_FLUSH_VERTICES(ctx
);
3800 /* Only save the value if we know the statechange will take effect:
3802 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3803 ctx
->ListState
.Current
.ShadeModel
= mode
;
3805 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3812 static void GLAPIENTRY
3813 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3815 GET_CURRENT_CONTEXT(ctx
);
3817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3818 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3824 if (ctx
->ExecuteFlag
) {
3825 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3830 static void GLAPIENTRY
3831 save_StencilMask(GLuint mask
)
3833 GET_CURRENT_CONTEXT(ctx
);
3835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3836 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3840 if (ctx
->ExecuteFlag
) {
3841 CALL_StencilMask(ctx
->Exec
, (mask
));
3846 static void GLAPIENTRY
3847 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3849 GET_CURRENT_CONTEXT(ctx
);
3851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3852 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3858 if (ctx
->ExecuteFlag
) {
3859 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3864 static void GLAPIENTRY
3865 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3867 GET_CURRENT_CONTEXT(ctx
);
3869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3870 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3877 if (ctx
->ExecuteFlag
) {
3878 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3883 static void GLAPIENTRY
3884 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3887 GET_CURRENT_CONTEXT(ctx
);
3889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3891 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3899 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3906 if (ctx
->ExecuteFlag
) {
3907 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3908 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3913 static void GLAPIENTRY
3914 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3916 GET_CURRENT_CONTEXT(ctx
);
3918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3919 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3924 if (ctx
->ExecuteFlag
) {
3925 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3930 static void GLAPIENTRY
3931 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3933 GET_CURRENT_CONTEXT(ctx
);
3935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3936 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3943 if (ctx
->ExecuteFlag
) {
3944 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3949 static void GLAPIENTRY
3950 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3952 GET_CURRENT_CONTEXT(ctx
);
3954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3955 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3959 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3967 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3970 if (ctx
->ExecuteFlag
) {
3971 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3976 static void GLAPIENTRY
3977 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3980 parray
[0] = (GLfloat
) param
;
3981 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3982 save_TexEnvfv(target
, pname
, parray
);
3986 static void GLAPIENTRY
3987 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3990 p
[0] = (GLfloat
) param
;
3991 p
[1] = p
[2] = p
[3] = 0.0F
;
3992 save_TexEnvfv(target
, pname
, p
);
3996 static void GLAPIENTRY
3997 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4000 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4001 p
[0] = INT_TO_FLOAT(param
[0]);
4002 p
[1] = INT_TO_FLOAT(param
[1]);
4003 p
[2] = INT_TO_FLOAT(param
[2]);
4004 p
[3] = INT_TO_FLOAT(param
[3]);
4007 p
[0] = (GLfloat
) param
[0];
4008 p
[1] = p
[2] = p
[3] = 0.0F
;
4010 save_TexEnvfv(target
, pname
, p
);
4014 static void GLAPIENTRY
4015 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4017 GET_CURRENT_CONTEXT(ctx
);
4019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4020 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4029 if (ctx
->ExecuteFlag
) {
4030 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4035 static void GLAPIENTRY
4036 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4039 p
[0] = (GLfloat
) params
[0];
4040 p
[1] = (GLfloat
) params
[1];
4041 p
[2] = (GLfloat
) params
[2];
4042 p
[3] = (GLfloat
) params
[3];
4043 save_TexGenfv(coord
, pname
, p
);
4047 static void GLAPIENTRY
4048 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4051 parray
[0] = (GLfloat
) param
;
4052 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4053 save_TexGenfv(coord
, pname
, parray
);
4057 static void GLAPIENTRY
4058 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4061 p
[0] = (GLfloat
) params
[0];
4062 p
[1] = (GLfloat
) params
[1];
4063 p
[2] = (GLfloat
) params
[2];
4064 p
[3] = (GLfloat
) params
[3];
4065 save_TexGenfv(coord
, pname
, p
);
4069 static void GLAPIENTRY
4070 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4074 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4075 save_TexGenfv(coord
, pname
, parray
);
4079 static void GLAPIENTRY
4080 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4084 parray
[1] = parray
[2] = parray
[3] = 0;
4085 save_TexGeniv(coord
, pname
, parray
);
4089 static void GLAPIENTRY
4090 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4092 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4095 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4104 if (ctx
->ExecuteFlag
) {
4105 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4110 static void GLAPIENTRY
4111 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4115 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4116 save_TexParameterfv(target
, pname
, parray
);
4120 static void GLAPIENTRY
4121 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4124 fparam
[0] = (GLfloat
) param
;
4125 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4126 save_TexParameterfv(target
, pname
, fparam
);
4130 static void GLAPIENTRY
4131 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4134 fparam
[0] = (GLfloat
) params
[0];
4135 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4136 save_TexParameterfv(target
, pname
, fparam
);
4140 static void GLAPIENTRY
4141 save_TexImage1D(GLenum target
,
4142 GLint level
, GLint components
,
4143 GLsizei width
, GLint border
,
4144 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4146 GET_CURRENT_CONTEXT(ctx
);
4147 if (target
== GL_PROXY_TEXTURE_1D
) {
4148 /* don't compile, execute immediately */
4149 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4150 border
, format
, type
, pixels
));
4154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4155 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4159 n
[3].i
= components
;
4160 n
[4].i
= (GLint
) width
;
4164 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4165 pixels
, &ctx
->Unpack
);
4167 if (ctx
->ExecuteFlag
) {
4168 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4169 border
, format
, type
, pixels
));
4175 static void GLAPIENTRY
4176 save_TexImage2D(GLenum target
,
4177 GLint level
, GLint components
,
4178 GLsizei width
, GLsizei height
, GLint border
,
4179 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4181 GET_CURRENT_CONTEXT(ctx
);
4182 if (target
== GL_PROXY_TEXTURE_2D
) {
4183 /* don't compile, execute immediately */
4184 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4185 height
, border
, format
, type
, pixels
));
4189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4190 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4194 n
[3].i
= components
;
4195 n
[4].i
= (GLint
) width
;
4196 n
[5].i
= (GLint
) height
;
4200 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4201 pixels
, &ctx
->Unpack
);
4203 if (ctx
->ExecuteFlag
) {
4204 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4205 height
, border
, format
, type
, pixels
));
4211 static void GLAPIENTRY
4212 save_TexImage3D(GLenum target
,
4213 GLint level
, GLint internalFormat
,
4214 GLsizei width
, GLsizei height
, GLsizei depth
,
4216 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4218 GET_CURRENT_CONTEXT(ctx
);
4219 if (target
== GL_PROXY_TEXTURE_3D
) {
4220 /* don't compile, execute immediately */
4221 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4222 height
, depth
, border
, format
, type
,
4227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4228 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4232 n
[3].i
= (GLint
) internalFormat
;
4233 n
[4].i
= (GLint
) width
;
4234 n
[5].i
= (GLint
) height
;
4235 n
[6].i
= (GLint
) depth
;
4239 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4240 pixels
, &ctx
->Unpack
);
4242 if (ctx
->ExecuteFlag
) {
4243 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4244 height
, depth
, border
, format
, type
,
4251 static void GLAPIENTRY
4252 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4253 GLsizei width
, GLenum format
, GLenum type
,
4254 const GLvoid
* pixels
)
4256 GET_CURRENT_CONTEXT(ctx
);
4259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4261 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4266 n
[4].i
= (GLint
) width
;
4269 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4270 pixels
, &ctx
->Unpack
);
4272 if (ctx
->ExecuteFlag
) {
4273 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4274 format
, type
, pixels
));
4279 static void GLAPIENTRY
4280 save_TexSubImage2D(GLenum target
, GLint level
,
4281 GLint xoffset
, GLint yoffset
,
4282 GLsizei width
, GLsizei height
,
4283 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4285 GET_CURRENT_CONTEXT(ctx
);
4288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4290 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4296 n
[5].i
= (GLint
) width
;
4297 n
[6].i
= (GLint
) height
;
4300 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4301 pixels
, &ctx
->Unpack
);
4303 if (ctx
->ExecuteFlag
) {
4304 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4305 width
, height
, format
, type
, pixels
));
4310 static void GLAPIENTRY
4311 save_TexSubImage3D(GLenum target
, GLint level
,
4312 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4313 GLsizei width
, GLsizei height
, GLsizei depth
,
4314 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4316 GET_CURRENT_CONTEXT(ctx
);
4319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4321 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4328 n
[6].i
= (GLint
) width
;
4329 n
[7].i
= (GLint
) height
;
4330 n
[8].i
= (GLint
) depth
;
4333 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4334 pixels
, &ctx
->Unpack
);
4336 if (ctx
->ExecuteFlag
) {
4337 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4338 xoffset
, yoffset
, zoffset
,
4339 width
, height
, depth
, format
, type
,
4345 static void GLAPIENTRY
4346 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4348 GET_CURRENT_CONTEXT(ctx
);
4350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4351 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4357 if (ctx
->ExecuteFlag
) {
4358 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4363 static void GLAPIENTRY
4364 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4366 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4371 static void GLAPIENTRY
4372 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4374 GET_CURRENT_CONTEXT(ctx
);
4376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4377 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4381 n
[3].i
= (GLint
) width
;
4382 n
[4].i
= (GLint
) height
;
4384 if (ctx
->ExecuteFlag
) {
4385 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4390 static void GLAPIENTRY
4391 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4393 GET_CURRENT_CONTEXT(ctx
);
4395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4396 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4403 if (ctx
->ExecuteFlag
) {
4404 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4408 static void GLAPIENTRY
4409 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4411 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4414 static void GLAPIENTRY
4415 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4417 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4420 static void GLAPIENTRY
4421 save_WindowPos2iMESA(GLint x
, GLint y
)
4423 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4426 static void GLAPIENTRY
4427 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4429 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4432 static void GLAPIENTRY
4433 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4435 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4438 static void GLAPIENTRY
4439 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4441 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4444 static void GLAPIENTRY
4445 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4447 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4450 static void GLAPIENTRY
4451 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4453 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4456 static void GLAPIENTRY
4457 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4459 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4462 static void GLAPIENTRY
4463 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4465 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4468 static void GLAPIENTRY
4469 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4471 save_WindowPos4fMESA(x
, y
, z
, w
);
4474 static void GLAPIENTRY
4475 save_WindowPos2dvMESA(const GLdouble
* v
)
4477 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4480 static void GLAPIENTRY
4481 save_WindowPos2fvMESA(const GLfloat
* v
)
4483 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4486 static void GLAPIENTRY
4487 save_WindowPos2ivMESA(const GLint
* v
)
4489 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4492 static void GLAPIENTRY
4493 save_WindowPos2svMESA(const GLshort
* v
)
4495 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4498 static void GLAPIENTRY
4499 save_WindowPos3dvMESA(const GLdouble
* v
)
4501 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4504 static void GLAPIENTRY
4505 save_WindowPos3fvMESA(const GLfloat
* v
)
4507 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4510 static void GLAPIENTRY
4511 save_WindowPos3ivMESA(const GLint
* v
)
4513 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4516 static void GLAPIENTRY
4517 save_WindowPos3svMESA(const GLshort
* v
)
4519 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4522 static void GLAPIENTRY
4523 save_WindowPos4dvMESA(const GLdouble
* v
)
4525 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4526 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4529 static void GLAPIENTRY
4530 save_WindowPos4fvMESA(const GLfloat
* v
)
4532 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4535 static void GLAPIENTRY
4536 save_WindowPos4ivMESA(const GLint
* v
)
4538 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4539 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4542 static void GLAPIENTRY
4543 save_WindowPos4svMESA(const GLshort
* v
)
4545 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4550 /* GL_ARB_multitexture */
4551 static void GLAPIENTRY
4552 save_ActiveTextureARB(GLenum target
)
4554 GET_CURRENT_CONTEXT(ctx
);
4556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4557 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4561 if (ctx
->ExecuteFlag
) {
4562 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4567 /* GL_ARB_transpose_matrix */
4569 static void GLAPIENTRY
4570 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4573 _math_transposefd(tm
, m
);
4574 save_LoadMatrixf(tm
);
4578 static void GLAPIENTRY
4579 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4582 _math_transposef(tm
, m
);
4583 save_LoadMatrixf(tm
);
4587 static void GLAPIENTRY
4588 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4591 _math_transposefd(tm
, m
);
4592 save_MultMatrixf(tm
);
4596 static void GLAPIENTRY
4597 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4600 _math_transposef(tm
, m
);
4601 save_MultMatrixf(tm
);
4604 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4606 GET_CURRENT_CONTEXT(ctx
);
4612 image
= malloc(size
);
4614 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4617 memcpy(image
, data
, size
);
4623 /* GL_ARB_texture_compression */
4624 static void GLAPIENTRY
4625 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4626 GLenum internalFormat
, GLsizei width
,
4627 GLint border
, GLsizei imageSize
,
4628 const GLvoid
* data
)
4630 GET_CURRENT_CONTEXT(ctx
);
4631 if (target
== GL_PROXY_TEXTURE_1D
) {
4632 /* don't compile, execute immediately */
4633 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4634 width
, border
, imageSize
,
4639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4641 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4645 n
[3].e
= internalFormat
;
4646 n
[4].i
= (GLint
) width
;
4649 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4651 if (ctx
->ExecuteFlag
) {
4652 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4653 (target
, level
, internalFormat
, width
,
4654 border
, imageSize
, data
));
4660 static void GLAPIENTRY
4661 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4662 GLenum internalFormat
, GLsizei width
,
4663 GLsizei height
, GLint border
, GLsizei imageSize
,
4664 const GLvoid
* data
)
4666 GET_CURRENT_CONTEXT(ctx
);
4667 if (target
== GL_PROXY_TEXTURE_2D
) {
4668 /* don't compile, execute immediately */
4669 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4670 width
, height
, border
,
4675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4677 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4681 n
[3].e
= internalFormat
;
4682 n
[4].i
= (GLint
) width
;
4683 n
[5].i
= (GLint
) height
;
4686 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4688 if (ctx
->ExecuteFlag
) {
4689 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4690 (target
, level
, internalFormat
, width
,
4691 height
, border
, imageSize
, data
));
4697 static void GLAPIENTRY
4698 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4699 GLenum internalFormat
, GLsizei width
,
4700 GLsizei height
, GLsizei depth
, GLint border
,
4701 GLsizei imageSize
, const GLvoid
* data
)
4703 GET_CURRENT_CONTEXT(ctx
);
4704 if (target
== GL_PROXY_TEXTURE_3D
) {
4705 /* don't compile, execute immediately */
4706 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4707 width
, height
, depth
, border
,
4712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4714 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4718 n
[3].e
= internalFormat
;
4719 n
[4].i
= (GLint
) width
;
4720 n
[5].i
= (GLint
) height
;
4721 n
[6].i
= (GLint
) depth
;
4724 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4726 if (ctx
->ExecuteFlag
) {
4727 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4728 (target
, level
, internalFormat
, width
,
4729 height
, depth
, border
, imageSize
,
4736 static void GLAPIENTRY
4737 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4738 GLsizei width
, GLenum format
,
4739 GLsizei imageSize
, const GLvoid
* data
)
4742 GET_CURRENT_CONTEXT(ctx
);
4743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4745 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4750 n
[4].i
= (GLint
) width
;
4753 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4755 if (ctx
->ExecuteFlag
) {
4756 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4757 width
, format
, imageSize
,
4763 static void GLAPIENTRY
4764 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4765 GLint yoffset
, GLsizei width
, GLsizei height
,
4766 GLenum format
, GLsizei imageSize
,
4767 const GLvoid
* data
)
4770 GET_CURRENT_CONTEXT(ctx
);
4771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4773 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4779 n
[5].i
= (GLint
) width
;
4780 n
[6].i
= (GLint
) height
;
4783 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4785 if (ctx
->ExecuteFlag
) {
4786 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4787 (target
, level
, xoffset
, yoffset
, width
,
4788 height
, format
, imageSize
, data
));
4793 static void GLAPIENTRY
4794 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4795 GLint yoffset
, GLint zoffset
, GLsizei width
,
4796 GLsizei height
, GLsizei depth
, GLenum format
,
4797 GLsizei imageSize
, const GLvoid
* data
)
4800 GET_CURRENT_CONTEXT(ctx
);
4801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4803 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4810 n
[6].i
= (GLint
) width
;
4811 n
[7].i
= (GLint
) height
;
4812 n
[8].i
= (GLint
) depth
;
4814 n
[10].i
= imageSize
;
4815 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4817 if (ctx
->ExecuteFlag
) {
4818 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4819 (target
, level
, xoffset
, yoffset
,
4820 zoffset
, width
, height
, depth
, format
,
4826 /* GL_ARB_multisample */
4827 static void GLAPIENTRY
4828 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4830 GET_CURRENT_CONTEXT(ctx
);
4832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4833 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4838 if (ctx
->ExecuteFlag
) {
4839 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4845 * GL_NV_vertex_program
4847 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4848 static void GLAPIENTRY
4849 save_BindProgramNV(GLenum target
, GLuint id
)
4851 GET_CURRENT_CONTEXT(ctx
);
4853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4854 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4859 if (ctx
->ExecuteFlag
) {
4860 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4864 static void GLAPIENTRY
4865 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4866 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4868 GET_CURRENT_CONTEXT(ctx
);
4870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4871 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4880 if (ctx
->ExecuteFlag
) {
4881 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4886 static void GLAPIENTRY
4887 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4888 const GLfloat
*params
)
4890 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4891 params
[2], params
[3]);
4895 static void GLAPIENTRY
4896 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4897 const GLfloat
* params
)
4899 GET_CURRENT_CONTEXT(ctx
);
4901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4905 const GLfloat
* p
= params
;
4907 for (i
= 0 ; i
< count
; i
++) {
4908 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4921 if (ctx
->ExecuteFlag
) {
4922 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4927 static void GLAPIENTRY
4928 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4929 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4931 save_ProgramEnvParameter4fARB(target
, index
,
4933 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4937 static void GLAPIENTRY
4938 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4939 const GLdouble
*params
)
4941 save_ProgramEnvParameter4fARB(target
, index
,
4942 (GLfloat
) params
[0],
4943 (GLfloat
) params
[1],
4944 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4947 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4949 #if FEATURE_NV_vertex_program
4950 static void GLAPIENTRY
4951 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4953 GET_CURRENT_CONTEXT(ctx
);
4955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4956 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4965 if (ctx
->ExecuteFlag
) {
4966 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4971 static void GLAPIENTRY
4972 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4973 GLsizei num
, const GLdouble
*params
)
4976 for (i
= 0; i
< num
; i
++) {
4977 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4982 static void GLAPIENTRY
4983 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4984 GLsizei num
, const GLfloat
*params
)
4987 for (i
= 0; i
< num
; i
++) {
4988 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4993 static void GLAPIENTRY
4994 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4995 const GLubyte
* program
)
4997 GET_CURRENT_CONTEXT(ctx
);
5000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5002 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
5004 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5006 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
5009 memcpy(programCopy
, program
, len
);
5013 n
[4].data
= programCopy
;
5015 if (ctx
->ExecuteFlag
) {
5016 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
5021 static void GLAPIENTRY
5022 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
5024 GET_CURRENT_CONTEXT(ctx
);
5027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5029 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
5031 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
5033 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
5036 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
5040 if (ctx
->ExecuteFlag
) {
5041 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
5046 static void GLAPIENTRY
5047 save_TrackMatrixNV(GLenum target
, GLuint address
,
5048 GLenum matrix
, GLenum transform
)
5050 GET_CURRENT_CONTEXT(ctx
);
5052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5053 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
5060 if (ctx
->ExecuteFlag
) {
5061 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
5064 #endif /* FEATURE_NV_vertex_program */
5068 * GL_NV_fragment_program
5070 #if FEATURE_NV_fragment_program
5071 static void GLAPIENTRY
5072 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5073 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5075 GET_CURRENT_CONTEXT(ctx
);
5077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5078 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5087 if (ctx
->ExecuteFlag
) {
5088 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5093 static void GLAPIENTRY
5094 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5095 const GLfloat
*params
)
5097 GET_CURRENT_CONTEXT(ctx
);
5099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5100 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5109 if (ctx
->ExecuteFlag
) {
5110 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5115 static void GLAPIENTRY
5116 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5117 const GLfloat
*params
)
5119 GET_CURRENT_CONTEXT(ctx
);
5121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5125 const GLfloat
* p
= params
;
5127 for (i
= 0 ; i
< count
; i
++) {
5128 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5141 if (ctx
->ExecuteFlag
) {
5142 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5147 static void GLAPIENTRY
5148 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5149 GLdouble x
, GLdouble y
,
5150 GLdouble z
, GLdouble w
)
5152 GET_CURRENT_CONTEXT(ctx
);
5154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5155 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5159 n
[3].f
= (GLfloat
) x
;
5160 n
[4].f
= (GLfloat
) y
;
5161 n
[5].f
= (GLfloat
) z
;
5162 n
[6].f
= (GLfloat
) w
;
5164 if (ctx
->ExecuteFlag
) {
5165 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5170 static void GLAPIENTRY
5171 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5172 const GLdouble
*params
)
5174 GET_CURRENT_CONTEXT(ctx
);
5176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5177 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5181 n
[3].f
= (GLfloat
) params
[0];
5182 n
[4].f
= (GLfloat
) params
[1];
5183 n
[5].f
= (GLfloat
) params
[2];
5184 n
[6].f
= (GLfloat
) params
[3];
5186 if (ctx
->ExecuteFlag
) {
5187 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5191 static void GLAPIENTRY
5192 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5193 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5195 GET_CURRENT_CONTEXT(ctx
);
5198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5200 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5202 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
5204 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5207 memcpy(nameCopy
, name
, len
);
5210 n
[3].data
= nameCopy
;
5216 if (ctx
->ExecuteFlag
) {
5217 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5222 static void GLAPIENTRY
5223 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5226 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5230 static void GLAPIENTRY
5231 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5232 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5234 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5235 (GLfloat
) z
, (GLfloat
) w
);
5239 static void GLAPIENTRY
5240 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5243 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5244 (GLfloat
) v
[1], (GLfloat
) v
[2],
5248 #endif /* FEATURE_NV_fragment_program */
5252 /* GL_EXT_stencil_two_side */
5253 static void GLAPIENTRY
5254 save_ActiveStencilFaceEXT(GLenum face
)
5256 GET_CURRENT_CONTEXT(ctx
);
5258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5259 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5263 if (ctx
->ExecuteFlag
) {
5264 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5269 /* GL_EXT_depth_bounds_test */
5270 static void GLAPIENTRY
5271 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5273 GET_CURRENT_CONTEXT(ctx
);
5275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5276 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5278 n
[1].f
= (GLfloat
) zmin
;
5279 n
[2].f
= (GLfloat
) zmax
;
5281 if (ctx
->ExecuteFlag
) {
5282 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5288 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5290 static void GLAPIENTRY
5291 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5292 const GLvoid
* string
)
5294 GET_CURRENT_CONTEXT(ctx
);
5297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5299 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5301 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5303 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5306 memcpy(programCopy
, string
, len
);
5310 n
[4].data
= programCopy
;
5312 if (ctx
->ExecuteFlag
) {
5313 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5317 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5320 #if FEATURE_queryobj
5322 static void GLAPIENTRY
5323 save_BeginQueryARB(GLenum target
, GLuint id
)
5325 GET_CURRENT_CONTEXT(ctx
);
5327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5328 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5333 if (ctx
->ExecuteFlag
) {
5334 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5339 static void GLAPIENTRY
5340 save_EndQueryARB(GLenum target
)
5342 GET_CURRENT_CONTEXT(ctx
);
5344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5345 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5349 if (ctx
->ExecuteFlag
) {
5350 CALL_EndQueryARB(ctx
->Exec
, (target
));
5354 #endif /* FEATURE_queryobj */
5357 static void GLAPIENTRY
5358 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5360 GET_CURRENT_CONTEXT(ctx
);
5362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5363 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5367 if (count
> MAX_DRAW_BUFFERS
)
5368 count
= MAX_DRAW_BUFFERS
;
5369 for (i
= 0; i
< count
; i
++) {
5370 n
[2 + i
].e
= buffers
[i
];
5373 if (ctx
->ExecuteFlag
) {
5374 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5378 static void GLAPIENTRY
5379 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5381 GET_CURRENT_CONTEXT(ctx
);
5384 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5392 if (ctx
->ExecuteFlag
) {
5393 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5397 static void GLAPIENTRY
5398 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5401 p
[0] = INT_TO_FLOAT(param
[0]);
5402 p
[1] = INT_TO_FLOAT(param
[1]);
5403 p
[2] = INT_TO_FLOAT(param
[2]);
5404 p
[3] = INT_TO_FLOAT(param
[3]);
5405 save_TexBumpParameterfvATI(pname
, p
);
5408 #if FEATURE_ATI_fragment_shader
5409 static void GLAPIENTRY
5410 save_BindFragmentShaderATI(GLuint id
)
5412 GET_CURRENT_CONTEXT(ctx
);
5415 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5419 if (ctx
->ExecuteFlag
) {
5420 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5424 static void GLAPIENTRY
5425 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5427 GET_CURRENT_CONTEXT(ctx
);
5430 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5438 if (ctx
->ExecuteFlag
) {
5439 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5444 static void GLAPIENTRY
5445 save_Attr1fNV(GLenum attr
, GLfloat x
)
5447 GET_CURRENT_CONTEXT(ctx
);
5449 SAVE_FLUSH_VERTICES(ctx
);
5450 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5456 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5457 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5458 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5460 if (ctx
->ExecuteFlag
) {
5461 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5465 static void GLAPIENTRY
5466 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5468 GET_CURRENT_CONTEXT(ctx
);
5470 SAVE_FLUSH_VERTICES(ctx
);
5471 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5478 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5479 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5480 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5482 if (ctx
->ExecuteFlag
) {
5483 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5487 static void GLAPIENTRY
5488 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5490 GET_CURRENT_CONTEXT(ctx
);
5492 SAVE_FLUSH_VERTICES(ctx
);
5493 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5501 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5502 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5503 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5505 if (ctx
->ExecuteFlag
) {
5506 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5510 static void GLAPIENTRY
5511 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5513 GET_CURRENT_CONTEXT(ctx
);
5515 SAVE_FLUSH_VERTICES(ctx
);
5516 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5525 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5526 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5527 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5529 if (ctx
->ExecuteFlag
) {
5530 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5535 static void GLAPIENTRY
5536 save_Attr1fARB(GLenum attr
, GLfloat x
)
5538 GET_CURRENT_CONTEXT(ctx
);
5540 SAVE_FLUSH_VERTICES(ctx
);
5541 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5547 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5548 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5549 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5551 if (ctx
->ExecuteFlag
) {
5552 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5556 static void GLAPIENTRY
5557 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5559 GET_CURRENT_CONTEXT(ctx
);
5561 SAVE_FLUSH_VERTICES(ctx
);
5562 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5569 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5570 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5571 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5573 if (ctx
->ExecuteFlag
) {
5574 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5578 static void GLAPIENTRY
5579 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5581 GET_CURRENT_CONTEXT(ctx
);
5583 SAVE_FLUSH_VERTICES(ctx
);
5584 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5592 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5593 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5594 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5596 if (ctx
->ExecuteFlag
) {
5597 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5601 static void GLAPIENTRY
5602 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5604 GET_CURRENT_CONTEXT(ctx
);
5606 SAVE_FLUSH_VERTICES(ctx
);
5607 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5616 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5617 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5618 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5620 if (ctx
->ExecuteFlag
) {
5621 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5626 static void GLAPIENTRY
5627 save_EvalCoord1f(GLfloat x
)
5629 GET_CURRENT_CONTEXT(ctx
);
5631 SAVE_FLUSH_VERTICES(ctx
);
5632 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5636 if (ctx
->ExecuteFlag
) {
5637 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5641 static void GLAPIENTRY
5642 save_EvalCoord1fv(const GLfloat
* v
)
5644 save_EvalCoord1f(v
[0]);
5647 static void GLAPIENTRY
5648 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5650 GET_CURRENT_CONTEXT(ctx
);
5652 SAVE_FLUSH_VERTICES(ctx
);
5653 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5658 if (ctx
->ExecuteFlag
) {
5659 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5663 static void GLAPIENTRY
5664 save_EvalCoord2fv(const GLfloat
* v
)
5666 save_EvalCoord2f(v
[0], v
[1]);
5670 static void GLAPIENTRY
5671 save_EvalPoint1(GLint x
)
5673 GET_CURRENT_CONTEXT(ctx
);
5675 SAVE_FLUSH_VERTICES(ctx
);
5676 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5680 if (ctx
->ExecuteFlag
) {
5681 CALL_EvalPoint1(ctx
->Exec
, (x
));
5685 static void GLAPIENTRY
5686 save_EvalPoint2(GLint x
, GLint y
)
5688 GET_CURRENT_CONTEXT(ctx
);
5690 SAVE_FLUSH_VERTICES(ctx
);
5691 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5696 if (ctx
->ExecuteFlag
) {
5697 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5701 static void GLAPIENTRY
5702 save_Indexf(GLfloat x
)
5704 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5707 static void GLAPIENTRY
5708 save_Indexfv(const GLfloat
* v
)
5710 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5713 static void GLAPIENTRY
5714 save_EdgeFlag(GLboolean x
)
5716 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5721 * Compare 'count' elements of vectors 'a' and 'b'.
5722 * \return GL_TRUE if equal, GL_FALSE if different.
5724 static inline GLboolean
5725 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5727 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5732 * This glMaterial function is used for glMaterial calls that are outside
5733 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5735 static void GLAPIENTRY
5736 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5738 GET_CURRENT_CONTEXT(ctx
);
5746 case GL_FRONT_AND_BACK
:
5749 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5758 case GL_AMBIENT_AND_DIFFUSE
:
5764 case GL_COLOR_INDEXES
:
5768 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5772 if (ctx
->ExecuteFlag
) {
5773 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5776 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5778 /* Try to eliminate redundant statechanges. Because it is legal to
5779 * call glMaterial even inside begin/end calls, don't need to worry
5780 * about ctx->Driver.CurrentSavePrimitive here.
5782 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5783 if (bitmask
& (1 << i
)) {
5784 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5785 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5786 /* no change in material value */
5787 bitmask
&= ~(1 << i
);
5790 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5791 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5796 /* If this call has no effect, return early */
5800 SAVE_FLUSH_VERTICES(ctx
);
5802 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5806 for (i
= 0; i
< args
; i
++)
5807 n
[3 + i
].f
= param
[i
];
5811 static void GLAPIENTRY
5812 save_Begin(GLenum mode
)
5814 GET_CURRENT_CONTEXT(ctx
);
5816 GLboolean error
= GL_FALSE
;
5818 if (mode
> GL_POLYGON
) {
5819 _mesa_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode=%x)", mode
);
5822 if (ctx
->ExecuteFlag
) {
5823 if (!_mesa_valid_prim_mode(ctx
, mode
, "glBegin")) {
5828 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5829 /* Typically the first begin. This may raise an error on
5830 * playback, depending on whether CallList is issued from inside
5831 * a begin/end or not.
5833 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5835 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5836 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5839 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5844 /* Give the driver an opportunity to hook in an optimized
5845 * display list compiler.
5847 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5850 SAVE_FLUSH_VERTICES(ctx
);
5851 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5857 if (ctx
->ExecuteFlag
) {
5858 CALL_Begin(ctx
->Exec
, (mode
));
5862 static void GLAPIENTRY
5865 GET_CURRENT_CONTEXT(ctx
);
5866 SAVE_FLUSH_VERTICES(ctx
);
5867 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5868 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5869 if (ctx
->ExecuteFlag
) {
5870 CALL_End(ctx
->Exec
, ());
5874 static void GLAPIENTRY
5875 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5877 GET_CURRENT_CONTEXT(ctx
);
5879 SAVE_FLUSH_VERTICES(ctx
);
5880 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5887 if (ctx
->ExecuteFlag
) {
5888 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5893 static void GLAPIENTRY
5894 save_Vertex2f(GLfloat x
, GLfloat y
)
5896 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5899 static void GLAPIENTRY
5900 save_Vertex2fv(const GLfloat
* v
)
5902 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5905 static void GLAPIENTRY
5906 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5908 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5911 static void GLAPIENTRY
5912 save_Vertex3fv(const GLfloat
* v
)
5914 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5917 static void GLAPIENTRY
5918 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5920 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5923 static void GLAPIENTRY
5924 save_Vertex4fv(const GLfloat
* v
)
5926 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5929 static void GLAPIENTRY
5930 save_TexCoord1f(GLfloat x
)
5932 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5935 static void GLAPIENTRY
5936 save_TexCoord1fv(const GLfloat
* v
)
5938 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5941 static void GLAPIENTRY
5942 save_TexCoord2f(GLfloat x
, GLfloat y
)
5944 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5947 static void GLAPIENTRY
5948 save_TexCoord2fv(const GLfloat
* v
)
5950 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5953 static void GLAPIENTRY
5954 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5956 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5959 static void GLAPIENTRY
5960 save_TexCoord3fv(const GLfloat
* v
)
5962 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5965 static void GLAPIENTRY
5966 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5968 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5971 static void GLAPIENTRY
5972 save_TexCoord4fv(const GLfloat
* v
)
5974 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5977 static void GLAPIENTRY
5978 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5980 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5983 static void GLAPIENTRY
5984 save_Normal3fv(const GLfloat
* v
)
5986 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5989 static void GLAPIENTRY
5990 save_FogCoordfEXT(GLfloat x
)
5992 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5995 static void GLAPIENTRY
5996 save_FogCoordfvEXT(const GLfloat
* v
)
5998 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6001 static void GLAPIENTRY
6002 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6004 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6007 static void GLAPIENTRY
6008 save_Color3fv(const GLfloat
* v
)
6010 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6013 static void GLAPIENTRY
6014 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6016 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6019 static void GLAPIENTRY
6020 save_Color4fv(const GLfloat
* v
)
6022 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6025 static void GLAPIENTRY
6026 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6028 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6031 static void GLAPIENTRY
6032 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6034 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6038 /* Just call the respective ATTR for texcoord
6040 static void GLAPIENTRY
6041 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6043 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6044 save_Attr1fNV(attr
, x
);
6047 static void GLAPIENTRY
6048 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6050 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6051 save_Attr1fNV(attr
, v
[0]);
6054 static void GLAPIENTRY
6055 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6057 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6058 save_Attr2fNV(attr
, x
, y
);
6061 static void GLAPIENTRY
6062 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6064 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6065 save_Attr2fNV(attr
, v
[0], v
[1]);
6068 static void GLAPIENTRY
6069 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6071 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6072 save_Attr3fNV(attr
, x
, y
, z
);
6075 static void GLAPIENTRY
6076 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6078 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6079 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6082 static void GLAPIENTRY
6083 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6084 GLfloat z
, GLfloat w
)
6086 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6087 save_Attr4fNV(attr
, x
, y
, z
, w
);
6090 static void GLAPIENTRY
6091 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6093 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6094 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6099 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6105 GET_CURRENT_CONTEXT(ctx
);
6106 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6110 /* First level for NV_vertex_program:
6112 * Check for errors at compile time?.
6114 static void GLAPIENTRY
6115 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6117 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6118 save_Attr1fNV(index
, x
);
6123 static void GLAPIENTRY
6124 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6126 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6127 save_Attr1fNV(index
, v
[0]);
6132 static void GLAPIENTRY
6133 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6135 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6136 save_Attr2fNV(index
, x
, y
);
6141 static void GLAPIENTRY
6142 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6144 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6145 save_Attr2fNV(index
, v
[0], v
[1]);
6150 static void GLAPIENTRY
6151 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6153 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6154 save_Attr3fNV(index
, x
, y
, z
);
6159 static void GLAPIENTRY
6160 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6162 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6163 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6168 static void GLAPIENTRY
6169 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6170 GLfloat z
, GLfloat w
)
6172 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6173 save_Attr4fNV(index
, x
, y
, z
, w
);
6178 static void GLAPIENTRY
6179 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6181 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6182 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6190 static void GLAPIENTRY
6191 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6193 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6194 save_Attr1fARB(index
, x
);
6199 static void GLAPIENTRY
6200 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6202 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6203 save_Attr1fARB(index
, v
[0]);
6208 static void GLAPIENTRY
6209 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6211 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6212 save_Attr2fARB(index
, x
, y
);
6217 static void GLAPIENTRY
6218 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6220 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6221 save_Attr2fARB(index
, v
[0], v
[1]);
6226 static void GLAPIENTRY
6227 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6229 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6230 save_Attr3fARB(index
, x
, y
, z
);
6235 static void GLAPIENTRY
6236 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6238 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6239 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6244 static void GLAPIENTRY
6245 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6248 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6249 save_Attr4fARB(index
, x
, y
, z
, w
);
6254 static void GLAPIENTRY
6255 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6257 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6258 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6264 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6266 static void GLAPIENTRY
6267 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6269 GET_CURRENT_CONTEXT(ctx
);
6270 FLUSH_VERTICES(ctx
, 0);
6271 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6274 static GLint GLAPIENTRY
6275 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6277 GET_CURRENT_CONTEXT(ctx
);
6278 FLUSH_VERTICES(ctx
, 0);
6279 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6282 static GLint GLAPIENTRY
6283 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6285 GET_CURRENT_CONTEXT(ctx
);
6286 FLUSH_VERTICES(ctx
, 0);
6287 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6289 /* XXX more shader functions needed here */
6292 #if FEATURE_EXT_framebuffer_blit
6293 static void GLAPIENTRY
6294 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6295 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6296 GLbitfield mask
, GLenum filter
)
6298 GET_CURRENT_CONTEXT(ctx
);
6300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6301 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6314 if (ctx
->ExecuteFlag
) {
6315 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6316 dstX0
, dstY0
, dstX1
, dstY1
,
6323 /** GL_EXT_provoking_vertex */
6324 static void GLAPIENTRY
6325 save_ProvokingVertexEXT(GLenum mode
)
6327 GET_CURRENT_CONTEXT(ctx
);
6329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6330 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6334 if (ctx
->ExecuteFlag
) {
6335 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6336 _mesa_ProvokingVertexEXT(mode
);
6341 /** GL_EXT_transform_feedback */
6342 static void GLAPIENTRY
6343 save_BeginTransformFeedback(GLenum mode
)
6345 GET_CURRENT_CONTEXT(ctx
);
6347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6348 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6352 if (ctx
->ExecuteFlag
) {
6353 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6358 /** GL_EXT_transform_feedback */
6359 static void GLAPIENTRY
6360 save_EndTransformFeedback(void)
6362 GET_CURRENT_CONTEXT(ctx
);
6363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6364 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6365 if (ctx
->ExecuteFlag
) {
6366 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6370 static void GLAPIENTRY
6371 save_BindTransformFeedback(GLenum target
, GLuint name
)
6373 GET_CURRENT_CONTEXT(ctx
);
6375 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6376 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6381 if (ctx
->ExecuteFlag
) {
6382 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6386 static void GLAPIENTRY
6387 save_PauseTransformFeedback(void)
6389 GET_CURRENT_CONTEXT(ctx
);
6390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6391 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6392 if (ctx
->ExecuteFlag
) {
6393 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6397 static void GLAPIENTRY
6398 save_ResumeTransformFeedback(void)
6400 GET_CURRENT_CONTEXT(ctx
);
6401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6402 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6403 if (ctx
->ExecuteFlag
) {
6404 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6408 static void GLAPIENTRY
6409 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6411 GET_CURRENT_CONTEXT(ctx
);
6413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6414 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6419 if (ctx
->ExecuteFlag
) {
6420 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6425 /* aka UseProgram() */
6426 static void GLAPIENTRY
6427 save_UseProgramObjectARB(GLhandleARB program
)
6429 GET_CURRENT_CONTEXT(ctx
);
6431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6432 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6436 if (ctx
->ExecuteFlag
) {
6437 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6442 static void GLAPIENTRY
6443 save_Uniform1fARB(GLint location
, GLfloat x
)
6445 GET_CURRENT_CONTEXT(ctx
);
6447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6448 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6453 if (ctx
->ExecuteFlag
) {
6454 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6459 static void GLAPIENTRY
6460 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6462 GET_CURRENT_CONTEXT(ctx
);
6464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6465 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6471 if (ctx
->ExecuteFlag
) {
6472 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6477 static void GLAPIENTRY
6478 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6480 GET_CURRENT_CONTEXT(ctx
);
6482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6483 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6490 if (ctx
->ExecuteFlag
) {
6491 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6496 static void GLAPIENTRY
6497 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6499 GET_CURRENT_CONTEXT(ctx
);
6501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6502 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6510 if (ctx
->ExecuteFlag
) {
6511 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6516 /** Return copy of memory */
6518 memdup(const void *src
, GLsizei bytes
)
6520 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6522 memcpy(b
, src
, bytes
);
6527 static void GLAPIENTRY
6528 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6530 GET_CURRENT_CONTEXT(ctx
);
6532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6533 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6537 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6539 if (ctx
->ExecuteFlag
) {
6540 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6544 static void GLAPIENTRY
6545 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6547 GET_CURRENT_CONTEXT(ctx
);
6549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6550 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6554 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6556 if (ctx
->ExecuteFlag
) {
6557 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6561 static void GLAPIENTRY
6562 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6564 GET_CURRENT_CONTEXT(ctx
);
6566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6567 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6571 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6573 if (ctx
->ExecuteFlag
) {
6574 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6578 static void GLAPIENTRY
6579 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6581 GET_CURRENT_CONTEXT(ctx
);
6583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6584 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6588 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6590 if (ctx
->ExecuteFlag
) {
6591 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6596 static void GLAPIENTRY
6597 save_Uniform1iARB(GLint location
, GLint x
)
6599 GET_CURRENT_CONTEXT(ctx
);
6601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6602 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6607 if (ctx
->ExecuteFlag
) {
6608 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6612 static void GLAPIENTRY
6613 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6615 GET_CURRENT_CONTEXT(ctx
);
6617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6618 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6624 if (ctx
->ExecuteFlag
) {
6625 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6629 static void GLAPIENTRY
6630 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6632 GET_CURRENT_CONTEXT(ctx
);
6634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6635 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6642 if (ctx
->ExecuteFlag
) {
6643 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6647 static void GLAPIENTRY
6648 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6650 GET_CURRENT_CONTEXT(ctx
);
6652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6653 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6661 if (ctx
->ExecuteFlag
) {
6662 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6668 static void GLAPIENTRY
6669 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6671 GET_CURRENT_CONTEXT(ctx
);
6673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6674 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6678 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6680 if (ctx
->ExecuteFlag
) {
6681 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6685 static void GLAPIENTRY
6686 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6688 GET_CURRENT_CONTEXT(ctx
);
6690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6691 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6695 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6697 if (ctx
->ExecuteFlag
) {
6698 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6702 static void GLAPIENTRY
6703 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6705 GET_CURRENT_CONTEXT(ctx
);
6707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6708 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6712 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6714 if (ctx
->ExecuteFlag
) {
6715 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6719 static void GLAPIENTRY
6720 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6722 GET_CURRENT_CONTEXT(ctx
);
6724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6725 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6729 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6731 if (ctx
->ExecuteFlag
) {
6732 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6738 static void GLAPIENTRY
6739 save_Uniform1ui(GLint location
, GLuint x
)
6741 GET_CURRENT_CONTEXT(ctx
);
6743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6744 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6749 if (ctx
->ExecuteFlag
) {
6750 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6754 static void GLAPIENTRY
6755 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6757 GET_CURRENT_CONTEXT(ctx
);
6759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6760 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6766 if (ctx
->ExecuteFlag
) {
6767 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6771 static void GLAPIENTRY
6772 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6774 GET_CURRENT_CONTEXT(ctx
);
6776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6777 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6784 if (ctx
->ExecuteFlag
) {
6785 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6789 static void GLAPIENTRY
6790 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6792 GET_CURRENT_CONTEXT(ctx
);
6794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6795 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6803 if (ctx
->ExecuteFlag
) {
6804 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6810 static void GLAPIENTRY
6811 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6813 GET_CURRENT_CONTEXT(ctx
);
6815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6816 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6820 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6822 if (ctx
->ExecuteFlag
) {
6823 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6827 static void GLAPIENTRY
6828 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6830 GET_CURRENT_CONTEXT(ctx
);
6832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6833 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6837 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6839 if (ctx
->ExecuteFlag
) {
6840 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6844 static void GLAPIENTRY
6845 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6847 GET_CURRENT_CONTEXT(ctx
);
6849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6850 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6854 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6856 if (ctx
->ExecuteFlag
) {
6857 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6861 static void GLAPIENTRY
6862 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6864 GET_CURRENT_CONTEXT(ctx
);
6866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6867 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6871 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6873 if (ctx
->ExecuteFlag
) {
6874 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6880 static void GLAPIENTRY
6881 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6884 GET_CURRENT_CONTEXT(ctx
);
6886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6887 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6892 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6894 if (ctx
->ExecuteFlag
) {
6895 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6899 static void GLAPIENTRY
6900 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6903 GET_CURRENT_CONTEXT(ctx
);
6905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6906 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6911 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6913 if (ctx
->ExecuteFlag
) {
6914 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6918 static void GLAPIENTRY
6919 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6922 GET_CURRENT_CONTEXT(ctx
);
6924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6925 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6930 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6932 if (ctx
->ExecuteFlag
) {
6933 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6938 static void GLAPIENTRY
6939 save_UniformMatrix2x3fv(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_MATRIX23
, 4);
6950 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6952 if (ctx
->ExecuteFlag
) {
6953 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6957 static void GLAPIENTRY
6958 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6961 GET_CURRENT_CONTEXT(ctx
);
6963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6964 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6969 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6971 if (ctx
->ExecuteFlag
) {
6972 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6977 static void GLAPIENTRY
6978 save_UniformMatrix2x4fv(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_MATRIX24
, 4);
6989 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6991 if (ctx
->ExecuteFlag
) {
6992 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6996 static void GLAPIENTRY
6997 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7000 GET_CURRENT_CONTEXT(ctx
);
7002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7003 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
7008 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
7010 if (ctx
->ExecuteFlag
) {
7011 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7016 static void GLAPIENTRY
7017 save_UniformMatrix3x4fv(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_MATRIX34
, 4);
7028 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
7030 if (ctx
->ExecuteFlag
) {
7031 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7035 static void GLAPIENTRY
7036 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7039 GET_CURRENT_CONTEXT(ctx
);
7041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7042 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
7047 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
7049 if (ctx
->ExecuteFlag
) {
7050 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7054 static void GLAPIENTRY
7055 save_ClampColorARB(GLenum target
, GLenum clamp
)
7057 GET_CURRENT_CONTEXT(ctx
);
7059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7060 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7065 if (ctx
->ExecuteFlag
) {
7066 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
7070 static void GLAPIENTRY
7071 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
7073 GET_CURRENT_CONTEXT(ctx
);
7075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7076 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
7081 if (ctx
->ExecuteFlag
) {
7082 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
7086 static void GLAPIENTRY
7087 save_ActiveProgramEXT(GLuint program
)
7089 GET_CURRENT_CONTEXT(ctx
);
7091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7092 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7096 if (ctx
->ExecuteFlag
) {
7097 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7101 /** GL_EXT_texture_integer */
7102 static void GLAPIENTRY
7103 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7105 GET_CURRENT_CONTEXT(ctx
);
7107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7108 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7115 if (ctx
->ExecuteFlag
) {
7116 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7120 /** GL_EXT_texture_integer */
7121 static void GLAPIENTRY
7122 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7124 GET_CURRENT_CONTEXT(ctx
);
7126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7127 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7134 if (ctx
->ExecuteFlag
) {
7135 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7139 /** GL_EXT_texture_integer */
7140 static void GLAPIENTRY
7141 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7143 GET_CURRENT_CONTEXT(ctx
);
7145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7146 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7155 if (ctx
->ExecuteFlag
) {
7156 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7160 /** GL_EXT_texture_integer */
7161 static void GLAPIENTRY
7162 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7164 GET_CURRENT_CONTEXT(ctx
);
7166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7167 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7171 n
[3].ui
= params
[0];
7172 n
[4].ui
= params
[1];
7173 n
[5].ui
= params
[2];
7174 n
[6].ui
= params
[3];
7176 if (ctx
->ExecuteFlag
) {
7177 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7181 /** GL_EXT_texture_integer */
7182 static void GLAPIENTRY
7183 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7185 GET_CURRENT_CONTEXT(ctx
);
7186 FLUSH_VERTICES(ctx
, 0);
7187 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7190 /** GL_EXT_texture_integer */
7191 static void GLAPIENTRY
7192 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7194 GET_CURRENT_CONTEXT(ctx
);
7195 FLUSH_VERTICES(ctx
, 0);
7196 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7200 /* GL_ARB_instanced_arrays */
7201 static void GLAPIENTRY
7202 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7204 GET_CURRENT_CONTEXT(ctx
);
7206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7207 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7212 if (ctx
->ExecuteFlag
) {
7213 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7218 /* GL_NV_texture_barrier */
7219 static void GLAPIENTRY
7220 save_TextureBarrierNV(void)
7222 GET_CURRENT_CONTEXT(ctx
);
7223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7224 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7225 if (ctx
->ExecuteFlag
) {
7226 CALL_TextureBarrierNV(ctx
->Exec
, ());
7231 /* GL_ARB_sampler_objects */
7232 static void GLAPIENTRY
7233 save_BindSampler(GLuint unit
, GLuint sampler
)
7236 GET_CURRENT_CONTEXT(ctx
);
7237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7238 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7243 if (ctx
->ExecuteFlag
) {
7244 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7248 static void GLAPIENTRY
7249 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7252 GET_CURRENT_CONTEXT(ctx
);
7253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7254 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7259 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7265 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7268 if (ctx
->ExecuteFlag
) {
7269 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7273 static void GLAPIENTRY
7274 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7276 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7279 static void GLAPIENTRY
7280 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7283 GET_CURRENT_CONTEXT(ctx
);
7284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7285 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7290 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7296 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7299 if (ctx
->ExecuteFlag
) {
7300 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7304 static void GLAPIENTRY
7305 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7307 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7310 static void GLAPIENTRY
7311 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7314 GET_CURRENT_CONTEXT(ctx
);
7315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7316 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7321 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7327 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7330 if (ctx
->ExecuteFlag
) {
7331 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7335 static void GLAPIENTRY
7336 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7339 GET_CURRENT_CONTEXT(ctx
);
7340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7341 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7345 n
[3].ui
= params
[0];
7346 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7347 n
[4].ui
= params
[1];
7348 n
[5].ui
= params
[2];
7349 n
[6].ui
= params
[3];
7352 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7355 if (ctx
->ExecuteFlag
) {
7356 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7360 /* GL_ARB_geometry_shader4 */
7361 static void GLAPIENTRY
7362 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7365 GET_CURRENT_CONTEXT(ctx
);
7366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7367 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7373 if (ctx
->ExecuteFlag
) {
7374 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7378 static void GLAPIENTRY
7379 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7380 GLuint texture
, GLint level
)
7383 GET_CURRENT_CONTEXT(ctx
);
7384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7385 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7388 n
[2].e
= attachment
;
7392 if (ctx
->ExecuteFlag
) {
7393 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7397 static void GLAPIENTRY
7398 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7399 GLuint texture
, GLint level
, GLenum face
)
7402 GET_CURRENT_CONTEXT(ctx
);
7403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7404 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7407 n
[2].e
= attachment
;
7412 if (ctx
->ExecuteFlag
) {
7413 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7420 static void GLAPIENTRY
7421 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7424 GET_CURRENT_CONTEXT(ctx
);
7425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7426 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7428 union uint64_pair p
;
7432 n
[3].ui
= p
.uint32
[0];
7433 n
[4].ui
= p
.uint32
[1];
7435 if (ctx
->ExecuteFlag
) {
7436 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7441 /** GL_NV_conditional_render */
7442 static void GLAPIENTRY
7443 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7445 GET_CURRENT_CONTEXT(ctx
);
7447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7448 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7453 if (ctx
->ExecuteFlag
) {
7454 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7458 static void GLAPIENTRY
7459 save_EndConditionalRender(void)
7461 GET_CURRENT_CONTEXT(ctx
);
7462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7463 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7464 if (ctx
->ExecuteFlag
) {
7465 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7471 * Save an error-generating command into display list.
7473 * KW: Will appear in the list before the vertex buffer containing the
7474 * command that provoked the error. I don't see this as a problem.
7477 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7480 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7483 n
[2].data
= (void *) s
;
7489 * Compile an error into current display list.
7492 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7494 if (ctx
->CompileFlag
)
7495 save_error(ctx
, error
, s
);
7496 if (ctx
->ExecuteFlag
)
7497 _mesa_error(ctx
, error
, "%s", s
);
7502 * Test if ID names a display list.
7505 islist(struct gl_context
*ctx
, GLuint list
)
7507 if (list
> 0 && lookup_list(ctx
, list
)) {
7517 /**********************************************************************/
7518 /* Display list execution */
7519 /**********************************************************************/
7523 * Execute a display list. Note that the ListBase offset must have already
7524 * been added before calling this function. I.e. the list argument is
7525 * the absolute list number, not relative to ListBase.
7526 * \param list - display list number
7529 execute_list(struct gl_context
*ctx
, GLuint list
)
7531 struct gl_display_list
*dlist
;
7535 if (list
== 0 || !islist(ctx
, list
))
7538 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7539 /* raise an error? */
7543 dlist
= lookup_list(ctx
, list
);
7547 ctx
->ListState
.CallDepth
++;
7549 if (ctx
->Driver
.BeginCallList
)
7550 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7556 const OpCode opcode
= n
[0].opcode
;
7558 if (is_ext_opcode(opcode
)) {
7559 n
+= ext_opcode_execute(ctx
, n
);
7564 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7567 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7569 case OPCODE_ALPHA_FUNC
:
7570 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7572 case OPCODE_BIND_TEXTURE
:
7573 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7577 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7578 ctx
->Unpack
= ctx
->DefaultPacking
;
7579 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7580 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7581 (const GLubyte
*) n
[7].data
));
7582 ctx
->Unpack
= save
; /* restore */
7585 case OPCODE_BLEND_COLOR
:
7586 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7588 case OPCODE_BLEND_EQUATION
:
7589 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7591 case OPCODE_BLEND_EQUATION_SEPARATE
:
7592 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7594 case OPCODE_BLEND_FUNC_SEPARATE
:
7595 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7596 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7599 case OPCODE_BLEND_FUNC_I
:
7600 /* GL_ARB_draw_buffers_blend */
7601 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7603 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7604 /* GL_ARB_draw_buffers_blend */
7605 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7608 case OPCODE_BLEND_EQUATION_I
:
7609 /* GL_ARB_draw_buffers_blend */
7610 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7612 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7613 /* GL_ARB_draw_buffers_blend */
7614 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7615 (n
[1].ui
, n
[2].e
, n
[3].e
));
7618 case OPCODE_CALL_LIST
:
7619 /* Generated by glCallList(), don't add ListBase */
7620 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7621 execute_list(ctx
, n
[1].ui
);
7624 case OPCODE_CALL_LIST_OFFSET
:
7625 /* Generated by glCallLists() so we must add ListBase */
7627 /* user specified a bad data type at compile time */
7628 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7630 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7631 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7632 execute_list(ctx
, list
);
7636 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7638 case OPCODE_CLEAR_BUFFER_IV
:
7645 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7648 case OPCODE_CLEAR_BUFFER_UIV
:
7655 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7658 case OPCODE_CLEAR_BUFFER_FV
:
7665 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7668 case OPCODE_CLEAR_BUFFER_FI
:
7669 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7671 case OPCODE_CLEAR_COLOR
:
7672 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7674 case OPCODE_CLEAR_ACCUM
:
7675 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7677 case OPCODE_CLEAR_DEPTH
:
7678 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7680 case OPCODE_CLEAR_INDEX
:
7681 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7683 case OPCODE_CLEAR_STENCIL
:
7684 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7686 case OPCODE_CLIP_PLANE
:
7693 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7696 case OPCODE_COLOR_MASK
:
7697 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7699 case OPCODE_COLOR_MASK_INDEXED
:
7700 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7703 case OPCODE_COLOR_MATERIAL
:
7704 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7706 case OPCODE_COLOR_TABLE
:
7708 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7709 ctx
->Unpack
= ctx
->DefaultPacking
;
7710 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7711 n
[5].e
, n
[6].data
));
7712 ctx
->Unpack
= save
; /* restore */
7715 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7722 CALL_ColorTableParameterfv(ctx
->Exec
,
7723 (n
[1].e
, n
[2].e
, params
));
7726 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7733 CALL_ColorTableParameteriv(ctx
->Exec
,
7734 (n
[1].e
, n
[2].e
, params
));
7737 case OPCODE_COLOR_SUB_TABLE
:
7739 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7740 ctx
->Unpack
= ctx
->DefaultPacking
;
7741 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7742 n
[4].e
, n
[5].e
, n
[6].data
));
7743 ctx
->Unpack
= save
; /* restore */
7746 case OPCODE_CONVOLUTION_FILTER_1D
:
7748 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7749 ctx
->Unpack
= ctx
->DefaultPacking
;
7750 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7753 ctx
->Unpack
= save
; /* restore */
7756 case OPCODE_CONVOLUTION_FILTER_2D
:
7758 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7759 ctx
->Unpack
= ctx
->DefaultPacking
;
7760 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7761 n
[4].i
, n
[5].e
, n
[6].e
,
7763 ctx
->Unpack
= save
; /* restore */
7766 case OPCODE_CONVOLUTION_PARAMETER_I
:
7767 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7769 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7776 CALL_ConvolutionParameteriv(ctx
->Exec
,
7777 (n
[1].e
, n
[2].e
, params
));
7780 case OPCODE_CONVOLUTION_PARAMETER_F
:
7781 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7783 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7790 CALL_ConvolutionParameterfv(ctx
->Exec
,
7791 (n
[1].e
, n
[2].e
, params
));
7794 case OPCODE_COPY_COLOR_SUB_TABLE
:
7795 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7796 n
[3].i
, n
[4].i
, n
[5].i
));
7798 case OPCODE_COPY_COLOR_TABLE
:
7799 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7800 n
[3].i
, n
[4].i
, n
[5].i
));
7802 case OPCODE_COPY_PIXELS
:
7803 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7804 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7807 case OPCODE_COPY_TEX_IMAGE1D
:
7808 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7809 n
[5].i
, n
[6].i
, n
[7].i
));
7811 case OPCODE_COPY_TEX_IMAGE2D
:
7812 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7813 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7815 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7816 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7817 n
[4].i
, n
[5].i
, n
[6].i
));
7819 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7820 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7821 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7824 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7825 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7826 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7829 case OPCODE_CULL_FACE
:
7830 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7832 case OPCODE_DEPTH_FUNC
:
7833 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7835 case OPCODE_DEPTH_MASK
:
7836 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7838 case OPCODE_DEPTH_RANGE
:
7839 CALL_DepthRange(ctx
->Exec
,
7840 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7842 case OPCODE_DISABLE
:
7843 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7845 case OPCODE_DISABLE_INDEXED
:
7846 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7848 case OPCODE_DRAW_BUFFER
:
7849 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7851 case OPCODE_DRAW_PIXELS
:
7853 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7854 ctx
->Unpack
= ctx
->DefaultPacking
;
7855 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7857 ctx
->Unpack
= save
; /* restore */
7861 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7863 case OPCODE_ENABLE_INDEXED
:
7864 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7866 case OPCODE_EVALMESH1
:
7867 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7869 case OPCODE_EVALMESH2
:
7870 CALL_EvalMesh2(ctx
->Exec
,
7871 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7880 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7883 case OPCODE_FRONT_FACE
:
7884 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7886 case OPCODE_FRUSTUM
:
7887 CALL_Frustum(ctx
->Exec
,
7888 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7891 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7893 case OPCODE_HISTOGRAM
:
7894 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7896 case OPCODE_INDEX_MASK
:
7897 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7899 case OPCODE_INIT_NAMES
:
7900 CALL_InitNames(ctx
->Exec
, ());
7909 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7912 case OPCODE_LIGHT_MODEL
:
7919 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7922 case OPCODE_LINE_STIPPLE
:
7923 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7925 case OPCODE_LINE_WIDTH
:
7926 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7928 case OPCODE_LIST_BASE
:
7929 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7931 case OPCODE_LOAD_IDENTITY
:
7932 CALL_LoadIdentity(ctx
->Exec
, ());
7934 case OPCODE_LOAD_MATRIX
:
7935 if (sizeof(Node
) == sizeof(GLfloat
)) {
7936 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7941 for (i
= 0; i
< 16; i
++) {
7944 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7947 case OPCODE_LOAD_NAME
:
7948 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7950 case OPCODE_LOGIC_OP
:
7951 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7955 GLenum target
= n
[1].e
;
7956 GLint ustride
= _mesa_evaluator_components(target
);
7957 GLint uorder
= n
[5].i
;
7958 GLfloat u1
= n
[2].f
;
7959 GLfloat u2
= n
[3].f
;
7960 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7961 (GLfloat
*) n
[6].data
));
7966 GLenum target
= n
[1].e
;
7967 GLfloat u1
= n
[2].f
;
7968 GLfloat u2
= n
[3].f
;
7969 GLfloat v1
= n
[4].f
;
7970 GLfloat v2
= n
[5].f
;
7971 GLint ustride
= n
[6].i
;
7972 GLint vstride
= n
[7].i
;
7973 GLint uorder
= n
[8].i
;
7974 GLint vorder
= n
[9].i
;
7975 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7976 v1
, v2
, vstride
, vorder
,
7977 (GLfloat
*) n
[10].data
));
7980 case OPCODE_MAPGRID1
:
7981 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7983 case OPCODE_MAPGRID2
:
7984 CALL_MapGrid2f(ctx
->Exec
,
7985 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7987 case OPCODE_MATRIX_MODE
:
7988 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7990 case OPCODE_MIN_MAX
:
7991 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7993 case OPCODE_MULT_MATRIX
:
7994 if (sizeof(Node
) == sizeof(GLfloat
)) {
7995 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8000 for (i
= 0; i
< 16; i
++) {
8003 CALL_MultMatrixf(ctx
->Exec
, (m
));
8007 CALL_Ortho(ctx
->Exec
,
8008 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8010 case OPCODE_PASSTHROUGH
:
8011 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8013 case OPCODE_PIXEL_MAP
:
8014 CALL_PixelMapfv(ctx
->Exec
,
8015 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
8017 case OPCODE_PIXEL_TRANSFER
:
8018 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8020 case OPCODE_PIXEL_ZOOM
:
8021 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8023 case OPCODE_POINT_SIZE
:
8024 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8026 case OPCODE_POINT_PARAMETERS
:
8032 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
8035 case OPCODE_POLYGON_MODE
:
8036 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8038 case OPCODE_POLYGON_STIPPLE
:
8040 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8041 ctx
->Unpack
= ctx
->DefaultPacking
;
8042 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
8043 ctx
->Unpack
= save
; /* restore */
8046 case OPCODE_POLYGON_OFFSET
:
8047 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8049 case OPCODE_POP_ATTRIB
:
8050 CALL_PopAttrib(ctx
->Exec
, ());
8052 case OPCODE_POP_MATRIX
:
8053 CALL_PopMatrix(ctx
->Exec
, ());
8055 case OPCODE_POP_NAME
:
8056 CALL_PopName(ctx
->Exec
, ());
8058 case OPCODE_PRIORITIZE_TEXTURE
:
8059 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8061 case OPCODE_PUSH_ATTRIB
:
8062 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8064 case OPCODE_PUSH_MATRIX
:
8065 CALL_PushMatrix(ctx
->Exec
, ());
8067 case OPCODE_PUSH_NAME
:
8068 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8070 case OPCODE_RASTER_POS
:
8071 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8073 case OPCODE_READ_BUFFER
:
8074 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8076 case OPCODE_RESET_HISTOGRAM
:
8077 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
8079 case OPCODE_RESET_MIN_MAX
:
8080 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
8083 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8086 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8088 case OPCODE_SCISSOR
:
8089 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8091 case OPCODE_SHADE_MODEL
:
8092 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8094 case OPCODE_PROVOKING_VERTEX
:
8095 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8097 case OPCODE_STENCIL_FUNC
:
8098 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8100 case OPCODE_STENCIL_MASK
:
8101 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8103 case OPCODE_STENCIL_OP
:
8104 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8106 case OPCODE_STENCIL_FUNC_SEPARATE
:
8107 CALL_StencilFuncSeparate(ctx
->Exec
,
8108 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8110 case OPCODE_STENCIL_MASK_SEPARATE
:
8111 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8113 case OPCODE_STENCIL_OP_SEPARATE
:
8114 CALL_StencilOpSeparate(ctx
->Exec
,
8115 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8124 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8134 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8137 case OPCODE_TEXPARAMETER
:
8144 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8147 case OPCODE_TEX_IMAGE1D
:
8149 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8150 ctx
->Unpack
= ctx
->DefaultPacking
;
8151 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8153 n
[3].i
, /* components */
8155 n
[5].e
, /* border */
8156 n
[6].e
, /* format */
8159 ctx
->Unpack
= save
; /* restore */
8162 case OPCODE_TEX_IMAGE2D
:
8164 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8165 ctx
->Unpack
= ctx
->DefaultPacking
;
8166 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8168 n
[3].i
, /* components */
8170 n
[5].i
, /* height */
8171 n
[6].e
, /* border */
8172 n
[7].e
, /* format */
8175 ctx
->Unpack
= save
; /* restore */
8178 case OPCODE_TEX_IMAGE3D
:
8180 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8181 ctx
->Unpack
= ctx
->DefaultPacking
;
8182 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8184 n
[3].i
, /* components */
8186 n
[5].i
, /* height */
8188 n
[7].e
, /* border */
8189 n
[8].e
, /* format */
8192 ctx
->Unpack
= save
; /* restore */
8195 case OPCODE_TEX_SUB_IMAGE1D
:
8197 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8198 ctx
->Unpack
= ctx
->DefaultPacking
;
8199 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8201 n
[6].e
, n
[7].data
));
8202 ctx
->Unpack
= save
; /* restore */
8205 case OPCODE_TEX_SUB_IMAGE2D
:
8207 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8208 ctx
->Unpack
= ctx
->DefaultPacking
;
8209 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8211 n
[6].i
, n
[7].e
, n
[8].e
,
8213 ctx
->Unpack
= save
; /* restore */
8216 case OPCODE_TEX_SUB_IMAGE3D
:
8218 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8219 ctx
->Unpack
= ctx
->DefaultPacking
;
8220 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8221 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8222 n
[8].i
, n
[9].e
, n
[10].e
,
8224 ctx
->Unpack
= save
; /* restore */
8227 case OPCODE_TRANSLATE
:
8228 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8230 case OPCODE_VIEWPORT
:
8231 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8232 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8234 case OPCODE_WINDOW_POS
:
8235 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8237 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8238 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8240 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8241 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8242 n
[4].i
, n
[5].i
, n
[6].i
,
8245 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8246 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8247 n
[4].i
, n
[5].i
, n
[6].i
,
8248 n
[7].i
, n
[8].data
));
8250 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8251 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8252 n
[4].i
, n
[5].i
, n
[6].i
,
8256 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8257 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8258 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8259 n
[5].e
, n
[6].i
, n
[7].data
));
8261 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8262 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8263 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8264 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8267 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8268 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8269 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8270 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8271 n
[9].e
, n
[10].i
, n
[11].data
));
8273 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8274 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8276 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8277 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8279 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8280 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8281 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8284 #if FEATURE_NV_vertex_program
8285 case OPCODE_EXECUTE_PROGRAM_NV
:
8292 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8295 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8296 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8297 (GLuint
*) n
[2].data
));
8299 case OPCODE_LOAD_PROGRAM_NV
:
8300 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8301 (const GLubyte
*) n
[4].data
));
8303 case OPCODE_TRACK_MATRIX_NV
:
8304 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
8308 #if FEATURE_NV_fragment_program
8309 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8310 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8311 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8314 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8315 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8316 (const GLubyte
*) n
[3].
8317 data
, n
[4].f
, n
[5].f
,
8322 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8323 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8325 case OPCODE_DEPTH_BOUNDS_EXT
:
8326 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8328 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8329 case OPCODE_PROGRAM_STRING_ARB
:
8330 CALL_ProgramStringARB(ctx
->Exec
,
8331 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8334 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
8335 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8336 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8341 #if FEATURE_queryobj
8342 case OPCODE_BEGIN_QUERY_ARB
:
8343 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8345 case OPCODE_END_QUERY_ARB
:
8346 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8349 case OPCODE_DRAW_BUFFERS_ARB
:
8351 GLenum buffers
[MAX_DRAW_BUFFERS
];
8352 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8353 for (i
= 0; i
< count
; i
++)
8354 buffers
[i
] = n
[2 + i
].e
;
8355 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8358 #if FEATURE_EXT_framebuffer_blit
8359 case OPCODE_BLIT_FRAMEBUFFER
:
8360 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8361 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8366 case OPCODE_USE_PROGRAM
:
8367 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8369 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8370 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8372 case OPCODE_ACTIVE_PROGRAM_EXT
:
8373 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8375 case OPCODE_UNIFORM_1F
:
8376 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8378 case OPCODE_UNIFORM_2F
:
8379 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8381 case OPCODE_UNIFORM_3F
:
8382 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8384 case OPCODE_UNIFORM_4F
:
8385 CALL_Uniform4fARB(ctx
->Exec
,
8386 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8388 case OPCODE_UNIFORM_1FV
:
8389 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8391 case OPCODE_UNIFORM_2FV
:
8392 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8394 case OPCODE_UNIFORM_3FV
:
8395 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8397 case OPCODE_UNIFORM_4FV
:
8398 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8400 case OPCODE_UNIFORM_1I
:
8401 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8403 case OPCODE_UNIFORM_2I
:
8404 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8406 case OPCODE_UNIFORM_3I
:
8407 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8409 case OPCODE_UNIFORM_4I
:
8410 CALL_Uniform4iARB(ctx
->Exec
,
8411 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8413 case OPCODE_UNIFORM_1IV
:
8414 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8416 case OPCODE_UNIFORM_2IV
:
8417 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8419 case OPCODE_UNIFORM_3IV
:
8420 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8422 case OPCODE_UNIFORM_4IV
:
8423 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8425 case OPCODE_UNIFORM_1UI
:
8426 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8428 case OPCODE_UNIFORM_2UI
:
8429 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8431 case OPCODE_UNIFORM_3UI
:
8432 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8434 case OPCODE_UNIFORM_4UI
:
8435 /*CALL_Uniform4uiARB(ctx->Exec,
8436 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8439 case OPCODE_UNIFORM_1UIV
:
8440 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8442 case OPCODE_UNIFORM_2UIV
:
8443 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8445 case OPCODE_UNIFORM_3UIV
:
8446 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8448 case OPCODE_UNIFORM_4UIV
:
8449 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8451 case OPCODE_UNIFORM_MATRIX22
:
8452 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8453 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8455 case OPCODE_UNIFORM_MATRIX33
:
8456 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8457 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8459 case OPCODE_UNIFORM_MATRIX44
:
8460 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8461 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8463 case OPCODE_UNIFORM_MATRIX23
:
8464 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8465 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8467 case OPCODE_UNIFORM_MATRIX32
:
8468 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8469 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8471 case OPCODE_UNIFORM_MATRIX24
:
8472 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8473 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8475 case OPCODE_UNIFORM_MATRIX42
:
8476 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8477 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8479 case OPCODE_UNIFORM_MATRIX34
:
8480 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8481 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8483 case OPCODE_UNIFORM_MATRIX43
:
8484 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8485 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8488 case OPCODE_CLAMP_COLOR
:
8489 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8492 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8495 GLuint i
, pname
= n
[1].ui
;
8497 for (i
= 0; i
< 4; i
++)
8498 values
[i
] = n
[1 + i
].f
;
8499 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8502 #if FEATURE_ATI_fragment_shader
8503 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8504 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8506 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8509 GLuint i
, dst
= n
[1].ui
;
8511 for (i
= 0; i
< 4; i
++)
8512 values
[i
] = n
[1 + i
].f
;
8513 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8517 case OPCODE_ATTR_1F_NV
:
8518 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8520 case OPCODE_ATTR_2F_NV
:
8521 /* Really shouldn't have to do this - the Node structure
8522 * is convenient, but it would be better to store the data
8523 * packed appropriately so that it can be sent directly
8524 * on. With x86_64 becoming common, this will start to
8527 if (sizeof(Node
) == sizeof(GLfloat
))
8528 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8530 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8532 case OPCODE_ATTR_3F_NV
:
8533 if (sizeof(Node
) == sizeof(GLfloat
))
8534 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8536 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8539 case OPCODE_ATTR_4F_NV
:
8540 if (sizeof(Node
) == sizeof(GLfloat
))
8541 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8543 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8546 case OPCODE_ATTR_1F_ARB
:
8547 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8549 case OPCODE_ATTR_2F_ARB
:
8550 /* Really shouldn't have to do this - the Node structure
8551 * is convenient, but it would be better to store the data
8552 * packed appropriately so that it can be sent directly
8553 * on. With x86_64 becoming common, this will start to
8556 if (sizeof(Node
) == sizeof(GLfloat
))
8557 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8559 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8561 case OPCODE_ATTR_3F_ARB
:
8562 if (sizeof(Node
) == sizeof(GLfloat
))
8563 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8565 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8568 case OPCODE_ATTR_4F_ARB
:
8569 if (sizeof(Node
) == sizeof(GLfloat
))
8570 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8572 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8575 case OPCODE_MATERIAL
:
8576 if (sizeof(Node
) == sizeof(GLfloat
))
8577 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8584 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8588 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8591 CALL_End(ctx
->Exec
, ());
8594 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8596 case OPCODE_EVAL_C1
:
8597 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8599 case OPCODE_EVAL_C2
:
8600 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8602 case OPCODE_EVAL_P1
:
8603 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8605 case OPCODE_EVAL_P2
:
8606 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8609 /* GL_EXT_texture_integer */
8610 case OPCODE_CLEARCOLOR_I
:
8611 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8613 case OPCODE_CLEARCOLOR_UI
:
8614 CALL_ClearColorIuiEXT(ctx
->Exec
,
8615 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8617 case OPCODE_TEXPARAMETER_I
:
8624 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8627 case OPCODE_TEXPARAMETER_UI
:
8630 params
[0] = n
[3].ui
;
8631 params
[1] = n
[4].ui
;
8632 params
[2] = n
[5].ui
;
8633 params
[3] = n
[6].ui
;
8634 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8638 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8639 /* GL_ARB_instanced_arrays */
8640 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8643 case OPCODE_TEXTURE_BARRIER_NV
:
8644 CALL_TextureBarrierNV(ctx
->Exec
, ());
8647 /* GL_EXT/ARB_transform_feedback */
8648 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8649 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8651 case OPCODE_END_TRANSFORM_FEEDBACK
:
8652 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8654 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8655 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8657 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8658 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8660 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8661 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8663 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8664 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8668 case OPCODE_BIND_SAMPLER
:
8669 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8671 case OPCODE_SAMPLER_PARAMETERIV
:
8678 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8681 case OPCODE_SAMPLER_PARAMETERFV
:
8688 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8691 case OPCODE_SAMPLER_PARAMETERIIV
:
8698 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8701 case OPCODE_SAMPLER_PARAMETERUIV
:
8704 params
[0] = n
[3].ui
;
8705 params
[1] = n
[4].ui
;
8706 params
[2] = n
[5].ui
;
8707 params
[3] = n
[6].ui
;
8708 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8712 /* GL_ARB_geometry_shader4 */
8713 case OPCODE_PROGRAM_PARAMETERI
:
8714 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8716 case OPCODE_FRAMEBUFFER_TEXTURE
:
8717 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8720 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8721 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8722 n
[3].ui
, n
[4].i
, n
[5].e
));
8726 case OPCODE_WAIT_SYNC
:
8728 union uint64_pair p
;
8729 p
.uint32
[0] = n
[3].ui
;
8730 p
.uint32
[1] = n
[4].ui
;
8731 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8735 /* GL_NV_conditional_render */
8736 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8737 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8739 case OPCODE_END_CONDITIONAL_RENDER
:
8740 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8743 case OPCODE_CONTINUE
:
8744 n
= (Node
*) n
[1].next
;
8746 case OPCODE_END_OF_LIST
:
8752 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8754 _mesa_problem(ctx
, "%s", msg
);
8759 /* increment n to point to next compiled command */
8760 if (opcode
!= OPCODE_CONTINUE
) {
8761 n
+= InstSize
[opcode
];
8766 if (ctx
->Driver
.EndCallList
)
8767 ctx
->Driver
.EndCallList(ctx
);
8769 ctx
->ListState
.CallDepth
--;
8774 /**********************************************************************/
8776 /**********************************************************************/
8779 * Test if a display list number is valid.
8781 static GLboolean GLAPIENTRY
8782 _mesa_IsList(GLuint list
)
8784 GET_CURRENT_CONTEXT(ctx
);
8785 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8786 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8787 return islist(ctx
, list
);
8792 * Delete a sequence of consecutive display lists.
8794 static void GLAPIENTRY
8795 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8797 GET_CURRENT_CONTEXT(ctx
);
8799 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8800 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8803 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8806 for (i
= list
; i
< list
+ range
; i
++) {
8807 destroy_list(ctx
, i
);
8813 * Return a display list number, n, such that lists n through n+range-1
8816 static GLuint GLAPIENTRY
8817 _mesa_GenLists(GLsizei range
)
8819 GET_CURRENT_CONTEXT(ctx
);
8821 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8822 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8825 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8833 * Make this an atomic operation
8835 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8837 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8839 /* reserve the list IDs by with empty/dummy lists */
8841 for (i
= 0; i
< range
; i
++) {
8842 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8843 make_list(base
+ i
, 1));
8847 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8854 * Begin a new display list.
8856 static void GLAPIENTRY
8857 _mesa_NewList(GLuint name
, GLenum mode
)
8859 GET_CURRENT_CONTEXT(ctx
);
8861 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8862 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8864 if (MESA_VERBOSE
& VERBOSE_API
)
8865 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8866 _mesa_lookup_enum_by_nr(mode
));
8869 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8873 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8874 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8878 if (ctx
->ListState
.CurrentList
) {
8879 /* already compiling a display list */
8880 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8884 ctx
->CompileFlag
= GL_TRUE
;
8885 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8887 /* Reset acumulated list state:
8889 invalidate_saved_current_state( ctx
);
8891 /* Allocate new display list */
8892 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8893 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8894 ctx
->ListState
.CurrentPos
= 0;
8896 ctx
->Driver
.NewList(ctx
, name
, mode
);
8898 ctx
->CurrentDispatch
= ctx
->Save
;
8899 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8904 * End definition of current display list.
8906 static void GLAPIENTRY
8909 GET_CURRENT_CONTEXT(ctx
);
8910 SAVE_FLUSH_VERTICES(ctx
);
8911 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8913 if (MESA_VERBOSE
& VERBOSE_API
)
8914 _mesa_debug(ctx
, "glEndList\n");
8916 /* Check that a list is under construction */
8917 if (!ctx
->ListState
.CurrentList
) {
8918 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8922 /* Call before emitting END_OF_LIST, in case the driver wants to
8923 * emit opcodes itself.
8925 ctx
->Driver
.EndList(ctx
);
8927 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8929 /* Destroy old list, if any */
8930 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8932 /* Install the new list */
8933 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8934 ctx
->ListState
.CurrentList
->Name
,
8935 ctx
->ListState
.CurrentList
);
8938 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8939 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8941 ctx
->ListState
.CurrentList
= NULL
;
8942 ctx
->ExecuteFlag
= GL_TRUE
;
8943 ctx
->CompileFlag
= GL_FALSE
;
8945 ctx
->CurrentDispatch
= ctx
->Exec
;
8946 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8951 _mesa_CallList(GLuint list
)
8953 GLboolean save_compile_flag
;
8954 GET_CURRENT_CONTEXT(ctx
);
8955 FLUSH_CURRENT(ctx
, 0);
8957 if (MESA_VERBOSE
& VERBOSE_API
)
8958 _mesa_debug(ctx
, "glCallList %d\n", list
);
8961 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8966 mesa_print_display_list( list
);
8968 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
8969 * execute the display list, and restore the CompileFlag.
8971 save_compile_flag
= ctx
->CompileFlag
;
8972 if (save_compile_flag
) {
8973 ctx
->CompileFlag
= GL_FALSE
;
8976 execute_list(ctx
, list
);
8977 ctx
->CompileFlag
= save_compile_flag
;
8979 /* also restore API function pointers to point to "save" versions */
8980 if (save_compile_flag
) {
8981 ctx
->CurrentDispatch
= ctx
->Save
;
8982 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8988 * Execute glCallLists: call multiple display lists.
8991 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
8993 GET_CURRENT_CONTEXT(ctx
);
8995 GLboolean save_compile_flag
;
8997 if (MESA_VERBOSE
& VERBOSE_API
)
8998 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9002 case GL_UNSIGNED_BYTE
:
9004 case GL_UNSIGNED_SHORT
:
9006 case GL_UNSIGNED_INT
:
9014 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9018 /* Save the CompileFlag status, turn it off, execute display list,
9019 * and restore the CompileFlag.
9021 save_compile_flag
= ctx
->CompileFlag
;
9022 ctx
->CompileFlag
= GL_FALSE
;
9024 for (i
= 0; i
< n
; i
++) {
9025 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9026 execute_list(ctx
, list
);
9029 ctx
->CompileFlag
= save_compile_flag
;
9031 /* also restore API function pointers to point to "save" versions */
9032 if (save_compile_flag
) {
9033 ctx
->CurrentDispatch
= ctx
->Save
;
9034 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9040 * Set the offset added to list numbers in glCallLists.
9042 static void GLAPIENTRY
9043 _mesa_ListBase(GLuint base
)
9045 GET_CURRENT_CONTEXT(ctx
);
9046 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9047 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9048 ctx
->List
.ListBase
= base
;
9052 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
9054 static void GLAPIENTRY
9057 GET_CURRENT_CONTEXT(ctx
);
9058 FLUSH_VERTICES(ctx
, 0);
9059 CALL_Finish(ctx
->Exec
, ());
9062 static void GLAPIENTRY
9065 GET_CURRENT_CONTEXT(ctx
);
9066 FLUSH_VERTICES(ctx
, 0);
9067 CALL_Flush(ctx
->Exec
, ());
9070 static void GLAPIENTRY
9071 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
9073 GET_CURRENT_CONTEXT(ctx
);
9074 FLUSH_VERTICES(ctx
, 0);
9075 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
9078 static void GLAPIENTRY
9079 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
9081 GET_CURRENT_CONTEXT(ctx
);
9082 FLUSH_VERTICES(ctx
, 0);
9083 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
9086 static void GLAPIENTRY
9087 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
9089 GET_CURRENT_CONTEXT(ctx
);
9090 FLUSH_VERTICES(ctx
, 0);
9091 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
9094 static GLenum GLAPIENTRY
9097 GET_CURRENT_CONTEXT(ctx
);
9098 FLUSH_VERTICES(ctx
, 0);
9099 return CALL_GetError(ctx
->Exec
, ());
9102 static void GLAPIENTRY
9103 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9105 GET_CURRENT_CONTEXT(ctx
);
9106 FLUSH_VERTICES(ctx
, 0);
9107 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9110 static void GLAPIENTRY
9111 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9113 GET_CURRENT_CONTEXT(ctx
);
9114 FLUSH_VERTICES(ctx
, 0);
9115 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9118 static void GLAPIENTRY
9119 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9121 GET_CURRENT_CONTEXT(ctx
);
9122 FLUSH_VERTICES(ctx
, 0);
9123 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9126 static void GLAPIENTRY
9127 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9129 GET_CURRENT_CONTEXT(ctx
);
9130 FLUSH_VERTICES(ctx
, 0);
9131 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9134 static void GLAPIENTRY
9135 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9137 GET_CURRENT_CONTEXT(ctx
);
9138 FLUSH_VERTICES(ctx
, 0);
9139 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9142 static void GLAPIENTRY
9143 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9145 GET_CURRENT_CONTEXT(ctx
);
9146 FLUSH_VERTICES(ctx
, 0);
9147 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9150 static void GLAPIENTRY
9151 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9153 GET_CURRENT_CONTEXT(ctx
);
9154 FLUSH_VERTICES(ctx
, 0);
9155 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9158 static void GLAPIENTRY
9159 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9161 GET_CURRENT_CONTEXT(ctx
);
9162 FLUSH_VERTICES(ctx
, 0);
9163 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9166 static void GLAPIENTRY
9167 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9169 GET_CURRENT_CONTEXT(ctx
);
9170 FLUSH_VERTICES(ctx
, 0);
9171 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9174 static void GLAPIENTRY
9175 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9177 GET_CURRENT_CONTEXT(ctx
);
9178 FLUSH_VERTICES(ctx
, 0);
9179 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9182 static void GLAPIENTRY
9183 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9185 GET_CURRENT_CONTEXT(ctx
);
9186 FLUSH_VERTICES(ctx
, 0);
9187 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9190 static void GLAPIENTRY
9191 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9193 GET_CURRENT_CONTEXT(ctx
);
9194 FLUSH_VERTICES(ctx
, 0);
9195 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9198 static void GLAPIENTRY
9199 exec_GetPolygonStipple(GLubyte
* dest
)
9201 GET_CURRENT_CONTEXT(ctx
);
9202 FLUSH_VERTICES(ctx
, 0);
9203 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9206 static const GLubyte
*GLAPIENTRY
9207 exec_GetString(GLenum name
)
9209 GET_CURRENT_CONTEXT(ctx
);
9210 FLUSH_VERTICES(ctx
, 0);
9211 return CALL_GetString(ctx
->Exec
, (name
));
9214 static void GLAPIENTRY
9215 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9217 GET_CURRENT_CONTEXT(ctx
);
9218 FLUSH_VERTICES(ctx
, 0);
9219 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9222 static void GLAPIENTRY
9223 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9225 GET_CURRENT_CONTEXT(ctx
);
9226 FLUSH_VERTICES(ctx
, 0);
9227 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9230 static void GLAPIENTRY
9231 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9233 GET_CURRENT_CONTEXT(ctx
);
9234 FLUSH_VERTICES(ctx
, 0);
9235 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9238 static void GLAPIENTRY
9239 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9241 GET_CURRENT_CONTEXT(ctx
);
9242 FLUSH_VERTICES(ctx
, 0);
9243 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9246 static void GLAPIENTRY
9247 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9249 GET_CURRENT_CONTEXT(ctx
);
9250 FLUSH_VERTICES(ctx
, 0);
9251 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9254 static void GLAPIENTRY
9255 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9256 GLenum type
, GLvoid
* pixels
)
9258 GET_CURRENT_CONTEXT(ctx
);
9259 FLUSH_VERTICES(ctx
, 0);
9260 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9263 static void GLAPIENTRY
9264 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9265 GLenum pname
, GLfloat
*params
)
9267 GET_CURRENT_CONTEXT(ctx
);
9268 FLUSH_VERTICES(ctx
, 0);
9269 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9272 static void GLAPIENTRY
9273 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9274 GLenum pname
, GLint
*params
)
9276 GET_CURRENT_CONTEXT(ctx
);
9277 FLUSH_VERTICES(ctx
, 0);
9278 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9281 static void GLAPIENTRY
9282 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9284 GET_CURRENT_CONTEXT(ctx
);
9285 FLUSH_VERTICES(ctx
, 0);
9286 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9289 static void GLAPIENTRY
9290 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9292 GET_CURRENT_CONTEXT(ctx
);
9293 FLUSH_VERTICES(ctx
, 0);
9294 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9297 static GLboolean GLAPIENTRY
9298 exec_IsEnabled(GLenum cap
)
9300 GET_CURRENT_CONTEXT(ctx
);
9301 FLUSH_VERTICES(ctx
, 0);
9302 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9305 static void GLAPIENTRY
9306 exec_PixelStoref(GLenum pname
, GLfloat param
)
9308 GET_CURRENT_CONTEXT(ctx
);
9309 FLUSH_VERTICES(ctx
, 0);
9310 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9313 static void GLAPIENTRY
9314 exec_PixelStorei(GLenum pname
, GLint param
)
9316 GET_CURRENT_CONTEXT(ctx
);
9317 FLUSH_VERTICES(ctx
, 0);
9318 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9321 static void GLAPIENTRY
9322 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9323 GLenum format
, GLenum type
, GLvoid
* pixels
)
9325 GET_CURRENT_CONTEXT(ctx
);
9326 FLUSH_VERTICES(ctx
, 0);
9327 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9330 static GLint GLAPIENTRY
9331 exec_RenderMode(GLenum mode
)
9333 GET_CURRENT_CONTEXT(ctx
);
9334 FLUSH_VERTICES(ctx
, 0);
9335 return CALL_RenderMode(ctx
->Exec
, (mode
));
9338 static void GLAPIENTRY
9339 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9341 GET_CURRENT_CONTEXT(ctx
);
9342 FLUSH_VERTICES(ctx
, 0);
9343 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9346 static void GLAPIENTRY
9347 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9349 GET_CURRENT_CONTEXT(ctx
);
9350 FLUSH_VERTICES(ctx
, 0);
9351 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9354 static GLboolean GLAPIENTRY
9355 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9356 GLboolean
* residences
)
9358 GET_CURRENT_CONTEXT(ctx
);
9359 FLUSH_VERTICES(ctx
, 0);
9360 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9363 static void GLAPIENTRY
9364 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9366 GET_CURRENT_CONTEXT(ctx
);
9367 FLUSH_VERTICES(ctx
, 0);
9368 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9371 static void GLAPIENTRY
9372 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9374 GET_CURRENT_CONTEXT(ctx
);
9375 FLUSH_VERTICES(ctx
, 0);
9376 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9379 static void GLAPIENTRY
9380 exec_DisableClientState(GLenum cap
)
9382 GET_CURRENT_CONTEXT(ctx
);
9383 FLUSH_VERTICES(ctx
, 0);
9384 CALL_DisableClientState(ctx
->Exec
, (cap
));
9387 static void GLAPIENTRY
9388 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9390 GET_CURRENT_CONTEXT(ctx
);
9391 FLUSH_VERTICES(ctx
, 0);
9392 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9395 static void GLAPIENTRY
9396 exec_EnableClientState(GLenum cap
)
9398 GET_CURRENT_CONTEXT(ctx
);
9399 FLUSH_VERTICES(ctx
, 0);
9400 CALL_EnableClientState(ctx
->Exec
, (cap
));
9403 static void GLAPIENTRY
9404 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9406 GET_CURRENT_CONTEXT(ctx
);
9407 FLUSH_VERTICES(ctx
, 0);
9408 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9411 static void GLAPIENTRY
9412 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9414 GET_CURRENT_CONTEXT(ctx
);
9415 FLUSH_VERTICES(ctx
, 0);
9416 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9419 static void GLAPIENTRY
9420 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9422 GET_CURRENT_CONTEXT(ctx
);
9423 FLUSH_VERTICES(ctx
, 0);
9424 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9427 static void GLAPIENTRY
9428 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9430 GET_CURRENT_CONTEXT(ctx
);
9431 FLUSH_VERTICES(ctx
, 0);
9432 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9435 static GLboolean GLAPIENTRY
9436 exec_IsTexture(GLuint texture
)
9438 GET_CURRENT_CONTEXT(ctx
);
9439 FLUSH_VERTICES(ctx
, 0);
9440 return CALL_IsTexture(ctx
->Exec
, (texture
));
9443 static void GLAPIENTRY
9444 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9446 GET_CURRENT_CONTEXT(ctx
);
9447 FLUSH_VERTICES(ctx
, 0);
9448 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9451 static void GLAPIENTRY
9452 exec_PopClientAttrib(void)
9454 GET_CURRENT_CONTEXT(ctx
);
9455 FLUSH_VERTICES(ctx
, 0);
9456 CALL_PopClientAttrib(ctx
->Exec
, ());
9459 static void GLAPIENTRY
9460 exec_PushClientAttrib(GLbitfield mask
)
9462 GET_CURRENT_CONTEXT(ctx
);
9463 FLUSH_VERTICES(ctx
, 0);
9464 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9467 static void GLAPIENTRY
9468 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9471 GET_CURRENT_CONTEXT(ctx
);
9472 FLUSH_VERTICES(ctx
, 0);
9473 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9476 static void GLAPIENTRY
9477 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9479 GET_CURRENT_CONTEXT(ctx
);
9480 FLUSH_VERTICES(ctx
, 0);
9481 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9484 static void GLAPIENTRY
9485 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9488 GET_CURRENT_CONTEXT(ctx
);
9489 FLUSH_VERTICES(ctx
, 0);
9490 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9493 static void GLAPIENTRY
9494 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9495 GLint x
, GLint y
, GLsizei width
)
9497 GET_CURRENT_CONTEXT(ctx
);
9498 FLUSH_VERTICES(ctx
, 0);
9499 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9500 (target
, internalFormat
, x
, y
, width
));
9503 static void GLAPIENTRY
9504 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9505 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9507 GET_CURRENT_CONTEXT(ctx
);
9508 FLUSH_VERTICES(ctx
, 0);
9509 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9510 (target
, internalFormat
, x
, y
, width
,
9514 static void GLAPIENTRY
9515 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9517 GET_CURRENT_CONTEXT(ctx
);
9518 FLUSH_VERTICES(ctx
, 0);
9519 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9522 static void GLAPIENTRY
9523 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9525 GET_CURRENT_CONTEXT(ctx
);
9526 FLUSH_VERTICES(ctx
, 0);
9527 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9530 static void GLAPIENTRY
9531 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9533 GET_CURRENT_CONTEXT(ctx
);
9534 FLUSH_VERTICES(ctx
, 0);
9535 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9538 static void GLAPIENTRY
9539 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9542 GET_CURRENT_CONTEXT(ctx
);
9543 FLUSH_VERTICES(ctx
, 0);
9544 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9547 static void GLAPIENTRY
9548 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9550 GET_CURRENT_CONTEXT(ctx
);
9551 FLUSH_VERTICES(ctx
, 0);
9552 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9555 static void GLAPIENTRY
9556 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9558 GET_CURRENT_CONTEXT(ctx
);
9559 FLUSH_VERTICES(ctx
, 0);
9560 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9563 static void GLAPIENTRY
9564 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9565 GLenum type
, GLvoid
*values
)
9567 GET_CURRENT_CONTEXT(ctx
);
9568 FLUSH_VERTICES(ctx
, 0);
9569 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9572 static void GLAPIENTRY
9573 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9575 GET_CURRENT_CONTEXT(ctx
);
9576 FLUSH_VERTICES(ctx
, 0);
9577 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9580 static void GLAPIENTRY
9581 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9583 GET_CURRENT_CONTEXT(ctx
);
9584 FLUSH_VERTICES(ctx
, 0);
9585 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9588 static void GLAPIENTRY
9589 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9590 GLenum type
, GLvoid
*values
)
9592 GET_CURRENT_CONTEXT(ctx
);
9593 FLUSH_VERTICES(ctx
, 0);
9594 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9597 static void GLAPIENTRY
9598 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9600 GET_CURRENT_CONTEXT(ctx
);
9601 FLUSH_VERTICES(ctx
, 0);
9602 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9605 static void GLAPIENTRY
9606 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9608 GET_CURRENT_CONTEXT(ctx
);
9609 FLUSH_VERTICES(ctx
, 0);
9610 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9613 static void GLAPIENTRY
9614 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9615 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9617 GET_CURRENT_CONTEXT(ctx
);
9618 FLUSH_VERTICES(ctx
, 0);
9619 CALL_GetSeparableFilter(ctx
->Exec
,
9620 (target
, format
, type
, row
, column
, span
));
9623 static void GLAPIENTRY
9624 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9625 GLsizei width
, GLsizei height
, GLenum format
,
9626 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9628 GET_CURRENT_CONTEXT(ctx
);
9629 FLUSH_VERTICES(ctx
, 0);
9630 CALL_SeparableFilter2D(ctx
->Exec
,
9631 (target
, internalFormat
, width
, height
, format
,
9632 type
, row
, column
));
9635 static void GLAPIENTRY
9636 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9637 GLsizei count
, const GLvoid
*ptr
)
9639 GET_CURRENT_CONTEXT(ctx
);
9640 FLUSH_VERTICES(ctx
, 0);
9641 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9644 static void GLAPIENTRY
9645 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9647 GET_CURRENT_CONTEXT(ctx
);
9648 FLUSH_VERTICES(ctx
, 0);
9649 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9652 static void GLAPIENTRY
9653 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9656 GET_CURRENT_CONTEXT(ctx
);
9657 FLUSH_VERTICES(ctx
, 0);
9658 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9661 static void GLAPIENTRY
9662 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9665 GET_CURRENT_CONTEXT(ctx
);
9666 FLUSH_VERTICES(ctx
, 0);
9667 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9670 static void GLAPIENTRY
9671 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9672 GLsizei count
, const GLvoid
*ptr
)
9674 GET_CURRENT_CONTEXT(ctx
);
9675 FLUSH_VERTICES(ctx
, 0);
9676 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9679 static void GLAPIENTRY
9680 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9681 GLsizei count
, const GLvoid
*ptr
)
9683 GET_CURRENT_CONTEXT(ctx
);
9684 FLUSH_VERTICES(ctx
, 0);
9685 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9688 static void GLAPIENTRY
9689 exec_LockArraysEXT(GLint first
, GLsizei count
)
9691 GET_CURRENT_CONTEXT(ctx
);
9692 FLUSH_VERTICES(ctx
, 0);
9693 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9696 static void GLAPIENTRY
9697 exec_UnlockArraysEXT(void)
9699 GET_CURRENT_CONTEXT(ctx
);
9700 FLUSH_VERTICES(ctx
, 0);
9701 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9704 static void GLAPIENTRY
9705 exec_ClientActiveTextureARB(GLenum target
)
9707 GET_CURRENT_CONTEXT(ctx
);
9708 FLUSH_VERTICES(ctx
, 0);
9709 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9712 static void GLAPIENTRY
9713 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9714 GLsizei stride
, const GLvoid
*ptr
)
9716 GET_CURRENT_CONTEXT(ctx
);
9717 FLUSH_VERTICES(ctx
, 0);
9718 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9721 static void GLAPIENTRY
9722 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9724 GET_CURRENT_CONTEXT(ctx
);
9725 FLUSH_VERTICES(ctx
, 0);
9726 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9729 /* GL_EXT_multi_draw_arrays */
9730 static void GLAPIENTRY
9731 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9732 const GLsizei
*count
, GLsizei primcount
)
9734 GET_CURRENT_CONTEXT(ctx
);
9735 FLUSH_VERTICES(ctx
, 0);
9736 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9739 /* GL_IBM_multimode_draw_arrays */
9740 static void GLAPIENTRY
9741 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9742 const GLsizei
* count
, GLsizei primcount
,
9745 GET_CURRENT_CONTEXT(ctx
);
9746 FLUSH_VERTICES(ctx
, 0);
9747 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9748 (mode
, first
, count
, primcount
, modestride
));
9751 /* GL_IBM_multimode_draw_arrays */
9752 static void GLAPIENTRY
9753 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9754 const GLsizei
* count
,
9756 const GLvoid
* const *indices
,
9757 GLsizei primcount
, GLint modestride
)
9759 GET_CURRENT_CONTEXT(ctx
);
9760 FLUSH_VERTICES(ctx
, 0);
9761 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9762 (mode
, count
, type
, indices
, primcount
,
9767 * Setup the given dispatch table to point to Mesa's display list
9768 * building functions.
9770 * This does not include any of the tnl functions - they are
9771 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9774 struct _glapi_table
*
9775 _mesa_create_save_table(void)
9777 struct _glapi_table
*table
;
9779 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9783 _mesa_loopback_init_api_table(table
);
9786 SET_Accum(table
, save_Accum
);
9787 SET_AlphaFunc(table
, save_AlphaFunc
);
9788 SET_Bitmap(table
, save_Bitmap
);
9789 SET_BlendFunc(table
, save_BlendFunc
);
9790 SET_CallList(table
, save_CallList
);
9791 SET_CallLists(table
, save_CallLists
);
9792 SET_Clear(table
, save_Clear
);
9793 SET_ClearAccum(table
, save_ClearAccum
);
9794 SET_ClearColor(table
, save_ClearColor
);
9795 SET_ClearDepth(table
, save_ClearDepth
);
9796 SET_ClearIndex(table
, save_ClearIndex
);
9797 SET_ClearStencil(table
, save_ClearStencil
);
9798 SET_ClipPlane(table
, save_ClipPlane
);
9799 SET_ColorMask(table
, save_ColorMask
);
9800 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9801 SET_ColorMaterial(table
, save_ColorMaterial
);
9802 SET_CopyPixels(table
, save_CopyPixels
);
9803 SET_CullFace(table
, save_CullFace
);
9804 SET_DeleteLists(table
, _mesa_DeleteLists
);
9805 SET_DepthFunc(table
, save_DepthFunc
);
9806 SET_DepthMask(table
, save_DepthMask
);
9807 SET_DepthRange(table
, save_DepthRange
);
9808 SET_Disable(table
, save_Disable
);
9809 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9810 SET_DrawBuffer(table
, save_DrawBuffer
);
9811 SET_DrawPixels(table
, save_DrawPixels
);
9812 SET_Enable(table
, save_Enable
);
9813 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9814 SET_EndList(table
, _mesa_EndList
);
9815 SET_EvalMesh1(table
, save_EvalMesh1
);
9816 SET_EvalMesh2(table
, save_EvalMesh2
);
9817 SET_Finish(table
, exec_Finish
);
9818 SET_Flush(table
, exec_Flush
);
9819 SET_Fogf(table
, save_Fogf
);
9820 SET_Fogfv(table
, save_Fogfv
);
9821 SET_Fogi(table
, save_Fogi
);
9822 SET_Fogiv(table
, save_Fogiv
);
9823 SET_FrontFace(table
, save_FrontFace
);
9824 SET_Frustum(table
, save_Frustum
);
9825 SET_GenLists(table
, _mesa_GenLists
);
9826 SET_GetBooleanv(table
, exec_GetBooleanv
);
9827 SET_GetClipPlane(table
, exec_GetClipPlane
);
9828 SET_GetDoublev(table
, exec_GetDoublev
);
9829 SET_GetError(table
, exec_GetError
);
9830 SET_GetFloatv(table
, exec_GetFloatv
);
9831 SET_GetIntegerv(table
, exec_GetIntegerv
);
9832 SET_GetLightfv(table
, exec_GetLightfv
);
9833 SET_GetLightiv(table
, exec_GetLightiv
);
9834 SET_GetMapdv(table
, exec_GetMapdv
);
9835 SET_GetMapfv(table
, exec_GetMapfv
);
9836 SET_GetMapiv(table
, exec_GetMapiv
);
9837 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9838 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9839 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9840 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9841 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9842 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9843 SET_GetString(table
, exec_GetString
);
9844 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9845 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9846 SET_GetTexGendv(table
, exec_GetTexGendv
);
9847 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9848 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9849 SET_GetTexImage(table
, exec_GetTexImage
);
9850 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9851 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9852 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9853 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9854 SET_Hint(table
, save_Hint
);
9855 SET_IndexMask(table
, save_IndexMask
);
9856 SET_InitNames(table
, save_InitNames
);
9857 SET_IsEnabled(table
, exec_IsEnabled
);
9858 SET_IsList(table
, _mesa_IsList
);
9859 SET_LightModelf(table
, save_LightModelf
);
9860 SET_LightModelfv(table
, save_LightModelfv
);
9861 SET_LightModeli(table
, save_LightModeli
);
9862 SET_LightModeliv(table
, save_LightModeliv
);
9863 SET_Lightf(table
, save_Lightf
);
9864 SET_Lightfv(table
, save_Lightfv
);
9865 SET_Lighti(table
, save_Lighti
);
9866 SET_Lightiv(table
, save_Lightiv
);
9867 SET_LineStipple(table
, save_LineStipple
);
9868 SET_LineWidth(table
, save_LineWidth
);
9869 SET_ListBase(table
, save_ListBase
);
9870 SET_LoadIdentity(table
, save_LoadIdentity
);
9871 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9872 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9873 SET_LoadName(table
, save_LoadName
);
9874 SET_LogicOp(table
, save_LogicOp
);
9875 SET_Map1d(table
, save_Map1d
);
9876 SET_Map1f(table
, save_Map1f
);
9877 SET_Map2d(table
, save_Map2d
);
9878 SET_Map2f(table
, save_Map2f
);
9879 SET_MapGrid1d(table
, save_MapGrid1d
);
9880 SET_MapGrid1f(table
, save_MapGrid1f
);
9881 SET_MapGrid2d(table
, save_MapGrid2d
);
9882 SET_MapGrid2f(table
, save_MapGrid2f
);
9883 SET_MatrixMode(table
, save_MatrixMode
);
9884 SET_MultMatrixd(table
, save_MultMatrixd
);
9885 SET_MultMatrixf(table
, save_MultMatrixf
);
9886 SET_NewList(table
, save_NewList
);
9887 SET_Ortho(table
, save_Ortho
);
9888 SET_PassThrough(table
, save_PassThrough
);
9889 SET_PixelMapfv(table
, save_PixelMapfv
);
9890 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9891 SET_PixelMapusv(table
, save_PixelMapusv
);
9892 SET_PixelStoref(table
, exec_PixelStoref
);
9893 SET_PixelStorei(table
, exec_PixelStorei
);
9894 SET_PixelTransferf(table
, save_PixelTransferf
);
9895 SET_PixelTransferi(table
, save_PixelTransferi
);
9896 SET_PixelZoom(table
, save_PixelZoom
);
9897 SET_PointSize(table
, save_PointSize
);
9898 SET_PolygonMode(table
, save_PolygonMode
);
9899 SET_PolygonOffset(table
, save_PolygonOffset
);
9900 SET_PolygonStipple(table
, save_PolygonStipple
);
9901 SET_PopAttrib(table
, save_PopAttrib
);
9902 SET_PopMatrix(table
, save_PopMatrix
);
9903 SET_PopName(table
, save_PopName
);
9904 SET_PushAttrib(table
, save_PushAttrib
);
9905 SET_PushMatrix(table
, save_PushMatrix
);
9906 SET_PushName(table
, save_PushName
);
9907 SET_RasterPos2d(table
, save_RasterPos2d
);
9908 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9909 SET_RasterPos2f(table
, save_RasterPos2f
);
9910 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9911 SET_RasterPos2i(table
, save_RasterPos2i
);
9912 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9913 SET_RasterPos2s(table
, save_RasterPos2s
);
9914 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9915 SET_RasterPos3d(table
, save_RasterPos3d
);
9916 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9917 SET_RasterPos3f(table
, save_RasterPos3f
);
9918 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9919 SET_RasterPos3i(table
, save_RasterPos3i
);
9920 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9921 SET_RasterPos3s(table
, save_RasterPos3s
);
9922 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9923 SET_RasterPos4d(table
, save_RasterPos4d
);
9924 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9925 SET_RasterPos4f(table
, save_RasterPos4f
);
9926 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9927 SET_RasterPos4i(table
, save_RasterPos4i
);
9928 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9929 SET_RasterPos4s(table
, save_RasterPos4s
);
9930 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9931 SET_ReadBuffer(table
, save_ReadBuffer
);
9932 SET_ReadPixels(table
, exec_ReadPixels
);
9933 SET_RenderMode(table
, exec_RenderMode
);
9934 SET_Rotated(table
, save_Rotated
);
9935 SET_Rotatef(table
, save_Rotatef
);
9936 SET_Scaled(table
, save_Scaled
);
9937 SET_Scalef(table
, save_Scalef
);
9938 SET_Scissor(table
, save_Scissor
);
9939 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9940 SET_SelectBuffer(table
, exec_SelectBuffer
);
9941 SET_ShadeModel(table
, save_ShadeModel
);
9942 SET_StencilFunc(table
, save_StencilFunc
);
9943 SET_StencilMask(table
, save_StencilMask
);
9944 SET_StencilOp(table
, save_StencilOp
);
9945 SET_TexEnvf(table
, save_TexEnvf
);
9946 SET_TexEnvfv(table
, save_TexEnvfv
);
9947 SET_TexEnvi(table
, save_TexEnvi
);
9948 SET_TexEnviv(table
, save_TexEnviv
);
9949 SET_TexGend(table
, save_TexGend
);
9950 SET_TexGendv(table
, save_TexGendv
);
9951 SET_TexGenf(table
, save_TexGenf
);
9952 SET_TexGenfv(table
, save_TexGenfv
);
9953 SET_TexGeni(table
, save_TexGeni
);
9954 SET_TexGeniv(table
, save_TexGeniv
);
9955 SET_TexImage1D(table
, save_TexImage1D
);
9956 SET_TexImage2D(table
, save_TexImage2D
);
9957 SET_TexParameterf(table
, save_TexParameterf
);
9958 SET_TexParameterfv(table
, save_TexParameterfv
);
9959 SET_TexParameteri(table
, save_TexParameteri
);
9960 SET_TexParameteriv(table
, save_TexParameteriv
);
9961 SET_Translated(table
, save_Translated
);
9962 SET_Translatef(table
, save_Translatef
);
9963 SET_Viewport(table
, save_Viewport
);
9966 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9967 SET_BindTexture(table
, save_BindTexture
);
9968 SET_ColorPointer(table
, exec_ColorPointer
);
9969 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9970 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9971 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9972 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9973 SET_DeleteTextures(table
, exec_DeleteTextures
);
9974 SET_DisableClientState(table
, exec_DisableClientState
);
9975 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9976 SET_EnableClientState(table
, exec_EnableClientState
);
9977 SET_GenTextures(table
, exec_GenTextures
);
9978 SET_GetPointerv(table
, exec_GetPointerv
);
9979 SET_IndexPointer(table
, exec_IndexPointer
);
9980 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
9981 SET_IsTexture(table
, exec_IsTexture
);
9982 SET_NormalPointer(table
, exec_NormalPointer
);
9983 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
9984 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9985 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
9986 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
9987 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9988 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9989 SET_VertexPointer(table
, exec_VertexPointer
);
9992 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9993 SET_TexImage3D(table
, save_TexImage3D
);
9994 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9997 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9998 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9999 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
10001 /* ATI_separate_stencil */
10002 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
10004 /* GL_ARB_imaging */
10005 /* Not all are supported */
10006 SET_BlendColor(table
, save_BlendColor
);
10007 SET_BlendEquation(table
, save_BlendEquation
);
10008 SET_ColorSubTable(table
, save_ColorSubTable
);
10009 SET_ColorTable(table
, save_ColorTable
);
10010 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
10011 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
10012 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
10013 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
10014 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
10015 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
10016 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
10017 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
10018 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
10019 SET_CopyColorTable(table
, save_CopyColorTable
);
10020 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
10021 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
10022 SET_GetColorTable(table
, exec_GetColorTable
);
10023 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
10024 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
10025 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
10026 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
10027 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
10028 SET_GetHistogram(table
, exec_GetHistogram
);
10029 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
10030 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
10031 SET_GetMinmax(table
, exec_GetMinmax
);
10032 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
10033 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
10034 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
10035 SET_Histogram(table
, save_Histogram
);
10036 SET_Minmax(table
, save_Minmax
);
10037 SET_ResetHistogram(table
, save_ResetHistogram
);
10038 SET_ResetMinmax(table
, save_ResetMinmax
);
10039 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
10041 /* 2. GL_EXT_blend_color */
10043 SET_BlendColorEXT(table
, save_BlendColorEXT
);
10046 /* 3. GL_EXT_polygon_offset */
10047 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
10049 /* 6. GL_EXT_texture3d */
10051 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
10052 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
10053 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
10056 /* 14. GL_SGI_color_table */
10058 SET_ColorTableSGI(table
, save_ColorTable
);
10059 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
10060 SET_GetColorTableSGI(table
, exec_GetColorTable
);
10061 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
10062 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
10065 /* 30. GL_EXT_vertex_array */
10066 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
10067 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
10068 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
10069 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
10070 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
10071 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
10073 /* 37. GL_EXT_blend_minmax */
10075 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
10078 /* 54. GL_EXT_point_parameters */
10079 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
10080 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
10082 /* 97. GL_EXT_compiled_vertex_array */
10083 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
10084 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
10086 /* 145. GL_EXT_secondary_color */
10087 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
10089 /* 148. GL_EXT_multi_draw_arrays */
10090 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
10092 /* 149. GL_EXT_fog_coord */
10093 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10095 /* 173. GL_EXT_blend_func_separate */
10096 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10098 /* 196. GL_MESA_resize_buffers */
10099 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10101 /* 197. GL_MESA_window_pos */
10102 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10103 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10104 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10105 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10106 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10107 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10108 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10109 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10110 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10111 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10112 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10113 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10114 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10115 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10116 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10117 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10118 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10119 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10120 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10121 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10122 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10123 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10124 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10125 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10127 /* 200. GL_IBM_multimode_draw_arrays */
10128 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10129 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10131 #if FEATURE_NV_vertex_program
10132 /* 233. GL_NV_vertex_program */
10133 /* The following commands DO NOT go into display lists:
10134 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10135 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10137 SET_BindProgramNV(table
, save_BindProgramNV
);
10138 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10139 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10140 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10141 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10142 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10143 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10144 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10145 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10146 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10147 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
10148 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10149 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10150 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10151 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10152 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10153 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10154 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10155 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10156 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10157 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10158 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10159 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10160 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
10161 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10164 /* 244. GL_ATI_envmap_bumpmap */
10165 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10166 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10168 /* 245. GL_ATI_fragment_shader */
10169 #if FEATURE_ATI_fragment_shader
10170 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10171 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10174 /* 282. GL_NV_fragment_program */
10175 #if FEATURE_NV_fragment_program
10176 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10177 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10178 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10179 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10180 SET_GetProgramNamedParameterfvNV(table
,
10181 _mesa_GetProgramNamedParameterfvNV
);
10182 SET_GetProgramNamedParameterdvNV(table
,
10183 _mesa_GetProgramNamedParameterdvNV
);
10184 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10185 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10186 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10187 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10188 SET_GetProgramLocalParameterdvARB(table
,
10189 _mesa_GetProgramLocalParameterdvARB
);
10190 SET_GetProgramLocalParameterfvARB(table
,
10191 _mesa_GetProgramLocalParameterfvARB
);
10194 /* 262. GL_NV_point_sprite */
10195 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10196 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10198 /* 268. GL_EXT_stencil_two_side */
10199 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10201 /* 273. GL_APPLE_vertex_array_object */
10202 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10203 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10204 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10205 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10207 /* 310. GL_EXT_framebuffer_object */
10208 SET_GenFramebuffersEXT(table
, _mesa_GenFramebuffersEXT
);
10209 SET_BindFramebufferEXT(table
, _mesa_BindFramebufferEXT
);
10210 SET_DeleteFramebuffersEXT(table
, _mesa_DeleteFramebuffersEXT
);
10211 SET_CheckFramebufferStatusEXT(table
, _mesa_CheckFramebufferStatusEXT
);
10212 SET_GenRenderbuffersEXT(table
, _mesa_GenRenderbuffersEXT
);
10213 SET_BindRenderbufferEXT(table
, _mesa_BindRenderbufferEXT
);
10214 SET_DeleteRenderbuffersEXT(table
, _mesa_DeleteRenderbuffersEXT
);
10215 SET_RenderbufferStorageEXT(table
, _mesa_RenderbufferStorageEXT
);
10216 SET_FramebufferTexture1DEXT(table
, _mesa_FramebufferTexture1DEXT
);
10217 SET_FramebufferTexture2DEXT(table
, _mesa_FramebufferTexture2DEXT
);
10218 SET_FramebufferTexture3DEXT(table
, _mesa_FramebufferTexture3DEXT
);
10219 SET_FramebufferRenderbufferEXT(table
, _mesa_FramebufferRenderbufferEXT
);
10220 SET_GenerateMipmapEXT(table
, _mesa_GenerateMipmapEXT
);
10222 /* 317. GL_EXT_framebuffer_multisample */
10223 SET_RenderbufferStorageMultisample(table
, _mesa_RenderbufferStorageMultisample
);
10225 /* GL_ARB_vertex_array_object */
10226 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10227 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10229 /* ???. GL_EXT_depth_bounds_test */
10230 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10232 /* ARB 1. GL_ARB_multitexture */
10233 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10234 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10236 /* ARB 3. GL_ARB_transpose_matrix */
10237 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10238 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10239 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10240 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10242 /* ARB 5. GL_ARB_multisample */
10243 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10245 /* ARB 12. GL_ARB_texture_compression */
10246 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10247 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10248 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10249 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10250 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10251 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10252 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10254 /* ARB 14. GL_ARB_point_parameters */
10255 /* aliased with EXT_point_parameters functions */
10257 /* ARB 25. GL_ARB_window_pos */
10258 /* aliased with MESA_window_pos functions */
10260 /* ARB 26. GL_ARB_vertex_program */
10261 /* ARB 27. GL_ARB_fragment_program */
10262 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10263 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10264 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10265 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10266 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10267 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10268 SET_BindProgramNV(table
, save_BindProgramNV
);
10269 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10270 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10271 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10272 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10273 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10274 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10275 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10276 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10277 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10278 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10279 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10280 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10281 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10282 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10283 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10284 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10285 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10286 SET_GetProgramLocalParameterdvARB(table
,
10287 _mesa_GetProgramLocalParameterdvARB
);
10288 SET_GetProgramLocalParameterfvARB(table
,
10289 _mesa_GetProgramLocalParameterfvARB
);
10290 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10291 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10294 /* ARB 28. GL_ARB_vertex_buffer_object */
10295 /* None of the extension's functions get compiled */
10296 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10297 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10298 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10299 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10300 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10301 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10302 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10303 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10304 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10305 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10306 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10308 #if FEATURE_queryobj
10309 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10310 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10311 SET_EndQueryARB(table
, save_EndQueryARB
);
10314 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10316 #if FEATURE_EXT_framebuffer_blit
10317 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10320 /* GL_ARB_shader_objects */
10321 _mesa_init_shader_dispatch(table
); /* Plug in glCreate/Delete/Get, etc */
10322 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10323 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10324 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10325 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10326 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10327 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10328 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10329 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10330 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10331 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10332 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10333 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10334 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10335 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10336 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10337 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10338 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10339 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10340 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10341 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10342 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10343 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10344 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10345 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10346 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10347 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10349 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10350 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10351 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10352 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10353 /* XXX additional functions need to be implemented here! */
10355 /* 299. GL_EXT_blend_equation_separate */
10356 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10358 /* GL_EXT_gpu_program_parameters */
10359 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10360 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10361 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10364 /* ARB 50. GL_ARB_map_buffer_range */
10365 #if FEATURE_ARB_map_buffer_range
10366 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10367 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10370 /* ARB 51. GL_ARB_texture_buffer_object */
10371 SET_TexBufferARB(table
, _mesa_TexBuffer
); /* no dlist save */
10373 /* ARB 59. GL_ARB_copy_buffer */
10374 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10376 /* 364. GL_EXT_provoking_vertex */
10377 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10379 /* 371. GL_APPLE_object_purgeable */
10380 #if FEATURE_APPLE_object_purgeable
10381 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10382 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10383 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10386 /* GL_EXT_texture_integer */
10387 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10388 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10389 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10390 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10391 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10392 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10394 /* 377. GL_EXT_separate_shader_objects */
10395 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10396 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10398 /* GL_ARB_color_buffer_float */
10399 SET_ClampColorARB(table
, save_ClampColorARB
);
10400 SET_ClampColor(table
, save_ClampColorARB
);
10403 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10404 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10405 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10406 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10408 SET_Uniform1ui(table
, save_Uniform1ui
);
10409 SET_Uniform2ui(table
, save_Uniform2ui
);
10410 SET_Uniform3ui(table
, save_Uniform3ui
);
10411 SET_Uniform4ui(table
, save_Uniform4ui
);
10412 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10413 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10414 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10415 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10417 (void) save_Uniform1ui
;
10418 (void) save_Uniform2ui
;
10419 (void) save_Uniform3ui
;
10420 (void) save_Uniform4ui
;
10421 (void) save_Uniform1uiv
;
10422 (void) save_Uniform2uiv
;
10423 (void) save_Uniform3uiv
;
10424 (void) save_Uniform4uiv
;
10427 #if FEATURE_EXT_transform_feedback
10428 /* These are not compiled into display lists: */
10429 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10430 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10431 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10432 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10434 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10435 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10436 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10437 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10438 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10439 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10442 /* GL_ARB_instanced_arrays */
10443 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10445 /* GL_NV_texture_barrier */
10446 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10448 /* GL_ARB_sampler_objects */
10449 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10450 SET_BindSampler(table
, save_BindSampler
);
10451 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10452 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10453 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10454 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10455 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10456 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10458 /* GL_ARB_draw_buffer_blend */
10459 SET_BlendFunciARB(table
, save_BlendFunci
);
10460 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10461 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10462 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10464 /* GL_ARB_geometry_shader4 */
10465 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10466 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10467 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10469 /* GL_NV_conditional_render */
10470 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10471 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10474 _mesa_init_sync_dispatch(table
);
10475 SET_WaitSync(table
, save_WaitSync
);
10477 /* GL_ARB_texture_storage (no dlist support) */
10478 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10479 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10480 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10481 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10482 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10483 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10485 /* GL_ARB_debug_output (no dlist support) */
10486 _mesa_init_errors_dispatch(table
);
10488 /* GL_NV_primitive_restart */
10489 SET_PrimitiveRestartIndexNV(table
, _mesa_PrimitiveRestartIndex
);
10496 static const char *
10497 enum_string(GLenum k
)
10499 return _mesa_lookup_enum_by_nr(k
);
10504 * Print the commands in a display list. For debugging only.
10505 * TODO: many commands aren't handled yet.
10507 static void GLAPIENTRY
10508 print_list(struct gl_context
*ctx
, GLuint list
)
10510 struct gl_display_list
*dlist
;
10514 if (!islist(ctx
, list
)) {
10515 printf("%u is not a display list ID\n", list
);
10519 dlist
= lookup_list(ctx
, list
);
10525 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10527 done
= n
? GL_FALSE
: GL_TRUE
;
10529 const OpCode opcode
= n
[0].opcode
;
10531 if (is_ext_opcode(opcode
)) {
10532 n
+= ext_opcode_print(ctx
, n
);
10537 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10539 case OPCODE_BITMAP
:
10540 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10541 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10543 case OPCODE_CALL_LIST
:
10544 printf("CallList %d\n", (int) n
[1].ui
);
10546 case OPCODE_CALL_LIST_OFFSET
:
10547 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10548 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10550 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10551 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10552 enum_string(n
[1].e
), enum_string(n
[2].e
),
10553 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10555 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10556 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10557 enum_string(n
[1].e
), enum_string(n
[2].e
),
10558 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10560 case OPCODE_DISABLE
:
10561 printf("Disable %s\n", enum_string(n
[1].e
));
10563 case OPCODE_ENABLE
:
10564 printf("Enable %s\n", enum_string(n
[1].e
));
10566 case OPCODE_FRUSTUM
:
10567 printf("Frustum %g %g %g %g %g %g\n",
10568 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10570 case OPCODE_LINE_STIPPLE
:
10571 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10573 case OPCODE_LOAD_IDENTITY
:
10574 printf("LoadIdentity\n");
10576 case OPCODE_LOAD_MATRIX
:
10577 printf("LoadMatrix\n");
10578 printf(" %8f %8f %8f %8f\n",
10579 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10580 printf(" %8f %8f %8f %8f\n",
10581 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10582 printf(" %8f %8f %8f %8f\n",
10583 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10584 printf(" %8f %8f %8f %8f\n",
10585 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10587 case OPCODE_MULT_MATRIX
:
10588 printf("MultMatrix (or Rotate)\n");
10589 printf(" %8f %8f %8f %8f\n",
10590 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10591 printf(" %8f %8f %8f %8f\n",
10592 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10593 printf(" %8f %8f %8f %8f\n",
10594 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10595 printf(" %8f %8f %8f %8f\n",
10596 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10599 printf("Ortho %g %g %g %g %g %g\n",
10600 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10602 case OPCODE_POP_ATTRIB
:
10603 printf("PopAttrib\n");
10605 case OPCODE_POP_MATRIX
:
10606 printf("PopMatrix\n");
10608 case OPCODE_POP_NAME
:
10609 printf("PopName\n");
10611 case OPCODE_PUSH_ATTRIB
:
10612 printf("PushAttrib %x\n", n
[1].bf
);
10614 case OPCODE_PUSH_MATRIX
:
10615 printf("PushMatrix\n");
10617 case OPCODE_PUSH_NAME
:
10618 printf("PushName %d\n", (int) n
[1].ui
);
10620 case OPCODE_RASTER_POS
:
10621 printf("RasterPos %g %g %g %g\n",
10622 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10624 case OPCODE_ROTATE
:
10625 printf("Rotate %g %g %g %g\n",
10626 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10629 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10631 case OPCODE_TRANSLATE
:
10632 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10634 case OPCODE_BIND_TEXTURE
:
10635 printf("BindTexture %s %d\n",
10636 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10638 case OPCODE_SHADE_MODEL
:
10639 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10642 printf("Map1 %s %.3f %.3f %d %d\n",
10643 _mesa_lookup_enum_by_nr(n
[1].ui
),
10644 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10647 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10648 _mesa_lookup_enum_by_nr(n
[1].ui
),
10649 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10650 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10652 case OPCODE_MAPGRID1
:
10653 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10655 case OPCODE_MAPGRID2
:
10656 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10657 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10659 case OPCODE_EVALMESH1
:
10660 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10662 case OPCODE_EVALMESH2
:
10663 printf("EvalMesh2 %d %d %d %d\n",
10664 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10667 case OPCODE_ATTR_1F_NV
:
10668 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10670 case OPCODE_ATTR_2F_NV
:
10671 printf("ATTR_2F_NV attr %d: %f %f\n",
10672 n
[1].i
, n
[2].f
, n
[3].f
);
10674 case OPCODE_ATTR_3F_NV
:
10675 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10676 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10678 case OPCODE_ATTR_4F_NV
:
10679 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10680 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10682 case OPCODE_ATTR_1F_ARB
:
10683 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10685 case OPCODE_ATTR_2F_ARB
:
10686 printf("ATTR_2F_ARB attr %d: %f %f\n",
10687 n
[1].i
, n
[2].f
, n
[3].f
);
10689 case OPCODE_ATTR_3F_ARB
:
10690 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10691 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10693 case OPCODE_ATTR_4F_ARB
:
10694 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10695 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10698 case OPCODE_MATERIAL
:
10699 printf("MATERIAL %x %x: %f %f %f %f\n",
10700 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10703 printf("BEGIN %x\n", n
[1].i
);
10709 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10712 case OPCODE_EVAL_C1
:
10713 printf("EVAL_C1 %f\n", n
[1].f
);
10715 case OPCODE_EVAL_C2
:
10716 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10718 case OPCODE_EVAL_P1
:
10719 printf("EVAL_P1 %d\n", n
[1].i
);
10721 case OPCODE_EVAL_P2
:
10722 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10725 case OPCODE_PROVOKING_VERTEX
:
10726 printf("ProvokingVertex %s\n",
10727 _mesa_lookup_enum_by_nr(n
[1].ui
));
10731 * meta opcodes/commands
10734 printf("Error: %s %s\n",
10735 enum_string(n
[1].e
), (const char *) n
[2].data
);
10737 case OPCODE_CONTINUE
:
10738 printf("DISPLAY-LIST-CONTINUE\n");
10739 n
= (Node
*) n
[1].next
;
10741 case OPCODE_END_OF_LIST
:
10742 printf("END-LIST %u\n", list
);
10746 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10748 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10749 opcode
, (void *) n
);
10753 printf("command %d, %u operands\n", opcode
,
10757 /* increment n to point to next compiled command */
10758 if (opcode
!= OPCODE_CONTINUE
) {
10759 n
+= InstSize
[opcode
];
10768 * Clients may call this function to help debug display list problems.
10769 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10770 * changed, or break in the future without notice.
10773 mesa_print_display_list(GLuint list
)
10775 GET_CURRENT_CONTEXT(ctx
);
10776 print_list(ctx
, list
);
10780 /**********************************************************************/
10781 /***** Initialization *****/
10782 /**********************************************************************/
10785 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10787 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10789 vfmt
->Begin
= save_Begin
;
10791 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10793 vfmt
->Color3f
= save_Color3f
;
10794 vfmt
->Color3fv
= save_Color3fv
;
10795 vfmt
->Color4f
= save_Color4f
;
10796 vfmt
->Color4fv
= save_Color4fv
;
10797 vfmt
->EdgeFlag
= save_EdgeFlag
;
10798 vfmt
->End
= save_End
;
10800 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10802 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10803 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10804 vfmt
->Indexf
= save_Indexf
;
10805 vfmt
->Indexfv
= save_Indexfv
;
10806 vfmt
->Materialfv
= save_Materialfv
;
10807 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10808 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10809 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10810 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10811 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10812 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10813 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10814 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10815 vfmt
->Normal3f
= save_Normal3f
;
10816 vfmt
->Normal3fv
= save_Normal3fv
;
10817 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10818 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10819 vfmt
->TexCoord1f
= save_TexCoord1f
;
10820 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10821 vfmt
->TexCoord2f
= save_TexCoord2f
;
10822 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10823 vfmt
->TexCoord3f
= save_TexCoord3f
;
10824 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10825 vfmt
->TexCoord4f
= save_TexCoord4f
;
10826 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10827 vfmt
->Vertex2f
= save_Vertex2f
;
10828 vfmt
->Vertex2fv
= save_Vertex2fv
;
10829 vfmt
->Vertex3f
= save_Vertex3f
;
10830 vfmt
->Vertex3fv
= save_Vertex3fv
;
10831 vfmt
->Vertex4f
= save_Vertex4f
;
10832 vfmt
->Vertex4fv
= save_Vertex4fv
;
10833 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10834 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10835 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10836 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10837 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10838 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10839 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10840 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10841 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10842 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10843 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10844 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10845 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10846 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10847 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10848 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10850 vfmt
->Rectf
= save_Rectf
;
10852 /* GL_ARB_draw_instanced */
10853 vfmt
->DrawArraysInstanced
= save_DrawArraysInstancedARB
;
10854 vfmt
->DrawElementsInstanced
= save_DrawElementsInstancedARB
;
10856 /* GL_ARB_draw_elements_base_vertex */
10857 vfmt
->DrawElementsInstancedBaseVertex
= save_DrawElementsInstancedBaseVertexARB
;
10859 /* GL_ARB_base_instance */
10860 vfmt
->DrawArraysInstancedBaseInstance
= save_DrawArraysInstancedBaseInstance
;
10861 vfmt
->DrawElementsInstancedBaseInstance
= save_DrawElementsInstancedBaseInstance
;
10862 vfmt
->DrawElementsInstancedBaseVertexBaseInstance
= save_DrawElementsInstancedBaseVertexBaseInstance
;
10864 /* The driver is required to implement these as
10865 * 1) They can probably do a better job.
10866 * 2) A lot of new mechanisms would have to be added to this module
10867 * to support it. That code would probably never get used,
10871 vfmt
->DrawArrays
= 0;
10872 vfmt
->DrawElements
= 0;
10873 vfmt
->DrawRangeElements
= 0;
10874 vfmt
->MultiDrawElemementsEXT
= 0;
10875 vfmt
->DrawElementsBaseVertex
= 0;
10876 vfmt
->DrawRangeElementsBaseVertex
= 0;
10877 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10883 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10884 const GLvertexformat
*vfmt
)
10886 SET_CallList(disp
, vfmt
->CallList
);
10887 SET_CallLists(disp
, vfmt
->CallLists
);
10891 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10893 SET_CallList(disp
, _mesa_CallList
);
10894 SET_CallLists(disp
, _mesa_CallLists
);
10896 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10897 SET_EndList(disp
, _mesa_EndList
);
10898 SET_GenLists(disp
, _mesa_GenLists
);
10899 SET_IsList(disp
, _mesa_IsList
);
10900 SET_ListBase(disp
, _mesa_ListBase
);
10901 SET_NewList(disp
, _mesa_NewList
);
10905 #endif /* FEATURE_dlist */
10909 * Initialize display list state for given context.
10912 _mesa_init_display_list(struct gl_context
*ctx
)
10914 static GLboolean tableInitialized
= GL_FALSE
;
10916 /* zero-out the instruction size table, just once */
10917 if (!tableInitialized
) {
10918 memset(InstSize
, 0, sizeof(InstSize
));
10919 tableInitialized
= GL_TRUE
;
10922 /* extension info */
10923 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10926 ctx
->ListState
.CallDepth
= 0;
10927 ctx
->ExecuteFlag
= GL_TRUE
;
10928 ctx
->CompileFlag
= GL_FALSE
;
10929 ctx
->ListState
.CurrentBlock
= NULL
;
10930 ctx
->ListState
.CurrentPos
= 0;
10932 /* Display List group */
10933 ctx
->List
.ListBase
= 0;
10936 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10942 _mesa_free_display_list_data(struct gl_context
*ctx
)
10944 free(ctx
->ListExt
);
10945 ctx
->ListExt
= NULL
;