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"
50 #include "framebuffer.h"
51 #include "glapi/glapi.h"
52 #include "glformats.h"
60 #include "samplerobj.h"
61 #include "shaderapi.h"
64 #include "texstorage.h"
67 #include "arbprogram.h"
68 #include "nvprogram.h"
69 #if FEATURE_EXT_transform_feedback
70 #include "transformfeedback.h"
73 #include "math/m_matrix.h"
75 #include "main/dispatch.h"
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls
112 * dd_function_table::SaveFlushVertices if so.
114 #define SAVE_FLUSH_VERTICES(ctx) \
116 if (ctx->Driver.SaveNeedFlush) \
117 ctx->Driver.SaveFlushVertices(ctx); \
122 * Macro to assert that the API call was made outside the
123 * glBegin()/glEnd() pair, with return value.
125 * \param ctx GL context.
126 * \param retval value to return value in case the assertion fails.
128 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
130 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
131 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
132 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
138 * Macro to assert that the API call was made outside the
139 * glBegin()/glEnd() pair.
141 * \param ctx GL context.
143 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
145 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
146 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
147 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices.
156 * \param ctx GL context.
158 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
160 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
161 SAVE_FLUSH_VERTICES(ctx); \
165 * Macro to assert that the API call was made outside the
166 * glBegin()/glEnd() pair and flush the vertices, with return value.
168 * \param ctx GL context.
169 * \param retval value to return value in case the assertion fails.
171 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
173 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
174 SAVE_FLUSH_VERTICES(ctx); \
180 * Display list opcodes.
182 * The fact that these identifiers are assigned consecutive
183 * integer values starting at 0 is very important, see InstSize array usage)
187 OPCODE_INVALID
= -1, /* Force signed enum */
193 OPCODE_BLEND_EQUATION
,
194 OPCODE_BLEND_EQUATION_SEPARATE
,
195 OPCODE_BLEND_FUNC_SEPARATE
,
197 OPCODE_BLEND_EQUATION_I
,
198 OPCODE_BLEND_EQUATION_SEPARATE_I
,
200 OPCODE_BLEND_FUNC_SEPARATE_I
,
203 OPCODE_CALL_LIST_OFFSET
,
209 OPCODE_CLEAR_STENCIL
,
210 OPCODE_CLEAR_BUFFER_IV
,
211 OPCODE_CLEAR_BUFFER_UIV
,
212 OPCODE_CLEAR_BUFFER_FV
,
213 OPCODE_CLEAR_BUFFER_FI
,
216 OPCODE_COLOR_MASK_INDEXED
,
217 OPCODE_COLOR_MATERIAL
,
219 OPCODE_COLOR_TABLE_PARAMETER_FV
,
220 OPCODE_COLOR_TABLE_PARAMETER_IV
,
221 OPCODE_COLOR_SUB_TABLE
,
222 OPCODE_CONVOLUTION_FILTER_1D
,
223 OPCODE_CONVOLUTION_FILTER_2D
,
224 OPCODE_CONVOLUTION_PARAMETER_I
,
225 OPCODE_CONVOLUTION_PARAMETER_IV
,
226 OPCODE_CONVOLUTION_PARAMETER_F
,
227 OPCODE_CONVOLUTION_PARAMETER_FV
,
228 OPCODE_COPY_COLOR_SUB_TABLE
,
229 OPCODE_COPY_COLOR_TABLE
,
231 OPCODE_COPY_TEX_IMAGE1D
,
232 OPCODE_COPY_TEX_IMAGE2D
,
233 OPCODE_COPY_TEX_SUB_IMAGE1D
,
234 OPCODE_COPY_TEX_SUB_IMAGE2D
,
235 OPCODE_COPY_TEX_SUB_IMAGE3D
,
241 OPCODE_DISABLE_INDEXED
,
245 OPCODE_ENABLE_INDEXED
,
260 OPCODE_LOAD_IDENTITY
,
274 OPCODE_PIXEL_TRANSFER
,
277 OPCODE_POINT_PARAMETERS
,
279 OPCODE_POLYGON_STIPPLE
,
280 OPCODE_POLYGON_OFFSET
,
284 OPCODE_PRIORITIZE_TEXTURE
,
290 OPCODE_RESET_HISTOGRAM
,
291 OPCODE_RESET_MIN_MAX
,
295 OPCODE_SELECT_TEXTURE_SGIS
,
296 OPCODE_SELECT_TEXTURE_COORD_SET
,
307 OPCODE_TEX_SUB_IMAGE1D
,
308 OPCODE_TEX_SUB_IMAGE2D
,
309 OPCODE_TEX_SUB_IMAGE3D
,
313 /* GL_ARB_multitexture */
314 OPCODE_ACTIVE_TEXTURE
,
315 /* GL_ARB_texture_compression */
316 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
317 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
318 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
319 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
320 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
321 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
322 /* GL_ARB_multisample */
323 OPCODE_SAMPLE_COVERAGE
,
324 /* GL_ARB_window_pos */
325 OPCODE_WINDOW_POS_ARB
,
326 /* GL_NV_vertex_program */
327 OPCODE_BIND_PROGRAM_NV
,
328 OPCODE_EXECUTE_PROGRAM_NV
,
329 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
330 OPCODE_LOAD_PROGRAM_NV
,
331 OPCODE_TRACK_MATRIX_NV
,
332 /* GL_NV_fragment_program */
333 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
334 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
335 /* GL_EXT_stencil_two_side */
336 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
337 /* GL_EXT_depth_bounds_test */
338 OPCODE_DEPTH_BOUNDS_EXT
,
339 /* GL_ARB_vertex/fragment_program */
340 OPCODE_PROGRAM_STRING_ARB
,
341 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
342 /* GL_ARB_occlusion_query */
343 OPCODE_BEGIN_QUERY_ARB
,
344 OPCODE_END_QUERY_ARB
,
345 /* GL_ARB_draw_buffers */
346 OPCODE_DRAW_BUFFERS_ARB
,
347 /* GL_ATI_fragment_shader */
348 OPCODE_TEX_BUMP_PARAMETER_ATI
,
349 /* GL_ATI_fragment_shader */
350 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
351 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
353 OPCODE_STENCIL_FUNC_SEPARATE
,
354 OPCODE_STENCIL_OP_SEPARATE
,
355 OPCODE_STENCIL_MASK_SEPARATE
,
357 /* GL_ARB_shader_objects */
375 OPCODE_UNIFORM_MATRIX22
,
376 OPCODE_UNIFORM_MATRIX33
,
377 OPCODE_UNIFORM_MATRIX44
,
378 OPCODE_UNIFORM_MATRIX23
,
379 OPCODE_UNIFORM_MATRIX32
,
380 OPCODE_UNIFORM_MATRIX24
,
381 OPCODE_UNIFORM_MATRIX42
,
382 OPCODE_UNIFORM_MATRIX34
,
383 OPCODE_UNIFORM_MATRIX43
,
395 /* GL_ARB_color_buffer_float */
398 /* GL_EXT_framebuffer_blit */
399 OPCODE_BLIT_FRAMEBUFFER
,
401 /* Vertex attributes -- fallback for when optimized display
402 * list build isn't active.
421 /* GL_EXT_provoking_vertex */
422 OPCODE_PROVOKING_VERTEX
,
424 /* GL_EXT_transform_feedback */
425 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
426 OPCODE_END_TRANSFORM_FEEDBACK
,
427 OPCODE_BIND_TRANSFORM_FEEDBACK
,
428 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
429 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
430 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
432 /* GL_EXT_texture_integer */
434 OPCODE_CLEARCOLOR_UI
,
435 OPCODE_TEXPARAMETER_I
,
436 OPCODE_TEXPARAMETER_UI
,
438 /* GL_EXT_separate_shader_objects */
439 OPCODE_ACTIVE_PROGRAM_EXT
,
440 OPCODE_USE_SHADER_PROGRAM_EXT
,
442 /* GL_ARB_instanced_arrays */
443 OPCODE_VERTEX_ATTRIB_DIVISOR
,
445 /* GL_NV_texture_barrier */
446 OPCODE_TEXTURE_BARRIER_NV
,
448 /* GL_ARB_sampler_object */
450 OPCODE_SAMPLER_PARAMETERIV
,
451 OPCODE_SAMPLER_PARAMETERFV
,
452 OPCODE_SAMPLER_PARAMETERIIV
,
453 OPCODE_SAMPLER_PARAMETERUIV
,
455 /* GL_ARB_geometry_shader4 */
456 OPCODE_PROGRAM_PARAMETERI
,
457 OPCODE_FRAMEBUFFER_TEXTURE
,
458 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
463 /* GL_NV_conditional_render */
464 OPCODE_BEGIN_CONDITIONAL_RENDER
,
465 OPCODE_END_CONDITIONAL_RENDER
,
467 /* ARB_timer_query */
468 OPCODE_QUERY_COUNTER
,
470 /* ARB_transform_feedback3 */
471 OPCODE_BEGIN_QUERY_INDEXED
,
472 OPCODE_END_QUERY_INDEXED
,
473 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
475 /* ARB_transform_feedback_instanced */
476 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
477 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
479 /* ARB_uniform_buffer_object */
480 OPCODE_UNIFORM_BLOCK_BINDING
,
482 /* The following three are meta instructions */
483 OPCODE_ERROR
, /* raise compiled-in error */
494 * Display list instructions are stored as sequences of "nodes". Nodes
495 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
496 * are linked together with a pointer.
498 * Each instruction in the display list is stored as a sequence of
499 * contiguous nodes in memory.
500 * Each node is the union of a variety of data types.
516 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
520 typedef union gl_dlist_node Node
;
524 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
525 * environment. In 64-bit env, sizeof(Node)==8 anyway.
535 * How many nodes to allocate at a time.
537 * \note Reduced now that we hold vertices etc. elsewhere.
539 #define BLOCK_SIZE 256
544 * Number of nodes of storage needed for each instruction.
545 * Sizes for dynamically allocated opcodes are stored in the context struct.
547 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
550 void mesa_print_display_list(GLuint list
);
553 /**********************************************************************/
554 /***** Private *****/
555 /**********************************************************************/
559 * Make an empty display list. This is used by glGenLists() to
560 * reserve display list IDs.
562 static struct gl_display_list
*
563 make_list(GLuint name
, GLuint count
)
565 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
567 dlist
->Head
= malloc(sizeof(Node
) * count
);
568 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
574 * Lookup function to just encapsulate casting.
576 static inline struct gl_display_list
*
577 lookup_list(struct gl_context
*ctx
, GLuint list
)
579 return (struct gl_display_list
*)
580 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
584 /** Is the given opcode an extension code? */
585 static inline GLboolean
586 is_ext_opcode(OpCode opcode
)
588 return (opcode
>= OPCODE_EXT_0
);
592 /** Destroy an extended opcode instruction */
594 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
596 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
598 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
599 step
= ctx
->ListExt
->Opcode
[i
].Size
;
604 /** Execute an extended opcode instruction */
606 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
608 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
610 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
611 step
= ctx
->ListExt
->Opcode
[i
].Size
;
616 /** Print an extended opcode instruction */
618 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
620 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
622 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
623 step
= ctx
->ListExt
->Opcode
[i
].Size
;
629 * Delete the named display list, but don't remove from hash table.
630 * \param dlist - display list pointer
633 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
638 n
= block
= dlist
->Head
;
640 done
= block
? GL_FALSE
: GL_TRUE
;
642 const OpCode opcode
= n
[0].opcode
;
644 /* check for extension opcodes first */
645 if (is_ext_opcode(opcode
)) {
646 n
+= ext_opcode_destroy(ctx
, n
);
650 /* for some commands, we need to free malloc'd memory */
653 n
+= InstSize
[n
[0].opcode
];
657 n
+= InstSize
[n
[0].opcode
];
659 case OPCODE_DRAW_PIXELS
:
661 n
+= InstSize
[n
[0].opcode
];
665 n
+= InstSize
[n
[0].opcode
];
667 case OPCODE_COLOR_TABLE
:
669 n
+= InstSize
[n
[0].opcode
];
671 case OPCODE_COLOR_SUB_TABLE
:
673 n
+= InstSize
[n
[0].opcode
];
675 case OPCODE_CONVOLUTION_FILTER_1D
:
677 n
+= InstSize
[n
[0].opcode
];
679 case OPCODE_CONVOLUTION_FILTER_2D
:
681 n
+= InstSize
[n
[0].opcode
];
683 case OPCODE_POLYGON_STIPPLE
:
685 n
+= InstSize
[n
[0].opcode
];
687 case OPCODE_TEX_IMAGE1D
:
689 n
+= InstSize
[n
[0].opcode
];
691 case OPCODE_TEX_IMAGE2D
:
693 n
+= InstSize
[n
[0].opcode
];
695 case OPCODE_TEX_IMAGE3D
:
697 n
+= InstSize
[n
[0].opcode
];
699 case OPCODE_TEX_SUB_IMAGE1D
:
701 n
+= InstSize
[n
[0].opcode
];
703 case OPCODE_TEX_SUB_IMAGE2D
:
705 n
+= InstSize
[n
[0].opcode
];
707 case OPCODE_TEX_SUB_IMAGE3D
:
709 n
+= InstSize
[n
[0].opcode
];
711 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
713 n
+= InstSize
[n
[0].opcode
];
715 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
717 n
+= InstSize
[n
[0].opcode
];
719 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
721 n
+= InstSize
[n
[0].opcode
];
723 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
725 n
+= InstSize
[n
[0].opcode
];
727 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
729 n
+= InstSize
[n
[0].opcode
];
731 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
733 n
+= InstSize
[n
[0].opcode
];
735 case OPCODE_LOAD_PROGRAM_NV
:
736 free(n
[4].data
); /* program string */
737 n
+= InstSize
[n
[0].opcode
];
739 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
740 free(n
[2].data
); /* array of program ids */
741 n
+= InstSize
[n
[0].opcode
];
743 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
744 free(n
[3].data
); /* parameter name */
745 n
+= InstSize
[n
[0].opcode
];
747 case OPCODE_PROGRAM_STRING_ARB
:
748 free(n
[4].data
); /* program string */
749 n
+= InstSize
[n
[0].opcode
];
751 case OPCODE_UNIFORM_1FV
:
752 case OPCODE_UNIFORM_2FV
:
753 case OPCODE_UNIFORM_3FV
:
754 case OPCODE_UNIFORM_4FV
:
755 case OPCODE_UNIFORM_1IV
:
756 case OPCODE_UNIFORM_2IV
:
757 case OPCODE_UNIFORM_3IV
:
758 case OPCODE_UNIFORM_4IV
:
759 case OPCODE_UNIFORM_1UIV
:
760 case OPCODE_UNIFORM_2UIV
:
761 case OPCODE_UNIFORM_3UIV
:
762 case OPCODE_UNIFORM_4UIV
:
764 n
+= InstSize
[n
[0].opcode
];
766 case OPCODE_UNIFORM_MATRIX22
:
767 case OPCODE_UNIFORM_MATRIX33
:
768 case OPCODE_UNIFORM_MATRIX44
:
769 case OPCODE_UNIFORM_MATRIX24
:
770 case OPCODE_UNIFORM_MATRIX42
:
771 case OPCODE_UNIFORM_MATRIX23
:
772 case OPCODE_UNIFORM_MATRIX32
:
773 case OPCODE_UNIFORM_MATRIX34
:
774 case OPCODE_UNIFORM_MATRIX43
:
776 n
+= InstSize
[n
[0].opcode
];
779 case OPCODE_CONTINUE
:
780 n
= (Node
*) n
[1].next
;
784 case OPCODE_END_OF_LIST
:
789 /* Most frequent case */
790 n
+= InstSize
[n
[0].opcode
];
801 * Destroy a display list and remove from hash table.
802 * \param list - display list number
805 destroy_list(struct gl_context
*ctx
, GLuint list
)
807 struct gl_display_list
*dlist
;
812 dlist
= lookup_list(ctx
, list
);
816 _mesa_delete_list(ctx
, dlist
);
817 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
822 * Translate the nth element of list from <type> to GLint.
825 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
837 bptr
= (GLbyte
*) list
;
838 return (GLint
) bptr
[n
];
839 case GL_UNSIGNED_BYTE
:
840 ubptr
= (GLubyte
*) list
;
841 return (GLint
) ubptr
[n
];
843 sptr
= (GLshort
*) list
;
844 return (GLint
) sptr
[n
];
845 case GL_UNSIGNED_SHORT
:
846 usptr
= (GLushort
*) list
;
847 return (GLint
) usptr
[n
];
849 iptr
= (GLint
*) list
;
851 case GL_UNSIGNED_INT
:
852 uiptr
= (GLuint
*) list
;
853 return (GLint
) uiptr
[n
];
855 fptr
= (GLfloat
*) list
;
856 return (GLint
) FLOORF(fptr
[n
]);
858 ubptr
= ((GLubyte
*) list
) + 2 * n
;
859 return (GLint
) ubptr
[0] * 256
862 ubptr
= ((GLubyte
*) list
) + 3 * n
;
863 return (GLint
) ubptr
[0] * 65536
864 + (GLint
) ubptr
[1] * 256
867 ubptr
= ((GLubyte
*) list
) + 4 * n
;
868 return (GLint
) ubptr
[0] * 16777216
869 + (GLint
) ubptr
[1] * 65536
870 + (GLint
) ubptr
[2] * 256
880 /**********************************************************************/
882 /**********************************************************************/
885 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
886 * If width < 0 or height < 0 or format or type are invalid we'll just
887 * return NULL. We will not generate an error since OpenGL command
888 * arguments aren't error-checked until the command is actually executed
889 * (not when they're compiled).
890 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
893 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
894 GLsizei width
, GLsizei height
, GLsizei depth
,
895 GLenum format
, GLenum type
, const GLvoid
* pixels
,
896 const struct gl_pixelstore_attrib
*unpack
)
898 if (width
<= 0 || height
<= 0) {
902 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
903 /* bad format and/or type */
907 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
911 if (type
== GL_BITMAP
)
912 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
914 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
915 format
, type
, pixels
, unpack
);
916 if (pixels
&& !image
) {
917 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
921 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
922 depth
, format
, type
, INT_MAX
, pixels
)) {
923 const GLubyte
*map
, *src
;
927 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
928 GL_MAP_READ_BIT
, unpack
->BufferObj
);
930 /* unable to map src buffer! */
931 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
935 src
= ADD_POINTERS(map
, pixels
);
936 if (type
== GL_BITMAP
)
937 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
939 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
940 format
, type
, src
, unpack
);
942 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
945 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
951 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
956 * Allocate space for a display list instruction (opcode + payload space).
957 * \param opcode the instruction opcode (OPCODE_* value)
958 * \param bytes instruction payload size (not counting opcode)
959 * \return pointer to allocated memory (the opcode space)
962 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
964 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
967 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
968 if (InstSize
[opcode
] == 0) {
969 /* save instruction size now */
970 InstSize
[opcode
] = numNodes
;
973 /* make sure instruction size agrees */
974 ASSERT(numNodes
== InstSize
[opcode
]);
978 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
979 /* This block is full. Allocate a new block and chain to it */
981 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
982 n
[0].opcode
= OPCODE_CONTINUE
;
983 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
985 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
988 n
[1].next
= (Node
*) newblock
;
989 ctx
->ListState
.CurrentBlock
= newblock
;
990 ctx
->ListState
.CurrentPos
= 0;
993 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
994 ctx
->ListState
.CurrentPos
+= numNodes
;
996 n
[0].opcode
= opcode
;
1004 * Allocate space for a display list instruction. Used by callers outside
1005 * this file for things like VBO vertex data.
1007 * \param opcode the instruction opcode (OPCODE_* value)
1008 * \param bytes instruction size in bytes, not counting opcode.
1009 * \return pointer to the usable data area (not including the internal
1013 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1015 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1017 return n
+ 1; /* return pointer to payload area, after opcode */
1024 * This function allows modules and drivers to get their own opcodes
1025 * for extending display list functionality.
1026 * \param ctx the rendering context
1027 * \param size number of bytes for storing the new display list command
1028 * \param execute function to execute the new display list command
1029 * \param destroy function to destroy the new display list command
1030 * \param print function to print the new display list command
1031 * \return the new opcode number or -1 if error
1034 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1036 void (*execute
) (struct gl_context
*, void *),
1037 void (*destroy
) (struct gl_context
*, void *),
1038 void (*print
) (struct gl_context
*, void *))
1040 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1041 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1042 ctx
->ListExt
->Opcode
[i
].Size
=
1043 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1044 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1045 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1046 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1047 return i
+ OPCODE_EXT_0
;
1054 * Allocate space for a display list instruction. The space is basically
1055 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1056 * function parameter, node[2] is the second parameter, etc.
1058 * \param opcode one of OPCODE_x
1059 * \param nparams number of function parameters
1060 * \return pointer to start of instruction space
1062 static inline Node
*
1063 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1065 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1071 * Display List compilation functions
1073 static void GLAPIENTRY
1074 save_Accum(GLenum op
, GLfloat value
)
1076 GET_CURRENT_CONTEXT(ctx
);
1078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1079 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1084 if (ctx
->ExecuteFlag
) {
1085 CALL_Accum(ctx
->Exec
, (op
, value
));
1090 static void GLAPIENTRY
1091 save_AlphaFunc(GLenum func
, GLclampf ref
)
1093 GET_CURRENT_CONTEXT(ctx
);
1095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1096 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1099 n
[2].f
= (GLfloat
) ref
;
1101 if (ctx
->ExecuteFlag
) {
1102 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1107 static void GLAPIENTRY
1108 save_BindTexture(GLenum target
, GLuint texture
)
1110 GET_CURRENT_CONTEXT(ctx
);
1112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1113 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1118 if (ctx
->ExecuteFlag
) {
1119 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1124 static void GLAPIENTRY
1125 save_Bitmap(GLsizei width
, GLsizei height
,
1126 GLfloat xorig
, GLfloat yorig
,
1127 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1129 GET_CURRENT_CONTEXT(ctx
);
1131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1132 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1134 n
[1].i
= (GLint
) width
;
1135 n
[2].i
= (GLint
) height
;
1140 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1141 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1143 if (ctx
->ExecuteFlag
) {
1144 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1145 xorig
, yorig
, xmove
, ymove
, pixels
));
1150 static void GLAPIENTRY
1151 save_BlendEquation(GLenum mode
)
1153 GET_CURRENT_CONTEXT(ctx
);
1155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1156 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1160 if (ctx
->ExecuteFlag
) {
1161 CALL_BlendEquation(ctx
->Exec
, (mode
));
1166 static void GLAPIENTRY
1167 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1169 GET_CURRENT_CONTEXT(ctx
);
1171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1172 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1177 if (ctx
->ExecuteFlag
) {
1178 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1183 static void GLAPIENTRY
1184 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1185 GLenum sfactorA
, GLenum dfactorA
)
1187 GET_CURRENT_CONTEXT(ctx
);
1189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1190 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1192 n
[1].e
= sfactorRGB
;
1193 n
[2].e
= dfactorRGB
;
1197 if (ctx
->ExecuteFlag
) {
1198 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1199 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1204 static void GLAPIENTRY
1205 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1207 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1211 static void GLAPIENTRY
1212 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1214 GET_CURRENT_CONTEXT(ctx
);
1216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1217 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1224 if (ctx
->ExecuteFlag
) {
1225 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1229 /* GL_ARB_draw_buffers_blend */
1230 static void GLAPIENTRY
1231 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1232 GLenum sfactorA
, GLenum dfactorA
)
1234 GET_CURRENT_CONTEXT(ctx
);
1236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1237 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1240 n
[2].e
= sfactorRGB
;
1241 n
[3].e
= dfactorRGB
;
1245 if (ctx
->ExecuteFlag
) {
1246 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1247 sfactorA
, dfactorA
));
1251 /* GL_ARB_draw_buffers_blend */
1252 static void GLAPIENTRY
1253 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1255 GET_CURRENT_CONTEXT(ctx
);
1257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1258 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1264 if (ctx
->ExecuteFlag
) {
1265 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1269 /* GL_ARB_draw_buffers_blend */
1270 static void GLAPIENTRY
1271 save_BlendEquationi(GLuint buf
, GLenum mode
)
1273 GET_CURRENT_CONTEXT(ctx
);
1275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1276 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1281 if (ctx
->ExecuteFlag
) {
1282 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1286 /* GL_ARB_draw_buffers_blend */
1287 static void GLAPIENTRY
1288 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1290 GET_CURRENT_CONTEXT(ctx
);
1292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1293 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1299 if (ctx
->ExecuteFlag
) {
1300 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1305 /* GL_ARB_draw_instanced. */
1306 static void GLAPIENTRY
1307 save_DrawArraysInstancedARB(GLenum mode
,
1312 GET_CURRENT_CONTEXT(ctx
);
1313 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1314 "glDrawArraysInstanced() during display list compile");
1317 static void GLAPIENTRY
1318 save_DrawElementsInstancedARB(GLenum mode
,
1321 const GLvoid
*indices
,
1324 GET_CURRENT_CONTEXT(ctx
);
1325 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1326 "glDrawElementsInstanced() during display list compile");
1329 static void GLAPIENTRY
1330 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1333 const GLvoid
*indices
,
1337 GET_CURRENT_CONTEXT(ctx
);
1338 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1339 "glDrawElementsInstancedBaseVertex() during display list compile");
1342 /* GL_ARB_base_instance. */
1343 static void GLAPIENTRY
1344 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1348 GLuint baseinstance
)
1350 GET_CURRENT_CONTEXT(ctx
);
1351 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1352 "glDrawArraysInstancedBaseInstance() during display list compile");
1355 static void APIENTRY
1356 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1359 const void *indices
,
1361 GLuint baseinstance
)
1363 GET_CURRENT_CONTEXT(ctx
);
1364 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1365 "glDrawElementsInstancedBaseInstance() during display list compile");
1368 static void APIENTRY
1369 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1372 const void *indices
,
1375 GLuint baseinstance
)
1377 GET_CURRENT_CONTEXT(ctx
);
1378 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1379 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1382 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1386 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1387 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1389 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1390 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1392 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1394 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1397 static void GLAPIENTRY
1398 save_CallList(GLuint list
)
1400 GET_CURRENT_CONTEXT(ctx
);
1402 SAVE_FLUSH_VERTICES(ctx
);
1404 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1409 /* After this, we don't know what state we're in. Invalidate all
1410 * cached information previously gathered:
1412 invalidate_saved_current_state( ctx
);
1414 if (ctx
->ExecuteFlag
) {
1415 _mesa_CallList(list
);
1420 static void GLAPIENTRY
1421 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1423 GET_CURRENT_CONTEXT(ctx
);
1425 GLboolean typeErrorFlag
;
1427 SAVE_FLUSH_VERTICES(ctx
);
1431 case GL_UNSIGNED_BYTE
:
1433 case GL_UNSIGNED_SHORT
:
1435 case GL_UNSIGNED_INT
:
1440 typeErrorFlag
= GL_FALSE
;
1443 typeErrorFlag
= GL_TRUE
;
1446 for (i
= 0; i
< num
; i
++) {
1447 GLint list
= translate_id(i
, type
, lists
);
1448 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1451 n
[2].b
= typeErrorFlag
;
1455 /* After this, we don't know what state we're in. Invalidate all
1456 * cached information previously gathered:
1458 invalidate_saved_current_state( ctx
);
1460 if (ctx
->ExecuteFlag
) {
1461 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1466 static void GLAPIENTRY
1467 save_Clear(GLbitfield mask
)
1469 GET_CURRENT_CONTEXT(ctx
);
1471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1472 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1476 if (ctx
->ExecuteFlag
) {
1477 CALL_Clear(ctx
->Exec
, (mask
));
1482 static void GLAPIENTRY
1483 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1485 GET_CURRENT_CONTEXT(ctx
);
1487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1488 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1491 n
[2].i
= drawbuffer
;
1493 if (buffer
== GL_COLOR
) {
1504 if (ctx
->ExecuteFlag
) {
1505 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1510 static void GLAPIENTRY
1511 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1513 GET_CURRENT_CONTEXT(ctx
);
1515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1516 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1519 n
[2].i
= drawbuffer
;
1521 if (buffer
== GL_COLOR
) {
1532 if (ctx
->ExecuteFlag
) {
1533 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1538 static void GLAPIENTRY
1539 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1541 GET_CURRENT_CONTEXT(ctx
);
1543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1544 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1547 n
[2].i
= drawbuffer
;
1549 if (buffer
== GL_COLOR
) {
1560 if (ctx
->ExecuteFlag
) {
1561 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1566 static void GLAPIENTRY
1567 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1568 GLfloat depth
, GLint stencil
)
1570 GET_CURRENT_CONTEXT(ctx
);
1572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1573 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1576 n
[2].i
= drawbuffer
;
1580 if (ctx
->ExecuteFlag
) {
1581 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1586 static void GLAPIENTRY
1587 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1589 GET_CURRENT_CONTEXT(ctx
);
1591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1592 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1599 if (ctx
->ExecuteFlag
) {
1600 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1605 static void GLAPIENTRY
1606 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1608 GET_CURRENT_CONTEXT(ctx
);
1610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1611 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1618 if (ctx
->ExecuteFlag
) {
1619 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1624 static void GLAPIENTRY
1625 save_ClearDepth(GLclampd depth
)
1627 GET_CURRENT_CONTEXT(ctx
);
1629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1632 n
[1].f
= (GLfloat
) depth
;
1634 if (ctx
->ExecuteFlag
) {
1635 CALL_ClearDepth(ctx
->Exec
, (depth
));
1640 static void GLAPIENTRY
1641 save_ClearIndex(GLfloat c
)
1643 GET_CURRENT_CONTEXT(ctx
);
1645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1646 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1650 if (ctx
->ExecuteFlag
) {
1651 CALL_ClearIndex(ctx
->Exec
, (c
));
1656 static void GLAPIENTRY
1657 save_ClearStencil(GLint s
)
1659 GET_CURRENT_CONTEXT(ctx
);
1661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1662 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1666 if (ctx
->ExecuteFlag
) {
1667 CALL_ClearStencil(ctx
->Exec
, (s
));
1672 static void GLAPIENTRY
1673 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1675 GET_CURRENT_CONTEXT(ctx
);
1677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1678 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1681 n
[2].f
= (GLfloat
) equ
[0];
1682 n
[3].f
= (GLfloat
) equ
[1];
1683 n
[4].f
= (GLfloat
) equ
[2];
1684 n
[5].f
= (GLfloat
) equ
[3];
1686 if (ctx
->ExecuteFlag
) {
1687 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1693 static void GLAPIENTRY
1694 save_ColorMask(GLboolean red
, GLboolean green
,
1695 GLboolean blue
, GLboolean alpha
)
1697 GET_CURRENT_CONTEXT(ctx
);
1699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1700 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1707 if (ctx
->ExecuteFlag
) {
1708 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1713 static void GLAPIENTRY
1714 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1715 GLboolean blue
, GLboolean alpha
)
1717 GET_CURRENT_CONTEXT(ctx
);
1719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1720 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1728 if (ctx
->ExecuteFlag
) {
1729 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1734 static void GLAPIENTRY
1735 save_ColorMaterial(GLenum face
, GLenum mode
)
1737 GET_CURRENT_CONTEXT(ctx
);
1739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1741 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1746 if (ctx
->ExecuteFlag
) {
1747 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1752 static void GLAPIENTRY
1753 save_ColorTable(GLenum target
, GLenum internalFormat
,
1754 GLsizei width
, GLenum format
, GLenum type
,
1755 const GLvoid
* table
)
1757 GET_CURRENT_CONTEXT(ctx
);
1758 if (_mesa_is_proxy_texture(target
)) {
1759 /* execute immediately */
1760 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1761 format
, type
, table
));
1765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1766 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1769 n
[2].e
= internalFormat
;
1773 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1776 if (ctx
->ExecuteFlag
) {
1777 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1778 format
, type
, table
));
1785 static void GLAPIENTRY
1786 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1787 const GLfloat
*params
)
1789 GET_CURRENT_CONTEXT(ctx
);
1792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1794 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1799 if (pname
== GL_COLOR_TABLE_SGI
||
1800 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1801 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1808 if (ctx
->ExecuteFlag
) {
1809 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1814 static void GLAPIENTRY
1815 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1817 GET_CURRENT_CONTEXT(ctx
);
1820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1822 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1827 if (pname
== GL_COLOR_TABLE_SGI
||
1828 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1829 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1836 if (ctx
->ExecuteFlag
) {
1837 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1843 static void GLAPIENTRY
1844 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1845 GLenum format
, GLenum type
, const GLvoid
* table
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1857 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1860 if (ctx
->ExecuteFlag
) {
1861 CALL_ColorSubTable(ctx
->Exec
,
1862 (target
, start
, count
, format
, type
, table
));
1867 static void GLAPIENTRY
1868 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1869 GLint x
, GLint y
, GLsizei width
)
1871 GET_CURRENT_CONTEXT(ctx
);
1874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1875 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1883 if (ctx
->ExecuteFlag
) {
1884 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1889 static void GLAPIENTRY
1890 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1891 GLint x
, GLint y
, GLsizei width
)
1893 GET_CURRENT_CONTEXT(ctx
);
1896 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1897 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1900 n
[2].e
= internalformat
;
1905 if (ctx
->ExecuteFlag
) {
1906 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1911 static void GLAPIENTRY
1912 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1913 GLenum format
, GLenum type
, const GLvoid
* filter
)
1915 GET_CURRENT_CONTEXT(ctx
);
1918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1920 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1923 n
[2].e
= internalFormat
;
1927 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1930 if (ctx
->ExecuteFlag
) {
1931 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1932 format
, type
, filter
));
1937 static void GLAPIENTRY
1938 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1939 GLsizei width
, GLsizei height
, GLenum format
,
1940 GLenum type
, const GLvoid
* filter
)
1942 GET_CURRENT_CONTEXT(ctx
);
1945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1947 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1950 n
[2].e
= internalFormat
;
1955 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1958 if (ctx
->ExecuteFlag
) {
1959 CALL_ConvolutionFilter2D(ctx
->Exec
,
1960 (target
, internalFormat
, width
, height
, format
,
1966 static void GLAPIENTRY
1967 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1969 GET_CURRENT_CONTEXT(ctx
);
1971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1972 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1978 if (ctx
->ExecuteFlag
) {
1979 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1984 static void GLAPIENTRY
1985 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1987 GET_CURRENT_CONTEXT(ctx
);
1989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1990 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1995 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1996 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1997 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2003 n
[4].i
= n
[5].i
= n
[6].i
= 0;
2006 if (ctx
->ExecuteFlag
) {
2007 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
2012 static void GLAPIENTRY
2013 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
2015 GET_CURRENT_CONTEXT(ctx
);
2017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2018 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
2024 if (ctx
->ExecuteFlag
) {
2025 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
2030 static void GLAPIENTRY
2031 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
2032 const GLfloat
*params
)
2034 GET_CURRENT_CONTEXT(ctx
);
2036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2037 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
2042 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
2043 pname
== GL_CONVOLUTION_FILTER_SCALE
||
2044 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2050 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
2053 if (ctx
->ExecuteFlag
) {
2054 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
2059 static void GLAPIENTRY
2060 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2062 GET_CURRENT_CONTEXT(ctx
);
2064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2065 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2069 n
[3].i
= (GLint
) width
;
2070 n
[4].i
= (GLint
) height
;
2073 if (ctx
->ExecuteFlag
) {
2074 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2080 static void GLAPIENTRY
2081 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2082 GLint x
, GLint y
, GLsizei width
, GLint border
)
2084 GET_CURRENT_CONTEXT(ctx
);
2086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2087 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2091 n
[3].e
= internalformat
;
2097 if (ctx
->ExecuteFlag
) {
2098 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2099 x
, y
, width
, border
));
2104 static void GLAPIENTRY
2105 save_CopyTexImage2D(GLenum target
, GLint level
,
2106 GLenum internalformat
,
2107 GLint x
, GLint y
, GLsizei width
,
2108 GLsizei height
, GLint border
)
2110 GET_CURRENT_CONTEXT(ctx
);
2112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2113 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2117 n
[3].e
= internalformat
;
2124 if (ctx
->ExecuteFlag
) {
2125 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2126 x
, y
, width
, height
, border
));
2132 static void GLAPIENTRY
2133 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2134 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2136 GET_CURRENT_CONTEXT(ctx
);
2138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2139 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2148 if (ctx
->ExecuteFlag
) {
2149 CALL_CopyTexSubImage1D(ctx
->Exec
,
2150 (target
, level
, xoffset
, x
, y
, width
));
2155 static void GLAPIENTRY
2156 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2157 GLint xoffset
, GLint yoffset
,
2158 GLint x
, GLint y
, GLsizei width
, GLint height
)
2160 GET_CURRENT_CONTEXT(ctx
);
2162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2163 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2174 if (ctx
->ExecuteFlag
) {
2175 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2176 x
, y
, width
, height
));
2181 static void GLAPIENTRY
2182 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2183 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2184 GLint x
, GLint y
, GLsizei width
, GLint height
)
2186 GET_CURRENT_CONTEXT(ctx
);
2188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2189 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2201 if (ctx
->ExecuteFlag
) {
2202 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2203 xoffset
, yoffset
, zoffset
,
2204 x
, y
, width
, height
));
2209 static void GLAPIENTRY
2210 save_CullFace(GLenum mode
)
2212 GET_CURRENT_CONTEXT(ctx
);
2214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2215 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2219 if (ctx
->ExecuteFlag
) {
2220 CALL_CullFace(ctx
->Exec
, (mode
));
2225 static void GLAPIENTRY
2226 save_DepthFunc(GLenum func
)
2228 GET_CURRENT_CONTEXT(ctx
);
2230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2231 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2235 if (ctx
->ExecuteFlag
) {
2236 CALL_DepthFunc(ctx
->Exec
, (func
));
2241 static void GLAPIENTRY
2242 save_DepthMask(GLboolean mask
)
2244 GET_CURRENT_CONTEXT(ctx
);
2246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2247 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2251 if (ctx
->ExecuteFlag
) {
2252 CALL_DepthMask(ctx
->Exec
, (mask
));
2257 static void GLAPIENTRY
2258 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2260 GET_CURRENT_CONTEXT(ctx
);
2262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2263 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2265 n
[1].f
= (GLfloat
) nearval
;
2266 n
[2].f
= (GLfloat
) farval
;
2268 if (ctx
->ExecuteFlag
) {
2269 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2274 static void GLAPIENTRY
2275 save_Disable(GLenum cap
)
2277 GET_CURRENT_CONTEXT(ctx
);
2279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2280 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2284 if (ctx
->ExecuteFlag
) {
2285 CALL_Disable(ctx
->Exec
, (cap
));
2290 static void GLAPIENTRY
2291 save_DisableIndexed(GLuint index
, GLenum cap
)
2293 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2301 if (ctx
->ExecuteFlag
) {
2302 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2307 static void GLAPIENTRY
2308 save_DrawBuffer(GLenum mode
)
2310 GET_CURRENT_CONTEXT(ctx
);
2312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2313 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2317 if (ctx
->ExecuteFlag
) {
2318 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2323 static void GLAPIENTRY
2324 save_DrawPixels(GLsizei width
, GLsizei height
,
2325 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2327 GET_CURRENT_CONTEXT(ctx
);
2330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2332 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2338 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2339 pixels
, &ctx
->Unpack
);
2341 if (ctx
->ExecuteFlag
) {
2342 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2348 static void GLAPIENTRY
2349 save_Enable(GLenum cap
)
2351 GET_CURRENT_CONTEXT(ctx
);
2353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2354 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2358 if (ctx
->ExecuteFlag
) {
2359 CALL_Enable(ctx
->Exec
, (cap
));
2365 static void GLAPIENTRY
2366 save_EnableIndexed(GLuint index
, GLenum cap
)
2368 GET_CURRENT_CONTEXT(ctx
);
2370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2371 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2376 if (ctx
->ExecuteFlag
) {
2377 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2383 static void GLAPIENTRY
2384 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2386 GET_CURRENT_CONTEXT(ctx
);
2388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2389 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2395 if (ctx
->ExecuteFlag
) {
2396 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2401 static void GLAPIENTRY
2402 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2404 GET_CURRENT_CONTEXT(ctx
);
2406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2407 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2415 if (ctx
->ExecuteFlag
) {
2416 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2423 static void GLAPIENTRY
2424 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2426 GET_CURRENT_CONTEXT(ctx
);
2428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2429 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2437 if (ctx
->ExecuteFlag
) {
2438 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2443 static void GLAPIENTRY
2444 save_Fogf(GLenum pname
, GLfloat param
)
2448 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2449 save_Fogfv(pname
, parray
);
2453 static void GLAPIENTRY
2454 save_Fogiv(GLenum pname
, const GLint
*params
)
2459 case GL_FOG_DENSITY
:
2463 p
[0] = (GLfloat
) *params
;
2469 p
[0] = INT_TO_FLOAT(params
[0]);
2470 p
[1] = INT_TO_FLOAT(params
[1]);
2471 p
[2] = INT_TO_FLOAT(params
[2]);
2472 p
[3] = INT_TO_FLOAT(params
[3]);
2475 /* Error will be caught later in gl_Fogfv */
2476 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2478 save_Fogfv(pname
, p
);
2482 static void GLAPIENTRY
2483 save_Fogi(GLenum pname
, GLint param
)
2487 parray
[1] = parray
[2] = parray
[3] = 0;
2488 save_Fogiv(pname
, parray
);
2492 static void GLAPIENTRY
2493 save_FrontFace(GLenum mode
)
2495 GET_CURRENT_CONTEXT(ctx
);
2497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2498 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2502 if (ctx
->ExecuteFlag
) {
2503 CALL_FrontFace(ctx
->Exec
, (mode
));
2508 static void GLAPIENTRY
2509 save_Frustum(GLdouble left
, GLdouble right
,
2510 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2512 GET_CURRENT_CONTEXT(ctx
);
2514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2515 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2517 n
[1].f
= (GLfloat
) left
;
2518 n
[2].f
= (GLfloat
) right
;
2519 n
[3].f
= (GLfloat
) bottom
;
2520 n
[4].f
= (GLfloat
) top
;
2521 n
[5].f
= (GLfloat
) nearval
;
2522 n
[6].f
= (GLfloat
) farval
;
2524 if (ctx
->ExecuteFlag
) {
2525 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2530 static void GLAPIENTRY
2531 save_Hint(GLenum target
, GLenum mode
)
2533 GET_CURRENT_CONTEXT(ctx
);
2535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2536 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2541 if (ctx
->ExecuteFlag
) {
2542 CALL_Hint(ctx
->Exec
, (target
, mode
));
2547 static void GLAPIENTRY
2548 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2551 GET_CURRENT_CONTEXT(ctx
);
2554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2555 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2559 n
[3].e
= internalFormat
;
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2568 static void GLAPIENTRY
2569 save_IndexMask(GLuint mask
)
2571 GET_CURRENT_CONTEXT(ctx
);
2573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2574 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2578 if (ctx
->ExecuteFlag
) {
2579 CALL_IndexMask(ctx
->Exec
, (mask
));
2584 static void GLAPIENTRY
2585 save_InitNames(void)
2587 GET_CURRENT_CONTEXT(ctx
);
2588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2589 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_InitNames(ctx
->Exec
, ());
2596 static void GLAPIENTRY
2597 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2599 GET_CURRENT_CONTEXT(ctx
);
2601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2602 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2620 case GL_SPOT_DIRECTION
:
2623 case GL_SPOT_EXPONENT
:
2626 case GL_SPOT_CUTOFF
:
2629 case GL_CONSTANT_ATTENUATION
:
2632 case GL_LINEAR_ATTENUATION
:
2635 case GL_QUADRATIC_ATTENUATION
:
2641 for (i
= 0; i
< nParams
; i
++) {
2642 n
[3 + i
].f
= params
[i
];
2645 if (ctx
->ExecuteFlag
) {
2646 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2651 static void GLAPIENTRY
2652 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2656 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2657 save_Lightfv(light
, pname
, parray
);
2661 static void GLAPIENTRY
2662 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2669 fparam
[0] = INT_TO_FLOAT(params
[0]);
2670 fparam
[1] = INT_TO_FLOAT(params
[1]);
2671 fparam
[2] = INT_TO_FLOAT(params
[2]);
2672 fparam
[3] = INT_TO_FLOAT(params
[3]);
2675 fparam
[0] = (GLfloat
) params
[0];
2676 fparam
[1] = (GLfloat
) params
[1];
2677 fparam
[2] = (GLfloat
) params
[2];
2678 fparam
[3] = (GLfloat
) params
[3];
2680 case GL_SPOT_DIRECTION
:
2681 fparam
[0] = (GLfloat
) params
[0];
2682 fparam
[1] = (GLfloat
) params
[1];
2683 fparam
[2] = (GLfloat
) params
[2];
2685 case GL_SPOT_EXPONENT
:
2686 case GL_SPOT_CUTOFF
:
2687 case GL_CONSTANT_ATTENUATION
:
2688 case GL_LINEAR_ATTENUATION
:
2689 case GL_QUADRATIC_ATTENUATION
:
2690 fparam
[0] = (GLfloat
) params
[0];
2693 /* error will be caught later in gl_Lightfv */
2696 save_Lightfv(light
, pname
, fparam
);
2700 static void GLAPIENTRY
2701 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2705 parray
[1] = parray
[2] = parray
[3] = 0;
2706 save_Lightiv(light
, pname
, parray
);
2710 static void GLAPIENTRY
2711 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2713 GET_CURRENT_CONTEXT(ctx
);
2715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2716 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2724 if (ctx
->ExecuteFlag
) {
2725 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2730 static void GLAPIENTRY
2731 save_LightModelf(GLenum pname
, GLfloat param
)
2735 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2736 save_LightModelfv(pname
, parray
);
2740 static void GLAPIENTRY
2741 save_LightModeliv(GLenum pname
, const GLint
*params
)
2745 case GL_LIGHT_MODEL_AMBIENT
:
2746 fparam
[0] = INT_TO_FLOAT(params
[0]);
2747 fparam
[1] = INT_TO_FLOAT(params
[1]);
2748 fparam
[2] = INT_TO_FLOAT(params
[2]);
2749 fparam
[3] = INT_TO_FLOAT(params
[3]);
2751 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2752 case GL_LIGHT_MODEL_TWO_SIDE
:
2753 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2754 fparam
[0] = (GLfloat
) params
[0];
2760 /* Error will be caught later in gl_LightModelfv */
2761 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2763 save_LightModelfv(pname
, fparam
);
2767 static void GLAPIENTRY
2768 save_LightModeli(GLenum pname
, GLint param
)
2772 parray
[1] = parray
[2] = parray
[3] = 0;
2773 save_LightModeliv(pname
, parray
);
2777 static void GLAPIENTRY
2778 save_LineStipple(GLint factor
, GLushort pattern
)
2780 GET_CURRENT_CONTEXT(ctx
);
2782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2783 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2788 if (ctx
->ExecuteFlag
) {
2789 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2794 static void GLAPIENTRY
2795 save_LineWidth(GLfloat width
)
2797 GET_CURRENT_CONTEXT(ctx
);
2799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2800 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2804 if (ctx
->ExecuteFlag
) {
2805 CALL_LineWidth(ctx
->Exec
, (width
));
2810 static void GLAPIENTRY
2811 save_ListBase(GLuint base
)
2813 GET_CURRENT_CONTEXT(ctx
);
2815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2816 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2820 if (ctx
->ExecuteFlag
) {
2821 CALL_ListBase(ctx
->Exec
, (base
));
2826 static void GLAPIENTRY
2827 save_LoadIdentity(void)
2829 GET_CURRENT_CONTEXT(ctx
);
2830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2831 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2832 if (ctx
->ExecuteFlag
) {
2833 CALL_LoadIdentity(ctx
->Exec
, ());
2838 static void GLAPIENTRY
2839 save_LoadMatrixf(const GLfloat
* m
)
2841 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2847 for (i
= 0; i
< 16; i
++) {
2851 if (ctx
->ExecuteFlag
) {
2852 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2857 static void GLAPIENTRY
2858 save_LoadMatrixd(const GLdouble
* m
)
2862 for (i
= 0; i
< 16; i
++) {
2863 f
[i
] = (GLfloat
) m
[i
];
2865 save_LoadMatrixf(f
);
2869 static void GLAPIENTRY
2870 save_LoadName(GLuint name
)
2872 GET_CURRENT_CONTEXT(ctx
);
2874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2875 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2879 if (ctx
->ExecuteFlag
) {
2880 CALL_LoadName(ctx
->Exec
, (name
));
2885 static void GLAPIENTRY
2886 save_LogicOp(GLenum opcode
)
2888 GET_CURRENT_CONTEXT(ctx
);
2890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2891 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2895 if (ctx
->ExecuteFlag
) {
2896 CALL_LogicOp(ctx
->Exec
, (opcode
));
2901 static void GLAPIENTRY
2902 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2903 GLint order
, const GLdouble
* points
)
2905 GET_CURRENT_CONTEXT(ctx
);
2907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2908 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2910 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2912 n
[2].f
= (GLfloat
) u1
;
2913 n
[3].f
= (GLfloat
) u2
;
2914 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2916 n
[6].data
= (void *) pnts
;
2918 if (ctx
->ExecuteFlag
) {
2919 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2923 static void GLAPIENTRY
2924 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2925 GLint order
, const GLfloat
* points
)
2927 GET_CURRENT_CONTEXT(ctx
);
2929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2930 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2932 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2936 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2938 n
[6].data
= (void *) pnts
;
2940 if (ctx
->ExecuteFlag
) {
2941 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2946 static void GLAPIENTRY
2947 save_Map2d(GLenum target
,
2948 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2949 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2950 const GLdouble
* points
)
2952 GET_CURRENT_CONTEXT(ctx
);
2954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2955 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2957 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2958 vstride
, vorder
, points
);
2960 n
[2].f
= (GLfloat
) u1
;
2961 n
[3].f
= (GLfloat
) u2
;
2962 n
[4].f
= (GLfloat
) v1
;
2963 n
[5].f
= (GLfloat
) v2
;
2964 /* XXX verify these strides are correct */
2965 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2966 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2969 n
[10].data
= (void *) pnts
;
2971 if (ctx
->ExecuteFlag
) {
2972 CALL_Map2d(ctx
->Exec
, (target
,
2973 u1
, u2
, ustride
, uorder
,
2974 v1
, v2
, vstride
, vorder
, points
));
2979 static void GLAPIENTRY
2980 save_Map2f(GLenum target
,
2981 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2982 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2983 const GLfloat
* points
)
2985 GET_CURRENT_CONTEXT(ctx
);
2987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2988 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2990 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2991 vstride
, vorder
, points
);
2997 /* XXX verify these strides are correct */
2998 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2999 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3002 n
[10].data
= (void *) pnts
;
3004 if (ctx
->ExecuteFlag
) {
3005 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3006 v1
, v2
, vstride
, vorder
, points
));
3011 static void GLAPIENTRY
3012 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3014 GET_CURRENT_CONTEXT(ctx
);
3016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3017 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3023 if (ctx
->ExecuteFlag
) {
3024 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3029 static void GLAPIENTRY
3030 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3032 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3036 static void GLAPIENTRY
3037 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3038 GLint vn
, GLfloat v1
, GLfloat v2
)
3040 GET_CURRENT_CONTEXT(ctx
);
3042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3043 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3052 if (ctx
->ExecuteFlag
) {
3053 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3059 static void GLAPIENTRY
3060 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3061 GLint vn
, GLdouble v1
, GLdouble v2
)
3063 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3064 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3068 static void GLAPIENTRY
3069 save_MatrixMode(GLenum mode
)
3071 GET_CURRENT_CONTEXT(ctx
);
3073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3074 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3078 if (ctx
->ExecuteFlag
) {
3079 CALL_MatrixMode(ctx
->Exec
, (mode
));
3084 static void GLAPIENTRY
3085 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3087 GET_CURRENT_CONTEXT(ctx
);
3090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3091 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3094 n
[2].e
= internalFormat
;
3097 if (ctx
->ExecuteFlag
) {
3098 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3103 static void GLAPIENTRY
3104 save_MultMatrixf(const GLfloat
* m
)
3106 GET_CURRENT_CONTEXT(ctx
);
3108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3109 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3112 for (i
= 0; i
< 16; i
++) {
3116 if (ctx
->ExecuteFlag
) {
3117 CALL_MultMatrixf(ctx
->Exec
, (m
));
3122 static void GLAPIENTRY
3123 save_MultMatrixd(const GLdouble
* m
)
3127 for (i
= 0; i
< 16; i
++) {
3128 f
[i
] = (GLfloat
) m
[i
];
3130 save_MultMatrixf(f
);
3134 static void GLAPIENTRY
3135 save_NewList(GLuint name
, GLenum mode
)
3137 GET_CURRENT_CONTEXT(ctx
);
3138 /* It's an error to call this function while building a display list */
3139 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3146 static void GLAPIENTRY
3147 save_Ortho(GLdouble left
, GLdouble right
,
3148 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3150 GET_CURRENT_CONTEXT(ctx
);
3152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3153 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3155 n
[1].f
= (GLfloat
) left
;
3156 n
[2].f
= (GLfloat
) right
;
3157 n
[3].f
= (GLfloat
) bottom
;
3158 n
[4].f
= (GLfloat
) top
;
3159 n
[5].f
= (GLfloat
) nearval
;
3160 n
[6].f
= (GLfloat
) farval
;
3162 if (ctx
->ExecuteFlag
) {
3163 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3168 static void GLAPIENTRY
3169 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3171 GET_CURRENT_CONTEXT(ctx
);
3173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3174 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3178 n
[3].data
= malloc(mapsize
* sizeof(GLfloat
));
3179 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3181 if (ctx
->ExecuteFlag
) {
3182 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3187 static void GLAPIENTRY
3188 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3190 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3192 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3193 for (i
= 0; i
< mapsize
; i
++) {
3194 fvalues
[i
] = (GLfloat
) values
[i
];
3198 for (i
= 0; i
< mapsize
; i
++) {
3199 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3202 save_PixelMapfv(map
, mapsize
, fvalues
);
3206 static void GLAPIENTRY
3207 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3209 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3211 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3212 for (i
= 0; i
< mapsize
; i
++) {
3213 fvalues
[i
] = (GLfloat
) values
[i
];
3217 for (i
= 0; i
< mapsize
; i
++) {
3218 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3221 save_PixelMapfv(map
, mapsize
, fvalues
);
3225 static void GLAPIENTRY
3226 save_PixelTransferf(GLenum pname
, GLfloat param
)
3228 GET_CURRENT_CONTEXT(ctx
);
3230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3231 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3236 if (ctx
->ExecuteFlag
) {
3237 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3242 static void GLAPIENTRY
3243 save_PixelTransferi(GLenum pname
, GLint param
)
3245 save_PixelTransferf(pname
, (GLfloat
) param
);
3249 static void GLAPIENTRY
3250 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3266 static void GLAPIENTRY
3267 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3269 GET_CURRENT_CONTEXT(ctx
);
3271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3272 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3279 if (ctx
->ExecuteFlag
) {
3280 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3285 static void GLAPIENTRY
3286 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3290 parray
[1] = parray
[2] = 0.0F
;
3291 save_PointParameterfvEXT(pname
, parray
);
3294 static void GLAPIENTRY
3295 save_PointParameteriNV(GLenum pname
, GLint param
)
3298 parray
[0] = (GLfloat
) param
;
3299 parray
[1] = parray
[2] = 0.0F
;
3300 save_PointParameterfvEXT(pname
, parray
);
3303 static void GLAPIENTRY
3304 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3307 parray
[0] = (GLfloat
) param
[0];
3308 parray
[1] = parray
[2] = 0.0F
;
3309 save_PointParameterfvEXT(pname
, parray
);
3313 static void GLAPIENTRY
3314 save_PointSize(GLfloat size
)
3316 GET_CURRENT_CONTEXT(ctx
);
3318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3319 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3323 if (ctx
->ExecuteFlag
) {
3324 CALL_PointSize(ctx
->Exec
, (size
));
3329 static void GLAPIENTRY
3330 save_PolygonMode(GLenum face
, GLenum mode
)
3332 GET_CURRENT_CONTEXT(ctx
);
3334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3335 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3340 if (ctx
->ExecuteFlag
) {
3341 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3346 static void GLAPIENTRY
3347 save_PolygonStipple(const GLubyte
* pattern
)
3349 GET_CURRENT_CONTEXT(ctx
);
3352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3354 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3356 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3357 pattern
, &ctx
->Unpack
);
3359 if (ctx
->ExecuteFlag
) {
3360 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3365 static void GLAPIENTRY
3366 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3368 GET_CURRENT_CONTEXT(ctx
);
3370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3371 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3376 if (ctx
->ExecuteFlag
) {
3377 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3382 static void GLAPIENTRY
3383 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3385 GET_CURRENT_CONTEXT(ctx
);
3386 /* XXX mult by DepthMaxF here??? */
3387 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3391 static void GLAPIENTRY
3392 save_PopAttrib(void)
3394 GET_CURRENT_CONTEXT(ctx
);
3395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3396 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3397 if (ctx
->ExecuteFlag
) {
3398 CALL_PopAttrib(ctx
->Exec
, ());
3403 static void GLAPIENTRY
3404 save_PopMatrix(void)
3406 GET_CURRENT_CONTEXT(ctx
);
3407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3408 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3409 if (ctx
->ExecuteFlag
) {
3410 CALL_PopMatrix(ctx
->Exec
, ());
3415 static void GLAPIENTRY
3418 GET_CURRENT_CONTEXT(ctx
);
3419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3420 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3421 if (ctx
->ExecuteFlag
) {
3422 CALL_PopName(ctx
->Exec
, ());
3427 static void GLAPIENTRY
3428 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3429 const GLclampf
* priorities
)
3431 GET_CURRENT_CONTEXT(ctx
);
3433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3435 for (i
= 0; i
< num
; i
++) {
3437 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3439 n
[1].ui
= textures
[i
];
3440 n
[2].f
= priorities
[i
];
3443 if (ctx
->ExecuteFlag
) {
3444 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3449 static void GLAPIENTRY
3450 save_PushAttrib(GLbitfield mask
)
3452 GET_CURRENT_CONTEXT(ctx
);
3454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3455 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3459 if (ctx
->ExecuteFlag
) {
3460 CALL_PushAttrib(ctx
->Exec
, (mask
));
3465 static void GLAPIENTRY
3466 save_PushMatrix(void)
3468 GET_CURRENT_CONTEXT(ctx
);
3469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3470 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3471 if (ctx
->ExecuteFlag
) {
3472 CALL_PushMatrix(ctx
->Exec
, ());
3477 static void GLAPIENTRY
3478 save_PushName(GLuint name
)
3480 GET_CURRENT_CONTEXT(ctx
);
3482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3483 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3487 if (ctx
->ExecuteFlag
) {
3488 CALL_PushName(ctx
->Exec
, (name
));
3493 static void GLAPIENTRY
3494 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3496 GET_CURRENT_CONTEXT(ctx
);
3498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3499 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3506 if (ctx
->ExecuteFlag
) {
3507 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3511 static void GLAPIENTRY
3512 save_RasterPos2d(GLdouble x
, GLdouble y
)
3514 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3517 static void GLAPIENTRY
3518 save_RasterPos2f(GLfloat x
, GLfloat y
)
3520 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3523 static void GLAPIENTRY
3524 save_RasterPos2i(GLint x
, GLint y
)
3526 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3529 static void GLAPIENTRY
3530 save_RasterPos2s(GLshort x
, GLshort y
)
3532 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3535 static void GLAPIENTRY
3536 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3538 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3541 static void GLAPIENTRY
3542 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3544 save_RasterPos4f(x
, y
, z
, 1.0F
);
3547 static void GLAPIENTRY
3548 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3550 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3553 static void GLAPIENTRY
3554 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3556 save_RasterPos4f(x
, y
, z
, 1.0F
);
3559 static void GLAPIENTRY
3560 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3562 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3565 static void GLAPIENTRY
3566 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3568 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3571 static void GLAPIENTRY
3572 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3574 save_RasterPos4f(x
, y
, z
, w
);
3577 static void GLAPIENTRY
3578 save_RasterPos2dv(const GLdouble
* v
)
3580 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3583 static void GLAPIENTRY
3584 save_RasterPos2fv(const GLfloat
* v
)
3586 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3589 static void GLAPIENTRY
3590 save_RasterPos2iv(const GLint
* v
)
3592 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3595 static void GLAPIENTRY
3596 save_RasterPos2sv(const GLshort
* v
)
3598 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3601 static void GLAPIENTRY
3602 save_RasterPos3dv(const GLdouble
* v
)
3604 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3607 static void GLAPIENTRY
3608 save_RasterPos3fv(const GLfloat
* v
)
3610 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3613 static void GLAPIENTRY
3614 save_RasterPos3iv(const GLint
* v
)
3616 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3619 static void GLAPIENTRY
3620 save_RasterPos3sv(const GLshort
* v
)
3622 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3625 static void GLAPIENTRY
3626 save_RasterPos4dv(const GLdouble
* v
)
3628 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3629 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3632 static void GLAPIENTRY
3633 save_RasterPos4fv(const GLfloat
* v
)
3635 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3638 static void GLAPIENTRY
3639 save_RasterPos4iv(const GLint
* v
)
3641 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3642 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3645 static void GLAPIENTRY
3646 save_RasterPos4sv(const GLshort
* v
)
3648 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3652 static void GLAPIENTRY
3653 save_PassThrough(GLfloat token
)
3655 GET_CURRENT_CONTEXT(ctx
);
3657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3658 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3662 if (ctx
->ExecuteFlag
) {
3663 CALL_PassThrough(ctx
->Exec
, (token
));
3668 static void GLAPIENTRY
3669 save_ReadBuffer(GLenum mode
)
3671 GET_CURRENT_CONTEXT(ctx
);
3673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3674 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3678 if (ctx
->ExecuteFlag
) {
3679 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3684 static void GLAPIENTRY
3685 save_ResetHistogram(GLenum target
)
3687 GET_CURRENT_CONTEXT(ctx
);
3689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3690 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3694 if (ctx
->ExecuteFlag
) {
3695 CALL_ResetHistogram(ctx
->Exec
, (target
));
3700 static void GLAPIENTRY
3701 save_ResetMinmax(GLenum target
)
3703 GET_CURRENT_CONTEXT(ctx
);
3705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3706 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3710 if (ctx
->ExecuteFlag
) {
3711 CALL_ResetMinmax(ctx
->Exec
, (target
));
3716 static void GLAPIENTRY
3717 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3719 GET_CURRENT_CONTEXT(ctx
);
3721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3722 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3729 if (ctx
->ExecuteFlag
) {
3730 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3735 static void GLAPIENTRY
3736 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3738 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3742 static void GLAPIENTRY
3743 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3745 GET_CURRENT_CONTEXT(ctx
);
3747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3748 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3754 if (ctx
->ExecuteFlag
) {
3755 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3760 static void GLAPIENTRY
3761 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3763 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3767 static void GLAPIENTRY
3768 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3770 GET_CURRENT_CONTEXT(ctx
);
3772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3773 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3780 if (ctx
->ExecuteFlag
) {
3781 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3786 static void GLAPIENTRY
3787 save_ShadeModel(GLenum mode
)
3789 GET_CURRENT_CONTEXT(ctx
);
3791 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3793 if (ctx
->ExecuteFlag
) {
3794 CALL_ShadeModel(ctx
->Exec
, (mode
));
3797 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3800 SAVE_FLUSH_VERTICES(ctx
);
3802 /* Only save the value if we know the statechange will take effect:
3804 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3805 ctx
->ListState
.Current
.ShadeModel
= mode
;
3807 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3814 static void GLAPIENTRY
3815 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3817 GET_CURRENT_CONTEXT(ctx
);
3819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3820 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3826 if (ctx
->ExecuteFlag
) {
3827 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3832 static void GLAPIENTRY
3833 save_StencilMask(GLuint mask
)
3835 GET_CURRENT_CONTEXT(ctx
);
3837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3838 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3842 if (ctx
->ExecuteFlag
) {
3843 CALL_StencilMask(ctx
->Exec
, (mask
));
3848 static void GLAPIENTRY
3849 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3851 GET_CURRENT_CONTEXT(ctx
);
3853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3854 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3860 if (ctx
->ExecuteFlag
) {
3861 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3866 static void GLAPIENTRY
3867 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3869 GET_CURRENT_CONTEXT(ctx
);
3871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3872 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3879 if (ctx
->ExecuteFlag
) {
3880 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3885 static void GLAPIENTRY
3886 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3889 GET_CURRENT_CONTEXT(ctx
);
3891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3893 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3901 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3908 if (ctx
->ExecuteFlag
) {
3909 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3910 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3915 static void GLAPIENTRY
3916 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3918 GET_CURRENT_CONTEXT(ctx
);
3920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3921 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3926 if (ctx
->ExecuteFlag
) {
3927 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3932 static void GLAPIENTRY
3933 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3935 GET_CURRENT_CONTEXT(ctx
);
3937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3938 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3945 if (ctx
->ExecuteFlag
) {
3946 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3951 static void GLAPIENTRY
3952 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3954 GET_CURRENT_CONTEXT(ctx
);
3956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3957 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3961 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3969 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3972 if (ctx
->ExecuteFlag
) {
3973 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3978 static void GLAPIENTRY
3979 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3982 parray
[0] = (GLfloat
) param
;
3983 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3984 save_TexEnvfv(target
, pname
, parray
);
3988 static void GLAPIENTRY
3989 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3992 p
[0] = (GLfloat
) param
;
3993 p
[1] = p
[2] = p
[3] = 0.0F
;
3994 save_TexEnvfv(target
, pname
, p
);
3998 static void GLAPIENTRY
3999 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4002 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4003 p
[0] = INT_TO_FLOAT(param
[0]);
4004 p
[1] = INT_TO_FLOAT(param
[1]);
4005 p
[2] = INT_TO_FLOAT(param
[2]);
4006 p
[3] = INT_TO_FLOAT(param
[3]);
4009 p
[0] = (GLfloat
) param
[0];
4010 p
[1] = p
[2] = p
[3] = 0.0F
;
4012 save_TexEnvfv(target
, pname
, p
);
4016 static void GLAPIENTRY
4017 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4019 GET_CURRENT_CONTEXT(ctx
);
4021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4022 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4031 if (ctx
->ExecuteFlag
) {
4032 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4037 static void GLAPIENTRY
4038 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4041 p
[0] = (GLfloat
) params
[0];
4042 p
[1] = (GLfloat
) params
[1];
4043 p
[2] = (GLfloat
) params
[2];
4044 p
[3] = (GLfloat
) params
[3];
4045 save_TexGenfv(coord
, pname
, p
);
4049 static void GLAPIENTRY
4050 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4053 parray
[0] = (GLfloat
) param
;
4054 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4055 save_TexGenfv(coord
, pname
, parray
);
4059 static void GLAPIENTRY
4060 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4063 p
[0] = (GLfloat
) params
[0];
4064 p
[1] = (GLfloat
) params
[1];
4065 p
[2] = (GLfloat
) params
[2];
4066 p
[3] = (GLfloat
) params
[3];
4067 save_TexGenfv(coord
, pname
, p
);
4071 static void GLAPIENTRY
4072 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4076 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4077 save_TexGenfv(coord
, pname
, parray
);
4081 static void GLAPIENTRY
4082 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4086 parray
[1] = parray
[2] = parray
[3] = 0;
4087 save_TexGeniv(coord
, pname
, parray
);
4091 static void GLAPIENTRY
4092 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4094 GET_CURRENT_CONTEXT(ctx
);
4096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4097 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4106 if (ctx
->ExecuteFlag
) {
4107 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4112 static void GLAPIENTRY
4113 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4117 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4118 save_TexParameterfv(target
, pname
, parray
);
4122 static void GLAPIENTRY
4123 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4126 fparam
[0] = (GLfloat
) param
;
4127 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4128 save_TexParameterfv(target
, pname
, fparam
);
4132 static void GLAPIENTRY
4133 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4136 fparam
[0] = (GLfloat
) params
[0];
4137 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4138 save_TexParameterfv(target
, pname
, fparam
);
4142 static void GLAPIENTRY
4143 save_TexImage1D(GLenum target
,
4144 GLint level
, GLint components
,
4145 GLsizei width
, GLint border
,
4146 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4148 GET_CURRENT_CONTEXT(ctx
);
4149 if (target
== GL_PROXY_TEXTURE_1D
) {
4150 /* don't compile, execute immediately */
4151 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4152 border
, format
, type
, pixels
));
4156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4157 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4161 n
[3].i
= components
;
4162 n
[4].i
= (GLint
) width
;
4166 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4167 pixels
, &ctx
->Unpack
);
4169 if (ctx
->ExecuteFlag
) {
4170 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4171 border
, format
, type
, pixels
));
4177 static void GLAPIENTRY
4178 save_TexImage2D(GLenum target
,
4179 GLint level
, GLint components
,
4180 GLsizei width
, GLsizei height
, GLint border
,
4181 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4183 GET_CURRENT_CONTEXT(ctx
);
4184 if (target
== GL_PROXY_TEXTURE_2D
) {
4185 /* don't compile, execute immediately */
4186 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4187 height
, border
, format
, type
, pixels
));
4191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4192 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4196 n
[3].i
= components
;
4197 n
[4].i
= (GLint
) width
;
4198 n
[5].i
= (GLint
) height
;
4202 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4203 pixels
, &ctx
->Unpack
);
4205 if (ctx
->ExecuteFlag
) {
4206 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4207 height
, border
, format
, type
, pixels
));
4213 static void GLAPIENTRY
4214 save_TexImage3D(GLenum target
,
4215 GLint level
, GLint internalFormat
,
4216 GLsizei width
, GLsizei height
, GLsizei depth
,
4218 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4220 GET_CURRENT_CONTEXT(ctx
);
4221 if (target
== GL_PROXY_TEXTURE_3D
) {
4222 /* don't compile, execute immediately */
4223 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4224 height
, depth
, border
, format
, type
,
4229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4230 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4234 n
[3].i
= (GLint
) internalFormat
;
4235 n
[4].i
= (GLint
) width
;
4236 n
[5].i
= (GLint
) height
;
4237 n
[6].i
= (GLint
) depth
;
4241 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4242 pixels
, &ctx
->Unpack
);
4244 if (ctx
->ExecuteFlag
) {
4245 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4246 height
, depth
, border
, format
, type
,
4253 static void GLAPIENTRY
4254 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4255 GLsizei width
, GLenum format
, GLenum type
,
4256 const GLvoid
* pixels
)
4258 GET_CURRENT_CONTEXT(ctx
);
4261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4263 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4268 n
[4].i
= (GLint
) width
;
4271 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4272 pixels
, &ctx
->Unpack
);
4274 if (ctx
->ExecuteFlag
) {
4275 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4276 format
, type
, pixels
));
4281 static void GLAPIENTRY
4282 save_TexSubImage2D(GLenum target
, GLint level
,
4283 GLint xoffset
, GLint yoffset
,
4284 GLsizei width
, GLsizei height
,
4285 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4287 GET_CURRENT_CONTEXT(ctx
);
4290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4292 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4298 n
[5].i
= (GLint
) width
;
4299 n
[6].i
= (GLint
) height
;
4302 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4303 pixels
, &ctx
->Unpack
);
4305 if (ctx
->ExecuteFlag
) {
4306 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4307 width
, height
, format
, type
, pixels
));
4312 static void GLAPIENTRY
4313 save_TexSubImage3D(GLenum target
, GLint level
,
4314 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4315 GLsizei width
, GLsizei height
, GLsizei depth
,
4316 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4318 GET_CURRENT_CONTEXT(ctx
);
4321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4323 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4330 n
[6].i
= (GLint
) width
;
4331 n
[7].i
= (GLint
) height
;
4332 n
[8].i
= (GLint
) depth
;
4335 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4336 pixels
, &ctx
->Unpack
);
4338 if (ctx
->ExecuteFlag
) {
4339 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4340 xoffset
, yoffset
, zoffset
,
4341 width
, height
, depth
, format
, type
,
4347 static void GLAPIENTRY
4348 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4350 GET_CURRENT_CONTEXT(ctx
);
4352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4353 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4359 if (ctx
->ExecuteFlag
) {
4360 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4365 static void GLAPIENTRY
4366 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4368 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4373 static void GLAPIENTRY
4374 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4376 GET_CURRENT_CONTEXT(ctx
);
4378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4379 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4383 n
[3].i
= (GLint
) width
;
4384 n
[4].i
= (GLint
) height
;
4386 if (ctx
->ExecuteFlag
) {
4387 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4392 static void GLAPIENTRY
4393 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4395 GET_CURRENT_CONTEXT(ctx
);
4397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4398 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4405 if (ctx
->ExecuteFlag
) {
4406 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4410 static void GLAPIENTRY
4411 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4413 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4416 static void GLAPIENTRY
4417 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4419 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4422 static void GLAPIENTRY
4423 save_WindowPos2iMESA(GLint x
, GLint y
)
4425 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4428 static void GLAPIENTRY
4429 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4431 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4434 static void GLAPIENTRY
4435 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4437 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4440 static void GLAPIENTRY
4441 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4443 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4446 static void GLAPIENTRY
4447 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4449 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4452 static void GLAPIENTRY
4453 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4455 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4458 static void GLAPIENTRY
4459 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4461 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4464 static void GLAPIENTRY
4465 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4467 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4470 static void GLAPIENTRY
4471 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4473 save_WindowPos4fMESA(x
, y
, z
, w
);
4476 static void GLAPIENTRY
4477 save_WindowPos2dvMESA(const GLdouble
* v
)
4479 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4482 static void GLAPIENTRY
4483 save_WindowPos2fvMESA(const GLfloat
* v
)
4485 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4488 static void GLAPIENTRY
4489 save_WindowPos2ivMESA(const GLint
* v
)
4491 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4494 static void GLAPIENTRY
4495 save_WindowPos2svMESA(const GLshort
* v
)
4497 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4500 static void GLAPIENTRY
4501 save_WindowPos3dvMESA(const GLdouble
* v
)
4503 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4506 static void GLAPIENTRY
4507 save_WindowPos3fvMESA(const GLfloat
* v
)
4509 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4512 static void GLAPIENTRY
4513 save_WindowPos3ivMESA(const GLint
* v
)
4515 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4518 static void GLAPIENTRY
4519 save_WindowPos3svMESA(const GLshort
* v
)
4521 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4524 static void GLAPIENTRY
4525 save_WindowPos4dvMESA(const GLdouble
* v
)
4527 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4528 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4531 static void GLAPIENTRY
4532 save_WindowPos4fvMESA(const GLfloat
* v
)
4534 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4537 static void GLAPIENTRY
4538 save_WindowPos4ivMESA(const GLint
* v
)
4540 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4541 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4544 static void GLAPIENTRY
4545 save_WindowPos4svMESA(const GLshort
* v
)
4547 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4552 /* GL_ARB_multitexture */
4553 static void GLAPIENTRY
4554 save_ActiveTextureARB(GLenum target
)
4556 GET_CURRENT_CONTEXT(ctx
);
4558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4559 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4563 if (ctx
->ExecuteFlag
) {
4564 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4569 /* GL_ARB_transpose_matrix */
4571 static void GLAPIENTRY
4572 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4575 _math_transposefd(tm
, m
);
4576 save_LoadMatrixf(tm
);
4580 static void GLAPIENTRY
4581 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4584 _math_transposef(tm
, m
);
4585 save_LoadMatrixf(tm
);
4589 static void GLAPIENTRY
4590 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4593 _math_transposefd(tm
, m
);
4594 save_MultMatrixf(tm
);
4598 static void GLAPIENTRY
4599 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4602 _math_transposef(tm
, m
);
4603 save_MultMatrixf(tm
);
4606 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4608 GET_CURRENT_CONTEXT(ctx
);
4614 image
= malloc(size
);
4616 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4619 memcpy(image
, data
, size
);
4625 /* GL_ARB_texture_compression */
4626 static void GLAPIENTRY
4627 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4628 GLenum internalFormat
, GLsizei width
,
4629 GLint border
, GLsizei imageSize
,
4630 const GLvoid
* data
)
4632 GET_CURRENT_CONTEXT(ctx
);
4633 if (target
== GL_PROXY_TEXTURE_1D
) {
4634 /* don't compile, execute immediately */
4635 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4636 width
, border
, imageSize
,
4641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4643 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4647 n
[3].e
= internalFormat
;
4648 n
[4].i
= (GLint
) width
;
4651 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4653 if (ctx
->ExecuteFlag
) {
4654 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4655 (target
, level
, internalFormat
, width
,
4656 border
, imageSize
, data
));
4662 static void GLAPIENTRY
4663 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4664 GLenum internalFormat
, GLsizei width
,
4665 GLsizei height
, GLint border
, GLsizei imageSize
,
4666 const GLvoid
* data
)
4668 GET_CURRENT_CONTEXT(ctx
);
4669 if (target
== GL_PROXY_TEXTURE_2D
) {
4670 /* don't compile, execute immediately */
4671 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4672 width
, height
, border
,
4677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4679 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4683 n
[3].e
= internalFormat
;
4684 n
[4].i
= (GLint
) width
;
4685 n
[5].i
= (GLint
) height
;
4688 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4690 if (ctx
->ExecuteFlag
) {
4691 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4692 (target
, level
, internalFormat
, width
,
4693 height
, border
, imageSize
, data
));
4699 static void GLAPIENTRY
4700 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4701 GLenum internalFormat
, GLsizei width
,
4702 GLsizei height
, GLsizei depth
, GLint border
,
4703 GLsizei imageSize
, const GLvoid
* data
)
4705 GET_CURRENT_CONTEXT(ctx
);
4706 if (target
== GL_PROXY_TEXTURE_3D
) {
4707 /* don't compile, execute immediately */
4708 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4709 width
, height
, depth
, border
,
4714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4716 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4720 n
[3].e
= internalFormat
;
4721 n
[4].i
= (GLint
) width
;
4722 n
[5].i
= (GLint
) height
;
4723 n
[6].i
= (GLint
) depth
;
4726 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4728 if (ctx
->ExecuteFlag
) {
4729 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4730 (target
, level
, internalFormat
, width
,
4731 height
, depth
, border
, imageSize
,
4738 static void GLAPIENTRY
4739 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4740 GLsizei width
, GLenum format
,
4741 GLsizei imageSize
, const GLvoid
* data
)
4744 GET_CURRENT_CONTEXT(ctx
);
4745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4747 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4752 n
[4].i
= (GLint
) width
;
4755 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4757 if (ctx
->ExecuteFlag
) {
4758 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4759 width
, format
, imageSize
,
4765 static void GLAPIENTRY
4766 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4767 GLint yoffset
, GLsizei width
, GLsizei height
,
4768 GLenum format
, GLsizei imageSize
,
4769 const GLvoid
* data
)
4772 GET_CURRENT_CONTEXT(ctx
);
4773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4775 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4781 n
[5].i
= (GLint
) width
;
4782 n
[6].i
= (GLint
) height
;
4785 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4787 if (ctx
->ExecuteFlag
) {
4788 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4789 (target
, level
, xoffset
, yoffset
, width
,
4790 height
, format
, imageSize
, data
));
4795 static void GLAPIENTRY
4796 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4797 GLint yoffset
, GLint zoffset
, GLsizei width
,
4798 GLsizei height
, GLsizei depth
, GLenum format
,
4799 GLsizei imageSize
, const GLvoid
* data
)
4802 GET_CURRENT_CONTEXT(ctx
);
4803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4805 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4812 n
[6].i
= (GLint
) width
;
4813 n
[7].i
= (GLint
) height
;
4814 n
[8].i
= (GLint
) depth
;
4816 n
[10].i
= imageSize
;
4817 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4819 if (ctx
->ExecuteFlag
) {
4820 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4821 (target
, level
, xoffset
, yoffset
,
4822 zoffset
, width
, height
, depth
, format
,
4828 /* GL_ARB_multisample */
4829 static void GLAPIENTRY
4830 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4832 GET_CURRENT_CONTEXT(ctx
);
4834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4835 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4840 if (ctx
->ExecuteFlag
) {
4841 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4847 * GL_NV_vertex_program
4849 static void GLAPIENTRY
4850 save_BindProgramNV(GLenum target
, GLuint id
)
4852 GET_CURRENT_CONTEXT(ctx
);
4854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4855 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4860 if (ctx
->ExecuteFlag
) {
4861 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4865 static void GLAPIENTRY
4866 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4867 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4869 GET_CURRENT_CONTEXT(ctx
);
4871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4872 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4881 if (ctx
->ExecuteFlag
) {
4882 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4887 static void GLAPIENTRY
4888 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4889 const GLfloat
*params
)
4891 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4892 params
[2], params
[3]);
4896 static void GLAPIENTRY
4897 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4898 const GLfloat
* params
)
4900 GET_CURRENT_CONTEXT(ctx
);
4902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4906 const GLfloat
* p
= params
;
4908 for (i
= 0 ; i
< count
; i
++) {
4909 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4922 if (ctx
->ExecuteFlag
) {
4923 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4928 static void GLAPIENTRY
4929 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4930 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4932 save_ProgramEnvParameter4fARB(target
, index
,
4934 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4938 static void GLAPIENTRY
4939 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4940 const GLdouble
*params
)
4942 save_ProgramEnvParameter4fARB(target
, index
,
4943 (GLfloat
) params
[0],
4944 (GLfloat
) params
[1],
4945 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4949 static void GLAPIENTRY
4950 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4952 GET_CURRENT_CONTEXT(ctx
);
4954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4955 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4964 if (ctx
->ExecuteFlag
) {
4965 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4970 static void GLAPIENTRY
4971 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4972 GLsizei num
, const GLdouble
*params
)
4975 for (i
= 0; i
< num
; i
++) {
4976 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4981 static void GLAPIENTRY
4982 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4983 GLsizei num
, const GLfloat
*params
)
4986 for (i
= 0; i
< num
; i
++) {
4987 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4992 static void GLAPIENTRY
4993 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4994 const GLubyte
* program
)
4996 GET_CURRENT_CONTEXT(ctx
);
4999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5001 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
5003 GLubyte
*programCopy
= malloc(len
);
5005 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
5008 memcpy(programCopy
, program
, len
);
5012 n
[4].data
= programCopy
;
5014 if (ctx
->ExecuteFlag
) {
5015 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
5020 static void GLAPIENTRY
5021 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
5023 GET_CURRENT_CONTEXT(ctx
);
5026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5028 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
5030 GLuint
*idCopy
= malloc(num
* sizeof(GLuint
));
5032 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
5035 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
5039 if (ctx
->ExecuteFlag
) {
5040 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
5045 static void GLAPIENTRY
5046 save_TrackMatrixNV(GLenum target
, GLuint address
,
5047 GLenum matrix
, GLenum transform
)
5049 GET_CURRENT_CONTEXT(ctx
);
5051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5052 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
5059 if (ctx
->ExecuteFlag
) {
5060 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
5066 * GL_NV_fragment_program
5068 static void GLAPIENTRY
5069 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5070 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5072 GET_CURRENT_CONTEXT(ctx
);
5074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5075 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5084 if (ctx
->ExecuteFlag
) {
5085 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5090 static void GLAPIENTRY
5091 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5092 const GLfloat
*params
)
5094 GET_CURRENT_CONTEXT(ctx
);
5096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5097 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5106 if (ctx
->ExecuteFlag
) {
5107 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5112 static void GLAPIENTRY
5113 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5114 const GLfloat
*params
)
5116 GET_CURRENT_CONTEXT(ctx
);
5118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5122 const GLfloat
* p
= params
;
5124 for (i
= 0 ; i
< count
; i
++) {
5125 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5138 if (ctx
->ExecuteFlag
) {
5139 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5144 static void GLAPIENTRY
5145 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5146 GLdouble x
, GLdouble y
,
5147 GLdouble z
, GLdouble w
)
5149 GET_CURRENT_CONTEXT(ctx
);
5151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5152 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5156 n
[3].f
= (GLfloat
) x
;
5157 n
[4].f
= (GLfloat
) y
;
5158 n
[5].f
= (GLfloat
) z
;
5159 n
[6].f
= (GLfloat
) w
;
5161 if (ctx
->ExecuteFlag
) {
5162 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5167 static void GLAPIENTRY
5168 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5169 const GLdouble
*params
)
5171 GET_CURRENT_CONTEXT(ctx
);
5173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5174 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5178 n
[3].f
= (GLfloat
) params
[0];
5179 n
[4].f
= (GLfloat
) params
[1];
5180 n
[5].f
= (GLfloat
) params
[2];
5181 n
[6].f
= (GLfloat
) params
[3];
5183 if (ctx
->ExecuteFlag
) {
5184 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5188 static void GLAPIENTRY
5189 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5190 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5192 GET_CURRENT_CONTEXT(ctx
);
5195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5197 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5199 GLubyte
*nameCopy
= malloc(len
);
5201 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5204 memcpy(nameCopy
, name
, len
);
5207 n
[3].data
= nameCopy
;
5213 if (ctx
->ExecuteFlag
) {
5214 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5219 static void GLAPIENTRY
5220 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5223 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5227 static void GLAPIENTRY
5228 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5229 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5231 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5232 (GLfloat
) z
, (GLfloat
) w
);
5236 static void GLAPIENTRY
5237 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5240 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5241 (GLfloat
) v
[1], (GLfloat
) v
[2],
5246 /* GL_EXT_stencil_two_side */
5247 static void GLAPIENTRY
5248 save_ActiveStencilFaceEXT(GLenum face
)
5250 GET_CURRENT_CONTEXT(ctx
);
5252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5253 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5257 if (ctx
->ExecuteFlag
) {
5258 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5263 /* GL_EXT_depth_bounds_test */
5264 static void GLAPIENTRY
5265 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5267 GET_CURRENT_CONTEXT(ctx
);
5269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5270 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5272 n
[1].f
= (GLfloat
) zmin
;
5273 n
[2].f
= (GLfloat
) zmax
;
5275 if (ctx
->ExecuteFlag
) {
5276 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5282 static void GLAPIENTRY
5283 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5284 const GLvoid
* string
)
5286 GET_CURRENT_CONTEXT(ctx
);
5289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5291 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5293 GLubyte
*programCopy
= malloc(len
);
5295 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5298 memcpy(programCopy
, string
, len
);
5302 n
[4].data
= programCopy
;
5304 if (ctx
->ExecuteFlag
) {
5305 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5310 static void GLAPIENTRY
5311 save_BeginQueryARB(GLenum target
, GLuint id
)
5313 GET_CURRENT_CONTEXT(ctx
);
5315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5316 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5321 if (ctx
->ExecuteFlag
) {
5322 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5326 static void GLAPIENTRY
5327 save_EndQueryARB(GLenum target
)
5329 GET_CURRENT_CONTEXT(ctx
);
5331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5332 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5336 if (ctx
->ExecuteFlag
) {
5337 CALL_EndQueryARB(ctx
->Exec
, (target
));
5341 static void GLAPIENTRY
5342 save_QueryCounter(GLuint id
, GLenum target
)
5344 GET_CURRENT_CONTEXT(ctx
);
5346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5347 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5352 if (ctx
->ExecuteFlag
) {
5353 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5357 static void GLAPIENTRY
5358 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5360 GET_CURRENT_CONTEXT(ctx
);
5362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5363 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5369 if (ctx
->ExecuteFlag
) {
5370 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5374 static void GLAPIENTRY
5375 save_EndQueryIndexed(GLenum target
, GLuint index
)
5377 GET_CURRENT_CONTEXT(ctx
);
5379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5380 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5385 if (ctx
->ExecuteFlag
) {
5386 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5391 static void GLAPIENTRY
5392 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5394 GET_CURRENT_CONTEXT(ctx
);
5396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5397 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5401 if (count
> MAX_DRAW_BUFFERS
)
5402 count
= MAX_DRAW_BUFFERS
;
5403 for (i
= 0; i
< count
; i
++) {
5404 n
[2 + i
].e
= buffers
[i
];
5407 if (ctx
->ExecuteFlag
) {
5408 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5412 static void GLAPIENTRY
5413 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5415 GET_CURRENT_CONTEXT(ctx
);
5418 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5426 if (ctx
->ExecuteFlag
) {
5427 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5431 static void GLAPIENTRY
5432 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5435 p
[0] = INT_TO_FLOAT(param
[0]);
5436 p
[1] = INT_TO_FLOAT(param
[1]);
5437 p
[2] = INT_TO_FLOAT(param
[2]);
5438 p
[3] = INT_TO_FLOAT(param
[3]);
5439 save_TexBumpParameterfvATI(pname
, p
);
5442 #if FEATURE_ATI_fragment_shader
5443 static void GLAPIENTRY
5444 save_BindFragmentShaderATI(GLuint id
)
5446 GET_CURRENT_CONTEXT(ctx
);
5449 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5453 if (ctx
->ExecuteFlag
) {
5454 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5458 static void GLAPIENTRY
5459 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5461 GET_CURRENT_CONTEXT(ctx
);
5464 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5472 if (ctx
->ExecuteFlag
) {
5473 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5478 static void GLAPIENTRY
5479 save_Attr1fNV(GLenum attr
, GLfloat x
)
5481 GET_CURRENT_CONTEXT(ctx
);
5483 SAVE_FLUSH_VERTICES(ctx
);
5484 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5490 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5491 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5492 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5494 if (ctx
->ExecuteFlag
) {
5495 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5499 static void GLAPIENTRY
5500 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5502 GET_CURRENT_CONTEXT(ctx
);
5504 SAVE_FLUSH_VERTICES(ctx
);
5505 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5512 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5513 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5514 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5516 if (ctx
->ExecuteFlag
) {
5517 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5521 static void GLAPIENTRY
5522 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5524 GET_CURRENT_CONTEXT(ctx
);
5526 SAVE_FLUSH_VERTICES(ctx
);
5527 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5535 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5536 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5537 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5539 if (ctx
->ExecuteFlag
) {
5540 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5544 static void GLAPIENTRY
5545 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5547 GET_CURRENT_CONTEXT(ctx
);
5549 SAVE_FLUSH_VERTICES(ctx
);
5550 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5559 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5560 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5561 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5563 if (ctx
->ExecuteFlag
) {
5564 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5569 static void GLAPIENTRY
5570 save_Attr1fARB(GLenum attr
, GLfloat x
)
5572 GET_CURRENT_CONTEXT(ctx
);
5574 SAVE_FLUSH_VERTICES(ctx
);
5575 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5581 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5582 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5583 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5585 if (ctx
->ExecuteFlag
) {
5586 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5590 static void GLAPIENTRY
5591 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5593 GET_CURRENT_CONTEXT(ctx
);
5595 SAVE_FLUSH_VERTICES(ctx
);
5596 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5603 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5604 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5605 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5607 if (ctx
->ExecuteFlag
) {
5608 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5612 static void GLAPIENTRY
5613 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5615 GET_CURRENT_CONTEXT(ctx
);
5617 SAVE_FLUSH_VERTICES(ctx
);
5618 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5626 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5627 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5628 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5630 if (ctx
->ExecuteFlag
) {
5631 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5635 static void GLAPIENTRY
5636 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5638 GET_CURRENT_CONTEXT(ctx
);
5640 SAVE_FLUSH_VERTICES(ctx
);
5641 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5650 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5651 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5652 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5654 if (ctx
->ExecuteFlag
) {
5655 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5660 static void GLAPIENTRY
5661 save_EvalCoord1f(GLfloat x
)
5663 GET_CURRENT_CONTEXT(ctx
);
5665 SAVE_FLUSH_VERTICES(ctx
);
5666 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5670 if (ctx
->ExecuteFlag
) {
5671 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5675 static void GLAPIENTRY
5676 save_EvalCoord1fv(const GLfloat
* v
)
5678 save_EvalCoord1f(v
[0]);
5681 static void GLAPIENTRY
5682 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5684 GET_CURRENT_CONTEXT(ctx
);
5686 SAVE_FLUSH_VERTICES(ctx
);
5687 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5692 if (ctx
->ExecuteFlag
) {
5693 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5697 static void GLAPIENTRY
5698 save_EvalCoord2fv(const GLfloat
* v
)
5700 save_EvalCoord2f(v
[0], v
[1]);
5704 static void GLAPIENTRY
5705 save_EvalPoint1(GLint x
)
5707 GET_CURRENT_CONTEXT(ctx
);
5709 SAVE_FLUSH_VERTICES(ctx
);
5710 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5714 if (ctx
->ExecuteFlag
) {
5715 CALL_EvalPoint1(ctx
->Exec
, (x
));
5719 static void GLAPIENTRY
5720 save_EvalPoint2(GLint x
, GLint y
)
5722 GET_CURRENT_CONTEXT(ctx
);
5724 SAVE_FLUSH_VERTICES(ctx
);
5725 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5730 if (ctx
->ExecuteFlag
) {
5731 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5735 static void GLAPIENTRY
5736 save_Indexf(GLfloat x
)
5738 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5741 static void GLAPIENTRY
5742 save_Indexfv(const GLfloat
* v
)
5744 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5747 static void GLAPIENTRY
5748 save_EdgeFlag(GLboolean x
)
5750 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5755 * Compare 'count' elements of vectors 'a' and 'b'.
5756 * \return GL_TRUE if equal, GL_FALSE if different.
5758 static inline GLboolean
5759 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5761 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5766 * This glMaterial function is used for glMaterial calls that are outside
5767 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5769 static void GLAPIENTRY
5770 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5772 GET_CURRENT_CONTEXT(ctx
);
5780 case GL_FRONT_AND_BACK
:
5783 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5792 case GL_AMBIENT_AND_DIFFUSE
:
5798 case GL_COLOR_INDEXES
:
5802 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5806 if (ctx
->ExecuteFlag
) {
5807 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5810 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5812 /* Try to eliminate redundant statechanges. Because it is legal to
5813 * call glMaterial even inside begin/end calls, don't need to worry
5814 * about ctx->Driver.CurrentSavePrimitive here.
5816 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5817 if (bitmask
& (1 << i
)) {
5818 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5819 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5820 /* no change in material value */
5821 bitmask
&= ~(1 << i
);
5824 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5825 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5830 /* If this call has no effect, return early */
5834 SAVE_FLUSH_VERTICES(ctx
);
5836 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5840 for (i
= 0; i
< args
; i
++)
5841 n
[3 + i
].f
= param
[i
];
5845 static void GLAPIENTRY
5846 save_Begin(GLenum mode
)
5848 GET_CURRENT_CONTEXT(ctx
);
5850 GLboolean error
= GL_FALSE
;
5852 if (mode
> GL_POLYGON
) {
5853 _mesa_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode=%x)", mode
);
5856 if (ctx
->ExecuteFlag
) {
5857 if (!_mesa_valid_prim_mode(ctx
, mode
, "glBegin")) {
5862 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5863 /* Typically the first begin. This may raise an error on
5864 * playback, depending on whether CallList is issued from inside
5865 * a begin/end or not.
5867 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5869 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5870 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5873 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5878 /* Give the driver an opportunity to hook in an optimized
5879 * display list compiler.
5881 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5884 SAVE_FLUSH_VERTICES(ctx
);
5885 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5891 if (ctx
->ExecuteFlag
) {
5892 CALL_Begin(ctx
->Exec
, (mode
));
5896 static void GLAPIENTRY
5899 GET_CURRENT_CONTEXT(ctx
);
5900 SAVE_FLUSH_VERTICES(ctx
);
5901 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5902 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5903 if (ctx
->ExecuteFlag
) {
5904 CALL_End(ctx
->Exec
, ());
5908 static void GLAPIENTRY
5909 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5911 GET_CURRENT_CONTEXT(ctx
);
5913 SAVE_FLUSH_VERTICES(ctx
);
5914 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5921 if (ctx
->ExecuteFlag
) {
5922 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5927 static void GLAPIENTRY
5928 save_Vertex2f(GLfloat x
, GLfloat y
)
5930 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5933 static void GLAPIENTRY
5934 save_Vertex2fv(const GLfloat
* v
)
5936 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5939 static void GLAPIENTRY
5940 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5942 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5945 static void GLAPIENTRY
5946 save_Vertex3fv(const GLfloat
* v
)
5948 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5951 static void GLAPIENTRY
5952 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5954 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5957 static void GLAPIENTRY
5958 save_Vertex4fv(const GLfloat
* v
)
5960 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5963 static void GLAPIENTRY
5964 save_TexCoord1f(GLfloat x
)
5966 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5969 static void GLAPIENTRY
5970 save_TexCoord1fv(const GLfloat
* v
)
5972 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5975 static void GLAPIENTRY
5976 save_TexCoord2f(GLfloat x
, GLfloat y
)
5978 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5981 static void GLAPIENTRY
5982 save_TexCoord2fv(const GLfloat
* v
)
5984 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5987 static void GLAPIENTRY
5988 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5990 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5993 static void GLAPIENTRY
5994 save_TexCoord3fv(const GLfloat
* v
)
5996 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5999 static void GLAPIENTRY
6000 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6002 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6005 static void GLAPIENTRY
6006 save_TexCoord4fv(const GLfloat
* v
)
6008 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6011 static void GLAPIENTRY
6012 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6014 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6017 static void GLAPIENTRY
6018 save_Normal3fv(const GLfloat
* v
)
6020 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6023 static void GLAPIENTRY
6024 save_FogCoordfEXT(GLfloat x
)
6026 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6029 static void GLAPIENTRY
6030 save_FogCoordfvEXT(const GLfloat
* v
)
6032 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6035 static void GLAPIENTRY
6036 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6038 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6041 static void GLAPIENTRY
6042 save_Color3fv(const GLfloat
* v
)
6044 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6047 static void GLAPIENTRY
6048 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6050 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6053 static void GLAPIENTRY
6054 save_Color4fv(const GLfloat
* v
)
6056 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6059 static void GLAPIENTRY
6060 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6062 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6065 static void GLAPIENTRY
6066 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6068 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6072 /* Just call the respective ATTR for texcoord
6074 static void GLAPIENTRY
6075 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6077 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6078 save_Attr1fNV(attr
, x
);
6081 static void GLAPIENTRY
6082 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6084 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6085 save_Attr1fNV(attr
, v
[0]);
6088 static void GLAPIENTRY
6089 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6091 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6092 save_Attr2fNV(attr
, x
, y
);
6095 static void GLAPIENTRY
6096 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6098 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6099 save_Attr2fNV(attr
, v
[0], v
[1]);
6102 static void GLAPIENTRY
6103 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6105 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6106 save_Attr3fNV(attr
, x
, y
, z
);
6109 static void GLAPIENTRY
6110 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6112 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6113 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6116 static void GLAPIENTRY
6117 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6118 GLfloat z
, GLfloat w
)
6120 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6121 save_Attr4fNV(attr
, x
, y
, z
, w
);
6124 static void GLAPIENTRY
6125 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6127 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6128 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6133 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6139 GET_CURRENT_CONTEXT(ctx
);
6140 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6144 /* First level for NV_vertex_program:
6146 * Check for errors at compile time?.
6148 static void GLAPIENTRY
6149 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6151 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6152 save_Attr1fNV(index
, x
);
6157 static void GLAPIENTRY
6158 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6160 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6161 save_Attr1fNV(index
, v
[0]);
6166 static void GLAPIENTRY
6167 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6169 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6170 save_Attr2fNV(index
, x
, y
);
6175 static void GLAPIENTRY
6176 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6178 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6179 save_Attr2fNV(index
, v
[0], v
[1]);
6184 static void GLAPIENTRY
6185 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6187 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6188 save_Attr3fNV(index
, x
, y
, z
);
6193 static void GLAPIENTRY
6194 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6196 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6197 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6202 static void GLAPIENTRY
6203 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6204 GLfloat z
, GLfloat w
)
6206 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6207 save_Attr4fNV(index
, x
, y
, z
, w
);
6212 static void GLAPIENTRY
6213 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6215 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6216 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6224 static void GLAPIENTRY
6225 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6227 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6228 save_Attr1fARB(index
, x
);
6233 static void GLAPIENTRY
6234 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6236 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6237 save_Attr1fARB(index
, v
[0]);
6242 static void GLAPIENTRY
6243 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6245 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6246 save_Attr2fARB(index
, x
, y
);
6251 static void GLAPIENTRY
6252 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6254 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6255 save_Attr2fARB(index
, v
[0], v
[1]);
6260 static void GLAPIENTRY
6261 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6263 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6264 save_Attr3fARB(index
, x
, y
, z
);
6269 static void GLAPIENTRY
6270 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6272 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6273 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6278 static void GLAPIENTRY
6279 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6282 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6283 save_Attr4fARB(index
, x
, y
, z
, w
);
6288 static void GLAPIENTRY
6289 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6291 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6292 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6298 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6300 static void GLAPIENTRY
6301 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6303 GET_CURRENT_CONTEXT(ctx
);
6304 FLUSH_VERTICES(ctx
, 0);
6305 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6308 static GLint GLAPIENTRY
6309 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6311 GET_CURRENT_CONTEXT(ctx
);
6312 FLUSH_VERTICES(ctx
, 0);
6313 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6316 static GLint GLAPIENTRY
6317 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6319 GET_CURRENT_CONTEXT(ctx
);
6320 FLUSH_VERTICES(ctx
, 0);
6321 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6323 /* XXX more shader functions needed here */
6326 #if FEATURE_EXT_framebuffer_blit
6327 static void GLAPIENTRY
6328 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6329 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6330 GLbitfield mask
, GLenum filter
)
6332 GET_CURRENT_CONTEXT(ctx
);
6334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6335 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6348 if (ctx
->ExecuteFlag
) {
6349 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6350 dstX0
, dstY0
, dstX1
, dstY1
,
6357 /** GL_EXT_provoking_vertex */
6358 static void GLAPIENTRY
6359 save_ProvokingVertexEXT(GLenum mode
)
6361 GET_CURRENT_CONTEXT(ctx
);
6363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6364 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6368 if (ctx
->ExecuteFlag
) {
6369 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6370 _mesa_ProvokingVertexEXT(mode
);
6375 /** GL_EXT_transform_feedback */
6376 static void GLAPIENTRY
6377 save_BeginTransformFeedback(GLenum mode
)
6379 GET_CURRENT_CONTEXT(ctx
);
6381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6382 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6386 if (ctx
->ExecuteFlag
) {
6387 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6392 /** GL_EXT_transform_feedback */
6393 static void GLAPIENTRY
6394 save_EndTransformFeedback(void)
6396 GET_CURRENT_CONTEXT(ctx
);
6397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6398 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6399 if (ctx
->ExecuteFlag
) {
6400 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6404 static void GLAPIENTRY
6405 save_BindTransformFeedback(GLenum target
, GLuint name
)
6407 GET_CURRENT_CONTEXT(ctx
);
6409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6410 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6415 if (ctx
->ExecuteFlag
) {
6416 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6420 static void GLAPIENTRY
6421 save_PauseTransformFeedback(void)
6423 GET_CURRENT_CONTEXT(ctx
);
6424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6425 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6426 if (ctx
->ExecuteFlag
) {
6427 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6431 static void GLAPIENTRY
6432 save_ResumeTransformFeedback(void)
6434 GET_CURRENT_CONTEXT(ctx
);
6435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6436 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6437 if (ctx
->ExecuteFlag
) {
6438 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6442 static void GLAPIENTRY
6443 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6445 GET_CURRENT_CONTEXT(ctx
);
6447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6448 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6453 if (ctx
->ExecuteFlag
) {
6454 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6458 static void GLAPIENTRY
6459 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6461 GET_CURRENT_CONTEXT(ctx
);
6463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6464 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6470 if (ctx
->ExecuteFlag
) {
6471 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6475 static void GLAPIENTRY
6476 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6479 GET_CURRENT_CONTEXT(ctx
);
6481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6482 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6486 n
[3].si
= primcount
;
6488 if (ctx
->ExecuteFlag
) {
6489 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6493 static void GLAPIENTRY
6494 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6495 GLuint stream
, GLsizei primcount
)
6497 GET_CURRENT_CONTEXT(ctx
);
6499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6500 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6505 n
[4].si
= primcount
;
6507 if (ctx
->ExecuteFlag
) {
6508 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6513 /* aka UseProgram() */
6514 static void GLAPIENTRY
6515 save_UseProgramObjectARB(GLhandleARB program
)
6517 GET_CURRENT_CONTEXT(ctx
);
6519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6520 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6524 if (ctx
->ExecuteFlag
) {
6525 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6530 static void GLAPIENTRY
6531 save_Uniform1fARB(GLint location
, GLfloat x
)
6533 GET_CURRENT_CONTEXT(ctx
);
6535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6536 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6541 if (ctx
->ExecuteFlag
) {
6542 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6547 static void GLAPIENTRY
6548 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6550 GET_CURRENT_CONTEXT(ctx
);
6552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6553 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6559 if (ctx
->ExecuteFlag
) {
6560 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6565 static void GLAPIENTRY
6566 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6568 GET_CURRENT_CONTEXT(ctx
);
6570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6571 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6578 if (ctx
->ExecuteFlag
) {
6579 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6584 static void GLAPIENTRY
6585 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6587 GET_CURRENT_CONTEXT(ctx
);
6589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6590 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6598 if (ctx
->ExecuteFlag
) {
6599 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6604 /** Return copy of memory */
6606 memdup(const void *src
, GLsizei bytes
)
6608 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6610 memcpy(b
, src
, bytes
);
6615 static void GLAPIENTRY
6616 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6618 GET_CURRENT_CONTEXT(ctx
);
6620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6621 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6625 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6627 if (ctx
->ExecuteFlag
) {
6628 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6632 static void GLAPIENTRY
6633 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6635 GET_CURRENT_CONTEXT(ctx
);
6637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6638 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6642 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6644 if (ctx
->ExecuteFlag
) {
6645 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6649 static void GLAPIENTRY
6650 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6652 GET_CURRENT_CONTEXT(ctx
);
6654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6655 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6659 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6661 if (ctx
->ExecuteFlag
) {
6662 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6666 static void GLAPIENTRY
6667 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6669 GET_CURRENT_CONTEXT(ctx
);
6671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6672 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6676 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6678 if (ctx
->ExecuteFlag
) {
6679 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6684 static void GLAPIENTRY
6685 save_Uniform1iARB(GLint location
, GLint x
)
6687 GET_CURRENT_CONTEXT(ctx
);
6689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6690 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6695 if (ctx
->ExecuteFlag
) {
6696 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6700 static void GLAPIENTRY
6701 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6703 GET_CURRENT_CONTEXT(ctx
);
6705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6706 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6712 if (ctx
->ExecuteFlag
) {
6713 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6717 static void GLAPIENTRY
6718 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6720 GET_CURRENT_CONTEXT(ctx
);
6722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6723 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6730 if (ctx
->ExecuteFlag
) {
6731 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6735 static void GLAPIENTRY
6736 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6738 GET_CURRENT_CONTEXT(ctx
);
6740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6741 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6749 if (ctx
->ExecuteFlag
) {
6750 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6756 static void GLAPIENTRY
6757 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6759 GET_CURRENT_CONTEXT(ctx
);
6761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6762 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6766 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6768 if (ctx
->ExecuteFlag
) {
6769 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6773 static void GLAPIENTRY
6774 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6776 GET_CURRENT_CONTEXT(ctx
);
6778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6779 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6783 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6785 if (ctx
->ExecuteFlag
) {
6786 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6790 static void GLAPIENTRY
6791 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6793 GET_CURRENT_CONTEXT(ctx
);
6795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6796 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6800 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6802 if (ctx
->ExecuteFlag
) {
6803 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6807 static void GLAPIENTRY
6808 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6810 GET_CURRENT_CONTEXT(ctx
);
6812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6813 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6817 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6819 if (ctx
->ExecuteFlag
) {
6820 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6826 static void GLAPIENTRY
6827 save_Uniform1ui(GLint location
, GLuint x
)
6829 GET_CURRENT_CONTEXT(ctx
);
6831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6832 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6837 if (ctx
->ExecuteFlag
) {
6838 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6842 static void GLAPIENTRY
6843 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6854 if (ctx
->ExecuteFlag
) {
6855 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6859 static void GLAPIENTRY
6860 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6862 GET_CURRENT_CONTEXT(ctx
);
6864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6865 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6872 if (ctx
->ExecuteFlag
) {
6873 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6877 static void GLAPIENTRY
6878 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6880 GET_CURRENT_CONTEXT(ctx
);
6882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6883 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6891 if (ctx
->ExecuteFlag
) {
6892 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6898 static void GLAPIENTRY
6899 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6901 GET_CURRENT_CONTEXT(ctx
);
6903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6904 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6908 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6910 if (ctx
->ExecuteFlag
) {
6911 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6915 static void GLAPIENTRY
6916 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6918 GET_CURRENT_CONTEXT(ctx
);
6920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6921 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6925 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6927 if (ctx
->ExecuteFlag
) {
6928 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6932 static void GLAPIENTRY
6933 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6935 GET_CURRENT_CONTEXT(ctx
);
6937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6938 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6942 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6944 if (ctx
->ExecuteFlag
) {
6945 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6949 static void GLAPIENTRY
6950 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6952 GET_CURRENT_CONTEXT(ctx
);
6954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6955 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6959 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6961 if (ctx
->ExecuteFlag
) {
6962 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6968 static void GLAPIENTRY
6969 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6972 GET_CURRENT_CONTEXT(ctx
);
6974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6975 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6980 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6982 if (ctx
->ExecuteFlag
) {
6983 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6987 static void GLAPIENTRY
6988 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6991 GET_CURRENT_CONTEXT(ctx
);
6993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6994 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6999 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
7001 if (ctx
->ExecuteFlag
) {
7002 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
7006 static void GLAPIENTRY
7007 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7010 GET_CURRENT_CONTEXT(ctx
);
7012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7013 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
7018 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
7020 if (ctx
->ExecuteFlag
) {
7021 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
7026 static void GLAPIENTRY
7027 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7030 GET_CURRENT_CONTEXT(ctx
);
7032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7033 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
7038 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
7040 if (ctx
->ExecuteFlag
) {
7041 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7045 static void GLAPIENTRY
7046 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7049 GET_CURRENT_CONTEXT(ctx
);
7051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7052 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
7057 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
7059 if (ctx
->ExecuteFlag
) {
7060 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7065 static void GLAPIENTRY
7066 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7069 GET_CURRENT_CONTEXT(ctx
);
7071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7072 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
7077 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
7079 if (ctx
->ExecuteFlag
) {
7080 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7084 static void GLAPIENTRY
7085 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7088 GET_CURRENT_CONTEXT(ctx
);
7090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7091 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
7096 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
7098 if (ctx
->ExecuteFlag
) {
7099 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7104 static void GLAPIENTRY
7105 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7108 GET_CURRENT_CONTEXT(ctx
);
7110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7111 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
7116 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
7118 if (ctx
->ExecuteFlag
) {
7119 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7123 static void GLAPIENTRY
7124 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7127 GET_CURRENT_CONTEXT(ctx
);
7129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7130 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
7135 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
7137 if (ctx
->ExecuteFlag
) {
7138 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7142 static void GLAPIENTRY
7143 save_ClampColorARB(GLenum target
, GLenum clamp
)
7145 GET_CURRENT_CONTEXT(ctx
);
7147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7148 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7153 if (ctx
->ExecuteFlag
) {
7154 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
7158 static void GLAPIENTRY
7159 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
7161 GET_CURRENT_CONTEXT(ctx
);
7163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7164 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
7169 if (ctx
->ExecuteFlag
) {
7170 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
7174 static void GLAPIENTRY
7175 save_ActiveProgramEXT(GLuint program
)
7177 GET_CURRENT_CONTEXT(ctx
);
7179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7180 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7184 if (ctx
->ExecuteFlag
) {
7185 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7189 /** GL_EXT_texture_integer */
7190 static void GLAPIENTRY
7191 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7193 GET_CURRENT_CONTEXT(ctx
);
7195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7196 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7203 if (ctx
->ExecuteFlag
) {
7204 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7208 /** GL_EXT_texture_integer */
7209 static void GLAPIENTRY
7210 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7212 GET_CURRENT_CONTEXT(ctx
);
7214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7215 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7222 if (ctx
->ExecuteFlag
) {
7223 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7227 /** GL_EXT_texture_integer */
7228 static void GLAPIENTRY
7229 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7231 GET_CURRENT_CONTEXT(ctx
);
7233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7234 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7243 if (ctx
->ExecuteFlag
) {
7244 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7248 /** GL_EXT_texture_integer */
7249 static void GLAPIENTRY
7250 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7252 GET_CURRENT_CONTEXT(ctx
);
7254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7255 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7259 n
[3].ui
= params
[0];
7260 n
[4].ui
= params
[1];
7261 n
[5].ui
= params
[2];
7262 n
[6].ui
= params
[3];
7264 if (ctx
->ExecuteFlag
) {
7265 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7269 /** GL_EXT_texture_integer */
7270 static void GLAPIENTRY
7271 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 FLUSH_VERTICES(ctx
, 0);
7275 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7278 /** GL_EXT_texture_integer */
7279 static void GLAPIENTRY
7280 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7288 /* GL_ARB_instanced_arrays */
7289 static void GLAPIENTRY
7290 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7292 GET_CURRENT_CONTEXT(ctx
);
7294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7295 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7300 if (ctx
->ExecuteFlag
) {
7301 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7306 /* GL_NV_texture_barrier */
7307 static void GLAPIENTRY
7308 save_TextureBarrierNV(void)
7310 GET_CURRENT_CONTEXT(ctx
);
7311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7312 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7313 if (ctx
->ExecuteFlag
) {
7314 CALL_TextureBarrierNV(ctx
->Exec
, ());
7319 /* GL_ARB_sampler_objects */
7320 static void GLAPIENTRY
7321 save_BindSampler(GLuint unit
, GLuint sampler
)
7324 GET_CURRENT_CONTEXT(ctx
);
7325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7326 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7331 if (ctx
->ExecuteFlag
) {
7332 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7336 static void GLAPIENTRY
7337 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7340 GET_CURRENT_CONTEXT(ctx
);
7341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7342 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7347 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7353 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7356 if (ctx
->ExecuteFlag
) {
7357 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7361 static void GLAPIENTRY
7362 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7364 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7367 static void GLAPIENTRY
7368 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7371 GET_CURRENT_CONTEXT(ctx
);
7372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7373 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7378 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7384 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7387 if (ctx
->ExecuteFlag
) {
7388 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7392 static void GLAPIENTRY
7393 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7395 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7398 static void GLAPIENTRY
7399 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7402 GET_CURRENT_CONTEXT(ctx
);
7403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7404 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7409 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7415 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7418 if (ctx
->ExecuteFlag
) {
7419 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7423 static void GLAPIENTRY
7424 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7427 GET_CURRENT_CONTEXT(ctx
);
7428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7429 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7433 n
[3].ui
= params
[0];
7434 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7435 n
[4].ui
= params
[1];
7436 n
[5].ui
= params
[2];
7437 n
[6].ui
= params
[3];
7440 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7443 if (ctx
->ExecuteFlag
) {
7444 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7448 /* GL_ARB_geometry_shader4 */
7449 static void GLAPIENTRY
7450 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7453 GET_CURRENT_CONTEXT(ctx
);
7454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7455 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7461 if (ctx
->ExecuteFlag
) {
7462 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7466 static void GLAPIENTRY
7467 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7468 GLuint texture
, GLint level
)
7471 GET_CURRENT_CONTEXT(ctx
);
7472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7473 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7476 n
[2].e
= attachment
;
7480 if (ctx
->ExecuteFlag
) {
7481 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7485 static void GLAPIENTRY
7486 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7487 GLuint texture
, GLint level
, GLenum face
)
7490 GET_CURRENT_CONTEXT(ctx
);
7491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7492 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7495 n
[2].e
= attachment
;
7500 if (ctx
->ExecuteFlag
) {
7501 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7508 static void GLAPIENTRY
7509 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7512 GET_CURRENT_CONTEXT(ctx
);
7513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7514 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7516 union uint64_pair p
;
7520 n
[3].ui
= p
.uint32
[0];
7521 n
[4].ui
= p
.uint32
[1];
7523 if (ctx
->ExecuteFlag
) {
7524 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7529 /** GL_NV_conditional_render */
7530 static void GLAPIENTRY
7531 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7533 GET_CURRENT_CONTEXT(ctx
);
7535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7536 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7541 if (ctx
->ExecuteFlag
) {
7542 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7546 static void GLAPIENTRY
7547 save_EndConditionalRender(void)
7549 GET_CURRENT_CONTEXT(ctx
);
7550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7551 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7552 if (ctx
->ExecuteFlag
) {
7553 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7557 static void GLAPIENTRY
7558 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7560 GET_CURRENT_CONTEXT(ctx
);
7562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7563 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7569 if (ctx
->ExecuteFlag
) {
7570 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7576 * Save an error-generating command into display list.
7578 * KW: Will appear in the list before the vertex buffer containing the
7579 * command that provoked the error. I don't see this as a problem.
7582 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7585 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7588 n
[2].data
= (void *) s
;
7594 * Compile an error into current display list.
7597 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7599 if (ctx
->CompileFlag
)
7600 save_error(ctx
, error
, s
);
7601 if (ctx
->ExecuteFlag
)
7602 _mesa_error(ctx
, error
, "%s", s
);
7607 * Test if ID names a display list.
7610 islist(struct gl_context
*ctx
, GLuint list
)
7612 if (list
> 0 && lookup_list(ctx
, list
)) {
7622 /**********************************************************************/
7623 /* Display list execution */
7624 /**********************************************************************/
7628 * Execute a display list. Note that the ListBase offset must have already
7629 * been added before calling this function. I.e. the list argument is
7630 * the absolute list number, not relative to ListBase.
7631 * \param list - display list number
7634 execute_list(struct gl_context
*ctx
, GLuint list
)
7636 struct gl_display_list
*dlist
;
7640 if (list
== 0 || !islist(ctx
, list
))
7643 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7644 /* raise an error? */
7648 dlist
= lookup_list(ctx
, list
);
7652 ctx
->ListState
.CallDepth
++;
7654 if (ctx
->Driver
.BeginCallList
)
7655 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7661 const OpCode opcode
= n
[0].opcode
;
7663 if (is_ext_opcode(opcode
)) {
7664 n
+= ext_opcode_execute(ctx
, n
);
7669 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7672 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7674 case OPCODE_ALPHA_FUNC
:
7675 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7677 case OPCODE_BIND_TEXTURE
:
7678 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7682 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7683 ctx
->Unpack
= ctx
->DefaultPacking
;
7684 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7685 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7686 (const GLubyte
*) n
[7].data
));
7687 ctx
->Unpack
= save
; /* restore */
7690 case OPCODE_BLEND_COLOR
:
7691 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7693 case OPCODE_BLEND_EQUATION
:
7694 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7696 case OPCODE_BLEND_EQUATION_SEPARATE
:
7697 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7699 case OPCODE_BLEND_FUNC_SEPARATE
:
7700 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7701 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7704 case OPCODE_BLEND_FUNC_I
:
7705 /* GL_ARB_draw_buffers_blend */
7706 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7708 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7709 /* GL_ARB_draw_buffers_blend */
7710 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7713 case OPCODE_BLEND_EQUATION_I
:
7714 /* GL_ARB_draw_buffers_blend */
7715 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7717 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7718 /* GL_ARB_draw_buffers_blend */
7719 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7720 (n
[1].ui
, n
[2].e
, n
[3].e
));
7723 case OPCODE_CALL_LIST
:
7724 /* Generated by glCallList(), don't add ListBase */
7725 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7726 execute_list(ctx
, n
[1].ui
);
7729 case OPCODE_CALL_LIST_OFFSET
:
7730 /* Generated by glCallLists() so we must add ListBase */
7732 /* user specified a bad data type at compile time */
7733 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7735 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7736 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7737 execute_list(ctx
, list
);
7741 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7743 case OPCODE_CLEAR_BUFFER_IV
:
7750 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7753 case OPCODE_CLEAR_BUFFER_UIV
:
7760 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7763 case OPCODE_CLEAR_BUFFER_FV
:
7770 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7773 case OPCODE_CLEAR_BUFFER_FI
:
7774 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7776 case OPCODE_CLEAR_COLOR
:
7777 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7779 case OPCODE_CLEAR_ACCUM
:
7780 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7782 case OPCODE_CLEAR_DEPTH
:
7783 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7785 case OPCODE_CLEAR_INDEX
:
7786 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7788 case OPCODE_CLEAR_STENCIL
:
7789 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7791 case OPCODE_CLIP_PLANE
:
7798 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7801 case OPCODE_COLOR_MASK
:
7802 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7804 case OPCODE_COLOR_MASK_INDEXED
:
7805 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7808 case OPCODE_COLOR_MATERIAL
:
7809 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7811 case OPCODE_COLOR_TABLE
:
7813 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7814 ctx
->Unpack
= ctx
->DefaultPacking
;
7815 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7816 n
[5].e
, n
[6].data
));
7817 ctx
->Unpack
= save
; /* restore */
7820 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7827 CALL_ColorTableParameterfv(ctx
->Exec
,
7828 (n
[1].e
, n
[2].e
, params
));
7831 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7838 CALL_ColorTableParameteriv(ctx
->Exec
,
7839 (n
[1].e
, n
[2].e
, params
));
7842 case OPCODE_COLOR_SUB_TABLE
:
7844 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7845 ctx
->Unpack
= ctx
->DefaultPacking
;
7846 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7847 n
[4].e
, n
[5].e
, n
[6].data
));
7848 ctx
->Unpack
= save
; /* restore */
7851 case OPCODE_CONVOLUTION_FILTER_1D
:
7853 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7854 ctx
->Unpack
= ctx
->DefaultPacking
;
7855 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7858 ctx
->Unpack
= save
; /* restore */
7861 case OPCODE_CONVOLUTION_FILTER_2D
:
7863 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7864 ctx
->Unpack
= ctx
->DefaultPacking
;
7865 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7866 n
[4].i
, n
[5].e
, n
[6].e
,
7868 ctx
->Unpack
= save
; /* restore */
7871 case OPCODE_CONVOLUTION_PARAMETER_I
:
7872 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7874 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7881 CALL_ConvolutionParameteriv(ctx
->Exec
,
7882 (n
[1].e
, n
[2].e
, params
));
7885 case OPCODE_CONVOLUTION_PARAMETER_F
:
7886 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7888 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7895 CALL_ConvolutionParameterfv(ctx
->Exec
,
7896 (n
[1].e
, n
[2].e
, params
));
7899 case OPCODE_COPY_COLOR_SUB_TABLE
:
7900 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7901 n
[3].i
, n
[4].i
, n
[5].i
));
7903 case OPCODE_COPY_COLOR_TABLE
:
7904 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7905 n
[3].i
, n
[4].i
, n
[5].i
));
7907 case OPCODE_COPY_PIXELS
:
7908 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7909 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7912 case OPCODE_COPY_TEX_IMAGE1D
:
7913 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7914 n
[5].i
, n
[6].i
, n
[7].i
));
7916 case OPCODE_COPY_TEX_IMAGE2D
:
7917 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7918 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7920 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7921 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7922 n
[4].i
, n
[5].i
, n
[6].i
));
7924 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7925 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7926 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7929 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7930 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7931 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7934 case OPCODE_CULL_FACE
:
7935 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7937 case OPCODE_DEPTH_FUNC
:
7938 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7940 case OPCODE_DEPTH_MASK
:
7941 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7943 case OPCODE_DEPTH_RANGE
:
7944 CALL_DepthRange(ctx
->Exec
,
7945 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7947 case OPCODE_DISABLE
:
7948 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7950 case OPCODE_DISABLE_INDEXED
:
7951 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7953 case OPCODE_DRAW_BUFFER
:
7954 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7956 case OPCODE_DRAW_PIXELS
:
7958 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7959 ctx
->Unpack
= ctx
->DefaultPacking
;
7960 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7962 ctx
->Unpack
= save
; /* restore */
7966 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7968 case OPCODE_ENABLE_INDEXED
:
7969 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7971 case OPCODE_EVALMESH1
:
7972 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7974 case OPCODE_EVALMESH2
:
7975 CALL_EvalMesh2(ctx
->Exec
,
7976 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7985 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7988 case OPCODE_FRONT_FACE
:
7989 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7991 case OPCODE_FRUSTUM
:
7992 CALL_Frustum(ctx
->Exec
,
7993 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7996 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7998 case OPCODE_HISTOGRAM
:
7999 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
8001 case OPCODE_INDEX_MASK
:
8002 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
8004 case OPCODE_INIT_NAMES
:
8005 CALL_InitNames(ctx
->Exec
, ());
8014 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
8017 case OPCODE_LIGHT_MODEL
:
8024 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
8027 case OPCODE_LINE_STIPPLE
:
8028 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
8030 case OPCODE_LINE_WIDTH
:
8031 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
8033 case OPCODE_LIST_BASE
:
8034 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
8036 case OPCODE_LOAD_IDENTITY
:
8037 CALL_LoadIdentity(ctx
->Exec
, ());
8039 case OPCODE_LOAD_MATRIX
:
8040 if (sizeof(Node
) == sizeof(GLfloat
)) {
8041 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
8046 for (i
= 0; i
< 16; i
++) {
8049 CALL_LoadMatrixf(ctx
->Exec
, (m
));
8052 case OPCODE_LOAD_NAME
:
8053 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
8055 case OPCODE_LOGIC_OP
:
8056 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
8060 GLenum target
= n
[1].e
;
8061 GLint ustride
= _mesa_evaluator_components(target
);
8062 GLint uorder
= n
[5].i
;
8063 GLfloat u1
= n
[2].f
;
8064 GLfloat u2
= n
[3].f
;
8065 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8066 (GLfloat
*) n
[6].data
));
8071 GLenum target
= n
[1].e
;
8072 GLfloat u1
= n
[2].f
;
8073 GLfloat u2
= n
[3].f
;
8074 GLfloat v1
= n
[4].f
;
8075 GLfloat v2
= n
[5].f
;
8076 GLint ustride
= n
[6].i
;
8077 GLint vstride
= n
[7].i
;
8078 GLint uorder
= n
[8].i
;
8079 GLint vorder
= n
[9].i
;
8080 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8081 v1
, v2
, vstride
, vorder
,
8082 (GLfloat
*) n
[10].data
));
8085 case OPCODE_MAPGRID1
:
8086 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8088 case OPCODE_MAPGRID2
:
8089 CALL_MapGrid2f(ctx
->Exec
,
8090 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8092 case OPCODE_MATRIX_MODE
:
8093 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8095 case OPCODE_MIN_MAX
:
8096 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
8098 case OPCODE_MULT_MATRIX
:
8099 if (sizeof(Node
) == sizeof(GLfloat
)) {
8100 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8105 for (i
= 0; i
< 16; i
++) {
8108 CALL_MultMatrixf(ctx
->Exec
, (m
));
8112 CALL_Ortho(ctx
->Exec
,
8113 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8115 case OPCODE_PASSTHROUGH
:
8116 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8118 case OPCODE_PIXEL_MAP
:
8119 CALL_PixelMapfv(ctx
->Exec
,
8120 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
8122 case OPCODE_PIXEL_TRANSFER
:
8123 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8125 case OPCODE_PIXEL_ZOOM
:
8126 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8128 case OPCODE_POINT_SIZE
:
8129 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8131 case OPCODE_POINT_PARAMETERS
:
8137 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
8140 case OPCODE_POLYGON_MODE
:
8141 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8143 case OPCODE_POLYGON_STIPPLE
:
8145 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8146 ctx
->Unpack
= ctx
->DefaultPacking
;
8147 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
8148 ctx
->Unpack
= save
; /* restore */
8151 case OPCODE_POLYGON_OFFSET
:
8152 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8154 case OPCODE_POP_ATTRIB
:
8155 CALL_PopAttrib(ctx
->Exec
, ());
8157 case OPCODE_POP_MATRIX
:
8158 CALL_PopMatrix(ctx
->Exec
, ());
8160 case OPCODE_POP_NAME
:
8161 CALL_PopName(ctx
->Exec
, ());
8163 case OPCODE_PRIORITIZE_TEXTURE
:
8164 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8166 case OPCODE_PUSH_ATTRIB
:
8167 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8169 case OPCODE_PUSH_MATRIX
:
8170 CALL_PushMatrix(ctx
->Exec
, ());
8172 case OPCODE_PUSH_NAME
:
8173 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8175 case OPCODE_RASTER_POS
:
8176 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8178 case OPCODE_READ_BUFFER
:
8179 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8181 case OPCODE_RESET_HISTOGRAM
:
8182 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
8184 case OPCODE_RESET_MIN_MAX
:
8185 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
8188 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8191 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8193 case OPCODE_SCISSOR
:
8194 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8196 case OPCODE_SHADE_MODEL
:
8197 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8199 case OPCODE_PROVOKING_VERTEX
:
8200 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8202 case OPCODE_STENCIL_FUNC
:
8203 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8205 case OPCODE_STENCIL_MASK
:
8206 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8208 case OPCODE_STENCIL_OP
:
8209 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8211 case OPCODE_STENCIL_FUNC_SEPARATE
:
8212 CALL_StencilFuncSeparate(ctx
->Exec
,
8213 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8215 case OPCODE_STENCIL_MASK_SEPARATE
:
8216 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8218 case OPCODE_STENCIL_OP_SEPARATE
:
8219 CALL_StencilOpSeparate(ctx
->Exec
,
8220 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8229 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8239 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8242 case OPCODE_TEXPARAMETER
:
8249 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8252 case OPCODE_TEX_IMAGE1D
:
8254 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8255 ctx
->Unpack
= ctx
->DefaultPacking
;
8256 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8258 n
[3].i
, /* components */
8260 n
[5].e
, /* border */
8261 n
[6].e
, /* format */
8264 ctx
->Unpack
= save
; /* restore */
8267 case OPCODE_TEX_IMAGE2D
:
8269 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8270 ctx
->Unpack
= ctx
->DefaultPacking
;
8271 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8273 n
[3].i
, /* components */
8275 n
[5].i
, /* height */
8276 n
[6].e
, /* border */
8277 n
[7].e
, /* format */
8280 ctx
->Unpack
= save
; /* restore */
8283 case OPCODE_TEX_IMAGE3D
:
8285 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8286 ctx
->Unpack
= ctx
->DefaultPacking
;
8287 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8289 n
[3].i
, /* components */
8291 n
[5].i
, /* height */
8293 n
[7].e
, /* border */
8294 n
[8].e
, /* format */
8297 ctx
->Unpack
= save
; /* restore */
8300 case OPCODE_TEX_SUB_IMAGE1D
:
8302 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8303 ctx
->Unpack
= ctx
->DefaultPacking
;
8304 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8306 n
[6].e
, n
[7].data
));
8307 ctx
->Unpack
= save
; /* restore */
8310 case OPCODE_TEX_SUB_IMAGE2D
:
8312 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8313 ctx
->Unpack
= ctx
->DefaultPacking
;
8314 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8316 n
[6].i
, n
[7].e
, n
[8].e
,
8318 ctx
->Unpack
= save
; /* restore */
8321 case OPCODE_TEX_SUB_IMAGE3D
:
8323 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8324 ctx
->Unpack
= ctx
->DefaultPacking
;
8325 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8326 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8327 n
[8].i
, n
[9].e
, n
[10].e
,
8329 ctx
->Unpack
= save
; /* restore */
8332 case OPCODE_TRANSLATE
:
8333 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8335 case OPCODE_VIEWPORT
:
8336 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8337 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8339 case OPCODE_WINDOW_POS
:
8340 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8342 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8343 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8345 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8346 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8347 n
[4].i
, n
[5].i
, n
[6].i
,
8350 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8351 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8352 n
[4].i
, n
[5].i
, n
[6].i
,
8353 n
[7].i
, n
[8].data
));
8355 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8356 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8357 n
[4].i
, n
[5].i
, n
[6].i
,
8361 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8362 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8363 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8364 n
[5].e
, n
[6].i
, n
[7].data
));
8366 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8367 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8368 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8369 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8372 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8373 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8374 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8375 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8376 n
[9].e
, n
[10].i
, n
[11].data
));
8378 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8379 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8381 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8382 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8384 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8385 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8387 case OPCODE_EXECUTE_PROGRAM_NV
:
8394 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8397 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8398 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8399 (GLuint
*) n
[2].data
));
8401 case OPCODE_LOAD_PROGRAM_NV
:
8402 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8403 (const GLubyte
*) n
[4].data
));
8405 case OPCODE_TRACK_MATRIX_NV
:
8406 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
8408 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8409 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8410 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8413 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8414 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8415 (const GLubyte
*) n
[3].
8416 data
, n
[4].f
, n
[5].f
,
8419 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8420 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8422 case OPCODE_DEPTH_BOUNDS_EXT
:
8423 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8425 case OPCODE_PROGRAM_STRING_ARB
:
8426 CALL_ProgramStringARB(ctx
->Exec
,
8427 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8429 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8430 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8434 case OPCODE_BEGIN_QUERY_ARB
:
8435 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8437 case OPCODE_END_QUERY_ARB
:
8438 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8440 case OPCODE_QUERY_COUNTER
:
8441 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8443 case OPCODE_BEGIN_QUERY_INDEXED
:
8444 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8446 case OPCODE_END_QUERY_INDEXED
:
8447 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8449 case OPCODE_DRAW_BUFFERS_ARB
:
8451 GLenum buffers
[MAX_DRAW_BUFFERS
];
8452 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8453 for (i
= 0; i
< count
; i
++)
8454 buffers
[i
] = n
[2 + i
].e
;
8455 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8458 #if FEATURE_EXT_framebuffer_blit
8459 case OPCODE_BLIT_FRAMEBUFFER
:
8460 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8461 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8466 case OPCODE_USE_PROGRAM
:
8467 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8469 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8470 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8472 case OPCODE_ACTIVE_PROGRAM_EXT
:
8473 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8475 case OPCODE_UNIFORM_1F
:
8476 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8478 case OPCODE_UNIFORM_2F
:
8479 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8481 case OPCODE_UNIFORM_3F
:
8482 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8484 case OPCODE_UNIFORM_4F
:
8485 CALL_Uniform4fARB(ctx
->Exec
,
8486 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8488 case OPCODE_UNIFORM_1FV
:
8489 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8491 case OPCODE_UNIFORM_2FV
:
8492 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8494 case OPCODE_UNIFORM_3FV
:
8495 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8497 case OPCODE_UNIFORM_4FV
:
8498 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8500 case OPCODE_UNIFORM_1I
:
8501 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8503 case OPCODE_UNIFORM_2I
:
8504 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8506 case OPCODE_UNIFORM_3I
:
8507 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8509 case OPCODE_UNIFORM_4I
:
8510 CALL_Uniform4iARB(ctx
->Exec
,
8511 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8513 case OPCODE_UNIFORM_1IV
:
8514 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8516 case OPCODE_UNIFORM_2IV
:
8517 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8519 case OPCODE_UNIFORM_3IV
:
8520 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8522 case OPCODE_UNIFORM_4IV
:
8523 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8525 case OPCODE_UNIFORM_1UI
:
8526 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8528 case OPCODE_UNIFORM_2UI
:
8529 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8531 case OPCODE_UNIFORM_3UI
:
8532 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8534 case OPCODE_UNIFORM_4UI
:
8535 /*CALL_Uniform4uiARB(ctx->Exec,
8536 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8539 case OPCODE_UNIFORM_1UIV
:
8540 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8542 case OPCODE_UNIFORM_2UIV
:
8543 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8545 case OPCODE_UNIFORM_3UIV
:
8546 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8548 case OPCODE_UNIFORM_4UIV
:
8549 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8551 case OPCODE_UNIFORM_MATRIX22
:
8552 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8553 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8555 case OPCODE_UNIFORM_MATRIX33
:
8556 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8557 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8559 case OPCODE_UNIFORM_MATRIX44
:
8560 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8561 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8563 case OPCODE_UNIFORM_MATRIX23
:
8564 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8565 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8567 case OPCODE_UNIFORM_MATRIX32
:
8568 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8569 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8571 case OPCODE_UNIFORM_MATRIX24
:
8572 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8573 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8575 case OPCODE_UNIFORM_MATRIX42
:
8576 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8577 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8579 case OPCODE_UNIFORM_MATRIX34
:
8580 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8581 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8583 case OPCODE_UNIFORM_MATRIX43
:
8584 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8585 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8588 case OPCODE_CLAMP_COLOR
:
8589 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8592 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8595 GLuint i
, pname
= n
[1].ui
;
8597 for (i
= 0; i
< 4; i
++)
8598 values
[i
] = n
[1 + i
].f
;
8599 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8602 #if FEATURE_ATI_fragment_shader
8603 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8604 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8606 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8609 GLuint i
, dst
= n
[1].ui
;
8611 for (i
= 0; i
< 4; i
++)
8612 values
[i
] = n
[1 + i
].f
;
8613 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8617 case OPCODE_ATTR_1F_NV
:
8618 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8620 case OPCODE_ATTR_2F_NV
:
8621 /* Really shouldn't have to do this - the Node structure
8622 * is convenient, but it would be better to store the data
8623 * packed appropriately so that it can be sent directly
8624 * on. With x86_64 becoming common, this will start to
8627 if (sizeof(Node
) == sizeof(GLfloat
))
8628 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8630 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8632 case OPCODE_ATTR_3F_NV
:
8633 if (sizeof(Node
) == sizeof(GLfloat
))
8634 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8636 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8639 case OPCODE_ATTR_4F_NV
:
8640 if (sizeof(Node
) == sizeof(GLfloat
))
8641 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8643 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8646 case OPCODE_ATTR_1F_ARB
:
8647 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8649 case OPCODE_ATTR_2F_ARB
:
8650 /* Really shouldn't have to do this - the Node structure
8651 * is convenient, but it would be better to store the data
8652 * packed appropriately so that it can be sent directly
8653 * on. With x86_64 becoming common, this will start to
8656 if (sizeof(Node
) == sizeof(GLfloat
))
8657 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8659 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8661 case OPCODE_ATTR_3F_ARB
:
8662 if (sizeof(Node
) == sizeof(GLfloat
))
8663 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8665 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8668 case OPCODE_ATTR_4F_ARB
:
8669 if (sizeof(Node
) == sizeof(GLfloat
))
8670 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8672 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8675 case OPCODE_MATERIAL
:
8676 if (sizeof(Node
) == sizeof(GLfloat
))
8677 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8684 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8688 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8691 CALL_End(ctx
->Exec
, ());
8694 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8696 case OPCODE_EVAL_C1
:
8697 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8699 case OPCODE_EVAL_C2
:
8700 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8702 case OPCODE_EVAL_P1
:
8703 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8705 case OPCODE_EVAL_P2
:
8706 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8709 /* GL_EXT_texture_integer */
8710 case OPCODE_CLEARCOLOR_I
:
8711 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8713 case OPCODE_CLEARCOLOR_UI
:
8714 CALL_ClearColorIuiEXT(ctx
->Exec
,
8715 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8717 case OPCODE_TEXPARAMETER_I
:
8724 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8727 case OPCODE_TEXPARAMETER_UI
:
8730 params
[0] = n
[3].ui
;
8731 params
[1] = n
[4].ui
;
8732 params
[2] = n
[5].ui
;
8733 params
[3] = n
[6].ui
;
8734 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8738 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8739 /* GL_ARB_instanced_arrays */
8740 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8743 case OPCODE_TEXTURE_BARRIER_NV
:
8744 CALL_TextureBarrierNV(ctx
->Exec
, ());
8747 /* GL_EXT/ARB_transform_feedback */
8748 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8749 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8751 case OPCODE_END_TRANSFORM_FEEDBACK
:
8752 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8754 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8755 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8757 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8758 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8760 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8761 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8763 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8764 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8766 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8767 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8768 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8770 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8771 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8772 (n
[1].e
, n
[2].ui
, n
[3].si
));
8774 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8775 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8776 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8780 case OPCODE_BIND_SAMPLER
:
8781 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8783 case OPCODE_SAMPLER_PARAMETERIV
:
8790 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8793 case OPCODE_SAMPLER_PARAMETERFV
:
8800 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8803 case OPCODE_SAMPLER_PARAMETERIIV
:
8810 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8813 case OPCODE_SAMPLER_PARAMETERUIV
:
8816 params
[0] = n
[3].ui
;
8817 params
[1] = n
[4].ui
;
8818 params
[2] = n
[5].ui
;
8819 params
[3] = n
[6].ui
;
8820 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8824 /* GL_ARB_geometry_shader4 */
8825 case OPCODE_PROGRAM_PARAMETERI
:
8826 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8828 case OPCODE_FRAMEBUFFER_TEXTURE
:
8829 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8832 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8833 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8834 n
[3].ui
, n
[4].i
, n
[5].e
));
8838 case OPCODE_WAIT_SYNC
:
8840 union uint64_pair p
;
8841 p
.uint32
[0] = n
[3].ui
;
8842 p
.uint32
[1] = n
[4].ui
;
8843 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8847 /* GL_NV_conditional_render */
8848 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8849 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8851 case OPCODE_END_CONDITIONAL_RENDER
:
8852 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8855 case OPCODE_UNIFORM_BLOCK_BINDING
:
8856 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8859 case OPCODE_CONTINUE
:
8860 n
= (Node
*) n
[1].next
;
8862 case OPCODE_END_OF_LIST
:
8868 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8870 _mesa_problem(ctx
, "%s", msg
);
8875 /* increment n to point to next compiled command */
8876 if (opcode
!= OPCODE_CONTINUE
) {
8877 n
+= InstSize
[opcode
];
8882 if (ctx
->Driver
.EndCallList
)
8883 ctx
->Driver
.EndCallList(ctx
);
8885 ctx
->ListState
.CallDepth
--;
8890 /**********************************************************************/
8892 /**********************************************************************/
8895 * Test if a display list number is valid.
8897 static GLboolean GLAPIENTRY
8898 _mesa_IsList(GLuint list
)
8900 GET_CURRENT_CONTEXT(ctx
);
8901 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8902 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8903 return islist(ctx
, list
);
8908 * Delete a sequence of consecutive display lists.
8910 static void GLAPIENTRY
8911 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8913 GET_CURRENT_CONTEXT(ctx
);
8915 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8916 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8919 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8922 for (i
= list
; i
< list
+ range
; i
++) {
8923 destroy_list(ctx
, i
);
8929 * Return a display list number, n, such that lists n through n+range-1
8932 static GLuint GLAPIENTRY
8933 _mesa_GenLists(GLsizei range
)
8935 GET_CURRENT_CONTEXT(ctx
);
8937 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8938 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8941 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8949 * Make this an atomic operation
8951 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8953 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8955 /* reserve the list IDs by with empty/dummy lists */
8957 for (i
= 0; i
< range
; i
++) {
8958 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8959 make_list(base
+ i
, 1));
8963 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8970 * Begin a new display list.
8972 static void GLAPIENTRY
8973 _mesa_NewList(GLuint name
, GLenum mode
)
8975 GET_CURRENT_CONTEXT(ctx
);
8977 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8978 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8980 if (MESA_VERBOSE
& VERBOSE_API
)
8981 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8982 _mesa_lookup_enum_by_nr(mode
));
8985 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8989 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8990 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8994 if (ctx
->ListState
.CurrentList
) {
8995 /* already compiling a display list */
8996 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
9000 ctx
->CompileFlag
= GL_TRUE
;
9001 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
9003 /* Reset acumulated list state:
9005 invalidate_saved_current_state( ctx
);
9007 /* Allocate new display list */
9008 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
9009 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
9010 ctx
->ListState
.CurrentPos
= 0;
9012 ctx
->Driver
.NewList(ctx
, name
, mode
);
9014 ctx
->CurrentDispatch
= ctx
->Save
;
9015 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9020 * End definition of current display list.
9022 static void GLAPIENTRY
9025 GET_CURRENT_CONTEXT(ctx
);
9026 SAVE_FLUSH_VERTICES(ctx
);
9027 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
9029 if (MESA_VERBOSE
& VERBOSE_API
)
9030 _mesa_debug(ctx
, "glEndList\n");
9032 /* Check that a list is under construction */
9033 if (!ctx
->ListState
.CurrentList
) {
9034 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
9038 /* Call before emitting END_OF_LIST, in case the driver wants to
9039 * emit opcodes itself.
9041 ctx
->Driver
.EndList(ctx
);
9043 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
9045 /* Destroy old list, if any */
9046 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
9048 /* Install the new list */
9049 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
9050 ctx
->ListState
.CurrentList
->Name
,
9051 ctx
->ListState
.CurrentList
);
9054 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
9055 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
9057 ctx
->ListState
.CurrentList
= NULL
;
9058 ctx
->ExecuteFlag
= GL_TRUE
;
9059 ctx
->CompileFlag
= GL_FALSE
;
9061 ctx
->CurrentDispatch
= ctx
->Exec
;
9062 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9067 _mesa_CallList(GLuint list
)
9069 GLboolean save_compile_flag
;
9070 GET_CURRENT_CONTEXT(ctx
);
9071 FLUSH_CURRENT(ctx
, 0);
9073 if (MESA_VERBOSE
& VERBOSE_API
)
9074 _mesa_debug(ctx
, "glCallList %d\n", list
);
9077 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
9082 mesa_print_display_list( list
);
9084 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
9085 * execute the display list, and restore the CompileFlag.
9087 save_compile_flag
= ctx
->CompileFlag
;
9088 if (save_compile_flag
) {
9089 ctx
->CompileFlag
= GL_FALSE
;
9092 execute_list(ctx
, list
);
9093 ctx
->CompileFlag
= save_compile_flag
;
9095 /* also restore API function pointers to point to "save" versions */
9096 if (save_compile_flag
) {
9097 ctx
->CurrentDispatch
= ctx
->Save
;
9098 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9104 * Execute glCallLists: call multiple display lists.
9107 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9109 GET_CURRENT_CONTEXT(ctx
);
9111 GLboolean save_compile_flag
;
9113 if (MESA_VERBOSE
& VERBOSE_API
)
9114 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9118 case GL_UNSIGNED_BYTE
:
9120 case GL_UNSIGNED_SHORT
:
9122 case GL_UNSIGNED_INT
:
9130 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9134 /* Save the CompileFlag status, turn it off, execute display list,
9135 * and restore the CompileFlag.
9137 save_compile_flag
= ctx
->CompileFlag
;
9138 ctx
->CompileFlag
= GL_FALSE
;
9140 for (i
= 0; i
< n
; i
++) {
9141 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9142 execute_list(ctx
, list
);
9145 ctx
->CompileFlag
= save_compile_flag
;
9147 /* also restore API function pointers to point to "save" versions */
9148 if (save_compile_flag
) {
9149 ctx
->CurrentDispatch
= ctx
->Save
;
9150 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9156 * Set the offset added to list numbers in glCallLists.
9158 static void GLAPIENTRY
9159 _mesa_ListBase(GLuint base
)
9161 GET_CURRENT_CONTEXT(ctx
);
9162 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9163 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9164 ctx
->List
.ListBase
= base
;
9168 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
9170 static void GLAPIENTRY
9173 GET_CURRENT_CONTEXT(ctx
);
9174 FLUSH_VERTICES(ctx
, 0);
9175 CALL_Finish(ctx
->Exec
, ());
9178 static void GLAPIENTRY
9181 GET_CURRENT_CONTEXT(ctx
);
9182 FLUSH_VERTICES(ctx
, 0);
9183 CALL_Flush(ctx
->Exec
, ());
9186 static void GLAPIENTRY
9187 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
9189 GET_CURRENT_CONTEXT(ctx
);
9190 FLUSH_VERTICES(ctx
, 0);
9191 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
9194 static void GLAPIENTRY
9195 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
9197 GET_CURRENT_CONTEXT(ctx
);
9198 FLUSH_VERTICES(ctx
, 0);
9199 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
9202 static void GLAPIENTRY
9203 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
9205 GET_CURRENT_CONTEXT(ctx
);
9206 FLUSH_VERTICES(ctx
, 0);
9207 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
9210 static GLenum GLAPIENTRY
9213 GET_CURRENT_CONTEXT(ctx
);
9214 FLUSH_VERTICES(ctx
, 0);
9215 return CALL_GetError(ctx
->Exec
, ());
9218 static void GLAPIENTRY
9219 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9221 GET_CURRENT_CONTEXT(ctx
);
9222 FLUSH_VERTICES(ctx
, 0);
9223 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9226 static void GLAPIENTRY
9227 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9229 GET_CURRENT_CONTEXT(ctx
);
9230 FLUSH_VERTICES(ctx
, 0);
9231 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9234 static void GLAPIENTRY
9235 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9237 GET_CURRENT_CONTEXT(ctx
);
9238 FLUSH_VERTICES(ctx
, 0);
9239 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9242 static void GLAPIENTRY
9243 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9245 GET_CURRENT_CONTEXT(ctx
);
9246 FLUSH_VERTICES(ctx
, 0);
9247 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9250 static void GLAPIENTRY
9251 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9253 GET_CURRENT_CONTEXT(ctx
);
9254 FLUSH_VERTICES(ctx
, 0);
9255 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9258 static void GLAPIENTRY
9259 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9261 GET_CURRENT_CONTEXT(ctx
);
9262 FLUSH_VERTICES(ctx
, 0);
9263 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9266 static void GLAPIENTRY
9267 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9269 GET_CURRENT_CONTEXT(ctx
);
9270 FLUSH_VERTICES(ctx
, 0);
9271 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9274 static void GLAPIENTRY
9275 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9277 GET_CURRENT_CONTEXT(ctx
);
9278 FLUSH_VERTICES(ctx
, 0);
9279 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9282 static void GLAPIENTRY
9283 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9285 GET_CURRENT_CONTEXT(ctx
);
9286 FLUSH_VERTICES(ctx
, 0);
9287 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9290 static void GLAPIENTRY
9291 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9293 GET_CURRENT_CONTEXT(ctx
);
9294 FLUSH_VERTICES(ctx
, 0);
9295 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9298 static void GLAPIENTRY
9299 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9301 GET_CURRENT_CONTEXT(ctx
);
9302 FLUSH_VERTICES(ctx
, 0);
9303 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9306 static void GLAPIENTRY
9307 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9309 GET_CURRENT_CONTEXT(ctx
);
9310 FLUSH_VERTICES(ctx
, 0);
9311 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9314 static void GLAPIENTRY
9315 exec_GetPolygonStipple(GLubyte
* dest
)
9317 GET_CURRENT_CONTEXT(ctx
);
9318 FLUSH_VERTICES(ctx
, 0);
9319 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9322 static const GLubyte
*GLAPIENTRY
9323 exec_GetString(GLenum name
)
9325 GET_CURRENT_CONTEXT(ctx
);
9326 FLUSH_VERTICES(ctx
, 0);
9327 return CALL_GetString(ctx
->Exec
, (name
));
9330 static void GLAPIENTRY
9331 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9333 GET_CURRENT_CONTEXT(ctx
);
9334 FLUSH_VERTICES(ctx
, 0);
9335 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9338 static void GLAPIENTRY
9339 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9341 GET_CURRENT_CONTEXT(ctx
);
9342 FLUSH_VERTICES(ctx
, 0);
9343 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9346 static void GLAPIENTRY
9347 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9349 GET_CURRENT_CONTEXT(ctx
);
9350 FLUSH_VERTICES(ctx
, 0);
9351 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9354 static void GLAPIENTRY
9355 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9357 GET_CURRENT_CONTEXT(ctx
);
9358 FLUSH_VERTICES(ctx
, 0);
9359 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9362 static void GLAPIENTRY
9363 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9365 GET_CURRENT_CONTEXT(ctx
);
9366 FLUSH_VERTICES(ctx
, 0);
9367 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9370 static void GLAPIENTRY
9371 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9372 GLenum type
, GLvoid
* pixels
)
9374 GET_CURRENT_CONTEXT(ctx
);
9375 FLUSH_VERTICES(ctx
, 0);
9376 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9379 static void GLAPIENTRY
9380 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9381 GLenum pname
, GLfloat
*params
)
9383 GET_CURRENT_CONTEXT(ctx
);
9384 FLUSH_VERTICES(ctx
, 0);
9385 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9388 static void GLAPIENTRY
9389 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9390 GLenum pname
, GLint
*params
)
9392 GET_CURRENT_CONTEXT(ctx
);
9393 FLUSH_VERTICES(ctx
, 0);
9394 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9397 static void GLAPIENTRY
9398 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9400 GET_CURRENT_CONTEXT(ctx
);
9401 FLUSH_VERTICES(ctx
, 0);
9402 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9405 static void GLAPIENTRY
9406 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9408 GET_CURRENT_CONTEXT(ctx
);
9409 FLUSH_VERTICES(ctx
, 0);
9410 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9413 static GLboolean GLAPIENTRY
9414 exec_IsEnabled(GLenum cap
)
9416 GET_CURRENT_CONTEXT(ctx
);
9417 FLUSH_VERTICES(ctx
, 0);
9418 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9421 static void GLAPIENTRY
9422 exec_PixelStoref(GLenum pname
, GLfloat param
)
9424 GET_CURRENT_CONTEXT(ctx
);
9425 FLUSH_VERTICES(ctx
, 0);
9426 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9429 static void GLAPIENTRY
9430 exec_PixelStorei(GLenum pname
, GLint param
)
9432 GET_CURRENT_CONTEXT(ctx
);
9433 FLUSH_VERTICES(ctx
, 0);
9434 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9437 static void GLAPIENTRY
9438 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9439 GLenum format
, GLenum type
, GLvoid
* pixels
)
9441 GET_CURRENT_CONTEXT(ctx
);
9442 FLUSH_VERTICES(ctx
, 0);
9443 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9446 static GLint GLAPIENTRY
9447 exec_RenderMode(GLenum mode
)
9449 GET_CURRENT_CONTEXT(ctx
);
9450 FLUSH_VERTICES(ctx
, 0);
9451 return CALL_RenderMode(ctx
->Exec
, (mode
));
9454 static void GLAPIENTRY
9455 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9457 GET_CURRENT_CONTEXT(ctx
);
9458 FLUSH_VERTICES(ctx
, 0);
9459 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9462 static void GLAPIENTRY
9463 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9465 GET_CURRENT_CONTEXT(ctx
);
9466 FLUSH_VERTICES(ctx
, 0);
9467 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9470 static GLboolean GLAPIENTRY
9471 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9472 GLboolean
* residences
)
9474 GET_CURRENT_CONTEXT(ctx
);
9475 FLUSH_VERTICES(ctx
, 0);
9476 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9479 static void GLAPIENTRY
9480 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9482 GET_CURRENT_CONTEXT(ctx
);
9483 FLUSH_VERTICES(ctx
, 0);
9484 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9487 static void GLAPIENTRY
9488 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9490 GET_CURRENT_CONTEXT(ctx
);
9491 FLUSH_VERTICES(ctx
, 0);
9492 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9495 static void GLAPIENTRY
9496 exec_DisableClientState(GLenum cap
)
9498 GET_CURRENT_CONTEXT(ctx
);
9499 FLUSH_VERTICES(ctx
, 0);
9500 CALL_DisableClientState(ctx
->Exec
, (cap
));
9503 static void GLAPIENTRY
9504 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9506 GET_CURRENT_CONTEXT(ctx
);
9507 FLUSH_VERTICES(ctx
, 0);
9508 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9511 static void GLAPIENTRY
9512 exec_EnableClientState(GLenum cap
)
9514 GET_CURRENT_CONTEXT(ctx
);
9515 FLUSH_VERTICES(ctx
, 0);
9516 CALL_EnableClientState(ctx
->Exec
, (cap
));
9519 static void GLAPIENTRY
9520 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9522 GET_CURRENT_CONTEXT(ctx
);
9523 FLUSH_VERTICES(ctx
, 0);
9524 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9527 static void GLAPIENTRY
9528 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9530 GET_CURRENT_CONTEXT(ctx
);
9531 FLUSH_VERTICES(ctx
, 0);
9532 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9535 static void GLAPIENTRY
9536 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9538 GET_CURRENT_CONTEXT(ctx
);
9539 FLUSH_VERTICES(ctx
, 0);
9540 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9543 static void GLAPIENTRY
9544 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9546 GET_CURRENT_CONTEXT(ctx
);
9547 FLUSH_VERTICES(ctx
, 0);
9548 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9551 static GLboolean GLAPIENTRY
9552 exec_IsTexture(GLuint texture
)
9554 GET_CURRENT_CONTEXT(ctx
);
9555 FLUSH_VERTICES(ctx
, 0);
9556 return CALL_IsTexture(ctx
->Exec
, (texture
));
9559 static void GLAPIENTRY
9560 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9562 GET_CURRENT_CONTEXT(ctx
);
9563 FLUSH_VERTICES(ctx
, 0);
9564 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9567 static void GLAPIENTRY
9568 exec_PopClientAttrib(void)
9570 GET_CURRENT_CONTEXT(ctx
);
9571 FLUSH_VERTICES(ctx
, 0);
9572 CALL_PopClientAttrib(ctx
->Exec
, ());
9575 static void GLAPIENTRY
9576 exec_PushClientAttrib(GLbitfield mask
)
9578 GET_CURRENT_CONTEXT(ctx
);
9579 FLUSH_VERTICES(ctx
, 0);
9580 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9583 static void GLAPIENTRY
9584 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9587 GET_CURRENT_CONTEXT(ctx
);
9588 FLUSH_VERTICES(ctx
, 0);
9589 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9592 static void GLAPIENTRY
9593 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9595 GET_CURRENT_CONTEXT(ctx
);
9596 FLUSH_VERTICES(ctx
, 0);
9597 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9600 static void GLAPIENTRY
9601 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9604 GET_CURRENT_CONTEXT(ctx
);
9605 FLUSH_VERTICES(ctx
, 0);
9606 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9609 static void GLAPIENTRY
9610 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9611 GLint x
, GLint y
, GLsizei width
)
9613 GET_CURRENT_CONTEXT(ctx
);
9614 FLUSH_VERTICES(ctx
, 0);
9615 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9616 (target
, internalFormat
, x
, y
, width
));
9619 static void GLAPIENTRY
9620 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9621 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9623 GET_CURRENT_CONTEXT(ctx
);
9624 FLUSH_VERTICES(ctx
, 0);
9625 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9626 (target
, internalFormat
, x
, y
, width
,
9630 static void GLAPIENTRY
9631 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9633 GET_CURRENT_CONTEXT(ctx
);
9634 FLUSH_VERTICES(ctx
, 0);
9635 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9638 static void GLAPIENTRY
9639 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9641 GET_CURRENT_CONTEXT(ctx
);
9642 FLUSH_VERTICES(ctx
, 0);
9643 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9646 static void GLAPIENTRY
9647 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9649 GET_CURRENT_CONTEXT(ctx
);
9650 FLUSH_VERTICES(ctx
, 0);
9651 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9654 static void GLAPIENTRY
9655 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9658 GET_CURRENT_CONTEXT(ctx
);
9659 FLUSH_VERTICES(ctx
, 0);
9660 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9663 static void GLAPIENTRY
9664 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9666 GET_CURRENT_CONTEXT(ctx
);
9667 FLUSH_VERTICES(ctx
, 0);
9668 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9671 static void GLAPIENTRY
9672 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9674 GET_CURRENT_CONTEXT(ctx
);
9675 FLUSH_VERTICES(ctx
, 0);
9676 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9679 static void GLAPIENTRY
9680 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9681 GLenum type
, GLvoid
*values
)
9683 GET_CURRENT_CONTEXT(ctx
);
9684 FLUSH_VERTICES(ctx
, 0);
9685 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9688 static void GLAPIENTRY
9689 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9691 GET_CURRENT_CONTEXT(ctx
);
9692 FLUSH_VERTICES(ctx
, 0);
9693 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9696 static void GLAPIENTRY
9697 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9699 GET_CURRENT_CONTEXT(ctx
);
9700 FLUSH_VERTICES(ctx
, 0);
9701 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9704 static void GLAPIENTRY
9705 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9706 GLenum type
, GLvoid
*values
)
9708 GET_CURRENT_CONTEXT(ctx
);
9709 FLUSH_VERTICES(ctx
, 0);
9710 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9713 static void GLAPIENTRY
9714 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9716 GET_CURRENT_CONTEXT(ctx
);
9717 FLUSH_VERTICES(ctx
, 0);
9718 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9721 static void GLAPIENTRY
9722 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9724 GET_CURRENT_CONTEXT(ctx
);
9725 FLUSH_VERTICES(ctx
, 0);
9726 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9729 static void GLAPIENTRY
9730 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9731 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9733 GET_CURRENT_CONTEXT(ctx
);
9734 FLUSH_VERTICES(ctx
, 0);
9735 CALL_GetSeparableFilter(ctx
->Exec
,
9736 (target
, format
, type
, row
, column
, span
));
9739 static void GLAPIENTRY
9740 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9741 GLsizei width
, GLsizei height
, GLenum format
,
9742 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9744 GET_CURRENT_CONTEXT(ctx
);
9745 FLUSH_VERTICES(ctx
, 0);
9746 CALL_SeparableFilter2D(ctx
->Exec
,
9747 (target
, internalFormat
, width
, height
, format
,
9748 type
, row
, column
));
9751 static void GLAPIENTRY
9752 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9753 GLsizei count
, const GLvoid
*ptr
)
9755 GET_CURRENT_CONTEXT(ctx
);
9756 FLUSH_VERTICES(ctx
, 0);
9757 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9760 static void GLAPIENTRY
9761 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9763 GET_CURRENT_CONTEXT(ctx
);
9764 FLUSH_VERTICES(ctx
, 0);
9765 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9768 static void GLAPIENTRY
9769 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9772 GET_CURRENT_CONTEXT(ctx
);
9773 FLUSH_VERTICES(ctx
, 0);
9774 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9777 static void GLAPIENTRY
9778 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9781 GET_CURRENT_CONTEXT(ctx
);
9782 FLUSH_VERTICES(ctx
, 0);
9783 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9786 static void GLAPIENTRY
9787 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9788 GLsizei count
, const GLvoid
*ptr
)
9790 GET_CURRENT_CONTEXT(ctx
);
9791 FLUSH_VERTICES(ctx
, 0);
9792 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9795 static void GLAPIENTRY
9796 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9797 GLsizei count
, const GLvoid
*ptr
)
9799 GET_CURRENT_CONTEXT(ctx
);
9800 FLUSH_VERTICES(ctx
, 0);
9801 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9804 static void GLAPIENTRY
9805 exec_LockArraysEXT(GLint first
, GLsizei count
)
9807 GET_CURRENT_CONTEXT(ctx
);
9808 FLUSH_VERTICES(ctx
, 0);
9809 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9812 static void GLAPIENTRY
9813 exec_UnlockArraysEXT(void)
9815 GET_CURRENT_CONTEXT(ctx
);
9816 FLUSH_VERTICES(ctx
, 0);
9817 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9820 static void GLAPIENTRY
9821 exec_ClientActiveTextureARB(GLenum target
)
9823 GET_CURRENT_CONTEXT(ctx
);
9824 FLUSH_VERTICES(ctx
, 0);
9825 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9828 static void GLAPIENTRY
9829 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9830 GLsizei stride
, const GLvoid
*ptr
)
9832 GET_CURRENT_CONTEXT(ctx
);
9833 FLUSH_VERTICES(ctx
, 0);
9834 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9837 static void GLAPIENTRY
9838 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9840 GET_CURRENT_CONTEXT(ctx
);
9841 FLUSH_VERTICES(ctx
, 0);
9842 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9845 /* GL_EXT_multi_draw_arrays */
9846 static void GLAPIENTRY
9847 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9848 const GLsizei
*count
, GLsizei primcount
)
9850 GET_CURRENT_CONTEXT(ctx
);
9851 FLUSH_VERTICES(ctx
, 0);
9852 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9855 /* GL_IBM_multimode_draw_arrays */
9856 static void GLAPIENTRY
9857 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9858 const GLsizei
* count
, GLsizei primcount
,
9861 GET_CURRENT_CONTEXT(ctx
);
9862 FLUSH_VERTICES(ctx
, 0);
9863 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9864 (mode
, first
, count
, primcount
, modestride
));
9867 /* GL_IBM_multimode_draw_arrays */
9868 static void GLAPIENTRY
9869 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9870 const GLsizei
* count
,
9872 const GLvoid
* const *indices
,
9873 GLsizei primcount
, GLint modestride
)
9875 GET_CURRENT_CONTEXT(ctx
);
9876 FLUSH_VERTICES(ctx
, 0);
9877 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9878 (mode
, count
, type
, indices
, primcount
,
9883 * Setup the given dispatch table to point to Mesa's display list
9884 * building functions.
9886 * This does not include any of the tnl functions - they are
9887 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9890 struct _glapi_table
*
9891 _mesa_create_save_table(void)
9893 struct _glapi_table
*table
;
9895 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9899 _mesa_loopback_init_api_table(table
);
9902 SET_Accum(table
, save_Accum
);
9903 SET_AlphaFunc(table
, save_AlphaFunc
);
9904 SET_Bitmap(table
, save_Bitmap
);
9905 SET_BlendFunc(table
, save_BlendFunc
);
9906 SET_CallList(table
, save_CallList
);
9907 SET_CallLists(table
, save_CallLists
);
9908 SET_Clear(table
, save_Clear
);
9909 SET_ClearAccum(table
, save_ClearAccum
);
9910 SET_ClearColor(table
, save_ClearColor
);
9911 SET_ClearDepth(table
, save_ClearDepth
);
9912 SET_ClearIndex(table
, save_ClearIndex
);
9913 SET_ClearStencil(table
, save_ClearStencil
);
9914 SET_ClipPlane(table
, save_ClipPlane
);
9915 SET_ColorMask(table
, save_ColorMask
);
9916 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9917 SET_ColorMaterial(table
, save_ColorMaterial
);
9918 SET_CopyPixels(table
, save_CopyPixels
);
9919 SET_CullFace(table
, save_CullFace
);
9920 SET_DeleteLists(table
, _mesa_DeleteLists
);
9921 SET_DepthFunc(table
, save_DepthFunc
);
9922 SET_DepthMask(table
, save_DepthMask
);
9923 SET_DepthRange(table
, save_DepthRange
);
9924 SET_Disable(table
, save_Disable
);
9925 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9926 SET_DrawBuffer(table
, save_DrawBuffer
);
9927 SET_DrawPixels(table
, save_DrawPixels
);
9928 SET_Enable(table
, save_Enable
);
9929 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9930 SET_EndList(table
, _mesa_EndList
);
9931 SET_EvalMesh1(table
, save_EvalMesh1
);
9932 SET_EvalMesh2(table
, save_EvalMesh2
);
9933 SET_Finish(table
, exec_Finish
);
9934 SET_Flush(table
, exec_Flush
);
9935 SET_Fogf(table
, save_Fogf
);
9936 SET_Fogfv(table
, save_Fogfv
);
9937 SET_Fogi(table
, save_Fogi
);
9938 SET_Fogiv(table
, save_Fogiv
);
9939 SET_FrontFace(table
, save_FrontFace
);
9940 SET_Frustum(table
, save_Frustum
);
9941 SET_GenLists(table
, _mesa_GenLists
);
9942 SET_GetBooleanv(table
, exec_GetBooleanv
);
9943 SET_GetClipPlane(table
, exec_GetClipPlane
);
9944 SET_GetDoublev(table
, exec_GetDoublev
);
9945 SET_GetError(table
, exec_GetError
);
9946 SET_GetFloatv(table
, exec_GetFloatv
);
9947 SET_GetIntegerv(table
, exec_GetIntegerv
);
9948 SET_GetLightfv(table
, exec_GetLightfv
);
9949 SET_GetLightiv(table
, exec_GetLightiv
);
9950 SET_GetMapdv(table
, exec_GetMapdv
);
9951 SET_GetMapfv(table
, exec_GetMapfv
);
9952 SET_GetMapiv(table
, exec_GetMapiv
);
9953 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9954 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9955 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9956 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9957 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9958 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9959 SET_GetString(table
, exec_GetString
);
9960 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9961 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9962 SET_GetTexGendv(table
, exec_GetTexGendv
);
9963 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9964 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9965 SET_GetTexImage(table
, exec_GetTexImage
);
9966 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9967 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9968 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9969 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9970 SET_Hint(table
, save_Hint
);
9971 SET_IndexMask(table
, save_IndexMask
);
9972 SET_InitNames(table
, save_InitNames
);
9973 SET_IsEnabled(table
, exec_IsEnabled
);
9974 SET_IsList(table
, _mesa_IsList
);
9975 SET_LightModelf(table
, save_LightModelf
);
9976 SET_LightModelfv(table
, save_LightModelfv
);
9977 SET_LightModeli(table
, save_LightModeli
);
9978 SET_LightModeliv(table
, save_LightModeliv
);
9979 SET_Lightf(table
, save_Lightf
);
9980 SET_Lightfv(table
, save_Lightfv
);
9981 SET_Lighti(table
, save_Lighti
);
9982 SET_Lightiv(table
, save_Lightiv
);
9983 SET_LineStipple(table
, save_LineStipple
);
9984 SET_LineWidth(table
, save_LineWidth
);
9985 SET_ListBase(table
, save_ListBase
);
9986 SET_LoadIdentity(table
, save_LoadIdentity
);
9987 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9988 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9989 SET_LoadName(table
, save_LoadName
);
9990 SET_LogicOp(table
, save_LogicOp
);
9991 SET_Map1d(table
, save_Map1d
);
9992 SET_Map1f(table
, save_Map1f
);
9993 SET_Map2d(table
, save_Map2d
);
9994 SET_Map2f(table
, save_Map2f
);
9995 SET_MapGrid1d(table
, save_MapGrid1d
);
9996 SET_MapGrid1f(table
, save_MapGrid1f
);
9997 SET_MapGrid2d(table
, save_MapGrid2d
);
9998 SET_MapGrid2f(table
, save_MapGrid2f
);
9999 SET_MatrixMode(table
, save_MatrixMode
);
10000 SET_MultMatrixd(table
, save_MultMatrixd
);
10001 SET_MultMatrixf(table
, save_MultMatrixf
);
10002 SET_NewList(table
, save_NewList
);
10003 SET_Ortho(table
, save_Ortho
);
10004 SET_PassThrough(table
, save_PassThrough
);
10005 SET_PixelMapfv(table
, save_PixelMapfv
);
10006 SET_PixelMapuiv(table
, save_PixelMapuiv
);
10007 SET_PixelMapusv(table
, save_PixelMapusv
);
10008 SET_PixelStoref(table
, exec_PixelStoref
);
10009 SET_PixelStorei(table
, exec_PixelStorei
);
10010 SET_PixelTransferf(table
, save_PixelTransferf
);
10011 SET_PixelTransferi(table
, save_PixelTransferi
);
10012 SET_PixelZoom(table
, save_PixelZoom
);
10013 SET_PointSize(table
, save_PointSize
);
10014 SET_PolygonMode(table
, save_PolygonMode
);
10015 SET_PolygonOffset(table
, save_PolygonOffset
);
10016 SET_PolygonStipple(table
, save_PolygonStipple
);
10017 SET_PopAttrib(table
, save_PopAttrib
);
10018 SET_PopMatrix(table
, save_PopMatrix
);
10019 SET_PopName(table
, save_PopName
);
10020 SET_PushAttrib(table
, save_PushAttrib
);
10021 SET_PushMatrix(table
, save_PushMatrix
);
10022 SET_PushName(table
, save_PushName
);
10023 SET_RasterPos2d(table
, save_RasterPos2d
);
10024 SET_RasterPos2dv(table
, save_RasterPos2dv
);
10025 SET_RasterPos2f(table
, save_RasterPos2f
);
10026 SET_RasterPos2fv(table
, save_RasterPos2fv
);
10027 SET_RasterPos2i(table
, save_RasterPos2i
);
10028 SET_RasterPos2iv(table
, save_RasterPos2iv
);
10029 SET_RasterPos2s(table
, save_RasterPos2s
);
10030 SET_RasterPos2sv(table
, save_RasterPos2sv
);
10031 SET_RasterPos3d(table
, save_RasterPos3d
);
10032 SET_RasterPos3dv(table
, save_RasterPos3dv
);
10033 SET_RasterPos3f(table
, save_RasterPos3f
);
10034 SET_RasterPos3fv(table
, save_RasterPos3fv
);
10035 SET_RasterPos3i(table
, save_RasterPos3i
);
10036 SET_RasterPos3iv(table
, save_RasterPos3iv
);
10037 SET_RasterPos3s(table
, save_RasterPos3s
);
10038 SET_RasterPos3sv(table
, save_RasterPos3sv
);
10039 SET_RasterPos4d(table
, save_RasterPos4d
);
10040 SET_RasterPos4dv(table
, save_RasterPos4dv
);
10041 SET_RasterPos4f(table
, save_RasterPos4f
);
10042 SET_RasterPos4fv(table
, save_RasterPos4fv
);
10043 SET_RasterPos4i(table
, save_RasterPos4i
);
10044 SET_RasterPos4iv(table
, save_RasterPos4iv
);
10045 SET_RasterPos4s(table
, save_RasterPos4s
);
10046 SET_RasterPos4sv(table
, save_RasterPos4sv
);
10047 SET_ReadBuffer(table
, save_ReadBuffer
);
10048 SET_ReadPixels(table
, exec_ReadPixels
);
10049 SET_RenderMode(table
, exec_RenderMode
);
10050 SET_Rotated(table
, save_Rotated
);
10051 SET_Rotatef(table
, save_Rotatef
);
10052 SET_Scaled(table
, save_Scaled
);
10053 SET_Scalef(table
, save_Scalef
);
10054 SET_Scissor(table
, save_Scissor
);
10055 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
10056 SET_SelectBuffer(table
, exec_SelectBuffer
);
10057 SET_ShadeModel(table
, save_ShadeModel
);
10058 SET_StencilFunc(table
, save_StencilFunc
);
10059 SET_StencilMask(table
, save_StencilMask
);
10060 SET_StencilOp(table
, save_StencilOp
);
10061 SET_TexEnvf(table
, save_TexEnvf
);
10062 SET_TexEnvfv(table
, save_TexEnvfv
);
10063 SET_TexEnvi(table
, save_TexEnvi
);
10064 SET_TexEnviv(table
, save_TexEnviv
);
10065 SET_TexGend(table
, save_TexGend
);
10066 SET_TexGendv(table
, save_TexGendv
);
10067 SET_TexGenf(table
, save_TexGenf
);
10068 SET_TexGenfv(table
, save_TexGenfv
);
10069 SET_TexGeni(table
, save_TexGeni
);
10070 SET_TexGeniv(table
, save_TexGeniv
);
10071 SET_TexImage1D(table
, save_TexImage1D
);
10072 SET_TexImage2D(table
, save_TexImage2D
);
10073 SET_TexParameterf(table
, save_TexParameterf
);
10074 SET_TexParameterfv(table
, save_TexParameterfv
);
10075 SET_TexParameteri(table
, save_TexParameteri
);
10076 SET_TexParameteriv(table
, save_TexParameteriv
);
10077 SET_Translated(table
, save_Translated
);
10078 SET_Translatef(table
, save_Translatef
);
10079 SET_Viewport(table
, save_Viewport
);
10082 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
10083 SET_BindTexture(table
, save_BindTexture
);
10084 SET_ColorPointer(table
, exec_ColorPointer
);
10085 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
10086 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
10087 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
10088 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
10089 SET_DeleteTextures(table
, exec_DeleteTextures
);
10090 SET_DisableClientState(table
, exec_DisableClientState
);
10091 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
10092 SET_EnableClientState(table
, exec_EnableClientState
);
10093 SET_GenTextures(table
, exec_GenTextures
);
10094 SET_GetPointerv(table
, exec_GetPointerv
);
10095 SET_IndexPointer(table
, exec_IndexPointer
);
10096 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
10097 SET_IsTexture(table
, exec_IsTexture
);
10098 SET_NormalPointer(table
, exec_NormalPointer
);
10099 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
10100 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
10101 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
10102 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
10103 SET_TexSubImage1D(table
, save_TexSubImage1D
);
10104 SET_TexSubImage2D(table
, save_TexSubImage2D
);
10105 SET_VertexPointer(table
, exec_VertexPointer
);
10108 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
10109 SET_TexImage3D(table
, save_TexImage3D
);
10110 SET_TexSubImage3D(table
, save_TexSubImage3D
);
10113 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
10114 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
10115 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
10117 /* ATI_separate_stencil */
10118 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
10120 /* GL_ARB_imaging */
10121 /* Not all are supported */
10122 SET_BlendColor(table
, save_BlendColor
);
10123 SET_BlendEquation(table
, save_BlendEquation
);
10124 SET_ColorSubTable(table
, save_ColorSubTable
);
10125 SET_ColorTable(table
, save_ColorTable
);
10126 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
10127 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
10128 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
10129 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
10130 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
10131 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
10132 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
10133 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
10134 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
10135 SET_CopyColorTable(table
, save_CopyColorTable
);
10136 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
10137 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
10138 SET_GetColorTable(table
, exec_GetColorTable
);
10139 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
10140 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
10141 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
10142 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
10143 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
10144 SET_GetHistogram(table
, exec_GetHistogram
);
10145 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
10146 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
10147 SET_GetMinmax(table
, exec_GetMinmax
);
10148 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
10149 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
10150 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
10151 SET_Histogram(table
, save_Histogram
);
10152 SET_Minmax(table
, save_Minmax
);
10153 SET_ResetHistogram(table
, save_ResetHistogram
);
10154 SET_ResetMinmax(table
, save_ResetMinmax
);
10155 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
10157 /* 2. GL_EXT_blend_color */
10159 SET_BlendColorEXT(table
, save_BlendColorEXT
);
10162 /* 3. GL_EXT_polygon_offset */
10163 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
10165 /* 6. GL_EXT_texture3d */
10167 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
10168 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
10169 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
10172 /* 14. GL_SGI_color_table */
10174 SET_ColorTableSGI(table
, save_ColorTable
);
10175 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
10176 SET_GetColorTableSGI(table
, exec_GetColorTable
);
10177 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
10178 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
10181 /* 30. GL_EXT_vertex_array */
10182 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
10183 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
10184 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
10185 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
10186 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
10187 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
10189 /* 37. GL_EXT_blend_minmax */
10191 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
10194 /* 54. GL_EXT_point_parameters */
10195 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
10196 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
10198 /* 97. GL_EXT_compiled_vertex_array */
10199 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
10200 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
10202 /* 145. GL_EXT_secondary_color */
10203 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
10205 /* 148. GL_EXT_multi_draw_arrays */
10206 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
10208 /* 149. GL_EXT_fog_coord */
10209 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10211 /* 173. GL_EXT_blend_func_separate */
10212 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10214 /* 196. GL_MESA_resize_buffers */
10215 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10217 /* 197. GL_MESA_window_pos */
10218 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10219 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10220 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10221 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10222 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10223 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10224 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10225 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10226 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10227 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10228 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10229 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10230 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10231 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10232 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10233 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10234 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10235 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10236 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10237 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10238 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10239 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10240 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10241 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10243 /* 200. GL_IBM_multimode_draw_arrays */
10244 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10245 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10247 /* 233. GL_NV_vertex_program */
10248 /* The following commands DO NOT go into display lists:
10249 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10250 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10252 SET_BindProgramNV(table
, save_BindProgramNV
);
10253 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10254 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10255 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10256 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10257 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10258 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10259 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10260 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10261 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10262 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
10263 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10264 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10265 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10266 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10267 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10268 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10269 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10270 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10271 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10272 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10273 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10274 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10275 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
10276 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10278 /* 244. GL_ATI_envmap_bumpmap */
10279 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10280 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10282 /* 245. GL_ATI_fragment_shader */
10283 #if FEATURE_ATI_fragment_shader
10284 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10285 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10288 /* 282. GL_NV_fragment_program */
10289 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10290 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10291 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10292 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10293 SET_GetProgramNamedParameterfvNV(table
,
10294 _mesa_GetProgramNamedParameterfvNV
);
10295 SET_GetProgramNamedParameterdvNV(table
,
10296 _mesa_GetProgramNamedParameterdvNV
);
10297 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10298 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10299 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10300 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10301 SET_GetProgramLocalParameterdvARB(table
,
10302 _mesa_GetProgramLocalParameterdvARB
);
10303 SET_GetProgramLocalParameterfvARB(table
,
10304 _mesa_GetProgramLocalParameterfvARB
);
10306 /* 262. GL_NV_point_sprite */
10307 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10308 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10310 /* 268. GL_EXT_stencil_two_side */
10311 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10313 /* 273. GL_APPLE_vertex_array_object */
10314 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10315 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10316 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10317 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10319 /* 310. GL_EXT_framebuffer_object */
10320 SET_GenFramebuffersEXT(table
, _mesa_GenFramebuffersEXT
);
10321 SET_BindFramebufferEXT(table
, _mesa_BindFramebufferEXT
);
10322 SET_DeleteFramebuffersEXT(table
, _mesa_DeleteFramebuffersEXT
);
10323 SET_CheckFramebufferStatusEXT(table
, _mesa_CheckFramebufferStatusEXT
);
10324 SET_GenRenderbuffersEXT(table
, _mesa_GenRenderbuffersEXT
);
10325 SET_BindRenderbufferEXT(table
, _mesa_BindRenderbufferEXT
);
10326 SET_DeleteRenderbuffersEXT(table
, _mesa_DeleteRenderbuffersEXT
);
10327 SET_RenderbufferStorageEXT(table
, _mesa_RenderbufferStorageEXT
);
10328 SET_FramebufferTexture1DEXT(table
, _mesa_FramebufferTexture1DEXT
);
10329 SET_FramebufferTexture2DEXT(table
, _mesa_FramebufferTexture2DEXT
);
10330 SET_FramebufferTexture3DEXT(table
, _mesa_FramebufferTexture3DEXT
);
10331 SET_FramebufferRenderbufferEXT(table
, _mesa_FramebufferRenderbufferEXT
);
10332 SET_GenerateMipmapEXT(table
, _mesa_GenerateMipmapEXT
);
10334 /* 317. GL_EXT_framebuffer_multisample */
10335 SET_RenderbufferStorageMultisample(table
, _mesa_RenderbufferStorageMultisample
);
10337 /* GL_ARB_vertex_array_object */
10338 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10339 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10341 /* ???. GL_EXT_depth_bounds_test */
10342 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10344 /* ARB 1. GL_ARB_multitexture */
10345 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10346 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10348 /* ARB 3. GL_ARB_transpose_matrix */
10349 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10350 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10351 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10352 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10354 /* ARB 5. GL_ARB_multisample */
10355 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10357 /* ARB 12. GL_ARB_texture_compression */
10358 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10359 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10360 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10361 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10362 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10363 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10364 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10366 /* ARB 14. GL_ARB_point_parameters */
10367 /* aliased with EXT_point_parameters functions */
10369 /* ARB 25. GL_ARB_window_pos */
10370 /* aliased with MESA_window_pos functions */
10372 /* ARB 26. GL_ARB_vertex_program */
10373 /* ARB 27. GL_ARB_fragment_program */
10374 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10375 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10376 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10377 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10378 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10379 SET_BindProgramNV(table
, save_BindProgramNV
);
10380 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10381 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10382 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10383 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10384 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10385 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10386 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10387 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10388 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10389 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10390 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10391 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10392 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10393 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10394 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10395 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10396 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10397 SET_GetProgramLocalParameterdvARB(table
,
10398 _mesa_GetProgramLocalParameterdvARB
);
10399 SET_GetProgramLocalParameterfvARB(table
,
10400 _mesa_GetProgramLocalParameterfvARB
);
10401 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10402 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10404 /* ARB 28. GL_ARB_vertex_buffer_object */
10405 /* None of the extension's functions get compiled */
10406 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10407 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10408 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10409 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10410 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10411 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10412 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10413 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10414 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10415 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10416 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10418 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10419 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10420 SET_EndQueryARB(table
, save_EndQueryARB
);
10421 SET_QueryCounter(table
, save_QueryCounter
);
10423 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10425 #if FEATURE_EXT_framebuffer_blit
10426 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10429 /* GL_ARB_shader_objects */
10430 _mesa_init_shader_dispatch(table
); /* Plug in glCreate/Delete/Get, etc */
10431 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10432 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10433 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10434 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10435 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10436 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10437 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10438 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10439 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10440 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10441 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10442 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10443 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10444 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10445 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10446 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10447 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10448 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10449 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10450 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10451 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10452 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10453 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10454 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10455 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10456 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10458 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10459 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10460 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10461 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10462 /* XXX additional functions need to be implemented here! */
10464 /* 299. GL_EXT_blend_equation_separate */
10465 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10467 /* GL_EXT_gpu_program_parameters */
10468 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10469 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10471 /* ARB 50. GL_ARB_map_buffer_range */
10472 #if FEATURE_ARB_map_buffer_range
10473 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10474 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10477 /* ARB 51. GL_ARB_texture_buffer_object */
10478 SET_TexBufferARB(table
, _mesa_TexBuffer
); /* no dlist save */
10480 /* ARB 59. GL_ARB_copy_buffer */
10481 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10483 /* 364. GL_EXT_provoking_vertex */
10484 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10486 /* 371. GL_APPLE_object_purgeable */
10487 #if FEATURE_APPLE_object_purgeable
10488 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10489 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10490 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10493 /* GL_EXT_texture_integer */
10494 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10495 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10496 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10497 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10498 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10499 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10501 /* 377. GL_EXT_separate_shader_objects */
10502 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10503 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10505 /* GL_ARB_color_buffer_float */
10506 SET_ClampColorARB(table
, save_ClampColorARB
);
10507 SET_ClampColor(table
, save_ClampColorARB
);
10510 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10511 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10512 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10513 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10515 SET_Uniform1ui(table
, save_Uniform1ui
);
10516 SET_Uniform2ui(table
, save_Uniform2ui
);
10517 SET_Uniform3ui(table
, save_Uniform3ui
);
10518 SET_Uniform4ui(table
, save_Uniform4ui
);
10519 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10520 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10521 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10522 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10524 (void) save_Uniform1ui
;
10525 (void) save_Uniform2ui
;
10526 (void) save_Uniform3ui
;
10527 (void) save_Uniform4ui
;
10528 (void) save_Uniform1uiv
;
10529 (void) save_Uniform2uiv
;
10530 (void) save_Uniform3uiv
;
10531 (void) save_Uniform4uiv
;
10534 #if FEATURE_EXT_transform_feedback
10535 /* These are not compiled into display lists: */
10536 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10537 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10538 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10539 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10541 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10542 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10543 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10544 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10545 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10546 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10547 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
10548 SET_DrawTransformFeedbackInstanced(table
,
10549 save_DrawTransformFeedbackInstanced
);
10550 SET_DrawTransformFeedbackStreamInstanced(table
,
10551 save_DrawTransformFeedbackStreamInstanced
);
10552 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
10553 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
10556 /* GL_ARB_instanced_arrays */
10557 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10559 /* GL_NV_texture_barrier */
10560 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10562 /* GL_ARB_sampler_objects */
10563 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10564 SET_BindSampler(table
, save_BindSampler
);
10565 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10566 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10567 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10568 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10569 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10570 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10572 /* GL_ARB_draw_buffer_blend */
10573 SET_BlendFunciARB(table
, save_BlendFunci
);
10574 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10575 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10576 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10578 /* GL_ARB_geometry_shader4 */
10579 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10580 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10581 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10583 /* GL_NV_conditional_render */
10584 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10585 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10588 _mesa_init_sync_dispatch(table
);
10589 SET_WaitSync(table
, save_WaitSync
);
10591 /* GL_ARB_texture_storage (no dlist support) */
10592 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10593 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10594 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10595 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10596 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10597 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10599 /* GL_ARB_debug_output (no dlist support) */
10600 _mesa_init_errors_dispatch(table
);
10602 /* GL_ARB_uniform_buffer_object */
10603 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
10605 /* GL_NV_primitive_restart */
10606 SET_PrimitiveRestartIndexNV(table
, _mesa_PrimitiveRestartIndex
);
10613 static const char *
10614 enum_string(GLenum k
)
10616 return _mesa_lookup_enum_by_nr(k
);
10621 * Print the commands in a display list. For debugging only.
10622 * TODO: many commands aren't handled yet.
10624 static void GLAPIENTRY
10625 print_list(struct gl_context
*ctx
, GLuint list
)
10627 struct gl_display_list
*dlist
;
10631 if (!islist(ctx
, list
)) {
10632 printf("%u is not a display list ID\n", list
);
10636 dlist
= lookup_list(ctx
, list
);
10642 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10644 done
= n
? GL_FALSE
: GL_TRUE
;
10646 const OpCode opcode
= n
[0].opcode
;
10648 if (is_ext_opcode(opcode
)) {
10649 n
+= ext_opcode_print(ctx
, n
);
10654 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10656 case OPCODE_BITMAP
:
10657 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10658 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10660 case OPCODE_CALL_LIST
:
10661 printf("CallList %d\n", (int) n
[1].ui
);
10663 case OPCODE_CALL_LIST_OFFSET
:
10664 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10665 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10667 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10668 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10669 enum_string(n
[1].e
), enum_string(n
[2].e
),
10670 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10672 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10673 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10674 enum_string(n
[1].e
), enum_string(n
[2].e
),
10675 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10677 case OPCODE_DISABLE
:
10678 printf("Disable %s\n", enum_string(n
[1].e
));
10680 case OPCODE_ENABLE
:
10681 printf("Enable %s\n", enum_string(n
[1].e
));
10683 case OPCODE_FRUSTUM
:
10684 printf("Frustum %g %g %g %g %g %g\n",
10685 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10687 case OPCODE_LINE_STIPPLE
:
10688 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10690 case OPCODE_LOAD_IDENTITY
:
10691 printf("LoadIdentity\n");
10693 case OPCODE_LOAD_MATRIX
:
10694 printf("LoadMatrix\n");
10695 printf(" %8f %8f %8f %8f\n",
10696 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10697 printf(" %8f %8f %8f %8f\n",
10698 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10699 printf(" %8f %8f %8f %8f\n",
10700 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10701 printf(" %8f %8f %8f %8f\n",
10702 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10704 case OPCODE_MULT_MATRIX
:
10705 printf("MultMatrix (or Rotate)\n");
10706 printf(" %8f %8f %8f %8f\n",
10707 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10708 printf(" %8f %8f %8f %8f\n",
10709 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10710 printf(" %8f %8f %8f %8f\n",
10711 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10712 printf(" %8f %8f %8f %8f\n",
10713 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10716 printf("Ortho %g %g %g %g %g %g\n",
10717 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10719 case OPCODE_POP_ATTRIB
:
10720 printf("PopAttrib\n");
10722 case OPCODE_POP_MATRIX
:
10723 printf("PopMatrix\n");
10725 case OPCODE_POP_NAME
:
10726 printf("PopName\n");
10728 case OPCODE_PUSH_ATTRIB
:
10729 printf("PushAttrib %x\n", n
[1].bf
);
10731 case OPCODE_PUSH_MATRIX
:
10732 printf("PushMatrix\n");
10734 case OPCODE_PUSH_NAME
:
10735 printf("PushName %d\n", (int) n
[1].ui
);
10737 case OPCODE_RASTER_POS
:
10738 printf("RasterPos %g %g %g %g\n",
10739 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10741 case OPCODE_ROTATE
:
10742 printf("Rotate %g %g %g %g\n",
10743 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10746 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10748 case OPCODE_TRANSLATE
:
10749 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10751 case OPCODE_BIND_TEXTURE
:
10752 printf("BindTexture %s %d\n",
10753 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10755 case OPCODE_SHADE_MODEL
:
10756 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10759 printf("Map1 %s %.3f %.3f %d %d\n",
10760 _mesa_lookup_enum_by_nr(n
[1].ui
),
10761 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10764 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10765 _mesa_lookup_enum_by_nr(n
[1].ui
),
10766 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10767 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10769 case OPCODE_MAPGRID1
:
10770 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10772 case OPCODE_MAPGRID2
:
10773 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10774 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10776 case OPCODE_EVALMESH1
:
10777 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10779 case OPCODE_EVALMESH2
:
10780 printf("EvalMesh2 %d %d %d %d\n",
10781 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10784 case OPCODE_ATTR_1F_NV
:
10785 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10787 case OPCODE_ATTR_2F_NV
:
10788 printf("ATTR_2F_NV attr %d: %f %f\n",
10789 n
[1].i
, n
[2].f
, n
[3].f
);
10791 case OPCODE_ATTR_3F_NV
:
10792 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10793 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10795 case OPCODE_ATTR_4F_NV
:
10796 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10797 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10799 case OPCODE_ATTR_1F_ARB
:
10800 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10802 case OPCODE_ATTR_2F_ARB
:
10803 printf("ATTR_2F_ARB attr %d: %f %f\n",
10804 n
[1].i
, n
[2].f
, n
[3].f
);
10806 case OPCODE_ATTR_3F_ARB
:
10807 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10808 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10810 case OPCODE_ATTR_4F_ARB
:
10811 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10812 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10815 case OPCODE_MATERIAL
:
10816 printf("MATERIAL %x %x: %f %f %f %f\n",
10817 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10820 printf("BEGIN %x\n", n
[1].i
);
10826 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10829 case OPCODE_EVAL_C1
:
10830 printf("EVAL_C1 %f\n", n
[1].f
);
10832 case OPCODE_EVAL_C2
:
10833 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10835 case OPCODE_EVAL_P1
:
10836 printf("EVAL_P1 %d\n", n
[1].i
);
10838 case OPCODE_EVAL_P2
:
10839 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10842 case OPCODE_PROVOKING_VERTEX
:
10843 printf("ProvokingVertex %s\n",
10844 _mesa_lookup_enum_by_nr(n
[1].ui
));
10848 * meta opcodes/commands
10851 printf("Error: %s %s\n",
10852 enum_string(n
[1].e
), (const char *) n
[2].data
);
10854 case OPCODE_CONTINUE
:
10855 printf("DISPLAY-LIST-CONTINUE\n");
10856 n
= (Node
*) n
[1].next
;
10858 case OPCODE_END_OF_LIST
:
10859 printf("END-LIST %u\n", list
);
10863 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10865 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10866 opcode
, (void *) n
);
10870 printf("command %d, %u operands\n", opcode
,
10874 /* increment n to point to next compiled command */
10875 if (opcode
!= OPCODE_CONTINUE
) {
10876 n
+= InstSize
[opcode
];
10885 * Clients may call this function to help debug display list problems.
10886 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10887 * changed, or break in the future without notice.
10890 mesa_print_display_list(GLuint list
)
10892 GET_CURRENT_CONTEXT(ctx
);
10893 print_list(ctx
, list
);
10897 /**********************************************************************/
10898 /***** Initialization *****/
10899 /**********************************************************************/
10902 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10904 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10906 vfmt
->Begin
= save_Begin
;
10908 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10910 vfmt
->Color3f
= save_Color3f
;
10911 vfmt
->Color3fv
= save_Color3fv
;
10912 vfmt
->Color4f
= save_Color4f
;
10913 vfmt
->Color4fv
= save_Color4fv
;
10914 vfmt
->EdgeFlag
= save_EdgeFlag
;
10915 vfmt
->End
= save_End
;
10917 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10919 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10920 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10921 vfmt
->Indexf
= save_Indexf
;
10922 vfmt
->Indexfv
= save_Indexfv
;
10923 vfmt
->Materialfv
= save_Materialfv
;
10924 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10925 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10926 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10927 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10928 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10929 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10930 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10931 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10932 vfmt
->Normal3f
= save_Normal3f
;
10933 vfmt
->Normal3fv
= save_Normal3fv
;
10934 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10935 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10936 vfmt
->TexCoord1f
= save_TexCoord1f
;
10937 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10938 vfmt
->TexCoord2f
= save_TexCoord2f
;
10939 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10940 vfmt
->TexCoord3f
= save_TexCoord3f
;
10941 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10942 vfmt
->TexCoord4f
= save_TexCoord4f
;
10943 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10944 vfmt
->Vertex2f
= save_Vertex2f
;
10945 vfmt
->Vertex2fv
= save_Vertex2fv
;
10946 vfmt
->Vertex3f
= save_Vertex3f
;
10947 vfmt
->Vertex3fv
= save_Vertex3fv
;
10948 vfmt
->Vertex4f
= save_Vertex4f
;
10949 vfmt
->Vertex4fv
= save_Vertex4fv
;
10950 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10951 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10952 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10953 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10954 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10955 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10956 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10957 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10958 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10959 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10960 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10961 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10962 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10963 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10964 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10965 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10967 vfmt
->Rectf
= save_Rectf
;
10969 /* GL_ARB_draw_instanced */
10970 vfmt
->DrawArraysInstanced
= save_DrawArraysInstancedARB
;
10971 vfmt
->DrawElementsInstanced
= save_DrawElementsInstancedARB
;
10973 /* GL_ARB_draw_elements_base_vertex */
10974 vfmt
->DrawElementsInstancedBaseVertex
= save_DrawElementsInstancedBaseVertexARB
;
10976 /* GL_ARB_base_instance */
10977 vfmt
->DrawArraysInstancedBaseInstance
= save_DrawArraysInstancedBaseInstance
;
10978 vfmt
->DrawElementsInstancedBaseInstance
= save_DrawElementsInstancedBaseInstance
;
10979 vfmt
->DrawElementsInstancedBaseVertexBaseInstance
= save_DrawElementsInstancedBaseVertexBaseInstance
;
10981 /* The driver is required to implement these as
10982 * 1) They can probably do a better job.
10983 * 2) A lot of new mechanisms would have to be added to this module
10984 * to support it. That code would probably never get used,
10988 vfmt
->DrawArrays
= 0;
10989 vfmt
->DrawElements
= 0;
10990 vfmt
->DrawRangeElements
= 0;
10991 vfmt
->MultiDrawElemementsEXT
= 0;
10992 vfmt
->DrawElementsBaseVertex
= 0;
10993 vfmt
->DrawRangeElementsBaseVertex
= 0;
10994 vfmt
->MultiDrawElemementsBaseVertex
= 0;
11000 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
11001 const GLvertexformat
*vfmt
)
11003 SET_CallList(disp
, vfmt
->CallList
);
11004 SET_CallLists(disp
, vfmt
->CallLists
);
11008 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
11010 SET_CallList(disp
, _mesa_CallList
);
11011 SET_CallLists(disp
, _mesa_CallLists
);
11013 SET_DeleteLists(disp
, _mesa_DeleteLists
);
11014 SET_EndList(disp
, _mesa_EndList
);
11015 SET_GenLists(disp
, _mesa_GenLists
);
11016 SET_IsList(disp
, _mesa_IsList
);
11017 SET_ListBase(disp
, _mesa_ListBase
);
11018 SET_NewList(disp
, _mesa_NewList
);
11023 * Initialize display list state for given context.
11026 _mesa_init_display_list(struct gl_context
*ctx
)
11028 static GLboolean tableInitialized
= GL_FALSE
;
11030 /* zero-out the instruction size table, just once */
11031 if (!tableInitialized
) {
11032 memset(InstSize
, 0, sizeof(InstSize
));
11033 tableInitialized
= GL_TRUE
;
11036 /* extension info */
11037 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
11040 ctx
->ListState
.CallDepth
= 0;
11041 ctx
->ExecuteFlag
= GL_TRUE
;
11042 ctx
->CompileFlag
= GL_FALSE
;
11043 ctx
->ListState
.CurrentBlock
= NULL
;
11044 ctx
->ListState
.CurrentPos
= 0;
11046 /* Display List group */
11047 ctx
->List
.ListBase
= 0;
11049 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
11054 _mesa_free_display_list_data(struct gl_context
*ctx
)
11056 free(ctx
->ListExt
);
11057 ctx
->ListExt
= NULL
;