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 #include "atifragshader.h"
40 #include "mfeatures.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "nvprogram.h"
67 #include "transformfeedback.h"
69 #include "math/m_matrix.h"
71 #include "main/dispatch.h"
76 * Other parts of Mesa (such as the VBO module) can plug into the display
77 * list system. This structure describes new display list instructions.
79 struct gl_list_instruction
82 void (*Execute
)( struct gl_context
*ctx
, void *data
);
83 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
84 void (*Print
)( struct gl_context
*ctx
, void *data
);
88 #define MAX_DLIST_EXT_OPCODES 16
91 * Used by device drivers to hook new commands into display lists.
93 struct gl_list_extensions
95 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
104 * \param ctx GL context.
106 * Checks if dd_function_table::SaveNeedFlush is marked to flush
107 * stored (save) vertices, and calls
108 * dd_function_table::SaveFlushVertices if so.
110 #define SAVE_FLUSH_VERTICES(ctx) \
112 if (ctx->Driver.SaveNeedFlush) \
113 ctx->Driver.SaveFlushVertices(ctx); \
118 * Macro to assert that the API call was made outside the
119 * glBegin()/glEnd() pair, with return value.
121 * \param ctx GL context.
122 * \param retval value to return value in case the assertion fails.
124 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
126 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
127 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
128 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
134 * Macro to assert that the API call was made outside the
135 * glBegin()/glEnd() pair.
137 * \param ctx GL context.
139 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
141 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
142 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
143 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
149 * Macro to assert that the API call was made outside the
150 * glBegin()/glEnd() pair and flush the vertices.
152 * \param ctx GL context.
154 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
156 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
157 SAVE_FLUSH_VERTICES(ctx); \
161 * Macro to assert that the API call was made outside the
162 * glBegin()/glEnd() pair and flush the vertices, with return value.
164 * \param ctx GL context.
165 * \param retval value to return value in case the assertion fails.
167 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
169 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
170 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
199 OPCODE_CALL_LIST_OFFSET
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COLOR_TABLE_PARAMETER_FV
,
216 OPCODE_COLOR_TABLE_PARAMETER_IV
,
217 OPCODE_COLOR_SUB_TABLE
,
218 OPCODE_CONVOLUTION_FILTER_1D
,
219 OPCODE_CONVOLUTION_FILTER_2D
,
220 OPCODE_CONVOLUTION_PARAMETER_I
,
221 OPCODE_CONVOLUTION_PARAMETER_IV
,
222 OPCODE_CONVOLUTION_PARAMETER_F
,
223 OPCODE_CONVOLUTION_PARAMETER_FV
,
224 OPCODE_COPY_COLOR_SUB_TABLE
,
225 OPCODE_COPY_COLOR_TABLE
,
227 OPCODE_COPY_TEX_IMAGE1D
,
228 OPCODE_COPY_TEX_IMAGE2D
,
229 OPCODE_COPY_TEX_SUB_IMAGE1D
,
230 OPCODE_COPY_TEX_SUB_IMAGE2D
,
231 OPCODE_COPY_TEX_SUB_IMAGE3D
,
237 OPCODE_DISABLE_INDEXED
,
241 OPCODE_ENABLE_INDEXED
,
256 OPCODE_LOAD_IDENTITY
,
270 OPCODE_PIXEL_TRANSFER
,
273 OPCODE_POINT_PARAMETERS
,
275 OPCODE_POLYGON_STIPPLE
,
276 OPCODE_POLYGON_OFFSET
,
280 OPCODE_PRIORITIZE_TEXTURE
,
286 OPCODE_RESET_HISTOGRAM
,
287 OPCODE_RESET_MIN_MAX
,
291 OPCODE_SELECT_TEXTURE_SGIS
,
292 OPCODE_SELECT_TEXTURE_COORD_SET
,
303 OPCODE_TEX_SUB_IMAGE1D
,
304 OPCODE_TEX_SUB_IMAGE2D
,
305 OPCODE_TEX_SUB_IMAGE3D
,
309 /* GL_ARB_multitexture */
310 OPCODE_ACTIVE_TEXTURE
,
311 /* GL_ARB_texture_compression */
312 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
313 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
314 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
315 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
316 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
317 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
318 /* GL_ARB_multisample */
319 OPCODE_SAMPLE_COVERAGE
,
320 /* GL_ARB_window_pos */
321 OPCODE_WINDOW_POS_ARB
,
322 /* GL_NV_vertex_program */
323 OPCODE_BIND_PROGRAM_NV
,
324 OPCODE_EXECUTE_PROGRAM_NV
,
325 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
326 OPCODE_LOAD_PROGRAM_NV
,
327 /* GL_NV_fragment_program */
328 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
329 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
330 /* GL_EXT_stencil_two_side */
331 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
332 /* GL_EXT_depth_bounds_test */
333 OPCODE_DEPTH_BOUNDS_EXT
,
334 /* GL_ARB_vertex/fragment_program */
335 OPCODE_PROGRAM_STRING_ARB
,
336 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
337 /* GL_ARB_occlusion_query */
338 OPCODE_BEGIN_QUERY_ARB
,
339 OPCODE_END_QUERY_ARB
,
340 /* GL_ARB_draw_buffers */
341 OPCODE_DRAW_BUFFERS_ARB
,
342 /* GL_ATI_fragment_shader */
343 OPCODE_TEX_BUMP_PARAMETER_ATI
,
344 /* GL_ATI_fragment_shader */
345 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
346 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
348 OPCODE_STENCIL_FUNC_SEPARATE
,
349 OPCODE_STENCIL_OP_SEPARATE
,
350 OPCODE_STENCIL_MASK_SEPARATE
,
352 /* GL_ARB_shader_objects */
370 OPCODE_UNIFORM_MATRIX22
,
371 OPCODE_UNIFORM_MATRIX33
,
372 OPCODE_UNIFORM_MATRIX44
,
373 OPCODE_UNIFORM_MATRIX23
,
374 OPCODE_UNIFORM_MATRIX32
,
375 OPCODE_UNIFORM_MATRIX24
,
376 OPCODE_UNIFORM_MATRIX42
,
377 OPCODE_UNIFORM_MATRIX34
,
378 OPCODE_UNIFORM_MATRIX43
,
390 /* GL_ARB_color_buffer_float */
393 /* GL_EXT_framebuffer_blit */
394 OPCODE_BLIT_FRAMEBUFFER
,
396 /* Vertex attributes -- fallback for when optimized display
397 * list build isn't active.
416 /* GL_EXT_provoking_vertex */
417 OPCODE_PROVOKING_VERTEX
,
419 /* GL_EXT_transform_feedback */
420 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
421 OPCODE_END_TRANSFORM_FEEDBACK
,
422 OPCODE_BIND_TRANSFORM_FEEDBACK
,
423 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
424 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
425 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
427 /* GL_EXT_texture_integer */
429 OPCODE_CLEARCOLOR_UI
,
430 OPCODE_TEXPARAMETER_I
,
431 OPCODE_TEXPARAMETER_UI
,
433 /* GL_EXT_separate_shader_objects */
434 OPCODE_ACTIVE_PROGRAM_EXT
,
435 OPCODE_USE_SHADER_PROGRAM_EXT
,
437 /* GL_ARB_instanced_arrays */
438 OPCODE_VERTEX_ATTRIB_DIVISOR
,
440 /* GL_NV_texture_barrier */
441 OPCODE_TEXTURE_BARRIER_NV
,
443 /* GL_ARB_sampler_object */
445 OPCODE_SAMPLER_PARAMETERIV
,
446 OPCODE_SAMPLER_PARAMETERFV
,
447 OPCODE_SAMPLER_PARAMETERIIV
,
448 OPCODE_SAMPLER_PARAMETERUIV
,
450 /* GL_ARB_geometry_shader4 */
451 OPCODE_PROGRAM_PARAMETERI
,
452 OPCODE_FRAMEBUFFER_TEXTURE
,
453 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
458 /* GL_NV_conditional_render */
459 OPCODE_BEGIN_CONDITIONAL_RENDER
,
460 OPCODE_END_CONDITIONAL_RENDER
,
462 /* ARB_timer_query */
463 OPCODE_QUERY_COUNTER
,
465 /* ARB_transform_feedback3 */
466 OPCODE_BEGIN_QUERY_INDEXED
,
467 OPCODE_END_QUERY_INDEXED
,
468 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
470 /* ARB_transform_feedback_instanced */
471 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
472 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
474 /* ARB_uniform_buffer_object */
475 OPCODE_UNIFORM_BLOCK_BINDING
,
477 /* The following three are meta instructions */
478 OPCODE_ERROR
, /* raise compiled-in error */
489 * Display list instructions are stored as sequences of "nodes". Nodes
490 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
491 * are linked together with a pointer.
493 * Each instruction in the display list is stored as a sequence of
494 * contiguous nodes in memory.
495 * Each node is the union of a variety of data types.
511 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
515 typedef union gl_dlist_node Node
;
519 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
520 * environment. In 64-bit env, sizeof(Node)==8 anyway.
530 * How many nodes to allocate at a time.
532 * \note Reduced now that we hold vertices etc. elsewhere.
534 #define BLOCK_SIZE 256
539 * Number of nodes of storage needed for each instruction.
540 * Sizes for dynamically allocated opcodes are stored in the context struct.
542 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
545 void mesa_print_display_list(GLuint list
);
548 /**********************************************************************/
549 /***** Private *****/
550 /**********************************************************************/
554 * Make an empty display list. This is used by glGenLists() to
555 * reserve display list IDs.
557 static struct gl_display_list
*
558 make_list(GLuint name
, GLuint count
)
560 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
562 dlist
->Head
= malloc(sizeof(Node
) * count
);
563 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
569 * Lookup function to just encapsulate casting.
571 static inline struct gl_display_list
*
572 lookup_list(struct gl_context
*ctx
, GLuint list
)
574 return (struct gl_display_list
*)
575 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
579 /** Is the given opcode an extension code? */
580 static inline GLboolean
581 is_ext_opcode(OpCode opcode
)
583 return (opcode
>= OPCODE_EXT_0
);
587 /** Destroy an extended opcode instruction */
589 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
591 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
593 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
594 step
= ctx
->ListExt
->Opcode
[i
].Size
;
599 /** Execute an extended opcode instruction */
601 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
603 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
605 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
606 step
= ctx
->ListExt
->Opcode
[i
].Size
;
611 /** Print an extended opcode instruction */
613 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
615 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
617 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
618 step
= ctx
->ListExt
->Opcode
[i
].Size
;
624 * Delete the named display list, but don't remove from hash table.
625 * \param dlist - display list pointer
628 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
633 n
= block
= dlist
->Head
;
635 done
= block
? GL_FALSE
: GL_TRUE
;
637 const OpCode opcode
= n
[0].opcode
;
639 /* check for extension opcodes first */
640 if (is_ext_opcode(opcode
)) {
641 n
+= ext_opcode_destroy(ctx
, n
);
645 /* for some commands, we need to free malloc'd memory */
648 n
+= InstSize
[n
[0].opcode
];
652 n
+= InstSize
[n
[0].opcode
];
654 case OPCODE_DRAW_PIXELS
:
656 n
+= InstSize
[n
[0].opcode
];
660 n
+= InstSize
[n
[0].opcode
];
662 case OPCODE_COLOR_TABLE
:
664 n
+= InstSize
[n
[0].opcode
];
666 case OPCODE_COLOR_SUB_TABLE
:
668 n
+= InstSize
[n
[0].opcode
];
670 case OPCODE_CONVOLUTION_FILTER_1D
:
672 n
+= InstSize
[n
[0].opcode
];
674 case OPCODE_CONVOLUTION_FILTER_2D
:
676 n
+= InstSize
[n
[0].opcode
];
678 case OPCODE_POLYGON_STIPPLE
:
680 n
+= InstSize
[n
[0].opcode
];
682 case OPCODE_TEX_IMAGE1D
:
684 n
+= InstSize
[n
[0].opcode
];
686 case OPCODE_TEX_IMAGE2D
:
688 n
+= InstSize
[n
[0].opcode
];
690 case OPCODE_TEX_IMAGE3D
:
692 n
+= InstSize
[n
[0].opcode
];
694 case OPCODE_TEX_SUB_IMAGE1D
:
696 n
+= InstSize
[n
[0].opcode
];
698 case OPCODE_TEX_SUB_IMAGE2D
:
700 n
+= InstSize
[n
[0].opcode
];
702 case OPCODE_TEX_SUB_IMAGE3D
:
704 n
+= InstSize
[n
[0].opcode
];
706 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
708 n
+= InstSize
[n
[0].opcode
];
710 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
712 n
+= InstSize
[n
[0].opcode
];
714 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
716 n
+= InstSize
[n
[0].opcode
];
718 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
720 n
+= InstSize
[n
[0].opcode
];
722 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
724 n
+= InstSize
[n
[0].opcode
];
726 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
728 n
+= InstSize
[n
[0].opcode
];
730 case OPCODE_LOAD_PROGRAM_NV
:
731 free(n
[4].data
); /* program string */
732 n
+= InstSize
[n
[0].opcode
];
734 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
735 free(n
[2].data
); /* array of program ids */
736 n
+= InstSize
[n
[0].opcode
];
738 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
739 free(n
[3].data
); /* parameter name */
740 n
+= InstSize
[n
[0].opcode
];
742 case OPCODE_PROGRAM_STRING_ARB
:
743 free(n
[4].data
); /* program string */
744 n
+= InstSize
[n
[0].opcode
];
746 case OPCODE_UNIFORM_1FV
:
747 case OPCODE_UNIFORM_2FV
:
748 case OPCODE_UNIFORM_3FV
:
749 case OPCODE_UNIFORM_4FV
:
750 case OPCODE_UNIFORM_1IV
:
751 case OPCODE_UNIFORM_2IV
:
752 case OPCODE_UNIFORM_3IV
:
753 case OPCODE_UNIFORM_4IV
:
754 case OPCODE_UNIFORM_1UIV
:
755 case OPCODE_UNIFORM_2UIV
:
756 case OPCODE_UNIFORM_3UIV
:
757 case OPCODE_UNIFORM_4UIV
:
759 n
+= InstSize
[n
[0].opcode
];
761 case OPCODE_UNIFORM_MATRIX22
:
762 case OPCODE_UNIFORM_MATRIX33
:
763 case OPCODE_UNIFORM_MATRIX44
:
764 case OPCODE_UNIFORM_MATRIX24
:
765 case OPCODE_UNIFORM_MATRIX42
:
766 case OPCODE_UNIFORM_MATRIX23
:
767 case OPCODE_UNIFORM_MATRIX32
:
768 case OPCODE_UNIFORM_MATRIX34
:
769 case OPCODE_UNIFORM_MATRIX43
:
771 n
+= InstSize
[n
[0].opcode
];
774 case OPCODE_CONTINUE
:
775 n
= (Node
*) n
[1].next
;
779 case OPCODE_END_OF_LIST
:
784 /* Most frequent case */
785 n
+= InstSize
[n
[0].opcode
];
796 * Destroy a display list and remove from hash table.
797 * \param list - display list number
800 destroy_list(struct gl_context
*ctx
, GLuint list
)
802 struct gl_display_list
*dlist
;
807 dlist
= lookup_list(ctx
, list
);
811 _mesa_delete_list(ctx
, dlist
);
812 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
817 * Translate the nth element of list from <type> to GLint.
820 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
832 bptr
= (GLbyte
*) list
;
833 return (GLint
) bptr
[n
];
834 case GL_UNSIGNED_BYTE
:
835 ubptr
= (GLubyte
*) list
;
836 return (GLint
) ubptr
[n
];
838 sptr
= (GLshort
*) list
;
839 return (GLint
) sptr
[n
];
840 case GL_UNSIGNED_SHORT
:
841 usptr
= (GLushort
*) list
;
842 return (GLint
) usptr
[n
];
844 iptr
= (GLint
*) list
;
846 case GL_UNSIGNED_INT
:
847 uiptr
= (GLuint
*) list
;
848 return (GLint
) uiptr
[n
];
850 fptr
= (GLfloat
*) list
;
851 return (GLint
) FLOORF(fptr
[n
]);
853 ubptr
= ((GLubyte
*) list
) + 2 * n
;
854 return (GLint
) ubptr
[0] * 256
857 ubptr
= ((GLubyte
*) list
) + 3 * n
;
858 return (GLint
) ubptr
[0] * 65536
859 + (GLint
) ubptr
[1] * 256
862 ubptr
= ((GLubyte
*) list
) + 4 * n
;
863 return (GLint
) ubptr
[0] * 16777216
864 + (GLint
) ubptr
[1] * 65536
865 + (GLint
) ubptr
[2] * 256
875 /**********************************************************************/
877 /**********************************************************************/
880 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
881 * If width < 0 or height < 0 or format or type are invalid we'll just
882 * return NULL. We will not generate an error since OpenGL command
883 * arguments aren't error-checked until the command is actually executed
884 * (not when they're compiled).
885 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
888 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
889 GLsizei width
, GLsizei height
, GLsizei depth
,
890 GLenum format
, GLenum type
, const GLvoid
* pixels
,
891 const struct gl_pixelstore_attrib
*unpack
)
893 if (width
<= 0 || height
<= 0) {
897 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
898 /* bad format and/or type */
902 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
906 if (type
== GL_BITMAP
)
907 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
909 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
910 format
, type
, pixels
, unpack
);
911 if (pixels
&& !image
) {
912 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
916 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
917 depth
, format
, type
, INT_MAX
, pixels
)) {
918 const GLubyte
*map
, *src
;
922 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
923 GL_MAP_READ_BIT
, unpack
->BufferObj
);
925 /* unable to map src buffer! */
926 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
930 src
= ADD_POINTERS(map
, pixels
);
931 if (type
== GL_BITMAP
)
932 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
934 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
935 format
, type
, src
, unpack
);
937 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
940 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
946 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
951 * Allocate space for a display list instruction (opcode + payload space).
952 * \param opcode the instruction opcode (OPCODE_* value)
953 * \param bytes instruction payload size (not counting opcode)
954 * \return pointer to allocated memory (the opcode space)
957 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
959 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
962 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
963 if (InstSize
[opcode
] == 0) {
964 /* save instruction size now */
965 InstSize
[opcode
] = numNodes
;
968 /* make sure instruction size agrees */
969 ASSERT(numNodes
== InstSize
[opcode
]);
973 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
974 /* This block is full. Allocate a new block and chain to it */
976 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
977 n
[0].opcode
= OPCODE_CONTINUE
;
978 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
980 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
983 n
[1].next
= (Node
*) newblock
;
984 ctx
->ListState
.CurrentBlock
= newblock
;
985 ctx
->ListState
.CurrentPos
= 0;
988 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
989 ctx
->ListState
.CurrentPos
+= numNodes
;
991 n
[0].opcode
= opcode
;
999 * Allocate space for a display list instruction. Used by callers outside
1000 * this file for things like VBO vertex data.
1002 * \param opcode the instruction opcode (OPCODE_* value)
1003 * \param bytes instruction size in bytes, not counting opcode.
1004 * \return pointer to the usable data area (not including the internal
1008 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1010 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1012 return n
+ 1; /* return pointer to payload area, after opcode */
1019 * This function allows modules and drivers to get their own opcodes
1020 * for extending display list functionality.
1021 * \param ctx the rendering context
1022 * \param size number of bytes for storing the new display list command
1023 * \param execute function to execute the new display list command
1024 * \param destroy function to destroy the new display list command
1025 * \param print function to print the new display list command
1026 * \return the new opcode number or -1 if error
1029 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1031 void (*execute
) (struct gl_context
*, void *),
1032 void (*destroy
) (struct gl_context
*, void *),
1033 void (*print
) (struct gl_context
*, void *))
1035 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1036 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1037 ctx
->ListExt
->Opcode
[i
].Size
=
1038 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1039 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1040 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1041 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1042 return i
+ OPCODE_EXT_0
;
1049 * Allocate space for a display list instruction. The space is basically
1050 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1051 * function parameter, node[2] is the second parameter, etc.
1053 * \param opcode one of OPCODE_x
1054 * \param nparams number of function parameters
1055 * \return pointer to start of instruction space
1057 static inline Node
*
1058 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1060 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1066 * Display List compilation functions
1068 static void GLAPIENTRY
1069 save_Accum(GLenum op
, GLfloat value
)
1071 GET_CURRENT_CONTEXT(ctx
);
1073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1074 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1079 if (ctx
->ExecuteFlag
) {
1080 CALL_Accum(ctx
->Exec
, (op
, value
));
1085 static void GLAPIENTRY
1086 save_AlphaFunc(GLenum func
, GLclampf ref
)
1088 GET_CURRENT_CONTEXT(ctx
);
1090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1091 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1094 n
[2].f
= (GLfloat
) ref
;
1096 if (ctx
->ExecuteFlag
) {
1097 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1102 static void GLAPIENTRY
1103 save_BindTexture(GLenum target
, GLuint texture
)
1105 GET_CURRENT_CONTEXT(ctx
);
1107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1108 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1113 if (ctx
->ExecuteFlag
) {
1114 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1119 static void GLAPIENTRY
1120 save_Bitmap(GLsizei width
, GLsizei height
,
1121 GLfloat xorig
, GLfloat yorig
,
1122 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1124 GET_CURRENT_CONTEXT(ctx
);
1126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1127 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1129 n
[1].i
= (GLint
) width
;
1130 n
[2].i
= (GLint
) height
;
1135 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1136 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1138 if (ctx
->ExecuteFlag
) {
1139 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1140 xorig
, yorig
, xmove
, ymove
, pixels
));
1145 static void GLAPIENTRY
1146 save_BlendEquation(GLenum mode
)
1148 GET_CURRENT_CONTEXT(ctx
);
1150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1151 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1155 if (ctx
->ExecuteFlag
) {
1156 CALL_BlendEquation(ctx
->Exec
, (mode
));
1161 static void GLAPIENTRY
1162 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1164 GET_CURRENT_CONTEXT(ctx
);
1166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1167 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1172 if (ctx
->ExecuteFlag
) {
1173 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1178 static void GLAPIENTRY
1179 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1180 GLenum sfactorA
, GLenum dfactorA
)
1182 GET_CURRENT_CONTEXT(ctx
);
1184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1185 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1187 n
[1].e
= sfactorRGB
;
1188 n
[2].e
= dfactorRGB
;
1192 if (ctx
->ExecuteFlag
) {
1193 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1194 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1199 static void GLAPIENTRY
1200 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1202 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1206 static void GLAPIENTRY
1207 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1209 GET_CURRENT_CONTEXT(ctx
);
1211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1212 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1219 if (ctx
->ExecuteFlag
) {
1220 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1224 /* GL_ARB_draw_buffers_blend */
1225 static void GLAPIENTRY
1226 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1227 GLenum sfactorA
, GLenum dfactorA
)
1229 GET_CURRENT_CONTEXT(ctx
);
1231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1232 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1235 n
[2].e
= sfactorRGB
;
1236 n
[3].e
= dfactorRGB
;
1240 if (ctx
->ExecuteFlag
) {
1241 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1242 sfactorA
, dfactorA
));
1246 /* GL_ARB_draw_buffers_blend */
1247 static void GLAPIENTRY
1248 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1250 GET_CURRENT_CONTEXT(ctx
);
1252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1253 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1259 if (ctx
->ExecuteFlag
) {
1260 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1264 /* GL_ARB_draw_buffers_blend */
1265 static void GLAPIENTRY
1266 save_BlendEquationi(GLuint buf
, GLenum mode
)
1268 GET_CURRENT_CONTEXT(ctx
);
1270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1271 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1276 if (ctx
->ExecuteFlag
) {
1277 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1281 /* GL_ARB_draw_buffers_blend */
1282 static void GLAPIENTRY
1283 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1285 GET_CURRENT_CONTEXT(ctx
);
1287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1288 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1294 if (ctx
->ExecuteFlag
) {
1295 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1300 /* GL_ARB_draw_instanced. */
1301 static void GLAPIENTRY
1302 save_DrawArraysInstancedARB(GLenum mode
,
1307 GET_CURRENT_CONTEXT(ctx
);
1308 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1309 "glDrawArraysInstanced() during display list compile");
1312 static void GLAPIENTRY
1313 save_DrawElementsInstancedARB(GLenum mode
,
1316 const GLvoid
*indices
,
1319 GET_CURRENT_CONTEXT(ctx
);
1320 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1321 "glDrawElementsInstanced() during display list compile");
1324 static void GLAPIENTRY
1325 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1328 const GLvoid
*indices
,
1332 GET_CURRENT_CONTEXT(ctx
);
1333 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1334 "glDrawElementsInstancedBaseVertex() during display list compile");
1337 /* GL_ARB_base_instance. */
1338 static void GLAPIENTRY
1339 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1343 GLuint baseinstance
)
1345 GET_CURRENT_CONTEXT(ctx
);
1346 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1347 "glDrawArraysInstancedBaseInstance() during display list compile");
1350 static void APIENTRY
1351 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1354 const void *indices
,
1356 GLuint baseinstance
)
1358 GET_CURRENT_CONTEXT(ctx
);
1359 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1360 "glDrawElementsInstancedBaseInstance() during display list compile");
1363 static void APIENTRY
1364 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1367 const void *indices
,
1370 GLuint baseinstance
)
1372 GET_CURRENT_CONTEXT(ctx
);
1373 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1374 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1377 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1381 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1382 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1384 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1385 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1387 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1389 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1392 static void GLAPIENTRY
1393 save_CallList(GLuint list
)
1395 GET_CURRENT_CONTEXT(ctx
);
1397 SAVE_FLUSH_VERTICES(ctx
);
1399 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1404 /* After this, we don't know what state we're in. Invalidate all
1405 * cached information previously gathered:
1407 invalidate_saved_current_state( ctx
);
1409 if (ctx
->ExecuteFlag
) {
1410 _mesa_CallList(list
);
1415 static void GLAPIENTRY
1416 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1418 GET_CURRENT_CONTEXT(ctx
);
1420 GLboolean typeErrorFlag
;
1422 SAVE_FLUSH_VERTICES(ctx
);
1426 case GL_UNSIGNED_BYTE
:
1428 case GL_UNSIGNED_SHORT
:
1430 case GL_UNSIGNED_INT
:
1435 typeErrorFlag
= GL_FALSE
;
1438 typeErrorFlag
= GL_TRUE
;
1441 for (i
= 0; i
< num
; i
++) {
1442 GLint list
= translate_id(i
, type
, lists
);
1443 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1446 n
[2].b
= typeErrorFlag
;
1450 /* After this, we don't know what state we're in. Invalidate all
1451 * cached information previously gathered:
1453 invalidate_saved_current_state( ctx
);
1455 if (ctx
->ExecuteFlag
) {
1456 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1461 static void GLAPIENTRY
1462 save_Clear(GLbitfield mask
)
1464 GET_CURRENT_CONTEXT(ctx
);
1466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1467 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1471 if (ctx
->ExecuteFlag
) {
1472 CALL_Clear(ctx
->Exec
, (mask
));
1477 static void GLAPIENTRY
1478 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1480 GET_CURRENT_CONTEXT(ctx
);
1482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1483 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1486 n
[2].i
= drawbuffer
;
1488 if (buffer
== GL_COLOR
) {
1499 if (ctx
->ExecuteFlag
) {
1500 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1505 static void GLAPIENTRY
1506 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1508 GET_CURRENT_CONTEXT(ctx
);
1510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1511 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1514 n
[2].i
= drawbuffer
;
1516 if (buffer
== GL_COLOR
) {
1527 if (ctx
->ExecuteFlag
) {
1528 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1533 static void GLAPIENTRY
1534 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1536 GET_CURRENT_CONTEXT(ctx
);
1538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1539 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1542 n
[2].i
= drawbuffer
;
1544 if (buffer
== GL_COLOR
) {
1555 if (ctx
->ExecuteFlag
) {
1556 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1561 static void GLAPIENTRY
1562 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1563 GLfloat depth
, GLint stencil
)
1565 GET_CURRENT_CONTEXT(ctx
);
1567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1568 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1571 n
[2].i
= drawbuffer
;
1575 if (ctx
->ExecuteFlag
) {
1576 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1581 static void GLAPIENTRY
1582 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1584 GET_CURRENT_CONTEXT(ctx
);
1586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1587 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1594 if (ctx
->ExecuteFlag
) {
1595 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1600 static void GLAPIENTRY
1601 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1603 GET_CURRENT_CONTEXT(ctx
);
1605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1606 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1613 if (ctx
->ExecuteFlag
) {
1614 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1619 static void GLAPIENTRY
1620 save_ClearDepth(GLclampd depth
)
1622 GET_CURRENT_CONTEXT(ctx
);
1624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1625 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1627 n
[1].f
= (GLfloat
) depth
;
1629 if (ctx
->ExecuteFlag
) {
1630 CALL_ClearDepth(ctx
->Exec
, (depth
));
1635 static void GLAPIENTRY
1636 save_ClearIndex(GLfloat c
)
1638 GET_CURRENT_CONTEXT(ctx
);
1640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1641 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1645 if (ctx
->ExecuteFlag
) {
1646 CALL_ClearIndex(ctx
->Exec
, (c
));
1651 static void GLAPIENTRY
1652 save_ClearStencil(GLint s
)
1654 GET_CURRENT_CONTEXT(ctx
);
1656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1657 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1661 if (ctx
->ExecuteFlag
) {
1662 CALL_ClearStencil(ctx
->Exec
, (s
));
1667 static void GLAPIENTRY
1668 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1670 GET_CURRENT_CONTEXT(ctx
);
1672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1673 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1676 n
[2].f
= (GLfloat
) equ
[0];
1677 n
[3].f
= (GLfloat
) equ
[1];
1678 n
[4].f
= (GLfloat
) equ
[2];
1679 n
[5].f
= (GLfloat
) equ
[3];
1681 if (ctx
->ExecuteFlag
) {
1682 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1688 static void GLAPIENTRY
1689 save_ColorMask(GLboolean red
, GLboolean green
,
1690 GLboolean blue
, GLboolean alpha
)
1692 GET_CURRENT_CONTEXT(ctx
);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1695 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1702 if (ctx
->ExecuteFlag
) {
1703 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1708 static void GLAPIENTRY
1709 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1710 GLboolean blue
, GLboolean alpha
)
1712 GET_CURRENT_CONTEXT(ctx
);
1714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1715 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1723 if (ctx
->ExecuteFlag
) {
1724 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1729 static void GLAPIENTRY
1730 save_ColorMaterial(GLenum face
, GLenum mode
)
1732 GET_CURRENT_CONTEXT(ctx
);
1734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1736 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1741 if (ctx
->ExecuteFlag
) {
1742 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1747 static void GLAPIENTRY
1748 save_ColorTable(GLenum target
, GLenum internalFormat
,
1749 GLsizei width
, GLenum format
, GLenum type
,
1750 const GLvoid
* table
)
1752 GET_CURRENT_CONTEXT(ctx
);
1753 if (_mesa_is_proxy_texture(target
)) {
1754 /* execute immediately */
1755 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1756 format
, type
, table
));
1760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1761 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1764 n
[2].e
= internalFormat
;
1768 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1771 if (ctx
->ExecuteFlag
) {
1772 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1773 format
, type
, table
));
1780 static void GLAPIENTRY
1781 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1782 const GLfloat
*params
)
1784 GET_CURRENT_CONTEXT(ctx
);
1787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1794 if (pname
== GL_COLOR_TABLE_SGI
||
1795 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1796 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1803 if (ctx
->ExecuteFlag
) {
1804 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1809 static void GLAPIENTRY
1810 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1812 GET_CURRENT_CONTEXT(ctx
);
1815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1817 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1822 if (pname
== GL_COLOR_TABLE_SGI
||
1823 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1824 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1831 if (ctx
->ExecuteFlag
) {
1832 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1838 static void GLAPIENTRY
1839 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1840 GLenum format
, GLenum type
, const GLvoid
* table
)
1842 GET_CURRENT_CONTEXT(ctx
);
1844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1845 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1852 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1855 if (ctx
->ExecuteFlag
) {
1856 CALL_ColorSubTable(ctx
->Exec
,
1857 (target
, start
, count
, format
, type
, table
));
1862 static void GLAPIENTRY
1863 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1864 GLint x
, GLint y
, GLsizei width
)
1866 GET_CURRENT_CONTEXT(ctx
);
1869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1870 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1878 if (ctx
->ExecuteFlag
) {
1879 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1884 static void GLAPIENTRY
1885 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1886 GLint x
, GLint y
, GLsizei width
)
1888 GET_CURRENT_CONTEXT(ctx
);
1891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1892 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1895 n
[2].e
= internalformat
;
1900 if (ctx
->ExecuteFlag
) {
1901 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1906 static void GLAPIENTRY
1907 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1908 GLenum format
, GLenum type
, const GLvoid
* filter
)
1910 GET_CURRENT_CONTEXT(ctx
);
1913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1915 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1918 n
[2].e
= internalFormat
;
1922 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1925 if (ctx
->ExecuteFlag
) {
1926 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1927 format
, type
, filter
));
1932 static void GLAPIENTRY
1933 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1934 GLsizei width
, GLsizei height
, GLenum format
,
1935 GLenum type
, const GLvoid
* filter
)
1937 GET_CURRENT_CONTEXT(ctx
);
1940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1942 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1945 n
[2].e
= internalFormat
;
1950 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1953 if (ctx
->ExecuteFlag
) {
1954 CALL_ConvolutionFilter2D(ctx
->Exec
,
1955 (target
, internalFormat
, width
, height
, format
,
1961 static void GLAPIENTRY
1962 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1964 GET_CURRENT_CONTEXT(ctx
);
1966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1967 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1973 if (ctx
->ExecuteFlag
) {
1974 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1979 static void GLAPIENTRY
1980 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1982 GET_CURRENT_CONTEXT(ctx
);
1984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1985 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1990 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1991 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1992 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1998 n
[4].i
= n
[5].i
= n
[6].i
= 0;
2001 if (ctx
->ExecuteFlag
) {
2002 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
2007 static void GLAPIENTRY
2008 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
2010 GET_CURRENT_CONTEXT(ctx
);
2012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2013 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
2019 if (ctx
->ExecuteFlag
) {
2020 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
2025 static void GLAPIENTRY
2026 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
2027 const GLfloat
*params
)
2029 GET_CURRENT_CONTEXT(ctx
);
2031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2032 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
2037 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
2038 pname
== GL_CONVOLUTION_FILTER_SCALE
||
2039 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2045 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
2048 if (ctx
->ExecuteFlag
) {
2049 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
2054 static void GLAPIENTRY
2055 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2057 GET_CURRENT_CONTEXT(ctx
);
2059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2060 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2064 n
[3].i
= (GLint
) width
;
2065 n
[4].i
= (GLint
) height
;
2068 if (ctx
->ExecuteFlag
) {
2069 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2075 static void GLAPIENTRY
2076 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2077 GLint x
, GLint y
, GLsizei width
, GLint border
)
2079 GET_CURRENT_CONTEXT(ctx
);
2081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2082 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2086 n
[3].e
= internalformat
;
2092 if (ctx
->ExecuteFlag
) {
2093 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2094 x
, y
, width
, border
));
2099 static void GLAPIENTRY
2100 save_CopyTexImage2D(GLenum target
, GLint level
,
2101 GLenum internalformat
,
2102 GLint x
, GLint y
, GLsizei width
,
2103 GLsizei height
, GLint border
)
2105 GET_CURRENT_CONTEXT(ctx
);
2107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2108 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2112 n
[3].e
= internalformat
;
2119 if (ctx
->ExecuteFlag
) {
2120 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2121 x
, y
, width
, height
, border
));
2127 static void GLAPIENTRY
2128 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2129 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2131 GET_CURRENT_CONTEXT(ctx
);
2133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2134 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2143 if (ctx
->ExecuteFlag
) {
2144 CALL_CopyTexSubImage1D(ctx
->Exec
,
2145 (target
, level
, xoffset
, x
, y
, width
));
2150 static void GLAPIENTRY
2151 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2152 GLint xoffset
, GLint yoffset
,
2153 GLint x
, GLint y
, GLsizei width
, GLint height
)
2155 GET_CURRENT_CONTEXT(ctx
);
2157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2158 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2169 if (ctx
->ExecuteFlag
) {
2170 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2171 x
, y
, width
, height
));
2176 static void GLAPIENTRY
2177 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2178 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2179 GLint x
, GLint y
, GLsizei width
, GLint height
)
2181 GET_CURRENT_CONTEXT(ctx
);
2183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2184 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2196 if (ctx
->ExecuteFlag
) {
2197 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2198 xoffset
, yoffset
, zoffset
,
2199 x
, y
, width
, height
));
2204 static void GLAPIENTRY
2205 save_CullFace(GLenum mode
)
2207 GET_CURRENT_CONTEXT(ctx
);
2209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2210 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2214 if (ctx
->ExecuteFlag
) {
2215 CALL_CullFace(ctx
->Exec
, (mode
));
2220 static void GLAPIENTRY
2221 save_DepthFunc(GLenum func
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2230 if (ctx
->ExecuteFlag
) {
2231 CALL_DepthFunc(ctx
->Exec
, (func
));
2236 static void GLAPIENTRY
2237 save_DepthMask(GLboolean mask
)
2239 GET_CURRENT_CONTEXT(ctx
);
2241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2242 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2246 if (ctx
->ExecuteFlag
) {
2247 CALL_DepthMask(ctx
->Exec
, (mask
));
2252 static void GLAPIENTRY
2253 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2255 GET_CURRENT_CONTEXT(ctx
);
2257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2258 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2260 n
[1].f
= (GLfloat
) nearval
;
2261 n
[2].f
= (GLfloat
) farval
;
2263 if (ctx
->ExecuteFlag
) {
2264 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2269 static void GLAPIENTRY
2270 save_Disable(GLenum cap
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2279 if (ctx
->ExecuteFlag
) {
2280 CALL_Disable(ctx
->Exec
, (cap
));
2285 static void GLAPIENTRY
2286 save_DisableIndexed(GLuint index
, GLenum cap
)
2288 GET_CURRENT_CONTEXT(ctx
);
2290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2291 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2296 if (ctx
->ExecuteFlag
) {
2297 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2302 static void GLAPIENTRY
2303 save_DrawBuffer(GLenum mode
)
2305 GET_CURRENT_CONTEXT(ctx
);
2307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2308 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2312 if (ctx
->ExecuteFlag
) {
2313 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2318 static void GLAPIENTRY
2319 save_DrawPixels(GLsizei width
, GLsizei height
,
2320 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2322 GET_CURRENT_CONTEXT(ctx
);
2325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2327 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2333 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2334 pixels
, &ctx
->Unpack
);
2336 if (ctx
->ExecuteFlag
) {
2337 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2343 static void GLAPIENTRY
2344 save_Enable(GLenum cap
)
2346 GET_CURRENT_CONTEXT(ctx
);
2348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2349 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2353 if (ctx
->ExecuteFlag
) {
2354 CALL_Enable(ctx
->Exec
, (cap
));
2360 static void GLAPIENTRY
2361 save_EnableIndexed(GLuint index
, GLenum cap
)
2363 GET_CURRENT_CONTEXT(ctx
);
2365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2366 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2371 if (ctx
->ExecuteFlag
) {
2372 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2378 static void GLAPIENTRY
2379 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2381 GET_CURRENT_CONTEXT(ctx
);
2383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2384 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2390 if (ctx
->ExecuteFlag
) {
2391 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2396 static void GLAPIENTRY
2397 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2399 GET_CURRENT_CONTEXT(ctx
);
2401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2402 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2410 if (ctx
->ExecuteFlag
) {
2411 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2418 static void GLAPIENTRY
2419 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2421 GET_CURRENT_CONTEXT(ctx
);
2423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2424 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2432 if (ctx
->ExecuteFlag
) {
2433 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2438 static void GLAPIENTRY
2439 save_Fogf(GLenum pname
, GLfloat param
)
2443 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2444 save_Fogfv(pname
, parray
);
2448 static void GLAPIENTRY
2449 save_Fogiv(GLenum pname
, const GLint
*params
)
2454 case GL_FOG_DENSITY
:
2458 p
[0] = (GLfloat
) *params
;
2464 p
[0] = INT_TO_FLOAT(params
[0]);
2465 p
[1] = INT_TO_FLOAT(params
[1]);
2466 p
[2] = INT_TO_FLOAT(params
[2]);
2467 p
[3] = INT_TO_FLOAT(params
[3]);
2470 /* Error will be caught later in gl_Fogfv */
2471 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2473 save_Fogfv(pname
, p
);
2477 static void GLAPIENTRY
2478 save_Fogi(GLenum pname
, GLint param
)
2482 parray
[1] = parray
[2] = parray
[3] = 0;
2483 save_Fogiv(pname
, parray
);
2487 static void GLAPIENTRY
2488 save_FrontFace(GLenum mode
)
2490 GET_CURRENT_CONTEXT(ctx
);
2492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2493 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2497 if (ctx
->ExecuteFlag
) {
2498 CALL_FrontFace(ctx
->Exec
, (mode
));
2503 static void GLAPIENTRY
2504 save_Frustum(GLdouble left
, GLdouble right
,
2505 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2507 GET_CURRENT_CONTEXT(ctx
);
2509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2510 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2512 n
[1].f
= (GLfloat
) left
;
2513 n
[2].f
= (GLfloat
) right
;
2514 n
[3].f
= (GLfloat
) bottom
;
2515 n
[4].f
= (GLfloat
) top
;
2516 n
[5].f
= (GLfloat
) nearval
;
2517 n
[6].f
= (GLfloat
) farval
;
2519 if (ctx
->ExecuteFlag
) {
2520 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2525 static void GLAPIENTRY
2526 save_Hint(GLenum target
, GLenum mode
)
2528 GET_CURRENT_CONTEXT(ctx
);
2530 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2531 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2536 if (ctx
->ExecuteFlag
) {
2537 CALL_Hint(ctx
->Exec
, (target
, mode
));
2542 static void GLAPIENTRY
2543 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2546 GET_CURRENT_CONTEXT(ctx
);
2549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2550 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2554 n
[3].e
= internalFormat
;
2557 if (ctx
->ExecuteFlag
) {
2558 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2563 static void GLAPIENTRY
2564 save_IndexMask(GLuint mask
)
2566 GET_CURRENT_CONTEXT(ctx
);
2568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2569 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2573 if (ctx
->ExecuteFlag
) {
2574 CALL_IndexMask(ctx
->Exec
, (mask
));
2579 static void GLAPIENTRY
2580 save_InitNames(void)
2582 GET_CURRENT_CONTEXT(ctx
);
2583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2584 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2585 if (ctx
->ExecuteFlag
) {
2586 CALL_InitNames(ctx
->Exec
, ());
2591 static void GLAPIENTRY
2592 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2594 GET_CURRENT_CONTEXT(ctx
);
2596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2597 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2615 case GL_SPOT_DIRECTION
:
2618 case GL_SPOT_EXPONENT
:
2621 case GL_SPOT_CUTOFF
:
2624 case GL_CONSTANT_ATTENUATION
:
2627 case GL_LINEAR_ATTENUATION
:
2630 case GL_QUADRATIC_ATTENUATION
:
2636 for (i
= 0; i
< nParams
; i
++) {
2637 n
[3 + i
].f
= params
[i
];
2640 if (ctx
->ExecuteFlag
) {
2641 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2646 static void GLAPIENTRY
2647 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2651 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2652 save_Lightfv(light
, pname
, parray
);
2656 static void GLAPIENTRY
2657 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2664 fparam
[0] = INT_TO_FLOAT(params
[0]);
2665 fparam
[1] = INT_TO_FLOAT(params
[1]);
2666 fparam
[2] = INT_TO_FLOAT(params
[2]);
2667 fparam
[3] = INT_TO_FLOAT(params
[3]);
2670 fparam
[0] = (GLfloat
) params
[0];
2671 fparam
[1] = (GLfloat
) params
[1];
2672 fparam
[2] = (GLfloat
) params
[2];
2673 fparam
[3] = (GLfloat
) params
[3];
2675 case GL_SPOT_DIRECTION
:
2676 fparam
[0] = (GLfloat
) params
[0];
2677 fparam
[1] = (GLfloat
) params
[1];
2678 fparam
[2] = (GLfloat
) params
[2];
2680 case GL_SPOT_EXPONENT
:
2681 case GL_SPOT_CUTOFF
:
2682 case GL_CONSTANT_ATTENUATION
:
2683 case GL_LINEAR_ATTENUATION
:
2684 case GL_QUADRATIC_ATTENUATION
:
2685 fparam
[0] = (GLfloat
) params
[0];
2688 /* error will be caught later in gl_Lightfv */
2691 save_Lightfv(light
, pname
, fparam
);
2695 static void GLAPIENTRY
2696 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2700 parray
[1] = parray
[2] = parray
[3] = 0;
2701 save_Lightiv(light
, pname
, parray
);
2705 static void GLAPIENTRY
2706 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2708 GET_CURRENT_CONTEXT(ctx
);
2710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2711 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2719 if (ctx
->ExecuteFlag
) {
2720 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2725 static void GLAPIENTRY
2726 save_LightModelf(GLenum pname
, GLfloat param
)
2730 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2731 save_LightModelfv(pname
, parray
);
2735 static void GLAPIENTRY
2736 save_LightModeliv(GLenum pname
, const GLint
*params
)
2740 case GL_LIGHT_MODEL_AMBIENT
:
2741 fparam
[0] = INT_TO_FLOAT(params
[0]);
2742 fparam
[1] = INT_TO_FLOAT(params
[1]);
2743 fparam
[2] = INT_TO_FLOAT(params
[2]);
2744 fparam
[3] = INT_TO_FLOAT(params
[3]);
2746 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2747 case GL_LIGHT_MODEL_TWO_SIDE
:
2748 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2749 fparam
[0] = (GLfloat
) params
[0];
2755 /* Error will be caught later in gl_LightModelfv */
2756 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2758 save_LightModelfv(pname
, fparam
);
2762 static void GLAPIENTRY
2763 save_LightModeli(GLenum pname
, GLint param
)
2767 parray
[1] = parray
[2] = parray
[3] = 0;
2768 save_LightModeliv(pname
, parray
);
2772 static void GLAPIENTRY
2773 save_LineStipple(GLint factor
, GLushort pattern
)
2775 GET_CURRENT_CONTEXT(ctx
);
2777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2778 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2783 if (ctx
->ExecuteFlag
) {
2784 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2789 static void GLAPIENTRY
2790 save_LineWidth(GLfloat width
)
2792 GET_CURRENT_CONTEXT(ctx
);
2794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2795 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_LineWidth(ctx
->Exec
, (width
));
2805 static void GLAPIENTRY
2806 save_ListBase(GLuint base
)
2808 GET_CURRENT_CONTEXT(ctx
);
2810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2811 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_ListBase(ctx
->Exec
, (base
));
2821 static void GLAPIENTRY
2822 save_LoadIdentity(void)
2824 GET_CURRENT_CONTEXT(ctx
);
2825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2826 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2827 if (ctx
->ExecuteFlag
) {
2828 CALL_LoadIdentity(ctx
->Exec
, ());
2833 static void GLAPIENTRY
2834 save_LoadMatrixf(const GLfloat
* m
)
2836 GET_CURRENT_CONTEXT(ctx
);
2838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2839 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2842 for (i
= 0; i
< 16; i
++) {
2846 if (ctx
->ExecuteFlag
) {
2847 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2852 static void GLAPIENTRY
2853 save_LoadMatrixd(const GLdouble
* m
)
2857 for (i
= 0; i
< 16; i
++) {
2858 f
[i
] = (GLfloat
) m
[i
];
2860 save_LoadMatrixf(f
);
2864 static void GLAPIENTRY
2865 save_LoadName(GLuint name
)
2867 GET_CURRENT_CONTEXT(ctx
);
2869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2870 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2874 if (ctx
->ExecuteFlag
) {
2875 CALL_LoadName(ctx
->Exec
, (name
));
2880 static void GLAPIENTRY
2881 save_LogicOp(GLenum opcode
)
2883 GET_CURRENT_CONTEXT(ctx
);
2885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2886 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2890 if (ctx
->ExecuteFlag
) {
2891 CALL_LogicOp(ctx
->Exec
, (opcode
));
2896 static void GLAPIENTRY
2897 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2898 GLint order
, const GLdouble
* points
)
2900 GET_CURRENT_CONTEXT(ctx
);
2902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2903 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2905 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2907 n
[2].f
= (GLfloat
) u1
;
2908 n
[3].f
= (GLfloat
) u2
;
2909 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2911 n
[6].data
= (void *) pnts
;
2913 if (ctx
->ExecuteFlag
) {
2914 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2918 static void GLAPIENTRY
2919 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2920 GLint order
, const GLfloat
* points
)
2922 GET_CURRENT_CONTEXT(ctx
);
2924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2925 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2927 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2931 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2933 n
[6].data
= (void *) pnts
;
2935 if (ctx
->ExecuteFlag
) {
2936 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2941 static void GLAPIENTRY
2942 save_Map2d(GLenum target
,
2943 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2944 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2945 const GLdouble
* points
)
2947 GET_CURRENT_CONTEXT(ctx
);
2949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2950 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2952 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2953 vstride
, vorder
, points
);
2955 n
[2].f
= (GLfloat
) u1
;
2956 n
[3].f
= (GLfloat
) u2
;
2957 n
[4].f
= (GLfloat
) v1
;
2958 n
[5].f
= (GLfloat
) v2
;
2959 /* XXX verify these strides are correct */
2960 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2961 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2964 n
[10].data
= (void *) pnts
;
2966 if (ctx
->ExecuteFlag
) {
2967 CALL_Map2d(ctx
->Exec
, (target
,
2968 u1
, u2
, ustride
, uorder
,
2969 v1
, v2
, vstride
, vorder
, points
));
2974 static void GLAPIENTRY
2975 save_Map2f(GLenum target
,
2976 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2977 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2978 const GLfloat
* points
)
2980 GET_CURRENT_CONTEXT(ctx
);
2982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2983 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2985 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2986 vstride
, vorder
, points
);
2992 /* XXX verify these strides are correct */
2993 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2994 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2997 n
[10].data
= (void *) pnts
;
2999 if (ctx
->ExecuteFlag
) {
3000 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3001 v1
, v2
, vstride
, vorder
, points
));
3006 static void GLAPIENTRY
3007 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3009 GET_CURRENT_CONTEXT(ctx
);
3011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3012 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3018 if (ctx
->ExecuteFlag
) {
3019 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3024 static void GLAPIENTRY
3025 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3027 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3031 static void GLAPIENTRY
3032 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3033 GLint vn
, GLfloat v1
, GLfloat v2
)
3035 GET_CURRENT_CONTEXT(ctx
);
3037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3038 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3047 if (ctx
->ExecuteFlag
) {
3048 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3054 static void GLAPIENTRY
3055 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3056 GLint vn
, GLdouble v1
, GLdouble v2
)
3058 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3059 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3063 static void GLAPIENTRY
3064 save_MatrixMode(GLenum mode
)
3066 GET_CURRENT_CONTEXT(ctx
);
3068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3069 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3073 if (ctx
->ExecuteFlag
) {
3074 CALL_MatrixMode(ctx
->Exec
, (mode
));
3079 static void GLAPIENTRY
3080 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3082 GET_CURRENT_CONTEXT(ctx
);
3085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3086 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3089 n
[2].e
= internalFormat
;
3092 if (ctx
->ExecuteFlag
) {
3093 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3098 static void GLAPIENTRY
3099 save_MultMatrixf(const GLfloat
* m
)
3101 GET_CURRENT_CONTEXT(ctx
);
3103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3104 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3107 for (i
= 0; i
< 16; i
++) {
3111 if (ctx
->ExecuteFlag
) {
3112 CALL_MultMatrixf(ctx
->Exec
, (m
));
3117 static void GLAPIENTRY
3118 save_MultMatrixd(const GLdouble
* m
)
3122 for (i
= 0; i
< 16; i
++) {
3123 f
[i
] = (GLfloat
) m
[i
];
3125 save_MultMatrixf(f
);
3129 static void GLAPIENTRY
3130 save_NewList(GLuint name
, GLenum mode
)
3132 GET_CURRENT_CONTEXT(ctx
);
3133 /* It's an error to call this function while building a display list */
3134 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3141 static void GLAPIENTRY
3142 save_Ortho(GLdouble left
, GLdouble right
,
3143 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3145 GET_CURRENT_CONTEXT(ctx
);
3147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3148 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3150 n
[1].f
= (GLfloat
) left
;
3151 n
[2].f
= (GLfloat
) right
;
3152 n
[3].f
= (GLfloat
) bottom
;
3153 n
[4].f
= (GLfloat
) top
;
3154 n
[5].f
= (GLfloat
) nearval
;
3155 n
[6].f
= (GLfloat
) farval
;
3157 if (ctx
->ExecuteFlag
) {
3158 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3163 static void GLAPIENTRY
3164 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3166 GET_CURRENT_CONTEXT(ctx
);
3168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3169 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3173 n
[3].data
= malloc(mapsize
* sizeof(GLfloat
));
3174 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3176 if (ctx
->ExecuteFlag
) {
3177 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3182 static void GLAPIENTRY
3183 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3185 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3187 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3188 for (i
= 0; i
< mapsize
; i
++) {
3189 fvalues
[i
] = (GLfloat
) values
[i
];
3193 for (i
= 0; i
< mapsize
; i
++) {
3194 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3197 save_PixelMapfv(map
, mapsize
, fvalues
);
3201 static void GLAPIENTRY
3202 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3204 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3206 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3207 for (i
= 0; i
< mapsize
; i
++) {
3208 fvalues
[i
] = (GLfloat
) values
[i
];
3212 for (i
= 0; i
< mapsize
; i
++) {
3213 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3216 save_PixelMapfv(map
, mapsize
, fvalues
);
3220 static void GLAPIENTRY
3221 save_PixelTransferf(GLenum pname
, GLfloat param
)
3223 GET_CURRENT_CONTEXT(ctx
);
3225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3226 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3231 if (ctx
->ExecuteFlag
) {
3232 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3237 static void GLAPIENTRY
3238 save_PixelTransferi(GLenum pname
, GLint param
)
3240 save_PixelTransferf(pname
, (GLfloat
) param
);
3244 static void GLAPIENTRY
3245 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3247 GET_CURRENT_CONTEXT(ctx
);
3249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3250 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3255 if (ctx
->ExecuteFlag
) {
3256 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3261 static void GLAPIENTRY
3262 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3264 GET_CURRENT_CONTEXT(ctx
);
3266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3267 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3274 if (ctx
->ExecuteFlag
) {
3275 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3280 static void GLAPIENTRY
3281 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3285 parray
[1] = parray
[2] = 0.0F
;
3286 save_PointParameterfvEXT(pname
, parray
);
3289 static void GLAPIENTRY
3290 save_PointParameteriNV(GLenum pname
, GLint param
)
3293 parray
[0] = (GLfloat
) param
;
3294 parray
[1] = parray
[2] = 0.0F
;
3295 save_PointParameterfvEXT(pname
, parray
);
3298 static void GLAPIENTRY
3299 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3302 parray
[0] = (GLfloat
) param
[0];
3303 parray
[1] = parray
[2] = 0.0F
;
3304 save_PointParameterfvEXT(pname
, parray
);
3308 static void GLAPIENTRY
3309 save_PointSize(GLfloat size
)
3311 GET_CURRENT_CONTEXT(ctx
);
3313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3314 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3318 if (ctx
->ExecuteFlag
) {
3319 CALL_PointSize(ctx
->Exec
, (size
));
3324 static void GLAPIENTRY
3325 save_PolygonMode(GLenum face
, GLenum mode
)
3327 GET_CURRENT_CONTEXT(ctx
);
3329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3330 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3335 if (ctx
->ExecuteFlag
) {
3336 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3341 static void GLAPIENTRY
3342 save_PolygonStipple(const GLubyte
* pattern
)
3344 GET_CURRENT_CONTEXT(ctx
);
3347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3349 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3351 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3352 pattern
, &ctx
->Unpack
);
3354 if (ctx
->ExecuteFlag
) {
3355 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3360 static void GLAPIENTRY
3361 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3363 GET_CURRENT_CONTEXT(ctx
);
3365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3366 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3371 if (ctx
->ExecuteFlag
) {
3372 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3377 static void GLAPIENTRY
3378 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3380 GET_CURRENT_CONTEXT(ctx
);
3381 /* XXX mult by DepthMaxF here??? */
3382 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3386 static void GLAPIENTRY
3387 save_PopAttrib(void)
3389 GET_CURRENT_CONTEXT(ctx
);
3390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3391 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3392 if (ctx
->ExecuteFlag
) {
3393 CALL_PopAttrib(ctx
->Exec
, ());
3398 static void GLAPIENTRY
3399 save_PopMatrix(void)
3401 GET_CURRENT_CONTEXT(ctx
);
3402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3403 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3404 if (ctx
->ExecuteFlag
) {
3405 CALL_PopMatrix(ctx
->Exec
, ());
3410 static void GLAPIENTRY
3413 GET_CURRENT_CONTEXT(ctx
);
3414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3415 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3416 if (ctx
->ExecuteFlag
) {
3417 CALL_PopName(ctx
->Exec
, ());
3422 static void GLAPIENTRY
3423 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3424 const GLclampf
* priorities
)
3426 GET_CURRENT_CONTEXT(ctx
);
3428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3430 for (i
= 0; i
< num
; i
++) {
3432 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3434 n
[1].ui
= textures
[i
];
3435 n
[2].f
= priorities
[i
];
3438 if (ctx
->ExecuteFlag
) {
3439 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3444 static void GLAPIENTRY
3445 save_PushAttrib(GLbitfield mask
)
3447 GET_CURRENT_CONTEXT(ctx
);
3449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3450 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3454 if (ctx
->ExecuteFlag
) {
3455 CALL_PushAttrib(ctx
->Exec
, (mask
));
3460 static void GLAPIENTRY
3461 save_PushMatrix(void)
3463 GET_CURRENT_CONTEXT(ctx
);
3464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3465 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3466 if (ctx
->ExecuteFlag
) {
3467 CALL_PushMatrix(ctx
->Exec
, ());
3472 static void GLAPIENTRY
3473 save_PushName(GLuint name
)
3475 GET_CURRENT_CONTEXT(ctx
);
3477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3478 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3482 if (ctx
->ExecuteFlag
) {
3483 CALL_PushName(ctx
->Exec
, (name
));
3488 static void GLAPIENTRY
3489 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3491 GET_CURRENT_CONTEXT(ctx
);
3493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3494 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3501 if (ctx
->ExecuteFlag
) {
3502 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3506 static void GLAPIENTRY
3507 save_RasterPos2d(GLdouble x
, GLdouble y
)
3509 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3512 static void GLAPIENTRY
3513 save_RasterPos2f(GLfloat x
, GLfloat y
)
3515 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3518 static void GLAPIENTRY
3519 save_RasterPos2i(GLint x
, GLint y
)
3521 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3524 static void GLAPIENTRY
3525 save_RasterPos2s(GLshort x
, GLshort y
)
3527 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3530 static void GLAPIENTRY
3531 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3533 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3536 static void GLAPIENTRY
3537 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3539 save_RasterPos4f(x
, y
, z
, 1.0F
);
3542 static void GLAPIENTRY
3543 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3545 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3548 static void GLAPIENTRY
3549 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3551 save_RasterPos4f(x
, y
, z
, 1.0F
);
3554 static void GLAPIENTRY
3555 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3557 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3560 static void GLAPIENTRY
3561 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3563 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3566 static void GLAPIENTRY
3567 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3569 save_RasterPos4f(x
, y
, z
, w
);
3572 static void GLAPIENTRY
3573 save_RasterPos2dv(const GLdouble
* v
)
3575 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3578 static void GLAPIENTRY
3579 save_RasterPos2fv(const GLfloat
* v
)
3581 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3584 static void GLAPIENTRY
3585 save_RasterPos2iv(const GLint
* v
)
3587 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3590 static void GLAPIENTRY
3591 save_RasterPos2sv(const GLshort
* v
)
3593 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3596 static void GLAPIENTRY
3597 save_RasterPos3dv(const GLdouble
* v
)
3599 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3602 static void GLAPIENTRY
3603 save_RasterPos3fv(const GLfloat
* v
)
3605 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3608 static void GLAPIENTRY
3609 save_RasterPos3iv(const GLint
* v
)
3611 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3614 static void GLAPIENTRY
3615 save_RasterPos3sv(const GLshort
* v
)
3617 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3620 static void GLAPIENTRY
3621 save_RasterPos4dv(const GLdouble
* v
)
3623 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3624 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3627 static void GLAPIENTRY
3628 save_RasterPos4fv(const GLfloat
* v
)
3630 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3633 static void GLAPIENTRY
3634 save_RasterPos4iv(const GLint
* v
)
3636 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3637 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3640 static void GLAPIENTRY
3641 save_RasterPos4sv(const GLshort
* v
)
3643 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3647 static void GLAPIENTRY
3648 save_PassThrough(GLfloat token
)
3650 GET_CURRENT_CONTEXT(ctx
);
3652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3653 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3657 if (ctx
->ExecuteFlag
) {
3658 CALL_PassThrough(ctx
->Exec
, (token
));
3663 static void GLAPIENTRY
3664 save_ReadBuffer(GLenum mode
)
3666 GET_CURRENT_CONTEXT(ctx
);
3668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3669 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3673 if (ctx
->ExecuteFlag
) {
3674 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3679 static void GLAPIENTRY
3680 save_ResetHistogram(GLenum target
)
3682 GET_CURRENT_CONTEXT(ctx
);
3684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3685 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3689 if (ctx
->ExecuteFlag
) {
3690 CALL_ResetHistogram(ctx
->Exec
, (target
));
3695 static void GLAPIENTRY
3696 save_ResetMinmax(GLenum target
)
3698 GET_CURRENT_CONTEXT(ctx
);
3700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3701 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3705 if (ctx
->ExecuteFlag
) {
3706 CALL_ResetMinmax(ctx
->Exec
, (target
));
3711 static void GLAPIENTRY
3712 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3714 GET_CURRENT_CONTEXT(ctx
);
3716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3717 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3724 if (ctx
->ExecuteFlag
) {
3725 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3730 static void GLAPIENTRY
3731 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3733 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3737 static void GLAPIENTRY
3738 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3740 GET_CURRENT_CONTEXT(ctx
);
3742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3743 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3749 if (ctx
->ExecuteFlag
) {
3750 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3755 static void GLAPIENTRY
3756 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3758 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3762 static void GLAPIENTRY
3763 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3765 GET_CURRENT_CONTEXT(ctx
);
3767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3768 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3775 if (ctx
->ExecuteFlag
) {
3776 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3781 static void GLAPIENTRY
3782 save_ShadeModel(GLenum mode
)
3784 GET_CURRENT_CONTEXT(ctx
);
3786 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3788 if (ctx
->ExecuteFlag
) {
3789 CALL_ShadeModel(ctx
->Exec
, (mode
));
3792 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3795 SAVE_FLUSH_VERTICES(ctx
);
3797 /* Only save the value if we know the statechange will take effect:
3799 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3800 ctx
->ListState
.Current
.ShadeModel
= mode
;
3802 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3809 static void GLAPIENTRY
3810 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3812 GET_CURRENT_CONTEXT(ctx
);
3814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3815 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3821 if (ctx
->ExecuteFlag
) {
3822 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3827 static void GLAPIENTRY
3828 save_StencilMask(GLuint mask
)
3830 GET_CURRENT_CONTEXT(ctx
);
3832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3833 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3837 if (ctx
->ExecuteFlag
) {
3838 CALL_StencilMask(ctx
->Exec
, (mask
));
3843 static void GLAPIENTRY
3844 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3846 GET_CURRENT_CONTEXT(ctx
);
3848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3849 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3855 if (ctx
->ExecuteFlag
) {
3856 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3861 static void GLAPIENTRY
3862 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3864 GET_CURRENT_CONTEXT(ctx
);
3866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3867 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3874 if (ctx
->ExecuteFlag
) {
3875 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3880 static void GLAPIENTRY
3881 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3884 GET_CURRENT_CONTEXT(ctx
);
3886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3888 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3896 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3903 if (ctx
->ExecuteFlag
) {
3904 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3905 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3910 static void GLAPIENTRY
3911 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3913 GET_CURRENT_CONTEXT(ctx
);
3915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3916 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3921 if (ctx
->ExecuteFlag
) {
3922 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3927 static void GLAPIENTRY
3928 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3930 GET_CURRENT_CONTEXT(ctx
);
3932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3933 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3940 if (ctx
->ExecuteFlag
) {
3941 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3946 static void GLAPIENTRY
3947 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3949 GET_CURRENT_CONTEXT(ctx
);
3951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3952 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3956 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3964 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3967 if (ctx
->ExecuteFlag
) {
3968 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3973 static void GLAPIENTRY
3974 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3977 parray
[0] = (GLfloat
) param
;
3978 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3979 save_TexEnvfv(target
, pname
, parray
);
3983 static void GLAPIENTRY
3984 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3987 p
[0] = (GLfloat
) param
;
3988 p
[1] = p
[2] = p
[3] = 0.0F
;
3989 save_TexEnvfv(target
, pname
, p
);
3993 static void GLAPIENTRY
3994 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3997 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3998 p
[0] = INT_TO_FLOAT(param
[0]);
3999 p
[1] = INT_TO_FLOAT(param
[1]);
4000 p
[2] = INT_TO_FLOAT(param
[2]);
4001 p
[3] = INT_TO_FLOAT(param
[3]);
4004 p
[0] = (GLfloat
) param
[0];
4005 p
[1] = p
[2] = p
[3] = 0.0F
;
4007 save_TexEnvfv(target
, pname
, p
);
4011 static void GLAPIENTRY
4012 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4014 GET_CURRENT_CONTEXT(ctx
);
4016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4017 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4026 if (ctx
->ExecuteFlag
) {
4027 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4032 static void GLAPIENTRY
4033 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4036 p
[0] = (GLfloat
) params
[0];
4037 p
[1] = (GLfloat
) params
[1];
4038 p
[2] = (GLfloat
) params
[2];
4039 p
[3] = (GLfloat
) params
[3];
4040 save_TexGenfv(coord
, pname
, p
);
4044 static void GLAPIENTRY
4045 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4048 parray
[0] = (GLfloat
) param
;
4049 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4050 save_TexGenfv(coord
, pname
, parray
);
4054 static void GLAPIENTRY
4055 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4058 p
[0] = (GLfloat
) params
[0];
4059 p
[1] = (GLfloat
) params
[1];
4060 p
[2] = (GLfloat
) params
[2];
4061 p
[3] = (GLfloat
) params
[3];
4062 save_TexGenfv(coord
, pname
, p
);
4066 static void GLAPIENTRY
4067 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4071 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4072 save_TexGenfv(coord
, pname
, parray
);
4076 static void GLAPIENTRY
4077 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4081 parray
[1] = parray
[2] = parray
[3] = 0;
4082 save_TexGeniv(coord
, pname
, parray
);
4086 static void GLAPIENTRY
4087 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4089 GET_CURRENT_CONTEXT(ctx
);
4091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4092 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4101 if (ctx
->ExecuteFlag
) {
4102 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4107 static void GLAPIENTRY
4108 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4112 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4113 save_TexParameterfv(target
, pname
, parray
);
4117 static void GLAPIENTRY
4118 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4121 fparam
[0] = (GLfloat
) param
;
4122 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4123 save_TexParameterfv(target
, pname
, fparam
);
4127 static void GLAPIENTRY
4128 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4131 fparam
[0] = (GLfloat
) params
[0];
4132 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4133 save_TexParameterfv(target
, pname
, fparam
);
4137 static void GLAPIENTRY
4138 save_TexImage1D(GLenum target
,
4139 GLint level
, GLint components
,
4140 GLsizei width
, GLint border
,
4141 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4143 GET_CURRENT_CONTEXT(ctx
);
4144 if (target
== GL_PROXY_TEXTURE_1D
) {
4145 /* don't compile, execute immediately */
4146 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4147 border
, format
, type
, pixels
));
4151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4152 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4156 n
[3].i
= components
;
4157 n
[4].i
= (GLint
) width
;
4161 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4162 pixels
, &ctx
->Unpack
);
4164 if (ctx
->ExecuteFlag
) {
4165 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4166 border
, format
, type
, pixels
));
4172 static void GLAPIENTRY
4173 save_TexImage2D(GLenum target
,
4174 GLint level
, GLint components
,
4175 GLsizei width
, GLsizei height
, GLint border
,
4176 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4178 GET_CURRENT_CONTEXT(ctx
);
4179 if (target
== GL_PROXY_TEXTURE_2D
) {
4180 /* don't compile, execute immediately */
4181 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4182 height
, border
, format
, type
, pixels
));
4186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4187 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4191 n
[3].i
= components
;
4192 n
[4].i
= (GLint
) width
;
4193 n
[5].i
= (GLint
) height
;
4197 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4198 pixels
, &ctx
->Unpack
);
4200 if (ctx
->ExecuteFlag
) {
4201 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4202 height
, border
, format
, type
, pixels
));
4208 static void GLAPIENTRY
4209 save_TexImage3D(GLenum target
,
4210 GLint level
, GLint internalFormat
,
4211 GLsizei width
, GLsizei height
, GLsizei depth
,
4213 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4215 GET_CURRENT_CONTEXT(ctx
);
4216 if (target
== GL_PROXY_TEXTURE_3D
) {
4217 /* don't compile, execute immediately */
4218 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4219 height
, depth
, border
, format
, type
,
4224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4225 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4229 n
[3].i
= (GLint
) internalFormat
;
4230 n
[4].i
= (GLint
) width
;
4231 n
[5].i
= (GLint
) height
;
4232 n
[6].i
= (GLint
) depth
;
4236 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4237 pixels
, &ctx
->Unpack
);
4239 if (ctx
->ExecuteFlag
) {
4240 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4241 height
, depth
, border
, format
, type
,
4248 static void GLAPIENTRY
4249 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4250 GLsizei width
, GLenum format
, GLenum type
,
4251 const GLvoid
* pixels
)
4253 GET_CURRENT_CONTEXT(ctx
);
4256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4258 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4263 n
[4].i
= (GLint
) width
;
4266 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4267 pixels
, &ctx
->Unpack
);
4269 if (ctx
->ExecuteFlag
) {
4270 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4271 format
, type
, pixels
));
4276 static void GLAPIENTRY
4277 save_TexSubImage2D(GLenum target
, GLint level
,
4278 GLint xoffset
, GLint yoffset
,
4279 GLsizei width
, GLsizei height
,
4280 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4282 GET_CURRENT_CONTEXT(ctx
);
4285 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4287 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4293 n
[5].i
= (GLint
) width
;
4294 n
[6].i
= (GLint
) height
;
4297 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4298 pixels
, &ctx
->Unpack
);
4300 if (ctx
->ExecuteFlag
) {
4301 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4302 width
, height
, format
, type
, pixels
));
4307 static void GLAPIENTRY
4308 save_TexSubImage3D(GLenum target
, GLint level
,
4309 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4310 GLsizei width
, GLsizei height
, GLsizei depth
,
4311 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4313 GET_CURRENT_CONTEXT(ctx
);
4316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4318 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4325 n
[6].i
= (GLint
) width
;
4326 n
[7].i
= (GLint
) height
;
4327 n
[8].i
= (GLint
) depth
;
4330 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4331 pixels
, &ctx
->Unpack
);
4333 if (ctx
->ExecuteFlag
) {
4334 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4335 xoffset
, yoffset
, zoffset
,
4336 width
, height
, depth
, format
, type
,
4342 static void GLAPIENTRY
4343 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4345 GET_CURRENT_CONTEXT(ctx
);
4347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4348 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4354 if (ctx
->ExecuteFlag
) {
4355 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4360 static void GLAPIENTRY
4361 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4363 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4368 static void GLAPIENTRY
4369 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4371 GET_CURRENT_CONTEXT(ctx
);
4373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4374 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4378 n
[3].i
= (GLint
) width
;
4379 n
[4].i
= (GLint
) height
;
4381 if (ctx
->ExecuteFlag
) {
4382 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4387 static void GLAPIENTRY
4388 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4390 GET_CURRENT_CONTEXT(ctx
);
4392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4393 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4400 if (ctx
->ExecuteFlag
) {
4401 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4405 static void GLAPIENTRY
4406 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4408 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4411 static void GLAPIENTRY
4412 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4414 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4417 static void GLAPIENTRY
4418 save_WindowPos2iMESA(GLint x
, GLint y
)
4420 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4423 static void GLAPIENTRY
4424 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4426 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4429 static void GLAPIENTRY
4430 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4432 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4435 static void GLAPIENTRY
4436 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4438 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4441 static void GLAPIENTRY
4442 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4444 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4447 static void GLAPIENTRY
4448 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4450 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4453 static void GLAPIENTRY
4454 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4456 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4459 static void GLAPIENTRY
4460 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4462 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4465 static void GLAPIENTRY
4466 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4468 save_WindowPos4fMESA(x
, y
, z
, w
);
4471 static void GLAPIENTRY
4472 save_WindowPos2dvMESA(const GLdouble
* v
)
4474 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4477 static void GLAPIENTRY
4478 save_WindowPos2fvMESA(const GLfloat
* v
)
4480 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4483 static void GLAPIENTRY
4484 save_WindowPos2ivMESA(const GLint
* v
)
4486 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4489 static void GLAPIENTRY
4490 save_WindowPos2svMESA(const GLshort
* v
)
4492 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4495 static void GLAPIENTRY
4496 save_WindowPos3dvMESA(const GLdouble
* v
)
4498 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4501 static void GLAPIENTRY
4502 save_WindowPos3fvMESA(const GLfloat
* v
)
4504 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4507 static void GLAPIENTRY
4508 save_WindowPos3ivMESA(const GLint
* v
)
4510 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4513 static void GLAPIENTRY
4514 save_WindowPos3svMESA(const GLshort
* v
)
4516 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4519 static void GLAPIENTRY
4520 save_WindowPos4dvMESA(const GLdouble
* v
)
4522 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4523 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4526 static void GLAPIENTRY
4527 save_WindowPos4fvMESA(const GLfloat
* v
)
4529 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4532 static void GLAPIENTRY
4533 save_WindowPos4ivMESA(const GLint
* v
)
4535 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4536 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4539 static void GLAPIENTRY
4540 save_WindowPos4svMESA(const GLshort
* v
)
4542 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4547 /* GL_ARB_multitexture */
4548 static void GLAPIENTRY
4549 save_ActiveTextureARB(GLenum target
)
4551 GET_CURRENT_CONTEXT(ctx
);
4553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4554 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4558 if (ctx
->ExecuteFlag
) {
4559 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4564 /* GL_ARB_transpose_matrix */
4566 static void GLAPIENTRY
4567 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4570 _math_transposefd(tm
, m
);
4571 save_LoadMatrixf(tm
);
4575 static void GLAPIENTRY
4576 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4579 _math_transposef(tm
, m
);
4580 save_LoadMatrixf(tm
);
4584 static void GLAPIENTRY
4585 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4588 _math_transposefd(tm
, m
);
4589 save_MultMatrixf(tm
);
4593 static void GLAPIENTRY
4594 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4597 _math_transposef(tm
, m
);
4598 save_MultMatrixf(tm
);
4601 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4603 GET_CURRENT_CONTEXT(ctx
);
4609 image
= malloc(size
);
4611 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4614 memcpy(image
, data
, size
);
4620 /* GL_ARB_texture_compression */
4621 static void GLAPIENTRY
4622 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4623 GLenum internalFormat
, GLsizei width
,
4624 GLint border
, GLsizei imageSize
,
4625 const GLvoid
* data
)
4627 GET_CURRENT_CONTEXT(ctx
);
4628 if (target
== GL_PROXY_TEXTURE_1D
) {
4629 /* don't compile, execute immediately */
4630 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4631 width
, border
, imageSize
,
4636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4638 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4642 n
[3].e
= internalFormat
;
4643 n
[4].i
= (GLint
) width
;
4646 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4650 (target
, level
, internalFormat
, width
,
4651 border
, imageSize
, data
));
4657 static void GLAPIENTRY
4658 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4659 GLenum internalFormat
, GLsizei width
,
4660 GLsizei height
, GLint border
, GLsizei imageSize
,
4661 const GLvoid
* data
)
4663 GET_CURRENT_CONTEXT(ctx
);
4664 if (target
== GL_PROXY_TEXTURE_2D
) {
4665 /* don't compile, execute immediately */
4666 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4667 width
, height
, border
,
4672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4674 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4678 n
[3].e
= internalFormat
;
4679 n
[4].i
= (GLint
) width
;
4680 n
[5].i
= (GLint
) height
;
4683 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4685 if (ctx
->ExecuteFlag
) {
4686 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4687 (target
, level
, internalFormat
, width
,
4688 height
, border
, imageSize
, data
));
4694 static void GLAPIENTRY
4695 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4696 GLenum internalFormat
, GLsizei width
,
4697 GLsizei height
, GLsizei depth
, GLint border
,
4698 GLsizei imageSize
, const GLvoid
* data
)
4700 GET_CURRENT_CONTEXT(ctx
);
4701 if (target
== GL_PROXY_TEXTURE_3D
) {
4702 /* don't compile, execute immediately */
4703 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4704 width
, height
, depth
, border
,
4709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4711 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4715 n
[3].e
= internalFormat
;
4716 n
[4].i
= (GLint
) width
;
4717 n
[5].i
= (GLint
) height
;
4718 n
[6].i
= (GLint
) depth
;
4721 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4723 if (ctx
->ExecuteFlag
) {
4724 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4725 (target
, level
, internalFormat
, width
,
4726 height
, depth
, border
, imageSize
,
4733 static void GLAPIENTRY
4734 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4735 GLsizei width
, GLenum format
,
4736 GLsizei imageSize
, const GLvoid
* data
)
4739 GET_CURRENT_CONTEXT(ctx
);
4740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4742 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4747 n
[4].i
= (GLint
) width
;
4750 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4752 if (ctx
->ExecuteFlag
) {
4753 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4754 width
, format
, imageSize
,
4760 static void GLAPIENTRY
4761 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4762 GLint yoffset
, GLsizei width
, GLsizei height
,
4763 GLenum format
, GLsizei imageSize
,
4764 const GLvoid
* data
)
4767 GET_CURRENT_CONTEXT(ctx
);
4768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4770 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4776 n
[5].i
= (GLint
) width
;
4777 n
[6].i
= (GLint
) height
;
4780 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4782 if (ctx
->ExecuteFlag
) {
4783 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4784 (target
, level
, xoffset
, yoffset
, width
,
4785 height
, format
, imageSize
, data
));
4790 static void GLAPIENTRY
4791 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4792 GLint yoffset
, GLint zoffset
, GLsizei width
,
4793 GLsizei height
, GLsizei depth
, GLenum format
,
4794 GLsizei imageSize
, const GLvoid
* data
)
4797 GET_CURRENT_CONTEXT(ctx
);
4798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4800 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4807 n
[6].i
= (GLint
) width
;
4808 n
[7].i
= (GLint
) height
;
4809 n
[8].i
= (GLint
) depth
;
4811 n
[10].i
= imageSize
;
4812 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4814 if (ctx
->ExecuteFlag
) {
4815 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4816 (target
, level
, xoffset
, yoffset
,
4817 zoffset
, width
, height
, depth
, format
,
4823 /* GL_ARB_multisample */
4824 static void GLAPIENTRY
4825 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4827 GET_CURRENT_CONTEXT(ctx
);
4829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4830 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4835 if (ctx
->ExecuteFlag
) {
4836 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4842 * GL_NV_vertex_program
4844 static void GLAPIENTRY
4845 save_BindProgramNV(GLenum target
, GLuint id
)
4847 GET_CURRENT_CONTEXT(ctx
);
4849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4850 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4855 if (ctx
->ExecuteFlag
) {
4856 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4860 static void GLAPIENTRY
4861 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4862 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4864 GET_CURRENT_CONTEXT(ctx
);
4866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4867 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4876 if (ctx
->ExecuteFlag
) {
4877 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4882 static void GLAPIENTRY
4883 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4884 const GLfloat
*params
)
4886 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4887 params
[2], params
[3]);
4891 static void GLAPIENTRY
4892 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4893 const GLfloat
* params
)
4895 GET_CURRENT_CONTEXT(ctx
);
4897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4901 const GLfloat
* p
= params
;
4903 for (i
= 0 ; i
< count
; i
++) {
4904 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4917 if (ctx
->ExecuteFlag
) {
4918 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4923 static void GLAPIENTRY
4924 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4925 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4927 save_ProgramEnvParameter4fARB(target
, index
,
4929 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4933 static void GLAPIENTRY
4934 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4935 const GLdouble
*params
)
4937 save_ProgramEnvParameter4fARB(target
, index
,
4938 (GLfloat
) params
[0],
4939 (GLfloat
) params
[1],
4940 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4944 static void GLAPIENTRY
4945 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4947 GET_CURRENT_CONTEXT(ctx
);
4949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4950 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4959 if (ctx
->ExecuteFlag
) {
4960 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4965 static void GLAPIENTRY
4966 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4967 GLsizei num
, const GLdouble
*params
)
4970 for (i
= 0; i
< num
; i
++) {
4971 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4976 static void GLAPIENTRY
4977 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4978 GLsizei num
, const GLfloat
*params
)
4981 for (i
= 0; i
< num
; i
++) {
4982 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4987 static void GLAPIENTRY
4988 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4989 const GLubyte
* program
)
4991 GET_CURRENT_CONTEXT(ctx
);
4994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4996 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4998 GLubyte
*programCopy
= malloc(len
);
5000 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
5003 memcpy(programCopy
, program
, len
);
5007 n
[4].data
= programCopy
;
5009 if (ctx
->ExecuteFlag
) {
5010 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
5015 static void GLAPIENTRY
5016 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
5018 GET_CURRENT_CONTEXT(ctx
);
5021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5023 n
= alloc_instruction(ctx
, OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
, 2);
5025 GLuint
*idCopy
= malloc(num
* sizeof(GLuint
));
5027 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
5030 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
5034 if (ctx
->ExecuteFlag
) {
5035 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
5040 * GL_NV_fragment_program
5042 static void GLAPIENTRY
5043 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5044 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5046 GET_CURRENT_CONTEXT(ctx
);
5048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5049 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5058 if (ctx
->ExecuteFlag
) {
5059 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5064 static void GLAPIENTRY
5065 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5066 const GLfloat
*params
)
5068 GET_CURRENT_CONTEXT(ctx
);
5070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5071 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5080 if (ctx
->ExecuteFlag
) {
5081 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5086 static void GLAPIENTRY
5087 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5088 const GLfloat
*params
)
5090 GET_CURRENT_CONTEXT(ctx
);
5092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5096 const GLfloat
* p
= params
;
5098 for (i
= 0 ; i
< count
; i
++) {
5099 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5112 if (ctx
->ExecuteFlag
) {
5113 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5118 static void GLAPIENTRY
5119 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5120 GLdouble x
, GLdouble y
,
5121 GLdouble z
, GLdouble w
)
5123 GET_CURRENT_CONTEXT(ctx
);
5125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5126 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5130 n
[3].f
= (GLfloat
) x
;
5131 n
[4].f
= (GLfloat
) y
;
5132 n
[5].f
= (GLfloat
) z
;
5133 n
[6].f
= (GLfloat
) w
;
5135 if (ctx
->ExecuteFlag
) {
5136 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5141 static void GLAPIENTRY
5142 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5143 const GLdouble
*params
)
5145 GET_CURRENT_CONTEXT(ctx
);
5147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5148 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5152 n
[3].f
= (GLfloat
) params
[0];
5153 n
[4].f
= (GLfloat
) params
[1];
5154 n
[5].f
= (GLfloat
) params
[2];
5155 n
[6].f
= (GLfloat
) params
[3];
5157 if (ctx
->ExecuteFlag
) {
5158 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5162 static void GLAPIENTRY
5163 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5164 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5166 GET_CURRENT_CONTEXT(ctx
);
5169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5171 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5173 GLubyte
*nameCopy
= malloc(len
);
5175 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5178 memcpy(nameCopy
, name
, len
);
5181 n
[3].data
= nameCopy
;
5187 if (ctx
->ExecuteFlag
) {
5188 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5193 static void GLAPIENTRY
5194 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5197 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5201 static void GLAPIENTRY
5202 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5203 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5205 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5206 (GLfloat
) z
, (GLfloat
) w
);
5210 static void GLAPIENTRY
5211 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5214 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5215 (GLfloat
) v
[1], (GLfloat
) v
[2],
5220 /* GL_EXT_stencil_two_side */
5221 static void GLAPIENTRY
5222 save_ActiveStencilFaceEXT(GLenum face
)
5224 GET_CURRENT_CONTEXT(ctx
);
5226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5227 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5231 if (ctx
->ExecuteFlag
) {
5232 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5237 /* GL_EXT_depth_bounds_test */
5238 static void GLAPIENTRY
5239 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5241 GET_CURRENT_CONTEXT(ctx
);
5243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5244 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5246 n
[1].f
= (GLfloat
) zmin
;
5247 n
[2].f
= (GLfloat
) zmax
;
5249 if (ctx
->ExecuteFlag
) {
5250 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5256 static void GLAPIENTRY
5257 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5258 const GLvoid
* string
)
5260 GET_CURRENT_CONTEXT(ctx
);
5263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5265 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5267 GLubyte
*programCopy
= malloc(len
);
5269 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5272 memcpy(programCopy
, string
, len
);
5276 n
[4].data
= programCopy
;
5278 if (ctx
->ExecuteFlag
) {
5279 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5284 static void GLAPIENTRY
5285 save_BeginQueryARB(GLenum target
, GLuint id
)
5287 GET_CURRENT_CONTEXT(ctx
);
5289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5290 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5295 if (ctx
->ExecuteFlag
) {
5296 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5300 static void GLAPIENTRY
5301 save_EndQueryARB(GLenum target
)
5303 GET_CURRENT_CONTEXT(ctx
);
5305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5306 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5310 if (ctx
->ExecuteFlag
) {
5311 CALL_EndQueryARB(ctx
->Exec
, (target
));
5315 static void GLAPIENTRY
5316 save_QueryCounter(GLuint id
, GLenum target
)
5318 GET_CURRENT_CONTEXT(ctx
);
5320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5321 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5326 if (ctx
->ExecuteFlag
) {
5327 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5331 static void GLAPIENTRY
5332 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5334 GET_CURRENT_CONTEXT(ctx
);
5336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5337 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5343 if (ctx
->ExecuteFlag
) {
5344 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5348 static void GLAPIENTRY
5349 save_EndQueryIndexed(GLenum target
, GLuint index
)
5351 GET_CURRENT_CONTEXT(ctx
);
5353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5354 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5359 if (ctx
->ExecuteFlag
) {
5360 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5365 static void GLAPIENTRY
5366 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5368 GET_CURRENT_CONTEXT(ctx
);
5370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5371 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5375 if (count
> MAX_DRAW_BUFFERS
)
5376 count
= MAX_DRAW_BUFFERS
;
5377 for (i
= 0; i
< count
; i
++) {
5378 n
[2 + i
].e
= buffers
[i
];
5381 if (ctx
->ExecuteFlag
) {
5382 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5386 static void GLAPIENTRY
5387 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5389 GET_CURRENT_CONTEXT(ctx
);
5392 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5400 if (ctx
->ExecuteFlag
) {
5401 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5405 static void GLAPIENTRY
5406 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5409 p
[0] = INT_TO_FLOAT(param
[0]);
5410 p
[1] = INT_TO_FLOAT(param
[1]);
5411 p
[2] = INT_TO_FLOAT(param
[2]);
5412 p
[3] = INT_TO_FLOAT(param
[3]);
5413 save_TexBumpParameterfvATI(pname
, p
);
5416 static void GLAPIENTRY
5417 save_BindFragmentShaderATI(GLuint id
)
5419 GET_CURRENT_CONTEXT(ctx
);
5422 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5426 if (ctx
->ExecuteFlag
) {
5427 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5431 static void GLAPIENTRY
5432 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5434 GET_CURRENT_CONTEXT(ctx
);
5437 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5445 if (ctx
->ExecuteFlag
) {
5446 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5450 static void GLAPIENTRY
5451 save_Attr1fNV(GLenum attr
, GLfloat x
)
5453 GET_CURRENT_CONTEXT(ctx
);
5455 SAVE_FLUSH_VERTICES(ctx
);
5456 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5462 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5463 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5464 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5466 if (ctx
->ExecuteFlag
) {
5467 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5471 static void GLAPIENTRY
5472 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5474 GET_CURRENT_CONTEXT(ctx
);
5476 SAVE_FLUSH_VERTICES(ctx
);
5477 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5484 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5485 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5486 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5488 if (ctx
->ExecuteFlag
) {
5489 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5493 static void GLAPIENTRY
5494 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5496 GET_CURRENT_CONTEXT(ctx
);
5498 SAVE_FLUSH_VERTICES(ctx
);
5499 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5507 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5508 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5509 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5511 if (ctx
->ExecuteFlag
) {
5512 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5516 static void GLAPIENTRY
5517 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5519 GET_CURRENT_CONTEXT(ctx
);
5521 SAVE_FLUSH_VERTICES(ctx
);
5522 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5531 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5532 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5533 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5535 if (ctx
->ExecuteFlag
) {
5536 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5541 static void GLAPIENTRY
5542 save_Attr1fARB(GLenum attr
, GLfloat x
)
5544 GET_CURRENT_CONTEXT(ctx
);
5546 SAVE_FLUSH_VERTICES(ctx
);
5547 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5553 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5554 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5555 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5557 if (ctx
->ExecuteFlag
) {
5558 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5562 static void GLAPIENTRY
5563 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5565 GET_CURRENT_CONTEXT(ctx
);
5567 SAVE_FLUSH_VERTICES(ctx
);
5568 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5575 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5576 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5577 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5579 if (ctx
->ExecuteFlag
) {
5580 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5584 static void GLAPIENTRY
5585 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5587 GET_CURRENT_CONTEXT(ctx
);
5589 SAVE_FLUSH_VERTICES(ctx
);
5590 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5598 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5599 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5600 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5602 if (ctx
->ExecuteFlag
) {
5603 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5607 static void GLAPIENTRY
5608 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5610 GET_CURRENT_CONTEXT(ctx
);
5612 SAVE_FLUSH_VERTICES(ctx
);
5613 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5622 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5623 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5624 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5626 if (ctx
->ExecuteFlag
) {
5627 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5632 static void GLAPIENTRY
5633 save_EvalCoord1f(GLfloat x
)
5635 GET_CURRENT_CONTEXT(ctx
);
5637 SAVE_FLUSH_VERTICES(ctx
);
5638 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5642 if (ctx
->ExecuteFlag
) {
5643 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5647 static void GLAPIENTRY
5648 save_EvalCoord1fv(const GLfloat
* v
)
5650 save_EvalCoord1f(v
[0]);
5653 static void GLAPIENTRY
5654 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5656 GET_CURRENT_CONTEXT(ctx
);
5658 SAVE_FLUSH_VERTICES(ctx
);
5659 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5664 if (ctx
->ExecuteFlag
) {
5665 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5669 static void GLAPIENTRY
5670 save_EvalCoord2fv(const GLfloat
* v
)
5672 save_EvalCoord2f(v
[0], v
[1]);
5676 static void GLAPIENTRY
5677 save_EvalPoint1(GLint x
)
5679 GET_CURRENT_CONTEXT(ctx
);
5681 SAVE_FLUSH_VERTICES(ctx
);
5682 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5686 if (ctx
->ExecuteFlag
) {
5687 CALL_EvalPoint1(ctx
->Exec
, (x
));
5691 static void GLAPIENTRY
5692 save_EvalPoint2(GLint x
, GLint y
)
5694 GET_CURRENT_CONTEXT(ctx
);
5696 SAVE_FLUSH_VERTICES(ctx
);
5697 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5702 if (ctx
->ExecuteFlag
) {
5703 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5707 static void GLAPIENTRY
5708 save_Indexf(GLfloat x
)
5710 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5713 static void GLAPIENTRY
5714 save_Indexfv(const GLfloat
* v
)
5716 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5719 static void GLAPIENTRY
5720 save_EdgeFlag(GLboolean x
)
5722 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5727 * Compare 'count' elements of vectors 'a' and 'b'.
5728 * \return GL_TRUE if equal, GL_FALSE if different.
5730 static inline GLboolean
5731 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5733 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5738 * This glMaterial function is used for glMaterial calls that are outside
5739 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5741 static void GLAPIENTRY
5742 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5744 GET_CURRENT_CONTEXT(ctx
);
5752 case GL_FRONT_AND_BACK
:
5755 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5764 case GL_AMBIENT_AND_DIFFUSE
:
5770 case GL_COLOR_INDEXES
:
5774 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5778 if (ctx
->ExecuteFlag
) {
5779 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5782 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5784 /* Try to eliminate redundant statechanges. Because it is legal to
5785 * call glMaterial even inside begin/end calls, don't need to worry
5786 * about ctx->Driver.CurrentSavePrimitive here.
5788 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5789 if (bitmask
& (1 << i
)) {
5790 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5791 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5792 /* no change in material value */
5793 bitmask
&= ~(1 << i
);
5796 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5797 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5802 /* If this call has no effect, return early */
5806 SAVE_FLUSH_VERTICES(ctx
);
5808 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5812 for (i
= 0; i
< args
; i
++)
5813 n
[3 + i
].f
= param
[i
];
5817 static void GLAPIENTRY
5818 save_Begin(GLenum mode
)
5820 GET_CURRENT_CONTEXT(ctx
);
5822 GLboolean error
= GL_FALSE
;
5824 if (mode
> GL_POLYGON
) {
5825 _mesa_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode=%x)", mode
);
5828 if (ctx
->ExecuteFlag
) {
5829 if (!_mesa_valid_prim_mode(ctx
, mode
, "glBegin")) {
5834 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5835 /* Typically the first begin. This may raise an error on
5836 * playback, depending on whether CallList is issued from inside
5837 * a begin/end or not.
5839 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5841 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5842 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5845 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5850 /* Give the driver an opportunity to hook in an optimized
5851 * display list compiler.
5853 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5856 SAVE_FLUSH_VERTICES(ctx
);
5857 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5863 if (ctx
->ExecuteFlag
) {
5864 CALL_Begin(ctx
->Exec
, (mode
));
5868 static void GLAPIENTRY
5871 GET_CURRENT_CONTEXT(ctx
);
5872 SAVE_FLUSH_VERTICES(ctx
);
5873 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5874 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5875 if (ctx
->ExecuteFlag
) {
5876 CALL_End(ctx
->Exec
, ());
5880 static void GLAPIENTRY
5881 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5883 GET_CURRENT_CONTEXT(ctx
);
5885 SAVE_FLUSH_VERTICES(ctx
);
5886 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5893 if (ctx
->ExecuteFlag
) {
5894 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5899 static void GLAPIENTRY
5900 save_Vertex2f(GLfloat x
, GLfloat y
)
5902 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5905 static void GLAPIENTRY
5906 save_Vertex2fv(const GLfloat
* v
)
5908 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5911 static void GLAPIENTRY
5912 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5914 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5917 static void GLAPIENTRY
5918 save_Vertex3fv(const GLfloat
* v
)
5920 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5923 static void GLAPIENTRY
5924 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5926 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5929 static void GLAPIENTRY
5930 save_Vertex4fv(const GLfloat
* v
)
5932 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5935 static void GLAPIENTRY
5936 save_TexCoord1f(GLfloat x
)
5938 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5941 static void GLAPIENTRY
5942 save_TexCoord1fv(const GLfloat
* v
)
5944 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5947 static void GLAPIENTRY
5948 save_TexCoord2f(GLfloat x
, GLfloat y
)
5950 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5953 static void GLAPIENTRY
5954 save_TexCoord2fv(const GLfloat
* v
)
5956 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5959 static void GLAPIENTRY
5960 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5962 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5965 static void GLAPIENTRY
5966 save_TexCoord3fv(const GLfloat
* v
)
5968 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5971 static void GLAPIENTRY
5972 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5974 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5977 static void GLAPIENTRY
5978 save_TexCoord4fv(const GLfloat
* v
)
5980 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5983 static void GLAPIENTRY
5984 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5986 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5989 static void GLAPIENTRY
5990 save_Normal3fv(const GLfloat
* v
)
5992 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5995 static void GLAPIENTRY
5996 save_FogCoordfEXT(GLfloat x
)
5998 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6001 static void GLAPIENTRY
6002 save_FogCoordfvEXT(const GLfloat
* v
)
6004 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6007 static void GLAPIENTRY
6008 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6010 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6013 static void GLAPIENTRY
6014 save_Color3fv(const GLfloat
* v
)
6016 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6019 static void GLAPIENTRY
6020 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6022 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6025 static void GLAPIENTRY
6026 save_Color4fv(const GLfloat
* v
)
6028 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6031 static void GLAPIENTRY
6032 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6034 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6037 static void GLAPIENTRY
6038 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6040 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6044 /* Just call the respective ATTR for texcoord
6046 static void GLAPIENTRY
6047 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6049 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6050 save_Attr1fNV(attr
, x
);
6053 static void GLAPIENTRY
6054 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6056 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6057 save_Attr1fNV(attr
, v
[0]);
6060 static void GLAPIENTRY
6061 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6063 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6064 save_Attr2fNV(attr
, x
, y
);
6067 static void GLAPIENTRY
6068 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6070 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6071 save_Attr2fNV(attr
, v
[0], v
[1]);
6074 static void GLAPIENTRY
6075 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6077 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6078 save_Attr3fNV(attr
, x
, y
, z
);
6081 static void GLAPIENTRY
6082 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6084 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6085 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6088 static void GLAPIENTRY
6089 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6090 GLfloat z
, GLfloat w
)
6092 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6093 save_Attr4fNV(attr
, x
, y
, z
, w
);
6096 static void GLAPIENTRY
6097 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6099 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6100 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6105 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6111 GET_CURRENT_CONTEXT(ctx
);
6112 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6116 /* First level for NV_vertex_program:
6118 * Check for errors at compile time?.
6120 static void GLAPIENTRY
6121 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6123 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6124 save_Attr1fNV(index
, x
);
6129 static void GLAPIENTRY
6130 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6132 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6133 save_Attr1fNV(index
, v
[0]);
6138 static void GLAPIENTRY
6139 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6141 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6142 save_Attr2fNV(index
, x
, y
);
6147 static void GLAPIENTRY
6148 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6150 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6151 save_Attr2fNV(index
, v
[0], v
[1]);
6156 static void GLAPIENTRY
6157 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6159 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6160 save_Attr3fNV(index
, x
, y
, z
);
6165 static void GLAPIENTRY
6166 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6168 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6169 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6174 static void GLAPIENTRY
6175 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6176 GLfloat z
, GLfloat w
)
6178 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6179 save_Attr4fNV(index
, x
, y
, z
, w
);
6184 static void GLAPIENTRY
6185 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6187 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6188 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6196 static void GLAPIENTRY
6197 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6199 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6200 save_Attr1fARB(index
, x
);
6205 static void GLAPIENTRY
6206 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6208 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6209 save_Attr1fARB(index
, v
[0]);
6214 static void GLAPIENTRY
6215 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6217 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6218 save_Attr2fARB(index
, x
, y
);
6223 static void GLAPIENTRY
6224 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6226 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6227 save_Attr2fARB(index
, v
[0], v
[1]);
6232 static void GLAPIENTRY
6233 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6235 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6236 save_Attr3fARB(index
, x
, y
, z
);
6241 static void GLAPIENTRY
6242 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6244 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6245 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6250 static void GLAPIENTRY
6251 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6254 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6255 save_Attr4fARB(index
, x
, y
, z
, w
);
6260 static void GLAPIENTRY
6261 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6263 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6264 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6270 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6272 static void GLAPIENTRY
6273 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6275 GET_CURRENT_CONTEXT(ctx
);
6276 FLUSH_VERTICES(ctx
, 0);
6277 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6280 static GLint GLAPIENTRY
6281 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6283 GET_CURRENT_CONTEXT(ctx
);
6284 FLUSH_VERTICES(ctx
, 0);
6285 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6288 static GLint GLAPIENTRY
6289 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6291 GET_CURRENT_CONTEXT(ctx
);
6292 FLUSH_VERTICES(ctx
, 0);
6293 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6295 /* XXX more shader functions needed here */
6298 static void GLAPIENTRY
6299 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6300 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6301 GLbitfield mask
, GLenum filter
)
6303 GET_CURRENT_CONTEXT(ctx
);
6305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6306 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6319 if (ctx
->ExecuteFlag
) {
6320 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6321 dstX0
, dstY0
, dstX1
, dstY1
,
6327 /** GL_EXT_provoking_vertex */
6328 static void GLAPIENTRY
6329 save_ProvokingVertexEXT(GLenum mode
)
6331 GET_CURRENT_CONTEXT(ctx
);
6333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6334 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6338 if (ctx
->ExecuteFlag
) {
6339 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6340 _mesa_ProvokingVertexEXT(mode
);
6345 /** GL_EXT_transform_feedback */
6346 static void GLAPIENTRY
6347 save_BeginTransformFeedback(GLenum mode
)
6349 GET_CURRENT_CONTEXT(ctx
);
6351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6352 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6356 if (ctx
->ExecuteFlag
) {
6357 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6362 /** GL_EXT_transform_feedback */
6363 static void GLAPIENTRY
6364 save_EndTransformFeedback(void)
6366 GET_CURRENT_CONTEXT(ctx
);
6367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6368 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6369 if (ctx
->ExecuteFlag
) {
6370 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6374 static void GLAPIENTRY
6375 save_BindTransformFeedback(GLenum target
, GLuint name
)
6377 GET_CURRENT_CONTEXT(ctx
);
6379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6380 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6385 if (ctx
->ExecuteFlag
) {
6386 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6390 static void GLAPIENTRY
6391 save_PauseTransformFeedback(void)
6393 GET_CURRENT_CONTEXT(ctx
);
6394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6395 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6396 if (ctx
->ExecuteFlag
) {
6397 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6401 static void GLAPIENTRY
6402 save_ResumeTransformFeedback(void)
6404 GET_CURRENT_CONTEXT(ctx
);
6405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6406 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6407 if (ctx
->ExecuteFlag
) {
6408 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6412 static void GLAPIENTRY
6413 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6415 GET_CURRENT_CONTEXT(ctx
);
6417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6418 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6423 if (ctx
->ExecuteFlag
) {
6424 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6428 static void GLAPIENTRY
6429 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6431 GET_CURRENT_CONTEXT(ctx
);
6433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6434 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6440 if (ctx
->ExecuteFlag
) {
6441 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6445 static void GLAPIENTRY
6446 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6449 GET_CURRENT_CONTEXT(ctx
);
6451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6452 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6456 n
[3].si
= primcount
;
6458 if (ctx
->ExecuteFlag
) {
6459 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6463 static void GLAPIENTRY
6464 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6465 GLuint stream
, GLsizei primcount
)
6467 GET_CURRENT_CONTEXT(ctx
);
6469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6470 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6475 n
[4].si
= primcount
;
6477 if (ctx
->ExecuteFlag
) {
6478 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6483 /* aka UseProgram() */
6484 static void GLAPIENTRY
6485 save_UseProgramObjectARB(GLhandleARB program
)
6487 GET_CURRENT_CONTEXT(ctx
);
6489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6490 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6494 if (ctx
->ExecuteFlag
) {
6495 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6500 static void GLAPIENTRY
6501 save_Uniform1fARB(GLint location
, GLfloat x
)
6503 GET_CURRENT_CONTEXT(ctx
);
6505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6506 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6511 if (ctx
->ExecuteFlag
) {
6512 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6517 static void GLAPIENTRY
6518 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6520 GET_CURRENT_CONTEXT(ctx
);
6522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6523 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6529 if (ctx
->ExecuteFlag
) {
6530 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6535 static void GLAPIENTRY
6536 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6538 GET_CURRENT_CONTEXT(ctx
);
6540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6541 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6548 if (ctx
->ExecuteFlag
) {
6549 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6554 static void GLAPIENTRY
6555 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6557 GET_CURRENT_CONTEXT(ctx
);
6559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6560 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6568 if (ctx
->ExecuteFlag
) {
6569 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6574 /** Return copy of memory */
6576 memdup(const void *src
, GLsizei bytes
)
6578 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6580 memcpy(b
, src
, bytes
);
6585 static void GLAPIENTRY
6586 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6588 GET_CURRENT_CONTEXT(ctx
);
6590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6591 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6595 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6597 if (ctx
->ExecuteFlag
) {
6598 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6602 static void GLAPIENTRY
6603 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6605 GET_CURRENT_CONTEXT(ctx
);
6607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6608 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6612 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6614 if (ctx
->ExecuteFlag
) {
6615 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6619 static void GLAPIENTRY
6620 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6622 GET_CURRENT_CONTEXT(ctx
);
6624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6625 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6629 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6631 if (ctx
->ExecuteFlag
) {
6632 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6636 static void GLAPIENTRY
6637 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6639 GET_CURRENT_CONTEXT(ctx
);
6641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6642 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6646 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6648 if (ctx
->ExecuteFlag
) {
6649 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6654 static void GLAPIENTRY
6655 save_Uniform1iARB(GLint location
, GLint x
)
6657 GET_CURRENT_CONTEXT(ctx
);
6659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6660 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6665 if (ctx
->ExecuteFlag
) {
6666 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6670 static void GLAPIENTRY
6671 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6673 GET_CURRENT_CONTEXT(ctx
);
6675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6676 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6682 if (ctx
->ExecuteFlag
) {
6683 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6687 static void GLAPIENTRY
6688 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6690 GET_CURRENT_CONTEXT(ctx
);
6692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6693 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6700 if (ctx
->ExecuteFlag
) {
6701 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6705 static void GLAPIENTRY
6706 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6708 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6719 if (ctx
->ExecuteFlag
) {
6720 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6726 static void GLAPIENTRY
6727 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6729 GET_CURRENT_CONTEXT(ctx
);
6731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6732 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6736 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6738 if (ctx
->ExecuteFlag
) {
6739 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6743 static void GLAPIENTRY
6744 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6746 GET_CURRENT_CONTEXT(ctx
);
6748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6749 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6753 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6755 if (ctx
->ExecuteFlag
) {
6756 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6760 static void GLAPIENTRY
6761 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6763 GET_CURRENT_CONTEXT(ctx
);
6765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6766 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6770 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6772 if (ctx
->ExecuteFlag
) {
6773 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6777 static void GLAPIENTRY
6778 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6780 GET_CURRENT_CONTEXT(ctx
);
6782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6783 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6787 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6789 if (ctx
->ExecuteFlag
) {
6790 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6796 static void GLAPIENTRY
6797 save_Uniform1ui(GLint location
, GLuint x
)
6799 GET_CURRENT_CONTEXT(ctx
);
6801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6802 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6807 if (ctx
->ExecuteFlag
) {
6808 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6812 static void GLAPIENTRY
6813 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6815 GET_CURRENT_CONTEXT(ctx
);
6817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6818 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6824 if (ctx
->ExecuteFlag
) {
6825 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6829 static void GLAPIENTRY
6830 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6832 GET_CURRENT_CONTEXT(ctx
);
6834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6835 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6842 if (ctx
->ExecuteFlag
) {
6843 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6847 static void GLAPIENTRY
6848 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6850 GET_CURRENT_CONTEXT(ctx
);
6852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6853 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6861 if (ctx
->ExecuteFlag
) {
6862 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6868 static void GLAPIENTRY
6869 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6871 GET_CURRENT_CONTEXT(ctx
);
6873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6874 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6878 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6880 if (ctx
->ExecuteFlag
) {
6881 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6885 static void GLAPIENTRY
6886 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6888 GET_CURRENT_CONTEXT(ctx
);
6890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6891 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6895 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6897 if (ctx
->ExecuteFlag
) {
6898 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6902 static void GLAPIENTRY
6903 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6905 GET_CURRENT_CONTEXT(ctx
);
6907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6908 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6912 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6914 if (ctx
->ExecuteFlag
) {
6915 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6919 static void GLAPIENTRY
6920 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6922 GET_CURRENT_CONTEXT(ctx
);
6924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6925 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6929 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6931 if (ctx
->ExecuteFlag
) {
6932 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6938 static void GLAPIENTRY
6939 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6942 GET_CURRENT_CONTEXT(ctx
);
6944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6945 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6950 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6952 if (ctx
->ExecuteFlag
) {
6953 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6957 static void GLAPIENTRY
6958 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6961 GET_CURRENT_CONTEXT(ctx
);
6963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6964 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6969 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6971 if (ctx
->ExecuteFlag
) {
6972 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6976 static void GLAPIENTRY
6977 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6980 GET_CURRENT_CONTEXT(ctx
);
6982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6983 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6988 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6990 if (ctx
->ExecuteFlag
) {
6991 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6996 static void GLAPIENTRY
6997 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7000 GET_CURRENT_CONTEXT(ctx
);
7002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7003 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
7008 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
7010 if (ctx
->ExecuteFlag
) {
7011 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7015 static void GLAPIENTRY
7016 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7019 GET_CURRENT_CONTEXT(ctx
);
7021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7022 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
7027 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
7029 if (ctx
->ExecuteFlag
) {
7030 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7035 static void GLAPIENTRY
7036 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7039 GET_CURRENT_CONTEXT(ctx
);
7041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7042 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
7047 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
7049 if (ctx
->ExecuteFlag
) {
7050 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7054 static void GLAPIENTRY
7055 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7058 GET_CURRENT_CONTEXT(ctx
);
7060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7061 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
7066 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
7068 if (ctx
->ExecuteFlag
) {
7069 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7074 static void GLAPIENTRY
7075 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7078 GET_CURRENT_CONTEXT(ctx
);
7080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7081 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
7086 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
7088 if (ctx
->ExecuteFlag
) {
7089 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7093 static void GLAPIENTRY
7094 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7097 GET_CURRENT_CONTEXT(ctx
);
7099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7100 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
7105 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
7107 if (ctx
->ExecuteFlag
) {
7108 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7112 static void GLAPIENTRY
7113 save_ClampColorARB(GLenum target
, GLenum clamp
)
7115 GET_CURRENT_CONTEXT(ctx
);
7117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7118 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7123 if (ctx
->ExecuteFlag
) {
7124 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
7128 static void GLAPIENTRY
7129 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
7131 GET_CURRENT_CONTEXT(ctx
);
7133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7134 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
7139 if (ctx
->ExecuteFlag
) {
7140 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
7144 static void GLAPIENTRY
7145 save_ActiveProgramEXT(GLuint program
)
7147 GET_CURRENT_CONTEXT(ctx
);
7149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7150 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7154 if (ctx
->ExecuteFlag
) {
7155 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7159 /** GL_EXT_texture_integer */
7160 static void GLAPIENTRY
7161 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7163 GET_CURRENT_CONTEXT(ctx
);
7165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7166 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7173 if (ctx
->ExecuteFlag
) {
7174 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7178 /** GL_EXT_texture_integer */
7179 static void GLAPIENTRY
7180 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7182 GET_CURRENT_CONTEXT(ctx
);
7184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7185 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7192 if (ctx
->ExecuteFlag
) {
7193 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7197 /** GL_EXT_texture_integer */
7198 static void GLAPIENTRY
7199 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7201 GET_CURRENT_CONTEXT(ctx
);
7203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7204 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7213 if (ctx
->ExecuteFlag
) {
7214 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7218 /** GL_EXT_texture_integer */
7219 static void GLAPIENTRY
7220 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7222 GET_CURRENT_CONTEXT(ctx
);
7224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7225 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7229 n
[3].ui
= params
[0];
7230 n
[4].ui
= params
[1];
7231 n
[5].ui
= params
[2];
7232 n
[6].ui
= params
[3];
7234 if (ctx
->ExecuteFlag
) {
7235 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7239 /** GL_EXT_texture_integer */
7240 static void GLAPIENTRY
7241 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7243 GET_CURRENT_CONTEXT(ctx
);
7244 FLUSH_VERTICES(ctx
, 0);
7245 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7248 /** GL_EXT_texture_integer */
7249 static void GLAPIENTRY
7250 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7252 GET_CURRENT_CONTEXT(ctx
);
7253 FLUSH_VERTICES(ctx
, 0);
7254 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7258 /* GL_ARB_instanced_arrays */
7259 static void GLAPIENTRY
7260 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7262 GET_CURRENT_CONTEXT(ctx
);
7264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7265 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7270 if (ctx
->ExecuteFlag
) {
7271 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7276 /* GL_NV_texture_barrier */
7277 static void GLAPIENTRY
7278 save_TextureBarrierNV(void)
7280 GET_CURRENT_CONTEXT(ctx
);
7281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7282 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7283 if (ctx
->ExecuteFlag
) {
7284 CALL_TextureBarrierNV(ctx
->Exec
, ());
7289 /* GL_ARB_sampler_objects */
7290 static void GLAPIENTRY
7291 save_BindSampler(GLuint unit
, GLuint sampler
)
7294 GET_CURRENT_CONTEXT(ctx
);
7295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7296 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7301 if (ctx
->ExecuteFlag
) {
7302 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7306 static void GLAPIENTRY
7307 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7310 GET_CURRENT_CONTEXT(ctx
);
7311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7312 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7317 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7323 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7326 if (ctx
->ExecuteFlag
) {
7327 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7331 static void GLAPIENTRY
7332 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7334 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7337 static void GLAPIENTRY
7338 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7341 GET_CURRENT_CONTEXT(ctx
);
7342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7343 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7348 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7354 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7357 if (ctx
->ExecuteFlag
) {
7358 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7362 static void GLAPIENTRY
7363 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7365 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7368 static void GLAPIENTRY
7369 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7372 GET_CURRENT_CONTEXT(ctx
);
7373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7374 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7379 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7385 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7388 if (ctx
->ExecuteFlag
) {
7389 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7393 static void GLAPIENTRY
7394 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7397 GET_CURRENT_CONTEXT(ctx
);
7398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7399 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7403 n
[3].ui
= params
[0];
7404 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7405 n
[4].ui
= params
[1];
7406 n
[5].ui
= params
[2];
7407 n
[6].ui
= params
[3];
7410 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7413 if (ctx
->ExecuteFlag
) {
7414 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7418 /* GL_ARB_geometry_shader4 */
7419 static void GLAPIENTRY
7420 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7423 GET_CURRENT_CONTEXT(ctx
);
7424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7425 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7431 if (ctx
->ExecuteFlag
) {
7432 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7436 static void GLAPIENTRY
7437 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7438 GLuint texture
, GLint level
)
7441 GET_CURRENT_CONTEXT(ctx
);
7442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7443 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7446 n
[2].e
= attachment
;
7450 if (ctx
->ExecuteFlag
) {
7451 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7455 static void GLAPIENTRY
7456 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7457 GLuint texture
, GLint level
, GLenum face
)
7460 GET_CURRENT_CONTEXT(ctx
);
7461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7462 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7465 n
[2].e
= attachment
;
7470 if (ctx
->ExecuteFlag
) {
7471 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7478 static void GLAPIENTRY
7479 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7482 GET_CURRENT_CONTEXT(ctx
);
7483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7484 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7486 union uint64_pair p
;
7490 n
[3].ui
= p
.uint32
[0];
7491 n
[4].ui
= p
.uint32
[1];
7493 if (ctx
->ExecuteFlag
) {
7494 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7499 /** GL_NV_conditional_render */
7500 static void GLAPIENTRY
7501 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7503 GET_CURRENT_CONTEXT(ctx
);
7505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7506 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7511 if (ctx
->ExecuteFlag
) {
7512 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7516 static void GLAPIENTRY
7517 save_EndConditionalRender(void)
7519 GET_CURRENT_CONTEXT(ctx
);
7520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7521 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7522 if (ctx
->ExecuteFlag
) {
7523 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7527 static void GLAPIENTRY
7528 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7530 GET_CURRENT_CONTEXT(ctx
);
7532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7533 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7539 if (ctx
->ExecuteFlag
) {
7540 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7546 * Save an error-generating command into display list.
7548 * KW: Will appear in the list before the vertex buffer containing the
7549 * command that provoked the error. I don't see this as a problem.
7552 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7555 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7558 n
[2].data
= (void *) s
;
7564 * Compile an error into current display list.
7567 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7569 if (ctx
->CompileFlag
)
7570 save_error(ctx
, error
, s
);
7571 if (ctx
->ExecuteFlag
)
7572 _mesa_error(ctx
, error
, "%s", s
);
7577 * Test if ID names a display list.
7580 islist(struct gl_context
*ctx
, GLuint list
)
7582 if (list
> 0 && lookup_list(ctx
, list
)) {
7592 /**********************************************************************/
7593 /* Display list execution */
7594 /**********************************************************************/
7598 * Execute a display list. Note that the ListBase offset must have already
7599 * been added before calling this function. I.e. the list argument is
7600 * the absolute list number, not relative to ListBase.
7601 * \param list - display list number
7604 execute_list(struct gl_context
*ctx
, GLuint list
)
7606 struct gl_display_list
*dlist
;
7610 if (list
== 0 || !islist(ctx
, list
))
7613 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7614 /* raise an error? */
7618 dlist
= lookup_list(ctx
, list
);
7622 ctx
->ListState
.CallDepth
++;
7624 if (ctx
->Driver
.BeginCallList
)
7625 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7631 const OpCode opcode
= n
[0].opcode
;
7633 if (is_ext_opcode(opcode
)) {
7634 n
+= ext_opcode_execute(ctx
, n
);
7639 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7642 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7644 case OPCODE_ALPHA_FUNC
:
7645 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7647 case OPCODE_BIND_TEXTURE
:
7648 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7652 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7653 ctx
->Unpack
= ctx
->DefaultPacking
;
7654 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7655 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7656 (const GLubyte
*) n
[7].data
));
7657 ctx
->Unpack
= save
; /* restore */
7660 case OPCODE_BLEND_COLOR
:
7661 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7663 case OPCODE_BLEND_EQUATION
:
7664 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7666 case OPCODE_BLEND_EQUATION_SEPARATE
:
7667 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7669 case OPCODE_BLEND_FUNC_SEPARATE
:
7670 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7671 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7674 case OPCODE_BLEND_FUNC_I
:
7675 /* GL_ARB_draw_buffers_blend */
7676 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7678 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7679 /* GL_ARB_draw_buffers_blend */
7680 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7683 case OPCODE_BLEND_EQUATION_I
:
7684 /* GL_ARB_draw_buffers_blend */
7685 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7687 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7688 /* GL_ARB_draw_buffers_blend */
7689 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7690 (n
[1].ui
, n
[2].e
, n
[3].e
));
7693 case OPCODE_CALL_LIST
:
7694 /* Generated by glCallList(), don't add ListBase */
7695 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7696 execute_list(ctx
, n
[1].ui
);
7699 case OPCODE_CALL_LIST_OFFSET
:
7700 /* Generated by glCallLists() so we must add ListBase */
7702 /* user specified a bad data type at compile time */
7703 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7705 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7706 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7707 execute_list(ctx
, list
);
7711 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7713 case OPCODE_CLEAR_BUFFER_IV
:
7720 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7723 case OPCODE_CLEAR_BUFFER_UIV
:
7730 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7733 case OPCODE_CLEAR_BUFFER_FV
:
7740 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7743 case OPCODE_CLEAR_BUFFER_FI
:
7744 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7746 case OPCODE_CLEAR_COLOR
:
7747 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7749 case OPCODE_CLEAR_ACCUM
:
7750 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7752 case OPCODE_CLEAR_DEPTH
:
7753 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7755 case OPCODE_CLEAR_INDEX
:
7756 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7758 case OPCODE_CLEAR_STENCIL
:
7759 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7761 case OPCODE_CLIP_PLANE
:
7768 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7771 case OPCODE_COLOR_MASK
:
7772 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7774 case OPCODE_COLOR_MASK_INDEXED
:
7775 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7778 case OPCODE_COLOR_MATERIAL
:
7779 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7781 case OPCODE_COLOR_TABLE
:
7783 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7784 ctx
->Unpack
= ctx
->DefaultPacking
;
7785 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7786 n
[5].e
, n
[6].data
));
7787 ctx
->Unpack
= save
; /* restore */
7790 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7797 CALL_ColorTableParameterfv(ctx
->Exec
,
7798 (n
[1].e
, n
[2].e
, params
));
7801 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7808 CALL_ColorTableParameteriv(ctx
->Exec
,
7809 (n
[1].e
, n
[2].e
, params
));
7812 case OPCODE_COLOR_SUB_TABLE
:
7814 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7815 ctx
->Unpack
= ctx
->DefaultPacking
;
7816 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7817 n
[4].e
, n
[5].e
, n
[6].data
));
7818 ctx
->Unpack
= save
; /* restore */
7821 case OPCODE_CONVOLUTION_FILTER_1D
:
7823 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7824 ctx
->Unpack
= ctx
->DefaultPacking
;
7825 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7828 ctx
->Unpack
= save
; /* restore */
7831 case OPCODE_CONVOLUTION_FILTER_2D
:
7833 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7834 ctx
->Unpack
= ctx
->DefaultPacking
;
7835 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7836 n
[4].i
, n
[5].e
, n
[6].e
,
7838 ctx
->Unpack
= save
; /* restore */
7841 case OPCODE_CONVOLUTION_PARAMETER_I
:
7842 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7844 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7851 CALL_ConvolutionParameteriv(ctx
->Exec
,
7852 (n
[1].e
, n
[2].e
, params
));
7855 case OPCODE_CONVOLUTION_PARAMETER_F
:
7856 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7858 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7865 CALL_ConvolutionParameterfv(ctx
->Exec
,
7866 (n
[1].e
, n
[2].e
, params
));
7869 case OPCODE_COPY_COLOR_SUB_TABLE
:
7870 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7871 n
[3].i
, n
[4].i
, n
[5].i
));
7873 case OPCODE_COPY_COLOR_TABLE
:
7874 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7875 n
[3].i
, n
[4].i
, n
[5].i
));
7877 case OPCODE_COPY_PIXELS
:
7878 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7879 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7882 case OPCODE_COPY_TEX_IMAGE1D
:
7883 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7884 n
[5].i
, n
[6].i
, n
[7].i
));
7886 case OPCODE_COPY_TEX_IMAGE2D
:
7887 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7888 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7890 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7891 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7892 n
[4].i
, n
[5].i
, n
[6].i
));
7894 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7895 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7896 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7899 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7900 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7901 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7904 case OPCODE_CULL_FACE
:
7905 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7907 case OPCODE_DEPTH_FUNC
:
7908 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7910 case OPCODE_DEPTH_MASK
:
7911 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7913 case OPCODE_DEPTH_RANGE
:
7914 CALL_DepthRange(ctx
->Exec
,
7915 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7917 case OPCODE_DISABLE
:
7918 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7920 case OPCODE_DISABLE_INDEXED
:
7921 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7923 case OPCODE_DRAW_BUFFER
:
7924 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7926 case OPCODE_DRAW_PIXELS
:
7928 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7929 ctx
->Unpack
= ctx
->DefaultPacking
;
7930 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7932 ctx
->Unpack
= save
; /* restore */
7936 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7938 case OPCODE_ENABLE_INDEXED
:
7939 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7941 case OPCODE_EVALMESH1
:
7942 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7944 case OPCODE_EVALMESH2
:
7945 CALL_EvalMesh2(ctx
->Exec
,
7946 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7955 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7958 case OPCODE_FRONT_FACE
:
7959 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7961 case OPCODE_FRUSTUM
:
7962 CALL_Frustum(ctx
->Exec
,
7963 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7966 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7968 case OPCODE_HISTOGRAM
:
7969 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7971 case OPCODE_INDEX_MASK
:
7972 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7974 case OPCODE_INIT_NAMES
:
7975 CALL_InitNames(ctx
->Exec
, ());
7984 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7987 case OPCODE_LIGHT_MODEL
:
7994 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7997 case OPCODE_LINE_STIPPLE
:
7998 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
8000 case OPCODE_LINE_WIDTH
:
8001 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
8003 case OPCODE_LIST_BASE
:
8004 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
8006 case OPCODE_LOAD_IDENTITY
:
8007 CALL_LoadIdentity(ctx
->Exec
, ());
8009 case OPCODE_LOAD_MATRIX
:
8010 if (sizeof(Node
) == sizeof(GLfloat
)) {
8011 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
8016 for (i
= 0; i
< 16; i
++) {
8019 CALL_LoadMatrixf(ctx
->Exec
, (m
));
8022 case OPCODE_LOAD_NAME
:
8023 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
8025 case OPCODE_LOGIC_OP
:
8026 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
8030 GLenum target
= n
[1].e
;
8031 GLint ustride
= _mesa_evaluator_components(target
);
8032 GLint uorder
= n
[5].i
;
8033 GLfloat u1
= n
[2].f
;
8034 GLfloat u2
= n
[3].f
;
8035 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8036 (GLfloat
*) n
[6].data
));
8041 GLenum target
= n
[1].e
;
8042 GLfloat u1
= n
[2].f
;
8043 GLfloat u2
= n
[3].f
;
8044 GLfloat v1
= n
[4].f
;
8045 GLfloat v2
= n
[5].f
;
8046 GLint ustride
= n
[6].i
;
8047 GLint vstride
= n
[7].i
;
8048 GLint uorder
= n
[8].i
;
8049 GLint vorder
= n
[9].i
;
8050 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8051 v1
, v2
, vstride
, vorder
,
8052 (GLfloat
*) n
[10].data
));
8055 case OPCODE_MAPGRID1
:
8056 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8058 case OPCODE_MAPGRID2
:
8059 CALL_MapGrid2f(ctx
->Exec
,
8060 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8062 case OPCODE_MATRIX_MODE
:
8063 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8065 case OPCODE_MIN_MAX
:
8066 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
8068 case OPCODE_MULT_MATRIX
:
8069 if (sizeof(Node
) == sizeof(GLfloat
)) {
8070 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8075 for (i
= 0; i
< 16; i
++) {
8078 CALL_MultMatrixf(ctx
->Exec
, (m
));
8082 CALL_Ortho(ctx
->Exec
,
8083 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8085 case OPCODE_PASSTHROUGH
:
8086 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8088 case OPCODE_PIXEL_MAP
:
8089 CALL_PixelMapfv(ctx
->Exec
,
8090 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
8092 case OPCODE_PIXEL_TRANSFER
:
8093 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8095 case OPCODE_PIXEL_ZOOM
:
8096 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8098 case OPCODE_POINT_SIZE
:
8099 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8101 case OPCODE_POINT_PARAMETERS
:
8107 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
8110 case OPCODE_POLYGON_MODE
:
8111 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8113 case OPCODE_POLYGON_STIPPLE
:
8115 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8116 ctx
->Unpack
= ctx
->DefaultPacking
;
8117 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
8118 ctx
->Unpack
= save
; /* restore */
8121 case OPCODE_POLYGON_OFFSET
:
8122 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8124 case OPCODE_POP_ATTRIB
:
8125 CALL_PopAttrib(ctx
->Exec
, ());
8127 case OPCODE_POP_MATRIX
:
8128 CALL_PopMatrix(ctx
->Exec
, ());
8130 case OPCODE_POP_NAME
:
8131 CALL_PopName(ctx
->Exec
, ());
8133 case OPCODE_PRIORITIZE_TEXTURE
:
8134 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8136 case OPCODE_PUSH_ATTRIB
:
8137 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8139 case OPCODE_PUSH_MATRIX
:
8140 CALL_PushMatrix(ctx
->Exec
, ());
8142 case OPCODE_PUSH_NAME
:
8143 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8145 case OPCODE_RASTER_POS
:
8146 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8148 case OPCODE_READ_BUFFER
:
8149 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8151 case OPCODE_RESET_HISTOGRAM
:
8152 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
8154 case OPCODE_RESET_MIN_MAX
:
8155 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
8158 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8161 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8163 case OPCODE_SCISSOR
:
8164 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8166 case OPCODE_SHADE_MODEL
:
8167 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8169 case OPCODE_PROVOKING_VERTEX
:
8170 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8172 case OPCODE_STENCIL_FUNC
:
8173 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8175 case OPCODE_STENCIL_MASK
:
8176 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8178 case OPCODE_STENCIL_OP
:
8179 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8181 case OPCODE_STENCIL_FUNC_SEPARATE
:
8182 CALL_StencilFuncSeparate(ctx
->Exec
,
8183 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8185 case OPCODE_STENCIL_MASK_SEPARATE
:
8186 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8188 case OPCODE_STENCIL_OP_SEPARATE
:
8189 CALL_StencilOpSeparate(ctx
->Exec
,
8190 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8199 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8209 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8212 case OPCODE_TEXPARAMETER
:
8219 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8222 case OPCODE_TEX_IMAGE1D
:
8224 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8225 ctx
->Unpack
= ctx
->DefaultPacking
;
8226 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8228 n
[3].i
, /* components */
8230 n
[5].e
, /* border */
8231 n
[6].e
, /* format */
8234 ctx
->Unpack
= save
; /* restore */
8237 case OPCODE_TEX_IMAGE2D
:
8239 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8240 ctx
->Unpack
= ctx
->DefaultPacking
;
8241 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8243 n
[3].i
, /* components */
8245 n
[5].i
, /* height */
8246 n
[6].e
, /* border */
8247 n
[7].e
, /* format */
8250 ctx
->Unpack
= save
; /* restore */
8253 case OPCODE_TEX_IMAGE3D
:
8255 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8256 ctx
->Unpack
= ctx
->DefaultPacking
;
8257 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8259 n
[3].i
, /* components */
8261 n
[5].i
, /* height */
8263 n
[7].e
, /* border */
8264 n
[8].e
, /* format */
8267 ctx
->Unpack
= save
; /* restore */
8270 case OPCODE_TEX_SUB_IMAGE1D
:
8272 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8273 ctx
->Unpack
= ctx
->DefaultPacking
;
8274 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8276 n
[6].e
, n
[7].data
));
8277 ctx
->Unpack
= save
; /* restore */
8280 case OPCODE_TEX_SUB_IMAGE2D
:
8282 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8283 ctx
->Unpack
= ctx
->DefaultPacking
;
8284 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8286 n
[6].i
, n
[7].e
, n
[8].e
,
8288 ctx
->Unpack
= save
; /* restore */
8291 case OPCODE_TEX_SUB_IMAGE3D
:
8293 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8294 ctx
->Unpack
= ctx
->DefaultPacking
;
8295 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8296 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8297 n
[8].i
, n
[9].e
, n
[10].e
,
8299 ctx
->Unpack
= save
; /* restore */
8302 case OPCODE_TRANSLATE
:
8303 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8305 case OPCODE_VIEWPORT
:
8306 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8307 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8309 case OPCODE_WINDOW_POS
:
8310 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8312 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8313 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8315 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8316 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8317 n
[4].i
, n
[5].i
, n
[6].i
,
8320 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8321 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8322 n
[4].i
, n
[5].i
, n
[6].i
,
8323 n
[7].i
, n
[8].data
));
8325 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8326 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8327 n
[4].i
, n
[5].i
, n
[6].i
,
8331 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8332 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8333 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8334 n
[5].e
, n
[6].i
, n
[7].data
));
8336 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8337 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8338 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8339 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8342 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8343 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8344 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8345 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8346 n
[9].e
, n
[10].i
, n
[11].data
));
8348 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8349 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8351 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8352 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8354 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8355 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8357 case OPCODE_EXECUTE_PROGRAM_NV
:
8364 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8367 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8368 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8369 (GLuint
*) n
[2].data
));
8371 case OPCODE_LOAD_PROGRAM_NV
:
8372 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8373 (const GLubyte
*) n
[4].data
));
8375 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8376 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8377 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8380 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8381 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8382 (const GLubyte
*) n
[3].
8383 data
, n
[4].f
, n
[5].f
,
8386 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8387 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8389 case OPCODE_DEPTH_BOUNDS_EXT
:
8390 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8392 case OPCODE_PROGRAM_STRING_ARB
:
8393 CALL_ProgramStringARB(ctx
->Exec
,
8394 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8396 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8397 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8401 case OPCODE_BEGIN_QUERY_ARB
:
8402 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8404 case OPCODE_END_QUERY_ARB
:
8405 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8407 case OPCODE_QUERY_COUNTER
:
8408 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8410 case OPCODE_BEGIN_QUERY_INDEXED
:
8411 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8413 case OPCODE_END_QUERY_INDEXED
:
8414 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8416 case OPCODE_DRAW_BUFFERS_ARB
:
8418 GLenum buffers
[MAX_DRAW_BUFFERS
];
8419 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8420 for (i
= 0; i
< count
; i
++)
8421 buffers
[i
] = n
[2 + i
].e
;
8422 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8425 case OPCODE_BLIT_FRAMEBUFFER
:
8426 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8427 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8430 case OPCODE_USE_PROGRAM
:
8431 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8433 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8434 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8436 case OPCODE_ACTIVE_PROGRAM_EXT
:
8437 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8439 case OPCODE_UNIFORM_1F
:
8440 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8442 case OPCODE_UNIFORM_2F
:
8443 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8445 case OPCODE_UNIFORM_3F
:
8446 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8448 case OPCODE_UNIFORM_4F
:
8449 CALL_Uniform4fARB(ctx
->Exec
,
8450 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8452 case OPCODE_UNIFORM_1FV
:
8453 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8455 case OPCODE_UNIFORM_2FV
:
8456 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8458 case OPCODE_UNIFORM_3FV
:
8459 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8461 case OPCODE_UNIFORM_4FV
:
8462 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8464 case OPCODE_UNIFORM_1I
:
8465 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8467 case OPCODE_UNIFORM_2I
:
8468 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8470 case OPCODE_UNIFORM_3I
:
8471 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8473 case OPCODE_UNIFORM_4I
:
8474 CALL_Uniform4iARB(ctx
->Exec
,
8475 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8477 case OPCODE_UNIFORM_1IV
:
8478 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8480 case OPCODE_UNIFORM_2IV
:
8481 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8483 case OPCODE_UNIFORM_3IV
:
8484 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8486 case OPCODE_UNIFORM_4IV
:
8487 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8489 case OPCODE_UNIFORM_1UI
:
8490 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8492 case OPCODE_UNIFORM_2UI
:
8493 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8495 case OPCODE_UNIFORM_3UI
:
8496 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8498 case OPCODE_UNIFORM_4UI
:
8499 /*CALL_Uniform4uiARB(ctx->Exec,
8500 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8503 case OPCODE_UNIFORM_1UIV
:
8504 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8506 case OPCODE_UNIFORM_2UIV
:
8507 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8509 case OPCODE_UNIFORM_3UIV
:
8510 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8512 case OPCODE_UNIFORM_4UIV
:
8513 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8515 case OPCODE_UNIFORM_MATRIX22
:
8516 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8517 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8519 case OPCODE_UNIFORM_MATRIX33
:
8520 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8521 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8523 case OPCODE_UNIFORM_MATRIX44
:
8524 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8525 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8527 case OPCODE_UNIFORM_MATRIX23
:
8528 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8529 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8531 case OPCODE_UNIFORM_MATRIX32
:
8532 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8533 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8535 case OPCODE_UNIFORM_MATRIX24
:
8536 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8537 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8539 case OPCODE_UNIFORM_MATRIX42
:
8540 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8541 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8543 case OPCODE_UNIFORM_MATRIX34
:
8544 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8545 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8547 case OPCODE_UNIFORM_MATRIX43
:
8548 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8549 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8552 case OPCODE_CLAMP_COLOR
:
8553 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8556 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8559 GLuint i
, pname
= n
[1].ui
;
8561 for (i
= 0; i
< 4; i
++)
8562 values
[i
] = n
[1 + i
].f
;
8563 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8566 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8567 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8569 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8572 GLuint i
, dst
= n
[1].ui
;
8574 for (i
= 0; i
< 4; i
++)
8575 values
[i
] = n
[1 + i
].f
;
8576 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8579 case OPCODE_ATTR_1F_NV
:
8580 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8582 case OPCODE_ATTR_2F_NV
:
8583 /* Really shouldn't have to do this - the Node structure
8584 * is convenient, but it would be better to store the data
8585 * packed appropriately so that it can be sent directly
8586 * on. With x86_64 becoming common, this will start to
8589 if (sizeof(Node
) == sizeof(GLfloat
))
8590 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8592 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8594 case OPCODE_ATTR_3F_NV
:
8595 if (sizeof(Node
) == sizeof(GLfloat
))
8596 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8598 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8601 case OPCODE_ATTR_4F_NV
:
8602 if (sizeof(Node
) == sizeof(GLfloat
))
8603 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8605 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8608 case OPCODE_ATTR_1F_ARB
:
8609 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8611 case OPCODE_ATTR_2F_ARB
:
8612 /* Really shouldn't have to do this - the Node structure
8613 * is convenient, but it would be better to store the data
8614 * packed appropriately so that it can be sent directly
8615 * on. With x86_64 becoming common, this will start to
8618 if (sizeof(Node
) == sizeof(GLfloat
))
8619 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8621 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8623 case OPCODE_ATTR_3F_ARB
:
8624 if (sizeof(Node
) == sizeof(GLfloat
))
8625 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8627 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8630 case OPCODE_ATTR_4F_ARB
:
8631 if (sizeof(Node
) == sizeof(GLfloat
))
8632 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8634 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8637 case OPCODE_MATERIAL
:
8638 if (sizeof(Node
) == sizeof(GLfloat
))
8639 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8646 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8650 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8653 CALL_End(ctx
->Exec
, ());
8656 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8658 case OPCODE_EVAL_C1
:
8659 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8661 case OPCODE_EVAL_C2
:
8662 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8664 case OPCODE_EVAL_P1
:
8665 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8667 case OPCODE_EVAL_P2
:
8668 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8671 /* GL_EXT_texture_integer */
8672 case OPCODE_CLEARCOLOR_I
:
8673 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8675 case OPCODE_CLEARCOLOR_UI
:
8676 CALL_ClearColorIuiEXT(ctx
->Exec
,
8677 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8679 case OPCODE_TEXPARAMETER_I
:
8686 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8689 case OPCODE_TEXPARAMETER_UI
:
8692 params
[0] = n
[3].ui
;
8693 params
[1] = n
[4].ui
;
8694 params
[2] = n
[5].ui
;
8695 params
[3] = n
[6].ui
;
8696 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8700 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8701 /* GL_ARB_instanced_arrays */
8702 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8705 case OPCODE_TEXTURE_BARRIER_NV
:
8706 CALL_TextureBarrierNV(ctx
->Exec
, ());
8709 /* GL_EXT/ARB_transform_feedback */
8710 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8711 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8713 case OPCODE_END_TRANSFORM_FEEDBACK
:
8714 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8716 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8717 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8719 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8720 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8722 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8723 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8725 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8726 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8728 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8729 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8730 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8732 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8733 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8734 (n
[1].e
, n
[2].ui
, n
[3].si
));
8736 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8737 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8738 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8742 case OPCODE_BIND_SAMPLER
:
8743 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8745 case OPCODE_SAMPLER_PARAMETERIV
:
8752 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8755 case OPCODE_SAMPLER_PARAMETERFV
:
8762 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8765 case OPCODE_SAMPLER_PARAMETERIIV
:
8772 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8775 case OPCODE_SAMPLER_PARAMETERUIV
:
8778 params
[0] = n
[3].ui
;
8779 params
[1] = n
[4].ui
;
8780 params
[2] = n
[5].ui
;
8781 params
[3] = n
[6].ui
;
8782 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8786 /* GL_ARB_geometry_shader4 */
8787 case OPCODE_PROGRAM_PARAMETERI
:
8788 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8790 case OPCODE_FRAMEBUFFER_TEXTURE
:
8791 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8794 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8795 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8796 n
[3].ui
, n
[4].i
, n
[5].e
));
8800 case OPCODE_WAIT_SYNC
:
8802 union uint64_pair p
;
8803 p
.uint32
[0] = n
[3].ui
;
8804 p
.uint32
[1] = n
[4].ui
;
8805 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8809 /* GL_NV_conditional_render */
8810 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8811 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8813 case OPCODE_END_CONDITIONAL_RENDER
:
8814 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8817 case OPCODE_UNIFORM_BLOCK_BINDING
:
8818 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8821 case OPCODE_CONTINUE
:
8822 n
= (Node
*) n
[1].next
;
8824 case OPCODE_END_OF_LIST
:
8830 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8832 _mesa_problem(ctx
, "%s", msg
);
8837 /* increment n to point to next compiled command */
8838 if (opcode
!= OPCODE_CONTINUE
) {
8839 n
+= InstSize
[opcode
];
8844 if (ctx
->Driver
.EndCallList
)
8845 ctx
->Driver
.EndCallList(ctx
);
8847 ctx
->ListState
.CallDepth
--;
8852 /**********************************************************************/
8854 /**********************************************************************/
8857 * Test if a display list number is valid.
8859 static GLboolean GLAPIENTRY
8860 _mesa_IsList(GLuint list
)
8862 GET_CURRENT_CONTEXT(ctx
);
8863 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8864 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8865 return islist(ctx
, list
);
8870 * Delete a sequence of consecutive display lists.
8872 static void GLAPIENTRY
8873 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8875 GET_CURRENT_CONTEXT(ctx
);
8877 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8878 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8881 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8884 for (i
= list
; i
< list
+ range
; i
++) {
8885 destroy_list(ctx
, i
);
8891 * Return a display list number, n, such that lists n through n+range-1
8894 static GLuint GLAPIENTRY
8895 _mesa_GenLists(GLsizei range
)
8897 GET_CURRENT_CONTEXT(ctx
);
8899 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8900 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8903 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8911 * Make this an atomic operation
8913 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8915 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8917 /* reserve the list IDs by with empty/dummy lists */
8919 for (i
= 0; i
< range
; i
++) {
8920 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8921 make_list(base
+ i
, 1));
8925 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8932 * Begin a new display list.
8934 static void GLAPIENTRY
8935 _mesa_NewList(GLuint name
, GLenum mode
)
8937 GET_CURRENT_CONTEXT(ctx
);
8939 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8940 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8942 if (MESA_VERBOSE
& VERBOSE_API
)
8943 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8944 _mesa_lookup_enum_by_nr(mode
));
8947 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8951 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8952 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8956 if (ctx
->ListState
.CurrentList
) {
8957 /* already compiling a display list */
8958 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8962 ctx
->CompileFlag
= GL_TRUE
;
8963 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8965 /* Reset acumulated list state:
8967 invalidate_saved_current_state( ctx
);
8969 /* Allocate new display list */
8970 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8971 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8972 ctx
->ListState
.CurrentPos
= 0;
8974 ctx
->Driver
.NewList(ctx
, name
, mode
);
8976 ctx
->CurrentDispatch
= ctx
->Save
;
8977 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8982 * End definition of current display list.
8984 static void GLAPIENTRY
8987 GET_CURRENT_CONTEXT(ctx
);
8988 SAVE_FLUSH_VERTICES(ctx
);
8989 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8991 if (MESA_VERBOSE
& VERBOSE_API
)
8992 _mesa_debug(ctx
, "glEndList\n");
8994 /* Check that a list is under construction */
8995 if (!ctx
->ListState
.CurrentList
) {
8996 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
9000 /* Call before emitting END_OF_LIST, in case the driver wants to
9001 * emit opcodes itself.
9003 ctx
->Driver
.EndList(ctx
);
9005 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
9007 /* Destroy old list, if any */
9008 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
9010 /* Install the new list */
9011 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
9012 ctx
->ListState
.CurrentList
->Name
,
9013 ctx
->ListState
.CurrentList
);
9016 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
9017 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
9019 ctx
->ListState
.CurrentList
= NULL
;
9020 ctx
->ExecuteFlag
= GL_TRUE
;
9021 ctx
->CompileFlag
= GL_FALSE
;
9023 ctx
->CurrentDispatch
= ctx
->Exec
;
9024 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9029 _mesa_CallList(GLuint list
)
9031 GLboolean save_compile_flag
;
9032 GET_CURRENT_CONTEXT(ctx
);
9033 FLUSH_CURRENT(ctx
, 0);
9035 if (MESA_VERBOSE
& VERBOSE_API
)
9036 _mesa_debug(ctx
, "glCallList %d\n", list
);
9039 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
9044 mesa_print_display_list( list
);
9046 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
9047 * execute the display list, and restore the CompileFlag.
9049 save_compile_flag
= ctx
->CompileFlag
;
9050 if (save_compile_flag
) {
9051 ctx
->CompileFlag
= GL_FALSE
;
9054 execute_list(ctx
, list
);
9055 ctx
->CompileFlag
= save_compile_flag
;
9057 /* also restore API function pointers to point to "save" versions */
9058 if (save_compile_flag
) {
9059 ctx
->CurrentDispatch
= ctx
->Save
;
9060 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9066 * Execute glCallLists: call multiple display lists.
9069 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9071 GET_CURRENT_CONTEXT(ctx
);
9073 GLboolean save_compile_flag
;
9075 if (MESA_VERBOSE
& VERBOSE_API
)
9076 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9080 case GL_UNSIGNED_BYTE
:
9082 case GL_UNSIGNED_SHORT
:
9084 case GL_UNSIGNED_INT
:
9092 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9096 /* Save the CompileFlag status, turn it off, execute display list,
9097 * and restore the CompileFlag.
9099 save_compile_flag
= ctx
->CompileFlag
;
9100 ctx
->CompileFlag
= GL_FALSE
;
9102 for (i
= 0; i
< n
; i
++) {
9103 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9104 execute_list(ctx
, list
);
9107 ctx
->CompileFlag
= save_compile_flag
;
9109 /* also restore API function pointers to point to "save" versions */
9110 if (save_compile_flag
) {
9111 ctx
->CurrentDispatch
= ctx
->Save
;
9112 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9118 * Set the offset added to list numbers in glCallLists.
9120 static void GLAPIENTRY
9121 _mesa_ListBase(GLuint base
)
9123 GET_CURRENT_CONTEXT(ctx
);
9124 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9125 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9126 ctx
->List
.ListBase
= base
;
9130 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
9132 static void GLAPIENTRY
9135 GET_CURRENT_CONTEXT(ctx
);
9136 FLUSH_VERTICES(ctx
, 0);
9137 CALL_Finish(ctx
->Exec
, ());
9140 static void GLAPIENTRY
9143 GET_CURRENT_CONTEXT(ctx
);
9144 FLUSH_VERTICES(ctx
, 0);
9145 CALL_Flush(ctx
->Exec
, ());
9148 static void GLAPIENTRY
9149 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
9151 GET_CURRENT_CONTEXT(ctx
);
9152 FLUSH_VERTICES(ctx
, 0);
9153 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
9156 static void GLAPIENTRY
9157 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
9159 GET_CURRENT_CONTEXT(ctx
);
9160 FLUSH_VERTICES(ctx
, 0);
9161 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
9164 static void GLAPIENTRY
9165 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
9167 GET_CURRENT_CONTEXT(ctx
);
9168 FLUSH_VERTICES(ctx
, 0);
9169 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
9172 static GLenum GLAPIENTRY
9175 GET_CURRENT_CONTEXT(ctx
);
9176 FLUSH_VERTICES(ctx
, 0);
9177 return CALL_GetError(ctx
->Exec
, ());
9180 static void GLAPIENTRY
9181 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9183 GET_CURRENT_CONTEXT(ctx
);
9184 FLUSH_VERTICES(ctx
, 0);
9185 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9188 static void GLAPIENTRY
9189 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9191 GET_CURRENT_CONTEXT(ctx
);
9192 FLUSH_VERTICES(ctx
, 0);
9193 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9196 static void GLAPIENTRY
9197 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9199 GET_CURRENT_CONTEXT(ctx
);
9200 FLUSH_VERTICES(ctx
, 0);
9201 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9204 static void GLAPIENTRY
9205 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9207 GET_CURRENT_CONTEXT(ctx
);
9208 FLUSH_VERTICES(ctx
, 0);
9209 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9212 static void GLAPIENTRY
9213 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9215 GET_CURRENT_CONTEXT(ctx
);
9216 FLUSH_VERTICES(ctx
, 0);
9217 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9220 static void GLAPIENTRY
9221 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9223 GET_CURRENT_CONTEXT(ctx
);
9224 FLUSH_VERTICES(ctx
, 0);
9225 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9228 static void GLAPIENTRY
9229 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9231 GET_CURRENT_CONTEXT(ctx
);
9232 FLUSH_VERTICES(ctx
, 0);
9233 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9236 static void GLAPIENTRY
9237 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9239 GET_CURRENT_CONTEXT(ctx
);
9240 FLUSH_VERTICES(ctx
, 0);
9241 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9244 static void GLAPIENTRY
9245 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9247 GET_CURRENT_CONTEXT(ctx
);
9248 FLUSH_VERTICES(ctx
, 0);
9249 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9252 static void GLAPIENTRY
9253 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9255 GET_CURRENT_CONTEXT(ctx
);
9256 FLUSH_VERTICES(ctx
, 0);
9257 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9260 static void GLAPIENTRY
9261 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9263 GET_CURRENT_CONTEXT(ctx
);
9264 FLUSH_VERTICES(ctx
, 0);
9265 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9268 static void GLAPIENTRY
9269 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9271 GET_CURRENT_CONTEXT(ctx
);
9272 FLUSH_VERTICES(ctx
, 0);
9273 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9276 static void GLAPIENTRY
9277 exec_GetPolygonStipple(GLubyte
* dest
)
9279 GET_CURRENT_CONTEXT(ctx
);
9280 FLUSH_VERTICES(ctx
, 0);
9281 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9284 static const GLubyte
*GLAPIENTRY
9285 exec_GetString(GLenum name
)
9287 GET_CURRENT_CONTEXT(ctx
);
9288 FLUSH_VERTICES(ctx
, 0);
9289 return CALL_GetString(ctx
->Exec
, (name
));
9292 static void GLAPIENTRY
9293 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9295 GET_CURRENT_CONTEXT(ctx
);
9296 FLUSH_VERTICES(ctx
, 0);
9297 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9300 static void GLAPIENTRY
9301 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9303 GET_CURRENT_CONTEXT(ctx
);
9304 FLUSH_VERTICES(ctx
, 0);
9305 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9308 static void GLAPIENTRY
9309 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9311 GET_CURRENT_CONTEXT(ctx
);
9312 FLUSH_VERTICES(ctx
, 0);
9313 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9316 static void GLAPIENTRY
9317 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9319 GET_CURRENT_CONTEXT(ctx
);
9320 FLUSH_VERTICES(ctx
, 0);
9321 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9324 static void GLAPIENTRY
9325 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9327 GET_CURRENT_CONTEXT(ctx
);
9328 FLUSH_VERTICES(ctx
, 0);
9329 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9332 static void GLAPIENTRY
9333 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9334 GLenum type
, GLvoid
* pixels
)
9336 GET_CURRENT_CONTEXT(ctx
);
9337 FLUSH_VERTICES(ctx
, 0);
9338 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9341 static void GLAPIENTRY
9342 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9343 GLenum pname
, GLfloat
*params
)
9345 GET_CURRENT_CONTEXT(ctx
);
9346 FLUSH_VERTICES(ctx
, 0);
9347 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9350 static void GLAPIENTRY
9351 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9352 GLenum pname
, GLint
*params
)
9354 GET_CURRENT_CONTEXT(ctx
);
9355 FLUSH_VERTICES(ctx
, 0);
9356 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9359 static void GLAPIENTRY
9360 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9362 GET_CURRENT_CONTEXT(ctx
);
9363 FLUSH_VERTICES(ctx
, 0);
9364 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9367 static void GLAPIENTRY
9368 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9370 GET_CURRENT_CONTEXT(ctx
);
9371 FLUSH_VERTICES(ctx
, 0);
9372 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9375 static GLboolean GLAPIENTRY
9376 exec_IsEnabled(GLenum cap
)
9378 GET_CURRENT_CONTEXT(ctx
);
9379 FLUSH_VERTICES(ctx
, 0);
9380 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9383 static void GLAPIENTRY
9384 exec_PixelStoref(GLenum pname
, GLfloat param
)
9386 GET_CURRENT_CONTEXT(ctx
);
9387 FLUSH_VERTICES(ctx
, 0);
9388 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9391 static void GLAPIENTRY
9392 exec_PixelStorei(GLenum pname
, GLint param
)
9394 GET_CURRENT_CONTEXT(ctx
);
9395 FLUSH_VERTICES(ctx
, 0);
9396 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9399 static void GLAPIENTRY
9400 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9401 GLenum format
, GLenum type
, GLvoid
* pixels
)
9403 GET_CURRENT_CONTEXT(ctx
);
9404 FLUSH_VERTICES(ctx
, 0);
9405 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9408 static GLint GLAPIENTRY
9409 exec_RenderMode(GLenum mode
)
9411 GET_CURRENT_CONTEXT(ctx
);
9412 FLUSH_VERTICES(ctx
, 0);
9413 return CALL_RenderMode(ctx
->Exec
, (mode
));
9416 static void GLAPIENTRY
9417 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9419 GET_CURRENT_CONTEXT(ctx
);
9420 FLUSH_VERTICES(ctx
, 0);
9421 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9424 static void GLAPIENTRY
9425 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9427 GET_CURRENT_CONTEXT(ctx
);
9428 FLUSH_VERTICES(ctx
, 0);
9429 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9432 static GLboolean GLAPIENTRY
9433 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9434 GLboolean
* residences
)
9436 GET_CURRENT_CONTEXT(ctx
);
9437 FLUSH_VERTICES(ctx
, 0);
9438 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9441 static void GLAPIENTRY
9442 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9444 GET_CURRENT_CONTEXT(ctx
);
9445 FLUSH_VERTICES(ctx
, 0);
9446 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9449 static void GLAPIENTRY
9450 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9452 GET_CURRENT_CONTEXT(ctx
);
9453 FLUSH_VERTICES(ctx
, 0);
9454 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9457 static void GLAPIENTRY
9458 exec_DisableClientState(GLenum cap
)
9460 GET_CURRENT_CONTEXT(ctx
);
9461 FLUSH_VERTICES(ctx
, 0);
9462 CALL_DisableClientState(ctx
->Exec
, (cap
));
9465 static void GLAPIENTRY
9466 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9468 GET_CURRENT_CONTEXT(ctx
);
9469 FLUSH_VERTICES(ctx
, 0);
9470 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9473 static void GLAPIENTRY
9474 exec_EnableClientState(GLenum cap
)
9476 GET_CURRENT_CONTEXT(ctx
);
9477 FLUSH_VERTICES(ctx
, 0);
9478 CALL_EnableClientState(ctx
->Exec
, (cap
));
9481 static void GLAPIENTRY
9482 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9484 GET_CURRENT_CONTEXT(ctx
);
9485 FLUSH_VERTICES(ctx
, 0);
9486 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9489 static void GLAPIENTRY
9490 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9492 GET_CURRENT_CONTEXT(ctx
);
9493 FLUSH_VERTICES(ctx
, 0);
9494 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9497 static void GLAPIENTRY
9498 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9500 GET_CURRENT_CONTEXT(ctx
);
9501 FLUSH_VERTICES(ctx
, 0);
9502 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9505 static void GLAPIENTRY
9506 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9508 GET_CURRENT_CONTEXT(ctx
);
9509 FLUSH_VERTICES(ctx
, 0);
9510 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9513 static GLboolean GLAPIENTRY
9514 exec_IsTexture(GLuint texture
)
9516 GET_CURRENT_CONTEXT(ctx
);
9517 FLUSH_VERTICES(ctx
, 0);
9518 return CALL_IsTexture(ctx
->Exec
, (texture
));
9521 static void GLAPIENTRY
9522 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9524 GET_CURRENT_CONTEXT(ctx
);
9525 FLUSH_VERTICES(ctx
, 0);
9526 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9529 static void GLAPIENTRY
9530 exec_PopClientAttrib(void)
9532 GET_CURRENT_CONTEXT(ctx
);
9533 FLUSH_VERTICES(ctx
, 0);
9534 CALL_PopClientAttrib(ctx
->Exec
, ());
9537 static void GLAPIENTRY
9538 exec_PushClientAttrib(GLbitfield mask
)
9540 GET_CURRENT_CONTEXT(ctx
);
9541 FLUSH_VERTICES(ctx
, 0);
9542 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9545 static void GLAPIENTRY
9546 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9549 GET_CURRENT_CONTEXT(ctx
);
9550 FLUSH_VERTICES(ctx
, 0);
9551 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9554 static void GLAPIENTRY
9555 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9557 GET_CURRENT_CONTEXT(ctx
);
9558 FLUSH_VERTICES(ctx
, 0);
9559 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9562 static void GLAPIENTRY
9563 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9566 GET_CURRENT_CONTEXT(ctx
);
9567 FLUSH_VERTICES(ctx
, 0);
9568 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9571 static void GLAPIENTRY
9572 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9573 GLint x
, GLint y
, GLsizei width
)
9575 GET_CURRENT_CONTEXT(ctx
);
9576 FLUSH_VERTICES(ctx
, 0);
9577 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9578 (target
, internalFormat
, x
, y
, width
));
9581 static void GLAPIENTRY
9582 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9583 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9585 GET_CURRENT_CONTEXT(ctx
);
9586 FLUSH_VERTICES(ctx
, 0);
9587 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9588 (target
, internalFormat
, x
, y
, width
,
9592 static void GLAPIENTRY
9593 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9595 GET_CURRENT_CONTEXT(ctx
);
9596 FLUSH_VERTICES(ctx
, 0);
9597 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9600 static void GLAPIENTRY
9601 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9603 GET_CURRENT_CONTEXT(ctx
);
9604 FLUSH_VERTICES(ctx
, 0);
9605 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9608 static void GLAPIENTRY
9609 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9611 GET_CURRENT_CONTEXT(ctx
);
9612 FLUSH_VERTICES(ctx
, 0);
9613 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9616 static void GLAPIENTRY
9617 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9620 GET_CURRENT_CONTEXT(ctx
);
9621 FLUSH_VERTICES(ctx
, 0);
9622 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9625 static void GLAPIENTRY
9626 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9628 GET_CURRENT_CONTEXT(ctx
);
9629 FLUSH_VERTICES(ctx
, 0);
9630 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9633 static void GLAPIENTRY
9634 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9636 GET_CURRENT_CONTEXT(ctx
);
9637 FLUSH_VERTICES(ctx
, 0);
9638 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9641 static void GLAPIENTRY
9642 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9643 GLenum type
, GLvoid
*values
)
9645 GET_CURRENT_CONTEXT(ctx
);
9646 FLUSH_VERTICES(ctx
, 0);
9647 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9650 static void GLAPIENTRY
9651 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9653 GET_CURRENT_CONTEXT(ctx
);
9654 FLUSH_VERTICES(ctx
, 0);
9655 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9658 static void GLAPIENTRY
9659 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9661 GET_CURRENT_CONTEXT(ctx
);
9662 FLUSH_VERTICES(ctx
, 0);
9663 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9666 static void GLAPIENTRY
9667 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9668 GLenum type
, GLvoid
*values
)
9670 GET_CURRENT_CONTEXT(ctx
);
9671 FLUSH_VERTICES(ctx
, 0);
9672 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9675 static void GLAPIENTRY
9676 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9678 GET_CURRENT_CONTEXT(ctx
);
9679 FLUSH_VERTICES(ctx
, 0);
9680 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9683 static void GLAPIENTRY
9684 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9686 GET_CURRENT_CONTEXT(ctx
);
9687 FLUSH_VERTICES(ctx
, 0);
9688 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9691 static void GLAPIENTRY
9692 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9693 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9695 GET_CURRENT_CONTEXT(ctx
);
9696 FLUSH_VERTICES(ctx
, 0);
9697 CALL_GetSeparableFilter(ctx
->Exec
,
9698 (target
, format
, type
, row
, column
, span
));
9701 static void GLAPIENTRY
9702 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9703 GLsizei width
, GLsizei height
, GLenum format
,
9704 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9706 GET_CURRENT_CONTEXT(ctx
);
9707 FLUSH_VERTICES(ctx
, 0);
9708 CALL_SeparableFilter2D(ctx
->Exec
,
9709 (target
, internalFormat
, width
, height
, format
,
9710 type
, row
, column
));
9713 static void GLAPIENTRY
9714 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9715 GLsizei count
, const GLvoid
*ptr
)
9717 GET_CURRENT_CONTEXT(ctx
);
9718 FLUSH_VERTICES(ctx
, 0);
9719 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9722 static void GLAPIENTRY
9723 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9725 GET_CURRENT_CONTEXT(ctx
);
9726 FLUSH_VERTICES(ctx
, 0);
9727 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9730 static void GLAPIENTRY
9731 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9734 GET_CURRENT_CONTEXT(ctx
);
9735 FLUSH_VERTICES(ctx
, 0);
9736 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9739 static void GLAPIENTRY
9740 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9743 GET_CURRENT_CONTEXT(ctx
);
9744 FLUSH_VERTICES(ctx
, 0);
9745 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9748 static void GLAPIENTRY
9749 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9750 GLsizei count
, const GLvoid
*ptr
)
9752 GET_CURRENT_CONTEXT(ctx
);
9753 FLUSH_VERTICES(ctx
, 0);
9754 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9757 static void GLAPIENTRY
9758 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9759 GLsizei count
, const GLvoid
*ptr
)
9761 GET_CURRENT_CONTEXT(ctx
);
9762 FLUSH_VERTICES(ctx
, 0);
9763 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9766 static void GLAPIENTRY
9767 exec_LockArraysEXT(GLint first
, GLsizei count
)
9769 GET_CURRENT_CONTEXT(ctx
);
9770 FLUSH_VERTICES(ctx
, 0);
9771 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9774 static void GLAPIENTRY
9775 exec_UnlockArraysEXT(void)
9777 GET_CURRENT_CONTEXT(ctx
);
9778 FLUSH_VERTICES(ctx
, 0);
9779 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9782 static void GLAPIENTRY
9783 exec_ClientActiveTextureARB(GLenum target
)
9785 GET_CURRENT_CONTEXT(ctx
);
9786 FLUSH_VERTICES(ctx
, 0);
9787 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9790 static void GLAPIENTRY
9791 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9792 GLsizei stride
, const GLvoid
*ptr
)
9794 GET_CURRENT_CONTEXT(ctx
);
9795 FLUSH_VERTICES(ctx
, 0);
9796 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9799 static void GLAPIENTRY
9800 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9802 GET_CURRENT_CONTEXT(ctx
);
9803 FLUSH_VERTICES(ctx
, 0);
9804 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9807 /* GL_EXT_multi_draw_arrays */
9808 static void GLAPIENTRY
9809 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9810 const GLsizei
*count
, GLsizei primcount
)
9812 GET_CURRENT_CONTEXT(ctx
);
9813 FLUSH_VERTICES(ctx
, 0);
9814 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9817 /* GL_IBM_multimode_draw_arrays */
9818 static void GLAPIENTRY
9819 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9820 const GLsizei
* count
, GLsizei primcount
,
9823 GET_CURRENT_CONTEXT(ctx
);
9824 FLUSH_VERTICES(ctx
, 0);
9825 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9826 (mode
, first
, count
, primcount
, modestride
));
9829 /* GL_IBM_multimode_draw_arrays */
9830 static void GLAPIENTRY
9831 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9832 const GLsizei
* count
,
9834 const GLvoid
* const *indices
,
9835 GLsizei primcount
, GLint modestride
)
9837 GET_CURRENT_CONTEXT(ctx
);
9838 FLUSH_VERTICES(ctx
, 0);
9839 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9840 (mode
, count
, type
, indices
, primcount
,
9845 * Setup the given dispatch table to point to Mesa's display list
9846 * building functions.
9848 * This does not include any of the tnl functions - they are
9849 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9852 struct _glapi_table
*
9853 _mesa_create_save_table(const struct gl_context
*ctx
)
9855 struct _glapi_table
*table
;
9857 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9861 _mesa_loopback_init_api_table(ctx
, table
);
9864 SET_Accum(table
, save_Accum
);
9865 SET_AlphaFunc(table
, save_AlphaFunc
);
9866 SET_Bitmap(table
, save_Bitmap
);
9867 SET_BlendFunc(table
, save_BlendFunc
);
9868 SET_CallList(table
, save_CallList
);
9869 SET_CallLists(table
, save_CallLists
);
9870 SET_Clear(table
, save_Clear
);
9871 SET_ClearAccum(table
, save_ClearAccum
);
9872 SET_ClearColor(table
, save_ClearColor
);
9873 SET_ClearDepth(table
, save_ClearDepth
);
9874 SET_ClearIndex(table
, save_ClearIndex
);
9875 SET_ClearStencil(table
, save_ClearStencil
);
9876 SET_ClipPlane(table
, save_ClipPlane
);
9877 SET_ColorMask(table
, save_ColorMask
);
9878 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9879 SET_ColorMaterial(table
, save_ColorMaterial
);
9880 SET_CopyPixels(table
, save_CopyPixels
);
9881 SET_CullFace(table
, save_CullFace
);
9882 SET_DeleteLists(table
, _mesa_DeleteLists
);
9883 SET_DepthFunc(table
, save_DepthFunc
);
9884 SET_DepthMask(table
, save_DepthMask
);
9885 SET_DepthRange(table
, save_DepthRange
);
9886 SET_Disable(table
, save_Disable
);
9887 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9888 SET_DrawBuffer(table
, save_DrawBuffer
);
9889 SET_DrawPixels(table
, save_DrawPixels
);
9890 SET_Enable(table
, save_Enable
);
9891 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9892 SET_EndList(table
, _mesa_EndList
);
9893 SET_EvalMesh1(table
, save_EvalMesh1
);
9894 SET_EvalMesh2(table
, save_EvalMesh2
);
9895 SET_Finish(table
, exec_Finish
);
9896 SET_Flush(table
, exec_Flush
);
9897 SET_Fogf(table
, save_Fogf
);
9898 SET_Fogfv(table
, save_Fogfv
);
9899 SET_Fogi(table
, save_Fogi
);
9900 SET_Fogiv(table
, save_Fogiv
);
9901 SET_FrontFace(table
, save_FrontFace
);
9902 SET_Frustum(table
, save_Frustum
);
9903 SET_GenLists(table
, _mesa_GenLists
);
9904 SET_GetBooleanv(table
, exec_GetBooleanv
);
9905 SET_GetClipPlane(table
, exec_GetClipPlane
);
9906 SET_GetDoublev(table
, exec_GetDoublev
);
9907 SET_GetError(table
, exec_GetError
);
9908 SET_GetFloatv(table
, exec_GetFloatv
);
9909 SET_GetIntegerv(table
, exec_GetIntegerv
);
9910 SET_GetLightfv(table
, exec_GetLightfv
);
9911 SET_GetLightiv(table
, exec_GetLightiv
);
9912 SET_GetMapdv(table
, exec_GetMapdv
);
9913 SET_GetMapfv(table
, exec_GetMapfv
);
9914 SET_GetMapiv(table
, exec_GetMapiv
);
9915 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9916 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9917 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9918 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9919 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9920 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9921 SET_GetString(table
, exec_GetString
);
9922 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9923 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9924 SET_GetTexGendv(table
, exec_GetTexGendv
);
9925 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9926 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9927 SET_GetTexImage(table
, exec_GetTexImage
);
9928 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9929 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9930 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9931 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9932 SET_Hint(table
, save_Hint
);
9933 SET_IndexMask(table
, save_IndexMask
);
9934 SET_InitNames(table
, save_InitNames
);
9935 SET_IsEnabled(table
, exec_IsEnabled
);
9936 SET_IsList(table
, _mesa_IsList
);
9937 SET_LightModelf(table
, save_LightModelf
);
9938 SET_LightModelfv(table
, save_LightModelfv
);
9939 SET_LightModeli(table
, save_LightModeli
);
9940 SET_LightModeliv(table
, save_LightModeliv
);
9941 SET_Lightf(table
, save_Lightf
);
9942 SET_Lightfv(table
, save_Lightfv
);
9943 SET_Lighti(table
, save_Lighti
);
9944 SET_Lightiv(table
, save_Lightiv
);
9945 SET_LineStipple(table
, save_LineStipple
);
9946 SET_LineWidth(table
, save_LineWidth
);
9947 SET_ListBase(table
, save_ListBase
);
9948 SET_LoadIdentity(table
, save_LoadIdentity
);
9949 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9950 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9951 SET_LoadName(table
, save_LoadName
);
9952 SET_LogicOp(table
, save_LogicOp
);
9953 SET_Map1d(table
, save_Map1d
);
9954 SET_Map1f(table
, save_Map1f
);
9955 SET_Map2d(table
, save_Map2d
);
9956 SET_Map2f(table
, save_Map2f
);
9957 SET_MapGrid1d(table
, save_MapGrid1d
);
9958 SET_MapGrid1f(table
, save_MapGrid1f
);
9959 SET_MapGrid2d(table
, save_MapGrid2d
);
9960 SET_MapGrid2f(table
, save_MapGrid2f
);
9961 SET_MatrixMode(table
, save_MatrixMode
);
9962 SET_MultMatrixd(table
, save_MultMatrixd
);
9963 SET_MultMatrixf(table
, save_MultMatrixf
);
9964 SET_NewList(table
, save_NewList
);
9965 SET_Ortho(table
, save_Ortho
);
9966 SET_PassThrough(table
, save_PassThrough
);
9967 SET_PixelMapfv(table
, save_PixelMapfv
);
9968 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9969 SET_PixelMapusv(table
, save_PixelMapusv
);
9970 SET_PixelStoref(table
, exec_PixelStoref
);
9971 SET_PixelStorei(table
, exec_PixelStorei
);
9972 SET_PixelTransferf(table
, save_PixelTransferf
);
9973 SET_PixelTransferi(table
, save_PixelTransferi
);
9974 SET_PixelZoom(table
, save_PixelZoom
);
9975 SET_PointSize(table
, save_PointSize
);
9976 SET_PolygonMode(table
, save_PolygonMode
);
9977 SET_PolygonOffset(table
, save_PolygonOffset
);
9978 SET_PolygonStipple(table
, save_PolygonStipple
);
9979 SET_PopAttrib(table
, save_PopAttrib
);
9980 SET_PopMatrix(table
, save_PopMatrix
);
9981 SET_PopName(table
, save_PopName
);
9982 SET_PushAttrib(table
, save_PushAttrib
);
9983 SET_PushMatrix(table
, save_PushMatrix
);
9984 SET_PushName(table
, save_PushName
);
9985 SET_RasterPos2d(table
, save_RasterPos2d
);
9986 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9987 SET_RasterPos2f(table
, save_RasterPos2f
);
9988 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9989 SET_RasterPos2i(table
, save_RasterPos2i
);
9990 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9991 SET_RasterPos2s(table
, save_RasterPos2s
);
9992 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9993 SET_RasterPos3d(table
, save_RasterPos3d
);
9994 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9995 SET_RasterPos3f(table
, save_RasterPos3f
);
9996 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9997 SET_RasterPos3i(table
, save_RasterPos3i
);
9998 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9999 SET_RasterPos3s(table
, save_RasterPos3s
);
10000 SET_RasterPos3sv(table
, save_RasterPos3sv
);
10001 SET_RasterPos4d(table
, save_RasterPos4d
);
10002 SET_RasterPos4dv(table
, save_RasterPos4dv
);
10003 SET_RasterPos4f(table
, save_RasterPos4f
);
10004 SET_RasterPos4fv(table
, save_RasterPos4fv
);
10005 SET_RasterPos4i(table
, save_RasterPos4i
);
10006 SET_RasterPos4iv(table
, save_RasterPos4iv
);
10007 SET_RasterPos4s(table
, save_RasterPos4s
);
10008 SET_RasterPos4sv(table
, save_RasterPos4sv
);
10009 SET_ReadBuffer(table
, save_ReadBuffer
);
10010 SET_ReadPixels(table
, exec_ReadPixels
);
10011 SET_RenderMode(table
, exec_RenderMode
);
10012 SET_Rotated(table
, save_Rotated
);
10013 SET_Rotatef(table
, save_Rotatef
);
10014 SET_Scaled(table
, save_Scaled
);
10015 SET_Scalef(table
, save_Scalef
);
10016 SET_Scissor(table
, save_Scissor
);
10017 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
10018 SET_SelectBuffer(table
, exec_SelectBuffer
);
10019 SET_ShadeModel(table
, save_ShadeModel
);
10020 SET_StencilFunc(table
, save_StencilFunc
);
10021 SET_StencilMask(table
, save_StencilMask
);
10022 SET_StencilOp(table
, save_StencilOp
);
10023 SET_TexEnvf(table
, save_TexEnvf
);
10024 SET_TexEnvfv(table
, save_TexEnvfv
);
10025 SET_TexEnvi(table
, save_TexEnvi
);
10026 SET_TexEnviv(table
, save_TexEnviv
);
10027 SET_TexGend(table
, save_TexGend
);
10028 SET_TexGendv(table
, save_TexGendv
);
10029 SET_TexGenf(table
, save_TexGenf
);
10030 SET_TexGenfv(table
, save_TexGenfv
);
10031 SET_TexGeni(table
, save_TexGeni
);
10032 SET_TexGeniv(table
, save_TexGeniv
);
10033 SET_TexImage1D(table
, save_TexImage1D
);
10034 SET_TexImage2D(table
, save_TexImage2D
);
10035 SET_TexParameterf(table
, save_TexParameterf
);
10036 SET_TexParameterfv(table
, save_TexParameterfv
);
10037 SET_TexParameteri(table
, save_TexParameteri
);
10038 SET_TexParameteriv(table
, save_TexParameteriv
);
10039 SET_Translated(table
, save_Translated
);
10040 SET_Translatef(table
, save_Translatef
);
10041 SET_Viewport(table
, save_Viewport
);
10044 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
10045 SET_BindTexture(table
, save_BindTexture
);
10046 SET_ColorPointer(table
, exec_ColorPointer
);
10047 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
10048 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
10049 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
10050 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
10051 SET_DeleteTextures(table
, exec_DeleteTextures
);
10052 SET_DisableClientState(table
, exec_DisableClientState
);
10053 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
10054 SET_EnableClientState(table
, exec_EnableClientState
);
10055 SET_GenTextures(table
, exec_GenTextures
);
10056 SET_GetPointerv(table
, exec_GetPointerv
);
10057 SET_IndexPointer(table
, exec_IndexPointer
);
10058 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
10059 SET_IsTexture(table
, exec_IsTexture
);
10060 SET_NormalPointer(table
, exec_NormalPointer
);
10061 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
10062 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
10063 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
10064 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
10065 SET_TexSubImage1D(table
, save_TexSubImage1D
);
10066 SET_TexSubImage2D(table
, save_TexSubImage2D
);
10067 SET_VertexPointer(table
, exec_VertexPointer
);
10070 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
10071 SET_TexImage3D(table
, save_TexImage3D
);
10072 SET_TexSubImage3D(table
, save_TexSubImage3D
);
10075 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
10076 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
10077 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
10079 /* ATI_separate_stencil */
10080 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
10082 /* GL_ARB_imaging */
10083 /* Not all are supported */
10084 SET_BlendColor(table
, save_BlendColor
);
10085 SET_BlendEquation(table
, save_BlendEquation
);
10086 SET_ColorSubTable(table
, save_ColorSubTable
);
10087 SET_ColorTable(table
, save_ColorTable
);
10088 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
10089 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
10090 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
10091 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
10092 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
10093 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
10094 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
10095 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
10096 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
10097 SET_CopyColorTable(table
, save_CopyColorTable
);
10098 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
10099 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
10100 SET_GetColorTable(table
, exec_GetColorTable
);
10101 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
10102 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
10103 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
10104 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
10105 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
10106 SET_GetHistogram(table
, exec_GetHistogram
);
10107 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
10108 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
10109 SET_GetMinmax(table
, exec_GetMinmax
);
10110 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
10111 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
10112 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
10113 SET_Histogram(table
, save_Histogram
);
10114 SET_Minmax(table
, save_Minmax
);
10115 SET_ResetHistogram(table
, save_ResetHistogram
);
10116 SET_ResetMinmax(table
, save_ResetMinmax
);
10117 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
10119 /* 2. GL_EXT_blend_color */
10121 SET_BlendColorEXT(table
, save_BlendColorEXT
);
10124 /* 3. GL_EXT_polygon_offset */
10125 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
10127 /* 6. GL_EXT_texture3d */
10129 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
10130 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
10131 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
10134 /* 14. GL_SGI_color_table */
10136 SET_ColorTableSGI(table
, save_ColorTable
);
10137 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
10138 SET_GetColorTableSGI(table
, exec_GetColorTable
);
10139 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
10140 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
10143 /* 30. GL_EXT_vertex_array */
10144 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
10145 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
10146 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
10147 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
10148 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
10149 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
10151 /* 37. GL_EXT_blend_minmax */
10153 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
10156 /* 54. GL_EXT_point_parameters */
10157 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
10158 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
10160 /* 97. GL_EXT_compiled_vertex_array */
10161 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
10162 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
10164 /* 145. GL_EXT_secondary_color */
10165 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
10167 /* 148. GL_EXT_multi_draw_arrays */
10168 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
10170 /* 149. GL_EXT_fog_coord */
10171 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10173 /* 173. GL_EXT_blend_func_separate */
10174 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10176 /* 196. GL_MESA_resize_buffers */
10177 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10179 /* 197. GL_MESA_window_pos */
10180 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10181 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10182 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10183 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10184 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10185 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10186 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10187 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10188 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10189 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10190 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10191 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10192 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10193 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10194 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10195 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10196 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10197 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10198 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10199 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10200 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10201 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10202 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10203 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10205 /* 200. GL_IBM_multimode_draw_arrays */
10206 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10207 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10209 /* 233. GL_NV_vertex_program */
10210 /* The following commands DO NOT go into display lists:
10211 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10212 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10214 SET_BindProgramNV(table
, save_BindProgramNV
);
10215 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10216 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10217 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10218 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10219 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10220 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10221 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10222 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10223 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10224 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10225 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10226 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10227 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10228 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10229 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10230 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10231 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10232 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10233 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10234 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10235 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10236 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10238 /* 244. GL_ATI_envmap_bumpmap */
10239 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10240 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10242 /* 245. GL_ATI_fragment_shader */
10243 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10244 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10246 /* 282. GL_NV_fragment_program */
10247 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10248 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10249 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10250 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10251 SET_GetProgramNamedParameterfvNV(table
,
10252 _mesa_GetProgramNamedParameterfvNV
);
10253 SET_GetProgramNamedParameterdvNV(table
,
10254 _mesa_GetProgramNamedParameterdvNV
);
10255 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10256 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10257 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10258 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10259 SET_GetProgramLocalParameterdvARB(table
,
10260 _mesa_GetProgramLocalParameterdvARB
);
10261 SET_GetProgramLocalParameterfvARB(table
,
10262 _mesa_GetProgramLocalParameterfvARB
);
10264 /* 262. GL_NV_point_sprite */
10265 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10266 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10268 /* 268. GL_EXT_stencil_two_side */
10269 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10271 /* 273. GL_APPLE_vertex_array_object */
10272 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10273 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10274 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10275 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10277 /* 310. GL_EXT_framebuffer_object */
10278 SET_GenFramebuffersEXT(table
, _mesa_GenFramebuffersEXT
);
10279 SET_BindFramebufferEXT(table
, _mesa_BindFramebufferEXT
);
10280 SET_DeleteFramebuffersEXT(table
, _mesa_DeleteFramebuffersEXT
);
10281 SET_CheckFramebufferStatusEXT(table
, _mesa_CheckFramebufferStatusEXT
);
10282 SET_GenRenderbuffersEXT(table
, _mesa_GenRenderbuffersEXT
);
10283 SET_BindRenderbufferEXT(table
, _mesa_BindRenderbufferEXT
);
10284 SET_DeleteRenderbuffersEXT(table
, _mesa_DeleteRenderbuffersEXT
);
10285 SET_RenderbufferStorageEXT(table
, _mesa_RenderbufferStorageEXT
);
10286 SET_FramebufferTexture1DEXT(table
, _mesa_FramebufferTexture1DEXT
);
10287 SET_FramebufferTexture2DEXT(table
, _mesa_FramebufferTexture2DEXT
);
10288 SET_FramebufferTexture3DEXT(table
, _mesa_FramebufferTexture3DEXT
);
10289 SET_FramebufferRenderbufferEXT(table
, _mesa_FramebufferRenderbufferEXT
);
10290 SET_GenerateMipmapEXT(table
, _mesa_GenerateMipmapEXT
);
10292 /* 317. GL_EXT_framebuffer_multisample */
10293 SET_RenderbufferStorageMultisample(table
, _mesa_RenderbufferStorageMultisample
);
10295 /* GL_ARB_vertex_array_object */
10296 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10297 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10299 /* ???. GL_EXT_depth_bounds_test */
10300 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10302 /* ARB 1. GL_ARB_multitexture */
10303 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10304 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10306 /* ARB 3. GL_ARB_transpose_matrix */
10307 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10308 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10309 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10310 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10312 /* ARB 5. GL_ARB_multisample */
10313 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10315 /* ARB 12. GL_ARB_texture_compression */
10316 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10317 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10318 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10319 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10320 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10321 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10322 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10324 /* ARB 14. GL_ARB_point_parameters */
10325 /* aliased with EXT_point_parameters functions */
10327 /* ARB 25. GL_ARB_window_pos */
10328 /* aliased with MESA_window_pos functions */
10330 /* ARB 26. GL_ARB_vertex_program */
10331 /* ARB 27. GL_ARB_fragment_program */
10332 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10333 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10334 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10335 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10336 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10337 SET_BindProgramNV(table
, save_BindProgramNV
);
10338 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10339 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10340 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10341 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10342 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10343 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10344 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10345 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10346 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10347 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10348 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10349 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10350 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10351 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10352 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10353 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10354 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10355 SET_GetProgramLocalParameterdvARB(table
,
10356 _mesa_GetProgramLocalParameterdvARB
);
10357 SET_GetProgramLocalParameterfvARB(table
,
10358 _mesa_GetProgramLocalParameterfvARB
);
10359 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10360 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10362 /* ARB 28. GL_ARB_vertex_buffer_object */
10363 /* None of the extension's functions get compiled */
10364 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10365 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10366 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10367 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10368 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10369 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10370 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10371 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10372 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10373 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10374 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10376 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10377 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10378 SET_EndQueryARB(table
, save_EndQueryARB
);
10379 SET_QueryCounter(table
, save_QueryCounter
);
10381 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10383 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10385 /* GL_ARB_shader_objects */
10386 _mesa_init_shader_dispatch(ctx
, table
); /* Plug in glCreate/Delete/Get, etc */
10387 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10388 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10389 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10390 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10391 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10392 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10393 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10394 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10395 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10396 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10397 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10398 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10399 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10400 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10401 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10402 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10403 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10404 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10405 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10406 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10407 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10408 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10409 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10410 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10411 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10412 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10414 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10415 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10416 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10417 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10418 /* XXX additional functions need to be implemented here! */
10420 /* 299. GL_EXT_blend_equation_separate */
10421 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10423 /* GL_EXT_gpu_program_parameters */
10424 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10425 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10427 /* ARB 50. GL_ARB_map_buffer_range */
10428 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10429 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10431 /* ARB 51. GL_ARB_texture_buffer_object */
10432 SET_TexBufferARB(table
, _mesa_TexBuffer
); /* no dlist save */
10434 /* ARB 59. GL_ARB_copy_buffer */
10435 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10437 /* 364. GL_EXT_provoking_vertex */
10438 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10440 /* 371. GL_APPLE_object_purgeable */
10441 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10442 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10443 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10445 /* GL_EXT_texture_integer */
10446 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10447 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10448 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10449 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10450 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10451 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10453 /* 377. GL_EXT_separate_shader_objects */
10454 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10455 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10457 /* GL_ARB_color_buffer_float */
10458 SET_ClampColorARB(table
, save_ClampColorARB
);
10459 SET_ClampColor(table
, save_ClampColorARB
);
10462 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10463 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10464 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10465 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10467 SET_Uniform1ui(table
, save_Uniform1ui
);
10468 SET_Uniform2ui(table
, save_Uniform2ui
);
10469 SET_Uniform3ui(table
, save_Uniform3ui
);
10470 SET_Uniform4ui(table
, save_Uniform4ui
);
10471 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10472 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10473 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10474 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10476 (void) save_Uniform1ui
;
10477 (void) save_Uniform2ui
;
10478 (void) save_Uniform3ui
;
10479 (void) save_Uniform4ui
;
10480 (void) save_Uniform1uiv
;
10481 (void) save_Uniform2uiv
;
10482 (void) save_Uniform3uiv
;
10483 (void) save_Uniform4uiv
;
10486 /* These are not compiled into display lists: */
10487 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10488 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10489 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10490 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10492 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10493 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10494 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10495 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10496 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10497 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10498 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
10499 SET_DrawTransformFeedbackInstanced(table
,
10500 save_DrawTransformFeedbackInstanced
);
10501 SET_DrawTransformFeedbackStreamInstanced(table
,
10502 save_DrawTransformFeedbackStreamInstanced
);
10503 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
10504 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
10506 /* GL_ARB_instanced_arrays */
10507 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10509 /* GL_NV_texture_barrier */
10510 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10512 /* GL_ARB_sampler_objects */
10513 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10514 SET_BindSampler(table
, save_BindSampler
);
10515 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10516 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10517 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10518 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10519 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10520 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10522 /* GL_ARB_draw_buffer_blend */
10523 SET_BlendFunciARB(table
, save_BlendFunci
);
10524 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10525 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10526 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10528 /* GL_ARB_geometry_shader4 */
10529 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10530 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10531 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10533 /* GL_NV_conditional_render */
10534 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10535 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10538 _mesa_init_sync_dispatch(table
);
10539 SET_WaitSync(table
, save_WaitSync
);
10541 /* GL_ARB_texture_storage (no dlist support) */
10542 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10543 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10544 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10545 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10546 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10547 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10549 /* GL_ARB_debug_output (no dlist support) */
10550 _mesa_init_errors_dispatch(table
);
10552 /* GL_ARB_uniform_buffer_object */
10553 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
10555 /* GL_NV_primitive_restart */
10556 SET_PrimitiveRestartIndexNV(table
, _mesa_PrimitiveRestartIndex
);
10563 static const char *
10564 enum_string(GLenum k
)
10566 return _mesa_lookup_enum_by_nr(k
);
10571 * Print the commands in a display list. For debugging only.
10572 * TODO: many commands aren't handled yet.
10574 static void GLAPIENTRY
10575 print_list(struct gl_context
*ctx
, GLuint list
)
10577 struct gl_display_list
*dlist
;
10581 if (!islist(ctx
, list
)) {
10582 printf("%u is not a display list ID\n", list
);
10586 dlist
= lookup_list(ctx
, list
);
10592 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10594 done
= n
? GL_FALSE
: GL_TRUE
;
10596 const OpCode opcode
= n
[0].opcode
;
10598 if (is_ext_opcode(opcode
)) {
10599 n
+= ext_opcode_print(ctx
, n
);
10604 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10606 case OPCODE_BITMAP
:
10607 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10608 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10610 case OPCODE_CALL_LIST
:
10611 printf("CallList %d\n", (int) n
[1].ui
);
10613 case OPCODE_CALL_LIST_OFFSET
:
10614 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10615 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10617 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10618 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10619 enum_string(n
[1].e
), enum_string(n
[2].e
),
10620 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10622 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10623 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10624 enum_string(n
[1].e
), enum_string(n
[2].e
),
10625 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10627 case OPCODE_DISABLE
:
10628 printf("Disable %s\n", enum_string(n
[1].e
));
10630 case OPCODE_ENABLE
:
10631 printf("Enable %s\n", enum_string(n
[1].e
));
10633 case OPCODE_FRUSTUM
:
10634 printf("Frustum %g %g %g %g %g %g\n",
10635 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10637 case OPCODE_LINE_STIPPLE
:
10638 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10640 case OPCODE_LOAD_IDENTITY
:
10641 printf("LoadIdentity\n");
10643 case OPCODE_LOAD_MATRIX
:
10644 printf("LoadMatrix\n");
10645 printf(" %8f %8f %8f %8f\n",
10646 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10647 printf(" %8f %8f %8f %8f\n",
10648 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10649 printf(" %8f %8f %8f %8f\n",
10650 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10651 printf(" %8f %8f %8f %8f\n",
10652 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10654 case OPCODE_MULT_MATRIX
:
10655 printf("MultMatrix (or Rotate)\n");
10656 printf(" %8f %8f %8f %8f\n",
10657 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10658 printf(" %8f %8f %8f %8f\n",
10659 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10660 printf(" %8f %8f %8f %8f\n",
10661 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10662 printf(" %8f %8f %8f %8f\n",
10663 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10666 printf("Ortho %g %g %g %g %g %g\n",
10667 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10669 case OPCODE_POP_ATTRIB
:
10670 printf("PopAttrib\n");
10672 case OPCODE_POP_MATRIX
:
10673 printf("PopMatrix\n");
10675 case OPCODE_POP_NAME
:
10676 printf("PopName\n");
10678 case OPCODE_PUSH_ATTRIB
:
10679 printf("PushAttrib %x\n", n
[1].bf
);
10681 case OPCODE_PUSH_MATRIX
:
10682 printf("PushMatrix\n");
10684 case OPCODE_PUSH_NAME
:
10685 printf("PushName %d\n", (int) n
[1].ui
);
10687 case OPCODE_RASTER_POS
:
10688 printf("RasterPos %g %g %g %g\n",
10689 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10691 case OPCODE_ROTATE
:
10692 printf("Rotate %g %g %g %g\n",
10693 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10696 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10698 case OPCODE_TRANSLATE
:
10699 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10701 case OPCODE_BIND_TEXTURE
:
10702 printf("BindTexture %s %d\n",
10703 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10705 case OPCODE_SHADE_MODEL
:
10706 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10709 printf("Map1 %s %.3f %.3f %d %d\n",
10710 _mesa_lookup_enum_by_nr(n
[1].ui
),
10711 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10714 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10715 _mesa_lookup_enum_by_nr(n
[1].ui
),
10716 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10717 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10719 case OPCODE_MAPGRID1
:
10720 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10722 case OPCODE_MAPGRID2
:
10723 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10724 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10726 case OPCODE_EVALMESH1
:
10727 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10729 case OPCODE_EVALMESH2
:
10730 printf("EvalMesh2 %d %d %d %d\n",
10731 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10734 case OPCODE_ATTR_1F_NV
:
10735 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10737 case OPCODE_ATTR_2F_NV
:
10738 printf("ATTR_2F_NV attr %d: %f %f\n",
10739 n
[1].i
, n
[2].f
, n
[3].f
);
10741 case OPCODE_ATTR_3F_NV
:
10742 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10743 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10745 case OPCODE_ATTR_4F_NV
:
10746 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10747 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10749 case OPCODE_ATTR_1F_ARB
:
10750 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10752 case OPCODE_ATTR_2F_ARB
:
10753 printf("ATTR_2F_ARB attr %d: %f %f\n",
10754 n
[1].i
, n
[2].f
, n
[3].f
);
10756 case OPCODE_ATTR_3F_ARB
:
10757 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10758 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10760 case OPCODE_ATTR_4F_ARB
:
10761 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10762 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10765 case OPCODE_MATERIAL
:
10766 printf("MATERIAL %x %x: %f %f %f %f\n",
10767 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10770 printf("BEGIN %x\n", n
[1].i
);
10776 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10779 case OPCODE_EVAL_C1
:
10780 printf("EVAL_C1 %f\n", n
[1].f
);
10782 case OPCODE_EVAL_C2
:
10783 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10785 case OPCODE_EVAL_P1
:
10786 printf("EVAL_P1 %d\n", n
[1].i
);
10788 case OPCODE_EVAL_P2
:
10789 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10792 case OPCODE_PROVOKING_VERTEX
:
10793 printf("ProvokingVertex %s\n",
10794 _mesa_lookup_enum_by_nr(n
[1].ui
));
10798 * meta opcodes/commands
10801 printf("Error: %s %s\n",
10802 enum_string(n
[1].e
), (const char *) n
[2].data
);
10804 case OPCODE_CONTINUE
:
10805 printf("DISPLAY-LIST-CONTINUE\n");
10806 n
= (Node
*) n
[1].next
;
10808 case OPCODE_END_OF_LIST
:
10809 printf("END-LIST %u\n", list
);
10813 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10815 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10816 opcode
, (void *) n
);
10820 printf("command %d, %u operands\n", opcode
,
10824 /* increment n to point to next compiled command */
10825 if (opcode
!= OPCODE_CONTINUE
) {
10826 n
+= InstSize
[opcode
];
10835 * Clients may call this function to help debug display list problems.
10836 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10837 * changed, or break in the future without notice.
10840 mesa_print_display_list(GLuint list
)
10842 GET_CURRENT_CONTEXT(ctx
);
10843 print_list(ctx
, list
);
10847 /**********************************************************************/
10848 /***** Initialization *****/
10849 /**********************************************************************/
10852 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10854 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10856 vfmt
->Begin
= save_Begin
;
10858 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10860 vfmt
->Color3f
= save_Color3f
;
10861 vfmt
->Color3fv
= save_Color3fv
;
10862 vfmt
->Color4f
= save_Color4f
;
10863 vfmt
->Color4fv
= save_Color4fv
;
10864 vfmt
->EdgeFlag
= save_EdgeFlag
;
10865 vfmt
->End
= save_End
;
10867 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10869 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10870 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10871 vfmt
->Indexf
= save_Indexf
;
10872 vfmt
->Indexfv
= save_Indexfv
;
10873 vfmt
->Materialfv
= save_Materialfv
;
10874 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10875 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10876 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10877 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10878 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10879 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10880 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10881 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10882 vfmt
->Normal3f
= save_Normal3f
;
10883 vfmt
->Normal3fv
= save_Normal3fv
;
10884 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10885 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10886 vfmt
->TexCoord1f
= save_TexCoord1f
;
10887 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10888 vfmt
->TexCoord2f
= save_TexCoord2f
;
10889 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10890 vfmt
->TexCoord3f
= save_TexCoord3f
;
10891 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10892 vfmt
->TexCoord4f
= save_TexCoord4f
;
10893 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10894 vfmt
->Vertex2f
= save_Vertex2f
;
10895 vfmt
->Vertex2fv
= save_Vertex2fv
;
10896 vfmt
->Vertex3f
= save_Vertex3f
;
10897 vfmt
->Vertex3fv
= save_Vertex3fv
;
10898 vfmt
->Vertex4f
= save_Vertex4f
;
10899 vfmt
->Vertex4fv
= save_Vertex4fv
;
10900 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10901 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10902 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10903 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10904 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10905 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10906 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10907 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10908 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10909 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10910 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10911 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10912 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10913 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10914 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10915 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10917 vfmt
->Rectf
= save_Rectf
;
10919 /* GL_ARB_draw_instanced */
10920 vfmt
->DrawArraysInstanced
= save_DrawArraysInstancedARB
;
10921 vfmt
->DrawElementsInstanced
= save_DrawElementsInstancedARB
;
10923 /* GL_ARB_draw_elements_base_vertex */
10924 vfmt
->DrawElementsInstancedBaseVertex
= save_DrawElementsInstancedBaseVertexARB
;
10926 /* GL_ARB_base_instance */
10927 vfmt
->DrawArraysInstancedBaseInstance
= save_DrawArraysInstancedBaseInstance
;
10928 vfmt
->DrawElementsInstancedBaseInstance
= save_DrawElementsInstancedBaseInstance
;
10929 vfmt
->DrawElementsInstancedBaseVertexBaseInstance
= save_DrawElementsInstancedBaseVertexBaseInstance
;
10931 /* The driver is required to implement these as
10932 * 1) They can probably do a better job.
10933 * 2) A lot of new mechanisms would have to be added to this module
10934 * to support it. That code would probably never get used,
10938 vfmt
->DrawArrays
= 0;
10939 vfmt
->DrawElements
= 0;
10940 vfmt
->DrawRangeElements
= 0;
10941 vfmt
->MultiDrawElemementsEXT
= 0;
10942 vfmt
->DrawElementsBaseVertex
= 0;
10943 vfmt
->DrawRangeElementsBaseVertex
= 0;
10944 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10950 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10951 const GLvertexformat
*vfmt
)
10953 SET_CallList(disp
, vfmt
->CallList
);
10954 SET_CallLists(disp
, vfmt
->CallLists
);
10958 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10960 SET_CallList(disp
, _mesa_CallList
);
10961 SET_CallLists(disp
, _mesa_CallLists
);
10963 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10964 SET_EndList(disp
, _mesa_EndList
);
10965 SET_GenLists(disp
, _mesa_GenLists
);
10966 SET_IsList(disp
, _mesa_IsList
);
10967 SET_ListBase(disp
, _mesa_ListBase
);
10968 SET_NewList(disp
, _mesa_NewList
);
10973 * Initialize display list state for given context.
10976 _mesa_init_display_list(struct gl_context
*ctx
)
10978 static GLboolean tableInitialized
= GL_FALSE
;
10980 /* zero-out the instruction size table, just once */
10981 if (!tableInitialized
) {
10982 memset(InstSize
, 0, sizeof(InstSize
));
10983 tableInitialized
= GL_TRUE
;
10986 /* extension info */
10987 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10990 ctx
->ListState
.CallDepth
= 0;
10991 ctx
->ExecuteFlag
= GL_TRUE
;
10992 ctx
->CompileFlag
= GL_FALSE
;
10993 ctx
->ListState
.CurrentBlock
= NULL
;
10994 ctx
->ListState
.CurrentPos
= 0;
10996 /* Display List group */
10997 ctx
->List
.ListBase
= 0;
10999 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
11004 _mesa_free_display_list_data(struct gl_context
*ctx
)
11006 free(ctx
->ListExt
);
11007 ctx
->ListExt
= NULL
;