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 #if FEATURE_ATI_fragment_shader
38 #include "atifragshader.h"
41 #include "mfeatures.h"
42 #if FEATURE_ARB_vertex_buffer_object
43 #include "bufferobj.h"
50 #include "framebuffer.h"
51 #include "glapi/glapi.h"
59 #include "samplerobj.h"
60 #include "shaderapi.h"
65 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
66 #include "arbprogram.h"
68 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
69 #include "nvprogram.h"
72 #include "math/m_matrix.h"
74 #include "main/dispatch.h"
79 * Other parts of Mesa (such as the VBO module) can plug into the display
80 * list system. This structure describes new display list instructions.
82 struct gl_list_instruction
85 void (*Execute
)( struct gl_context
*ctx
, void *data
);
86 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
87 void (*Print
)( struct gl_context
*ctx
, void *data
);
91 #define MAX_DLIST_EXT_OPCODES 16
94 * Used by device drivers to hook new commands into display lists.
96 struct gl_list_extensions
98 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
107 * \param ctx GL context.
109 * Checks if dd_function_table::SaveNeedFlush is marked to flush
110 * stored (save) vertices, and calls
111 * dd_function_table::SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 ctx->Driver.SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
130 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
131 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
137 * Macro to assert that the API call was made outside the
138 * glBegin()/glEnd() pair.
140 * \param ctx GL context.
142 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
144 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
145 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
146 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
152 * Macro to assert that the API call was made outside the
153 * glBegin()/glEnd() pair and flush the vertices.
155 * \param ctx GL context.
157 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
159 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
160 SAVE_FLUSH_VERTICES(ctx); \
164 * Macro to assert that the API call was made outside the
165 * glBegin()/glEnd() pair and flush the vertices, with return value.
167 * \param ctx GL context.
168 * \param retval value to return value in case the assertion fails.
170 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
172 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
173 SAVE_FLUSH_VERTICES(ctx); \
179 * Display list opcodes.
181 * The fact that these identifiers are assigned consecutive
182 * integer values starting at 0 is very important, see InstSize array usage)
186 OPCODE_INVALID
= -1, /* Force signed enum */
192 OPCODE_BLEND_EQUATION
,
193 OPCODE_BLEND_EQUATION_SEPARATE
,
194 OPCODE_BLEND_FUNC_SEPARATE
,
196 OPCODE_BLEND_EQUATION_I
,
197 OPCODE_BLEND_EQUATION_SEPARATE_I
,
199 OPCODE_BLEND_FUNC_SEPARATE_I
,
202 OPCODE_CALL_LIST_OFFSET
,
208 OPCODE_CLEAR_STENCIL
,
209 OPCODE_CLEAR_BUFFER_IV
,
210 OPCODE_CLEAR_BUFFER_UIV
,
211 OPCODE_CLEAR_BUFFER_FV
,
212 OPCODE_CLEAR_BUFFER_FI
,
215 OPCODE_COLOR_MASK_INDEXED
,
216 OPCODE_COLOR_MATERIAL
,
218 OPCODE_COLOR_TABLE_PARAMETER_FV
,
219 OPCODE_COLOR_TABLE_PARAMETER_IV
,
220 OPCODE_COLOR_SUB_TABLE
,
221 OPCODE_CONVOLUTION_FILTER_1D
,
222 OPCODE_CONVOLUTION_FILTER_2D
,
223 OPCODE_CONVOLUTION_PARAMETER_I
,
224 OPCODE_CONVOLUTION_PARAMETER_IV
,
225 OPCODE_CONVOLUTION_PARAMETER_F
,
226 OPCODE_CONVOLUTION_PARAMETER_FV
,
227 OPCODE_COPY_COLOR_SUB_TABLE
,
228 OPCODE_COPY_COLOR_TABLE
,
230 OPCODE_COPY_TEX_IMAGE1D
,
231 OPCODE_COPY_TEX_IMAGE2D
,
232 OPCODE_COPY_TEX_SUB_IMAGE1D
,
233 OPCODE_COPY_TEX_SUB_IMAGE2D
,
234 OPCODE_COPY_TEX_SUB_IMAGE3D
,
240 OPCODE_DISABLE_INDEXED
,
244 OPCODE_ENABLE_INDEXED
,
259 OPCODE_LOAD_IDENTITY
,
273 OPCODE_PIXEL_TRANSFER
,
276 OPCODE_POINT_PARAMETERS
,
278 OPCODE_POLYGON_STIPPLE
,
279 OPCODE_POLYGON_OFFSET
,
283 OPCODE_PRIORITIZE_TEXTURE
,
289 OPCODE_RESET_HISTOGRAM
,
290 OPCODE_RESET_MIN_MAX
,
294 OPCODE_SELECT_TEXTURE_SGIS
,
295 OPCODE_SELECT_TEXTURE_COORD_SET
,
306 OPCODE_TEX_SUB_IMAGE1D
,
307 OPCODE_TEX_SUB_IMAGE2D
,
308 OPCODE_TEX_SUB_IMAGE3D
,
312 /* GL_ARB_multitexture */
313 OPCODE_ACTIVE_TEXTURE
,
314 /* GL_ARB_texture_compression */
315 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
316 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
317 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
318 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
319 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
320 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
321 /* GL_ARB_multisample */
322 OPCODE_SAMPLE_COVERAGE
,
323 /* GL_ARB_window_pos */
324 OPCODE_WINDOW_POS_ARB
,
325 /* GL_NV_vertex_program */
326 OPCODE_BIND_PROGRAM_NV
,
327 OPCODE_EXECUTE_PROGRAM_NV
,
328 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
329 OPCODE_LOAD_PROGRAM_NV
,
330 OPCODE_TRACK_MATRIX_NV
,
331 /* GL_NV_fragment_program */
332 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
333 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
334 /* GL_EXT_stencil_two_side */
335 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
336 /* GL_EXT_depth_bounds_test */
337 OPCODE_DEPTH_BOUNDS_EXT
,
338 /* GL_ARB_vertex/fragment_program */
339 OPCODE_PROGRAM_STRING_ARB
,
340 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
341 /* GL_ARB_occlusion_query */
342 OPCODE_BEGIN_QUERY_ARB
,
343 OPCODE_END_QUERY_ARB
,
344 /* GL_ARB_draw_buffers */
345 OPCODE_DRAW_BUFFERS_ARB
,
346 /* GL_ATI_fragment_shader */
347 OPCODE_TEX_BUMP_PARAMETER_ATI
,
348 /* GL_ATI_fragment_shader */
349 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
350 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
352 OPCODE_STENCIL_FUNC_SEPARATE
,
353 OPCODE_STENCIL_OP_SEPARATE
,
354 OPCODE_STENCIL_MASK_SEPARATE
,
356 /* GL_ARB_shader_objects */
374 OPCODE_UNIFORM_MATRIX22
,
375 OPCODE_UNIFORM_MATRIX33
,
376 OPCODE_UNIFORM_MATRIX44
,
377 OPCODE_UNIFORM_MATRIX23
,
378 OPCODE_UNIFORM_MATRIX32
,
379 OPCODE_UNIFORM_MATRIX24
,
380 OPCODE_UNIFORM_MATRIX42
,
381 OPCODE_UNIFORM_MATRIX34
,
382 OPCODE_UNIFORM_MATRIX43
,
394 /* GL_ARB_color_buffer_float */
397 /* GL_EXT_framebuffer_blit */
398 OPCODE_BLIT_FRAMEBUFFER
,
400 /* Vertex attributes -- fallback for when optimized display
401 * list build isn't active.
420 /* GL_EXT_provoking_vertex */
421 OPCODE_PROVOKING_VERTEX
,
423 /* GL_EXT_transform_feedback */
424 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
425 OPCODE_END_TRANSFORM_FEEDBACK
,
426 OPCODE_BIND_TRANSFORM_FEEDBACK
,
427 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
428 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
429 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
431 /* GL_EXT_texture_integer */
433 OPCODE_CLEARCOLOR_UI
,
434 OPCODE_TEXPARAMETER_I
,
435 OPCODE_TEXPARAMETER_UI
,
437 /* GL_EXT_separate_shader_objects */
438 OPCODE_ACTIVE_PROGRAM_EXT
,
439 OPCODE_USE_SHADER_PROGRAM_EXT
,
441 /* GL_ARB_instanced_arrays */
442 OPCODE_VERTEX_ATTRIB_DIVISOR
,
444 /* GL_NV_texture_barrier */
445 OPCODE_TEXTURE_BARRIER_NV
,
447 /* GL_ARB_sampler_object */
449 OPCODE_SAMPLER_PARAMETERIV
,
450 OPCODE_SAMPLER_PARAMETERFV
,
451 OPCODE_SAMPLER_PARAMETERIIV
,
452 OPCODE_SAMPLER_PARAMETERUIV
,
454 /* GL_ARB_geometry_shader4 */
455 OPCODE_PROGRAM_PARAMETERI
,
456 OPCODE_FRAMEBUFFER_TEXTURE
,
457 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
462 /* The following three are meta instructions */
463 OPCODE_ERROR
, /* raise compiled-in error */
474 * Display list instructions are stored as sequences of "nodes". Nodes
475 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
476 * are linked together with a pointer.
478 * Each instruction in the display list is stored as a sequence of
479 * contiguous nodes in memory.
480 * Each node is the union of a variety of data types.
495 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
499 typedef union gl_dlist_node Node
;
503 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
504 * environment. In 64-bit env, sizeof(Node)==8 anyway.
514 * How many nodes to allocate at a time.
516 * \note Reduced now that we hold vertices etc. elsewhere.
518 #define BLOCK_SIZE 256
523 * Number of nodes of storage needed for each instruction.
524 * Sizes for dynamically allocated opcodes are stored in the context struct.
526 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
532 void mesa_print_display_list(GLuint list
);
535 /**********************************************************************/
536 /***** Private *****/
537 /**********************************************************************/
541 * Make an empty display list. This is used by glGenLists() to
542 * reserve display list IDs.
544 static struct gl_display_list
*
545 make_list(GLuint name
, GLuint count
)
547 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
549 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
550 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
556 * Lookup function to just encapsulate casting.
558 static INLINE
struct gl_display_list
*
559 lookup_list(struct gl_context
*ctx
, GLuint list
)
561 return (struct gl_display_list
*)
562 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
566 /** Is the given opcode an extension code? */
567 static INLINE GLboolean
568 is_ext_opcode(OpCode opcode
)
570 return (opcode
>= OPCODE_EXT_0
);
574 /** Destroy an extended opcode instruction */
576 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
578 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
580 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
581 step
= ctx
->ListExt
->Opcode
[i
].Size
;
586 /** Execute an extended opcode instruction */
588 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
590 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
592 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
593 step
= ctx
->ListExt
->Opcode
[i
].Size
;
598 /** Print an extended opcode instruction */
600 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
602 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
604 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
605 step
= ctx
->ListExt
->Opcode
[i
].Size
;
611 * Delete the named display list, but don't remove from hash table.
612 * \param dlist - display list pointer
615 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
620 n
= block
= dlist
->Head
;
622 done
= block
? GL_FALSE
: GL_TRUE
;
624 const OpCode opcode
= n
[0].opcode
;
626 /* check for extension opcodes first */
627 if (is_ext_opcode(opcode
)) {
628 n
+= ext_opcode_destroy(ctx
, n
);
632 /* for some commands, we need to free malloc'd memory */
635 n
+= InstSize
[n
[0].opcode
];
639 n
+= InstSize
[n
[0].opcode
];
641 case OPCODE_DRAW_PIXELS
:
643 n
+= InstSize
[n
[0].opcode
];
647 n
+= InstSize
[n
[0].opcode
];
649 case OPCODE_COLOR_TABLE
:
651 n
+= InstSize
[n
[0].opcode
];
653 case OPCODE_COLOR_SUB_TABLE
:
655 n
+= InstSize
[n
[0].opcode
];
657 case OPCODE_CONVOLUTION_FILTER_1D
:
659 n
+= InstSize
[n
[0].opcode
];
661 case OPCODE_CONVOLUTION_FILTER_2D
:
663 n
+= InstSize
[n
[0].opcode
];
665 case OPCODE_POLYGON_STIPPLE
:
667 n
+= InstSize
[n
[0].opcode
];
669 case OPCODE_TEX_IMAGE1D
:
671 n
+= InstSize
[n
[0].opcode
];
673 case OPCODE_TEX_IMAGE2D
:
675 n
+= InstSize
[n
[0].opcode
];
677 case OPCODE_TEX_IMAGE3D
:
679 n
+= InstSize
[n
[0].opcode
];
681 case OPCODE_TEX_SUB_IMAGE1D
:
683 n
+= InstSize
[n
[0].opcode
];
685 case OPCODE_TEX_SUB_IMAGE2D
:
687 n
+= InstSize
[n
[0].opcode
];
689 case OPCODE_TEX_SUB_IMAGE3D
:
691 n
+= InstSize
[n
[0].opcode
];
693 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
695 n
+= InstSize
[n
[0].opcode
];
697 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
699 n
+= InstSize
[n
[0].opcode
];
701 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
703 n
+= InstSize
[n
[0].opcode
];
705 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
707 n
+= InstSize
[n
[0].opcode
];
709 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
711 n
+= InstSize
[n
[0].opcode
];
713 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
715 n
+= InstSize
[n
[0].opcode
];
717 #if FEATURE_NV_vertex_program
718 case OPCODE_LOAD_PROGRAM_NV
:
719 free(n
[4].data
); /* program string */
720 n
+= InstSize
[n
[0].opcode
];
722 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
723 free(n
[2].data
); /* array of program ids */
724 n
+= InstSize
[n
[0].opcode
];
727 #if FEATURE_NV_fragment_program
728 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
729 free(n
[3].data
); /* parameter name */
730 n
+= InstSize
[n
[0].opcode
];
733 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
734 case OPCODE_PROGRAM_STRING_ARB
:
735 free(n
[4].data
); /* program string */
736 n
+= InstSize
[n
[0].opcode
];
739 case OPCODE_UNIFORM_1FV
:
740 case OPCODE_UNIFORM_2FV
:
741 case OPCODE_UNIFORM_3FV
:
742 case OPCODE_UNIFORM_4FV
:
743 case OPCODE_UNIFORM_1IV
:
744 case OPCODE_UNIFORM_2IV
:
745 case OPCODE_UNIFORM_3IV
:
746 case OPCODE_UNIFORM_4IV
:
747 case OPCODE_UNIFORM_1UIV
:
748 case OPCODE_UNIFORM_2UIV
:
749 case OPCODE_UNIFORM_3UIV
:
750 case OPCODE_UNIFORM_4UIV
:
752 n
+= InstSize
[n
[0].opcode
];
754 case OPCODE_UNIFORM_MATRIX22
:
755 case OPCODE_UNIFORM_MATRIX33
:
756 case OPCODE_UNIFORM_MATRIX44
:
757 case OPCODE_UNIFORM_MATRIX24
:
758 case OPCODE_UNIFORM_MATRIX42
:
759 case OPCODE_UNIFORM_MATRIX23
:
760 case OPCODE_UNIFORM_MATRIX32
:
761 case OPCODE_UNIFORM_MATRIX34
:
762 case OPCODE_UNIFORM_MATRIX43
:
764 n
+= InstSize
[n
[0].opcode
];
767 case OPCODE_CONTINUE
:
768 n
= (Node
*) n
[1].next
;
772 case OPCODE_END_OF_LIST
:
777 /* Most frequent case */
778 n
+= InstSize
[n
[0].opcode
];
789 * Destroy a display list and remove from hash table.
790 * \param list - display list number
793 destroy_list(struct gl_context
*ctx
, GLuint list
)
795 struct gl_display_list
*dlist
;
800 dlist
= lookup_list(ctx
, list
);
804 _mesa_delete_list(ctx
, dlist
);
805 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
810 * Translate the nth element of list from <type> to GLint.
813 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
825 bptr
= (GLbyte
*) list
;
826 return (GLint
) bptr
[n
];
827 case GL_UNSIGNED_BYTE
:
828 ubptr
= (GLubyte
*) list
;
829 return (GLint
) ubptr
[n
];
831 sptr
= (GLshort
*) list
;
832 return (GLint
) sptr
[n
];
833 case GL_UNSIGNED_SHORT
:
834 usptr
= (GLushort
*) list
;
835 return (GLint
) usptr
[n
];
837 iptr
= (GLint
*) list
;
839 case GL_UNSIGNED_INT
:
840 uiptr
= (GLuint
*) list
;
841 return (GLint
) uiptr
[n
];
843 fptr
= (GLfloat
*) list
;
844 return (GLint
) FLOORF(fptr
[n
]);
846 ubptr
= ((GLubyte
*) list
) + 2 * n
;
847 return (GLint
) ubptr
[0] * 256
850 ubptr
= ((GLubyte
*) list
) + 3 * n
;
851 return (GLint
) ubptr
[0] * 65536
852 + (GLint
) ubptr
[1] * 256
855 ubptr
= ((GLubyte
*) list
) + 4 * n
;
856 return (GLint
) ubptr
[0] * 16777216
857 + (GLint
) ubptr
[1] * 65536
858 + (GLint
) ubptr
[2] * 256
868 /**********************************************************************/
870 /**********************************************************************/
873 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
874 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
877 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
878 GLsizei width
, GLsizei height
, GLsizei depth
,
879 GLenum format
, GLenum type
, const GLvoid
* pixels
,
880 const struct gl_pixelstore_attrib
*unpack
)
882 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
884 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
885 format
, type
, pixels
, unpack
);
886 if (pixels
&& !image
) {
887 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
891 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
892 depth
, format
, type
, INT_MAX
, pixels
)) {
893 const GLubyte
*map
, *src
;
897 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
898 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
900 /* unable to map src buffer! */
901 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
905 src
= ADD_POINTERS(map
, pixels
);
906 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
907 format
, type
, src
, unpack
);
909 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
913 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
923 * Allocate space for a display list instruction (opcode + payload space).
924 * \param opcode the instruction opcode (OPCODE_* value)
925 * \param bytes instruction payload size (not counting opcode)
926 * \return pointer to allocated memory (the opcode space)
929 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
931 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
934 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
935 if (InstSize
[opcode
] == 0) {
936 /* save instruction size now */
937 InstSize
[opcode
] = numNodes
;
940 /* make sure instruction size agrees */
941 ASSERT(numNodes
== InstSize
[opcode
]);
945 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
946 /* This block is full. Allocate a new block and chain to it */
948 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
949 n
[0].opcode
= OPCODE_CONTINUE
;
950 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
952 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
955 n
[1].next
= (Node
*) newblock
;
956 ctx
->ListState
.CurrentBlock
= newblock
;
957 ctx
->ListState
.CurrentPos
= 0;
960 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
961 ctx
->ListState
.CurrentPos
+= numNodes
;
963 n
[0].opcode
= opcode
;
971 * Allocate space for a display list instruction. Used by callers outside
972 * this file for things like VBO vertex data.
974 * \param opcode the instruction opcode (OPCODE_* value)
975 * \param bytes instruction size in bytes, not counting opcode.
976 * \return pointer to the usable data area (not including the internal
980 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
982 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
984 return n
+ 1; /* return pointer to payload area, after opcode */
991 * This function allows modules and drivers to get their own opcodes
992 * for extending display list functionality.
993 * \param ctx the rendering context
994 * \param size number of bytes for storing the new display list command
995 * \param execute function to execute the new display list command
996 * \param destroy function to destroy the new display list command
997 * \param print function to print the new display list command
998 * \return the new opcode number or -1 if error
1001 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1003 void (*execute
) (struct gl_context
*, void *),
1004 void (*destroy
) (struct gl_context
*, void *),
1005 void (*print
) (struct gl_context
*, void *))
1007 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1008 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1009 ctx
->ListExt
->Opcode
[i
].Size
=
1010 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1011 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1012 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1013 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1014 return i
+ OPCODE_EXT_0
;
1021 * Allocate space for a display list instruction. The space is basically
1022 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1023 * function parameter, node[2] is the second parameter, etc.
1025 * \param opcode one of OPCODE_x
1026 * \param nparams number of function parameters
1027 * \return pointer to start of instruction space
1029 static INLINE Node
*
1030 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1032 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1038 * Display List compilation functions
1040 static void GLAPIENTRY
1041 save_Accum(GLenum op
, GLfloat value
)
1043 GET_CURRENT_CONTEXT(ctx
);
1045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1046 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1051 if (ctx
->ExecuteFlag
) {
1052 CALL_Accum(ctx
->Exec
, (op
, value
));
1057 static void GLAPIENTRY
1058 save_AlphaFunc(GLenum func
, GLclampf ref
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1066 n
[2].f
= (GLfloat
) ref
;
1068 if (ctx
->ExecuteFlag
) {
1069 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1074 static void GLAPIENTRY
1075 save_BindTexture(GLenum target
, GLuint texture
)
1077 GET_CURRENT_CONTEXT(ctx
);
1079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1080 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1085 if (ctx
->ExecuteFlag
) {
1086 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1091 static void GLAPIENTRY
1092 save_Bitmap(GLsizei width
, GLsizei height
,
1093 GLfloat xorig
, GLfloat yorig
,
1094 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1096 GET_CURRENT_CONTEXT(ctx
);
1098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1099 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1101 n
[1].i
= (GLint
) width
;
1102 n
[2].i
= (GLint
) height
;
1107 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1109 if (ctx
->ExecuteFlag
) {
1110 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1111 xorig
, yorig
, xmove
, ymove
, pixels
));
1116 static void GLAPIENTRY
1117 save_BlendEquation(GLenum mode
)
1119 GET_CURRENT_CONTEXT(ctx
);
1121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1122 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1126 if (ctx
->ExecuteFlag
) {
1127 CALL_BlendEquation(ctx
->Exec
, (mode
));
1132 static void GLAPIENTRY
1133 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1135 GET_CURRENT_CONTEXT(ctx
);
1137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1138 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1143 if (ctx
->ExecuteFlag
) {
1144 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1149 static void GLAPIENTRY
1150 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1151 GLenum sfactorA
, GLenum dfactorA
)
1153 GET_CURRENT_CONTEXT(ctx
);
1155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1156 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1158 n
[1].e
= sfactorRGB
;
1159 n
[2].e
= dfactorRGB
;
1163 if (ctx
->ExecuteFlag
) {
1164 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1165 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1170 static void GLAPIENTRY
1171 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1173 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1177 static void GLAPIENTRY
1178 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1180 GET_CURRENT_CONTEXT(ctx
);
1182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1183 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1190 if (ctx
->ExecuteFlag
) {
1191 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1195 /* GL_ARB_draw_buffers_blend */
1196 static void GLAPIENTRY
1197 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1198 GLenum sfactorA
, GLenum dfactorA
)
1200 GET_CURRENT_CONTEXT(ctx
);
1202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1203 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1206 n
[2].e
= sfactorRGB
;
1207 n
[3].e
= dfactorRGB
;
1211 if (ctx
->ExecuteFlag
) {
1212 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1213 sfactorA
, dfactorA
));
1217 /* GL_ARB_draw_buffers_blend */
1218 static void GLAPIENTRY
1219 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1221 GET_CURRENT_CONTEXT(ctx
);
1223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1224 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1230 if (ctx
->ExecuteFlag
) {
1231 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1235 /* GL_ARB_draw_buffers_blend */
1236 static void GLAPIENTRY
1237 save_BlendEquationi(GLuint buf
, GLenum mode
)
1239 GET_CURRENT_CONTEXT(ctx
);
1241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1242 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1247 if (ctx
->ExecuteFlag
) {
1248 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1252 /* GL_ARB_draw_buffers_blend */
1253 static void GLAPIENTRY
1254 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1256 GET_CURRENT_CONTEXT(ctx
);
1258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1259 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1265 if (ctx
->ExecuteFlag
) {
1266 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1271 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1275 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1276 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1278 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1279 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1281 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1283 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1286 static void GLAPIENTRY
1287 save_CallList(GLuint list
)
1289 GET_CURRENT_CONTEXT(ctx
);
1291 SAVE_FLUSH_VERTICES(ctx
);
1293 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1298 /* After this, we don't know what state we're in. Invalidate all
1299 * cached information previously gathered:
1301 invalidate_saved_current_state( ctx
);
1303 if (ctx
->ExecuteFlag
) {
1304 _mesa_CallList(list
);
1309 static void GLAPIENTRY
1310 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1312 GET_CURRENT_CONTEXT(ctx
);
1314 GLboolean typeErrorFlag
;
1316 SAVE_FLUSH_VERTICES(ctx
);
1320 case GL_UNSIGNED_BYTE
:
1322 case GL_UNSIGNED_SHORT
:
1324 case GL_UNSIGNED_INT
:
1329 typeErrorFlag
= GL_FALSE
;
1332 typeErrorFlag
= GL_TRUE
;
1335 for (i
= 0; i
< num
; i
++) {
1336 GLint list
= translate_id(i
, type
, lists
);
1337 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1340 n
[2].b
= typeErrorFlag
;
1344 /* After this, we don't know what state we're in. Invalidate all
1345 * cached information previously gathered:
1347 invalidate_saved_current_state( ctx
);
1349 if (ctx
->ExecuteFlag
) {
1350 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1355 static void GLAPIENTRY
1356 save_Clear(GLbitfield mask
)
1358 GET_CURRENT_CONTEXT(ctx
);
1360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1361 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1365 if (ctx
->ExecuteFlag
) {
1366 CALL_Clear(ctx
->Exec
, (mask
));
1371 static void GLAPIENTRY
1372 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1374 GET_CURRENT_CONTEXT(ctx
);
1376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1377 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1380 n
[2].i
= drawbuffer
;
1382 if (buffer
== GL_COLOR
) {
1393 if (ctx
->ExecuteFlag
) {
1394 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1399 static void GLAPIENTRY
1400 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1402 GET_CURRENT_CONTEXT(ctx
);
1404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1405 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1408 n
[2].i
= drawbuffer
;
1410 if (buffer
== GL_COLOR
) {
1421 if (ctx
->ExecuteFlag
) {
1422 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1427 static void GLAPIENTRY
1428 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1430 GET_CURRENT_CONTEXT(ctx
);
1432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1433 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1436 n
[2].i
= drawbuffer
;
1438 if (buffer
== GL_COLOR
) {
1449 if (ctx
->ExecuteFlag
) {
1450 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1455 static void GLAPIENTRY
1456 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1457 GLfloat depth
, GLint stencil
)
1459 GET_CURRENT_CONTEXT(ctx
);
1461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1462 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1465 n
[2].i
= drawbuffer
;
1469 if (ctx
->ExecuteFlag
) {
1470 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1475 static void GLAPIENTRY
1476 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1478 GET_CURRENT_CONTEXT(ctx
);
1480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1481 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1488 if (ctx
->ExecuteFlag
) {
1489 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1494 static void GLAPIENTRY
1495 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1497 GET_CURRENT_CONTEXT(ctx
);
1499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1500 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1507 if (ctx
->ExecuteFlag
) {
1508 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1513 static void GLAPIENTRY
1514 save_ClearDepth(GLclampd depth
)
1516 GET_CURRENT_CONTEXT(ctx
);
1518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1519 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1521 n
[1].f
= (GLfloat
) depth
;
1523 if (ctx
->ExecuteFlag
) {
1524 CALL_ClearDepth(ctx
->Exec
, (depth
));
1529 static void GLAPIENTRY
1530 save_ClearIndex(GLfloat c
)
1532 GET_CURRENT_CONTEXT(ctx
);
1534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1535 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1539 if (ctx
->ExecuteFlag
) {
1540 CALL_ClearIndex(ctx
->Exec
, (c
));
1545 static void GLAPIENTRY
1546 save_ClearStencil(GLint s
)
1548 GET_CURRENT_CONTEXT(ctx
);
1550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1551 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1555 if (ctx
->ExecuteFlag
) {
1556 CALL_ClearStencil(ctx
->Exec
, (s
));
1561 static void GLAPIENTRY
1562 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1564 GET_CURRENT_CONTEXT(ctx
);
1566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1567 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1570 n
[2].f
= (GLfloat
) equ
[0];
1571 n
[3].f
= (GLfloat
) equ
[1];
1572 n
[4].f
= (GLfloat
) equ
[2];
1573 n
[5].f
= (GLfloat
) equ
[3];
1575 if (ctx
->ExecuteFlag
) {
1576 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1582 static void GLAPIENTRY
1583 save_ColorMask(GLboolean red
, GLboolean green
,
1584 GLboolean blue
, GLboolean alpha
)
1586 GET_CURRENT_CONTEXT(ctx
);
1588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1589 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1596 if (ctx
->ExecuteFlag
) {
1597 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1602 static void GLAPIENTRY
1603 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1604 GLboolean blue
, GLboolean alpha
)
1606 GET_CURRENT_CONTEXT(ctx
);
1608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1609 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1617 if (ctx
->ExecuteFlag
) {
1618 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1623 static void GLAPIENTRY
1624 save_ColorMaterial(GLenum face
, GLenum mode
)
1626 GET_CURRENT_CONTEXT(ctx
);
1628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1635 if (ctx
->ExecuteFlag
) {
1636 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1641 static void GLAPIENTRY
1642 save_ColorTable(GLenum target
, GLenum internalFormat
,
1643 GLsizei width
, GLenum format
, GLenum type
,
1644 const GLvoid
* table
)
1646 GET_CURRENT_CONTEXT(ctx
);
1647 if (_mesa_is_proxy_texture(target
)) {
1648 /* execute immediately */
1649 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1650 format
, type
, table
));
1654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1655 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1658 n
[2].e
= internalFormat
;
1662 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1665 if (ctx
->ExecuteFlag
) {
1666 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1667 format
, type
, table
));
1674 static void GLAPIENTRY
1675 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1676 const GLfloat
*params
)
1678 GET_CURRENT_CONTEXT(ctx
);
1681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1683 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1688 if (pname
== GL_COLOR_TABLE_SGI
||
1689 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1690 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1697 if (ctx
->ExecuteFlag
) {
1698 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1703 static void GLAPIENTRY
1704 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1706 GET_CURRENT_CONTEXT(ctx
);
1709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1711 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1716 if (pname
== GL_COLOR_TABLE_SGI
||
1717 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1718 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1725 if (ctx
->ExecuteFlag
) {
1726 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1732 static void GLAPIENTRY
1733 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1734 GLenum format
, GLenum type
, const GLvoid
* table
)
1736 GET_CURRENT_CONTEXT(ctx
);
1738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1739 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1746 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1749 if (ctx
->ExecuteFlag
) {
1750 CALL_ColorSubTable(ctx
->Exec
,
1751 (target
, start
, count
, format
, type
, table
));
1756 static void GLAPIENTRY
1757 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1758 GLint x
, GLint y
, GLsizei width
)
1760 GET_CURRENT_CONTEXT(ctx
);
1763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1764 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1772 if (ctx
->ExecuteFlag
) {
1773 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1778 static void GLAPIENTRY
1779 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1780 GLint x
, GLint y
, GLsizei width
)
1782 GET_CURRENT_CONTEXT(ctx
);
1785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1786 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1789 n
[2].e
= internalformat
;
1794 if (ctx
->ExecuteFlag
) {
1795 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1800 static void GLAPIENTRY
1801 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1802 GLenum format
, GLenum type
, const GLvoid
* filter
)
1804 GET_CURRENT_CONTEXT(ctx
);
1807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1809 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1812 n
[2].e
= internalFormat
;
1816 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1819 if (ctx
->ExecuteFlag
) {
1820 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1821 format
, type
, filter
));
1826 static void GLAPIENTRY
1827 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1828 GLsizei width
, GLsizei height
, GLenum format
,
1829 GLenum type
, const GLvoid
* filter
)
1831 GET_CURRENT_CONTEXT(ctx
);
1834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1836 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1839 n
[2].e
= internalFormat
;
1844 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1847 if (ctx
->ExecuteFlag
) {
1848 CALL_ConvolutionFilter2D(ctx
->Exec
,
1849 (target
, internalFormat
, width
, height
, format
,
1855 static void GLAPIENTRY
1856 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1858 GET_CURRENT_CONTEXT(ctx
);
1860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1861 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1867 if (ctx
->ExecuteFlag
) {
1868 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1873 static void GLAPIENTRY
1874 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1876 GET_CURRENT_CONTEXT(ctx
);
1878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1879 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1884 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1885 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1886 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1892 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1895 if (ctx
->ExecuteFlag
) {
1896 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1901 static void GLAPIENTRY
1902 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1904 GET_CURRENT_CONTEXT(ctx
);
1906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1907 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1913 if (ctx
->ExecuteFlag
) {
1914 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1919 static void GLAPIENTRY
1920 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1921 const GLfloat
*params
)
1923 GET_CURRENT_CONTEXT(ctx
);
1925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1926 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1931 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1932 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1933 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1939 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1942 if (ctx
->ExecuteFlag
) {
1943 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1948 static void GLAPIENTRY
1949 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1951 GET_CURRENT_CONTEXT(ctx
);
1953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1954 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1958 n
[3].i
= (GLint
) width
;
1959 n
[4].i
= (GLint
) height
;
1962 if (ctx
->ExecuteFlag
) {
1963 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1969 static void GLAPIENTRY
1970 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1971 GLint x
, GLint y
, GLsizei width
, GLint border
)
1973 GET_CURRENT_CONTEXT(ctx
);
1975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1976 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1980 n
[3].e
= internalformat
;
1986 if (ctx
->ExecuteFlag
) {
1987 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1988 x
, y
, width
, border
));
1993 static void GLAPIENTRY
1994 save_CopyTexImage2D(GLenum target
, GLint level
,
1995 GLenum internalformat
,
1996 GLint x
, GLint y
, GLsizei width
,
1997 GLsizei height
, GLint border
)
1999 GET_CURRENT_CONTEXT(ctx
);
2001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2002 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2006 n
[3].e
= internalformat
;
2013 if (ctx
->ExecuteFlag
) {
2014 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2015 x
, y
, width
, height
, border
));
2021 static void GLAPIENTRY
2022 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2023 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2025 GET_CURRENT_CONTEXT(ctx
);
2027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2028 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2037 if (ctx
->ExecuteFlag
) {
2038 CALL_CopyTexSubImage1D(ctx
->Exec
,
2039 (target
, level
, xoffset
, x
, y
, width
));
2044 static void GLAPIENTRY
2045 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2046 GLint xoffset
, GLint yoffset
,
2047 GLint x
, GLint y
, GLsizei width
, GLint height
)
2049 GET_CURRENT_CONTEXT(ctx
);
2051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2052 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2063 if (ctx
->ExecuteFlag
) {
2064 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2065 x
, y
, width
, height
));
2070 static void GLAPIENTRY
2071 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2072 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2073 GLint x
, GLint y
, GLsizei width
, GLint height
)
2075 GET_CURRENT_CONTEXT(ctx
);
2077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2078 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2090 if (ctx
->ExecuteFlag
) {
2091 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2092 xoffset
, yoffset
, zoffset
,
2093 x
, y
, width
, height
));
2098 static void GLAPIENTRY
2099 save_CullFace(GLenum mode
)
2101 GET_CURRENT_CONTEXT(ctx
);
2103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2104 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2108 if (ctx
->ExecuteFlag
) {
2109 CALL_CullFace(ctx
->Exec
, (mode
));
2114 static void GLAPIENTRY
2115 save_DepthFunc(GLenum func
)
2117 GET_CURRENT_CONTEXT(ctx
);
2119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2120 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2124 if (ctx
->ExecuteFlag
) {
2125 CALL_DepthFunc(ctx
->Exec
, (func
));
2130 static void GLAPIENTRY
2131 save_DepthMask(GLboolean mask
)
2133 GET_CURRENT_CONTEXT(ctx
);
2135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2136 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2140 if (ctx
->ExecuteFlag
) {
2141 CALL_DepthMask(ctx
->Exec
, (mask
));
2146 static void GLAPIENTRY
2147 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2149 GET_CURRENT_CONTEXT(ctx
);
2151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2152 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2154 n
[1].f
= (GLfloat
) nearval
;
2155 n
[2].f
= (GLfloat
) farval
;
2157 if (ctx
->ExecuteFlag
) {
2158 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2163 static void GLAPIENTRY
2164 save_Disable(GLenum cap
)
2166 GET_CURRENT_CONTEXT(ctx
);
2168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2169 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2173 if (ctx
->ExecuteFlag
) {
2174 CALL_Disable(ctx
->Exec
, (cap
));
2179 static void GLAPIENTRY
2180 save_DisableIndexed(GLuint index
, GLenum cap
)
2182 GET_CURRENT_CONTEXT(ctx
);
2184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2185 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2190 if (ctx
->ExecuteFlag
) {
2191 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2196 static void GLAPIENTRY
2197 save_DrawBuffer(GLenum mode
)
2199 GET_CURRENT_CONTEXT(ctx
);
2201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2202 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2206 if (ctx
->ExecuteFlag
) {
2207 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2212 static void GLAPIENTRY
2213 save_DrawPixels(GLsizei width
, GLsizei height
,
2214 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2216 GET_CURRENT_CONTEXT(ctx
);
2219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2221 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2227 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2228 pixels
, &ctx
->Unpack
);
2230 if (ctx
->ExecuteFlag
) {
2231 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2237 static void GLAPIENTRY
2238 save_Enable(GLenum cap
)
2240 GET_CURRENT_CONTEXT(ctx
);
2242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2243 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2247 if (ctx
->ExecuteFlag
) {
2248 CALL_Enable(ctx
->Exec
, (cap
));
2254 static void GLAPIENTRY
2255 save_EnableIndexed(GLuint index
, GLenum cap
)
2257 GET_CURRENT_CONTEXT(ctx
);
2259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2260 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2265 if (ctx
->ExecuteFlag
) {
2266 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2272 static void GLAPIENTRY
2273 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2284 if (ctx
->ExecuteFlag
) {
2285 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2290 static void GLAPIENTRY
2291 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2293 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2304 if (ctx
->ExecuteFlag
) {
2305 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2312 static void GLAPIENTRY
2313 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2315 GET_CURRENT_CONTEXT(ctx
);
2317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2318 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2326 if (ctx
->ExecuteFlag
) {
2327 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2332 static void GLAPIENTRY
2333 save_Fogf(GLenum pname
, GLfloat param
)
2337 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2338 save_Fogfv(pname
, parray
);
2342 static void GLAPIENTRY
2343 save_Fogiv(GLenum pname
, const GLint
*params
)
2348 case GL_FOG_DENSITY
:
2352 p
[0] = (GLfloat
) *params
;
2358 p
[0] = INT_TO_FLOAT(params
[0]);
2359 p
[1] = INT_TO_FLOAT(params
[1]);
2360 p
[2] = INT_TO_FLOAT(params
[2]);
2361 p
[3] = INT_TO_FLOAT(params
[3]);
2364 /* Error will be caught later in gl_Fogfv */
2365 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2367 save_Fogfv(pname
, p
);
2371 static void GLAPIENTRY
2372 save_Fogi(GLenum pname
, GLint param
)
2376 parray
[1] = parray
[2] = parray
[3] = 0;
2377 save_Fogiv(pname
, parray
);
2381 static void GLAPIENTRY
2382 save_FrontFace(GLenum mode
)
2384 GET_CURRENT_CONTEXT(ctx
);
2386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2387 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2391 if (ctx
->ExecuteFlag
) {
2392 CALL_FrontFace(ctx
->Exec
, (mode
));
2397 static void GLAPIENTRY
2398 save_Frustum(GLdouble left
, GLdouble right
,
2399 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2401 GET_CURRENT_CONTEXT(ctx
);
2403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2404 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2406 n
[1].f
= (GLfloat
) left
;
2407 n
[2].f
= (GLfloat
) right
;
2408 n
[3].f
= (GLfloat
) bottom
;
2409 n
[4].f
= (GLfloat
) top
;
2410 n
[5].f
= (GLfloat
) nearval
;
2411 n
[6].f
= (GLfloat
) farval
;
2413 if (ctx
->ExecuteFlag
) {
2414 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2419 static void GLAPIENTRY
2420 save_Hint(GLenum target
, GLenum mode
)
2422 GET_CURRENT_CONTEXT(ctx
);
2424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2425 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2430 if (ctx
->ExecuteFlag
) {
2431 CALL_Hint(ctx
->Exec
, (target
, mode
));
2436 static void GLAPIENTRY
2437 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2440 GET_CURRENT_CONTEXT(ctx
);
2443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2444 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2448 n
[3].e
= internalFormat
;
2451 if (ctx
->ExecuteFlag
) {
2452 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2457 static void GLAPIENTRY
2458 save_IndexMask(GLuint mask
)
2460 GET_CURRENT_CONTEXT(ctx
);
2462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2463 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2467 if (ctx
->ExecuteFlag
) {
2468 CALL_IndexMask(ctx
->Exec
, (mask
));
2473 static void GLAPIENTRY
2474 save_InitNames(void)
2476 GET_CURRENT_CONTEXT(ctx
);
2477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2478 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2479 if (ctx
->ExecuteFlag
) {
2480 CALL_InitNames(ctx
->Exec
, ());
2485 static void GLAPIENTRY
2486 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2488 GET_CURRENT_CONTEXT(ctx
);
2490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2491 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2509 case GL_SPOT_DIRECTION
:
2512 case GL_SPOT_EXPONENT
:
2515 case GL_SPOT_CUTOFF
:
2518 case GL_CONSTANT_ATTENUATION
:
2521 case GL_LINEAR_ATTENUATION
:
2524 case GL_QUADRATIC_ATTENUATION
:
2530 for (i
= 0; i
< nParams
; i
++) {
2531 n
[3 + i
].f
= params
[i
];
2534 if (ctx
->ExecuteFlag
) {
2535 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2540 static void GLAPIENTRY
2541 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2545 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2546 save_Lightfv(light
, pname
, parray
);
2550 static void GLAPIENTRY
2551 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2558 fparam
[0] = INT_TO_FLOAT(params
[0]);
2559 fparam
[1] = INT_TO_FLOAT(params
[1]);
2560 fparam
[2] = INT_TO_FLOAT(params
[2]);
2561 fparam
[3] = INT_TO_FLOAT(params
[3]);
2564 fparam
[0] = (GLfloat
) params
[0];
2565 fparam
[1] = (GLfloat
) params
[1];
2566 fparam
[2] = (GLfloat
) params
[2];
2567 fparam
[3] = (GLfloat
) params
[3];
2569 case GL_SPOT_DIRECTION
:
2570 fparam
[0] = (GLfloat
) params
[0];
2571 fparam
[1] = (GLfloat
) params
[1];
2572 fparam
[2] = (GLfloat
) params
[2];
2574 case GL_SPOT_EXPONENT
:
2575 case GL_SPOT_CUTOFF
:
2576 case GL_CONSTANT_ATTENUATION
:
2577 case GL_LINEAR_ATTENUATION
:
2578 case GL_QUADRATIC_ATTENUATION
:
2579 fparam
[0] = (GLfloat
) params
[0];
2582 /* error will be caught later in gl_Lightfv */
2585 save_Lightfv(light
, pname
, fparam
);
2589 static void GLAPIENTRY
2590 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2594 parray
[1] = parray
[2] = parray
[3] = 0;
2595 save_Lightiv(light
, pname
, parray
);
2599 static void GLAPIENTRY
2600 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2602 GET_CURRENT_CONTEXT(ctx
);
2604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2605 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2613 if (ctx
->ExecuteFlag
) {
2614 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2619 static void GLAPIENTRY
2620 save_LightModelf(GLenum pname
, GLfloat param
)
2624 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2625 save_LightModelfv(pname
, parray
);
2629 static void GLAPIENTRY
2630 save_LightModeliv(GLenum pname
, const GLint
*params
)
2634 case GL_LIGHT_MODEL_AMBIENT
:
2635 fparam
[0] = INT_TO_FLOAT(params
[0]);
2636 fparam
[1] = INT_TO_FLOAT(params
[1]);
2637 fparam
[2] = INT_TO_FLOAT(params
[2]);
2638 fparam
[3] = INT_TO_FLOAT(params
[3]);
2640 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2641 case GL_LIGHT_MODEL_TWO_SIDE
:
2642 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2643 fparam
[0] = (GLfloat
) params
[0];
2649 /* Error will be caught later in gl_LightModelfv */
2650 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2652 save_LightModelfv(pname
, fparam
);
2656 static void GLAPIENTRY
2657 save_LightModeli(GLenum pname
, GLint param
)
2661 parray
[1] = parray
[2] = parray
[3] = 0;
2662 save_LightModeliv(pname
, parray
);
2666 static void GLAPIENTRY
2667 save_LineStipple(GLint factor
, GLushort pattern
)
2669 GET_CURRENT_CONTEXT(ctx
);
2671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2672 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2677 if (ctx
->ExecuteFlag
) {
2678 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2683 static void GLAPIENTRY
2684 save_LineWidth(GLfloat width
)
2686 GET_CURRENT_CONTEXT(ctx
);
2688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2689 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2693 if (ctx
->ExecuteFlag
) {
2694 CALL_LineWidth(ctx
->Exec
, (width
));
2699 static void GLAPIENTRY
2700 save_ListBase(GLuint base
)
2702 GET_CURRENT_CONTEXT(ctx
);
2704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2705 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2709 if (ctx
->ExecuteFlag
) {
2710 CALL_ListBase(ctx
->Exec
, (base
));
2715 static void GLAPIENTRY
2716 save_LoadIdentity(void)
2718 GET_CURRENT_CONTEXT(ctx
);
2719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2720 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2721 if (ctx
->ExecuteFlag
) {
2722 CALL_LoadIdentity(ctx
->Exec
, ());
2727 static void GLAPIENTRY
2728 save_LoadMatrixf(const GLfloat
* m
)
2730 GET_CURRENT_CONTEXT(ctx
);
2732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2733 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2736 for (i
= 0; i
< 16; i
++) {
2740 if (ctx
->ExecuteFlag
) {
2741 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2746 static void GLAPIENTRY
2747 save_LoadMatrixd(const GLdouble
* m
)
2751 for (i
= 0; i
< 16; i
++) {
2752 f
[i
] = (GLfloat
) m
[i
];
2754 save_LoadMatrixf(f
);
2758 static void GLAPIENTRY
2759 save_LoadName(GLuint name
)
2761 GET_CURRENT_CONTEXT(ctx
);
2763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2764 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2768 if (ctx
->ExecuteFlag
) {
2769 CALL_LoadName(ctx
->Exec
, (name
));
2774 static void GLAPIENTRY
2775 save_LogicOp(GLenum opcode
)
2777 GET_CURRENT_CONTEXT(ctx
);
2779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2780 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2784 if (ctx
->ExecuteFlag
) {
2785 CALL_LogicOp(ctx
->Exec
, (opcode
));
2790 static void GLAPIENTRY
2791 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2792 GLint order
, const GLdouble
* points
)
2794 GET_CURRENT_CONTEXT(ctx
);
2796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2797 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2799 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2801 n
[2].f
= (GLfloat
) u1
;
2802 n
[3].f
= (GLfloat
) u2
;
2803 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2805 n
[6].data
= (void *) pnts
;
2807 if (ctx
->ExecuteFlag
) {
2808 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2812 static void GLAPIENTRY
2813 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2814 GLint order
, const GLfloat
* points
)
2816 GET_CURRENT_CONTEXT(ctx
);
2818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2819 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2821 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2825 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2827 n
[6].data
= (void *) pnts
;
2829 if (ctx
->ExecuteFlag
) {
2830 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2835 static void GLAPIENTRY
2836 save_Map2d(GLenum target
,
2837 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2838 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2839 const GLdouble
* points
)
2841 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2846 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2847 vstride
, vorder
, points
);
2849 n
[2].f
= (GLfloat
) u1
;
2850 n
[3].f
= (GLfloat
) u2
;
2851 n
[4].f
= (GLfloat
) v1
;
2852 n
[5].f
= (GLfloat
) v2
;
2853 /* XXX verify these strides are correct */
2854 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2855 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2858 n
[10].data
= (void *) pnts
;
2860 if (ctx
->ExecuteFlag
) {
2861 CALL_Map2d(ctx
->Exec
, (target
,
2862 u1
, u2
, ustride
, uorder
,
2863 v1
, v2
, vstride
, vorder
, points
));
2868 static void GLAPIENTRY
2869 save_Map2f(GLenum target
,
2870 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2871 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2872 const GLfloat
* points
)
2874 GET_CURRENT_CONTEXT(ctx
);
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2877 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2879 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2880 vstride
, vorder
, points
);
2886 /* XXX verify these strides are correct */
2887 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2888 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2891 n
[10].data
= (void *) pnts
;
2893 if (ctx
->ExecuteFlag
) {
2894 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2895 v1
, v2
, vstride
, vorder
, points
));
2900 static void GLAPIENTRY
2901 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2903 GET_CURRENT_CONTEXT(ctx
);
2905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2906 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2912 if (ctx
->ExecuteFlag
) {
2913 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2918 static void GLAPIENTRY
2919 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2921 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2925 static void GLAPIENTRY
2926 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2927 GLint vn
, GLfloat v1
, GLfloat v2
)
2929 GET_CURRENT_CONTEXT(ctx
);
2931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2932 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2941 if (ctx
->ExecuteFlag
) {
2942 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2948 static void GLAPIENTRY
2949 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2950 GLint vn
, GLdouble v1
, GLdouble v2
)
2952 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2953 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2957 static void GLAPIENTRY
2958 save_MatrixMode(GLenum mode
)
2960 GET_CURRENT_CONTEXT(ctx
);
2962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2963 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2967 if (ctx
->ExecuteFlag
) {
2968 CALL_MatrixMode(ctx
->Exec
, (mode
));
2973 static void GLAPIENTRY
2974 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2976 GET_CURRENT_CONTEXT(ctx
);
2979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2980 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2983 n
[2].e
= internalFormat
;
2986 if (ctx
->ExecuteFlag
) {
2987 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2992 static void GLAPIENTRY
2993 save_MultMatrixf(const GLfloat
* m
)
2995 GET_CURRENT_CONTEXT(ctx
);
2997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2998 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3001 for (i
= 0; i
< 16; i
++) {
3005 if (ctx
->ExecuteFlag
) {
3006 CALL_MultMatrixf(ctx
->Exec
, (m
));
3011 static void GLAPIENTRY
3012 save_MultMatrixd(const GLdouble
* m
)
3016 for (i
= 0; i
< 16; i
++) {
3017 f
[i
] = (GLfloat
) m
[i
];
3019 save_MultMatrixf(f
);
3023 static void GLAPIENTRY
3024 save_NewList(GLuint name
, GLenum mode
)
3026 GET_CURRENT_CONTEXT(ctx
);
3027 /* It's an error to call this function while building a display list */
3028 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3035 static void GLAPIENTRY
3036 save_Ortho(GLdouble left
, GLdouble right
,
3037 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3039 GET_CURRENT_CONTEXT(ctx
);
3041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3042 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3044 n
[1].f
= (GLfloat
) left
;
3045 n
[2].f
= (GLfloat
) right
;
3046 n
[3].f
= (GLfloat
) bottom
;
3047 n
[4].f
= (GLfloat
) top
;
3048 n
[5].f
= (GLfloat
) nearval
;
3049 n
[6].f
= (GLfloat
) farval
;
3051 if (ctx
->ExecuteFlag
) {
3052 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3057 static void GLAPIENTRY
3058 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3060 GET_CURRENT_CONTEXT(ctx
);
3062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3063 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3067 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
3068 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3070 if (ctx
->ExecuteFlag
) {
3071 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3076 static void GLAPIENTRY
3077 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3079 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3081 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3082 for (i
= 0; i
< mapsize
; i
++) {
3083 fvalues
[i
] = (GLfloat
) values
[i
];
3087 for (i
= 0; i
< mapsize
; i
++) {
3088 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3091 save_PixelMapfv(map
, mapsize
, fvalues
);
3095 static void GLAPIENTRY
3096 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3098 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3100 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3101 for (i
= 0; i
< mapsize
; i
++) {
3102 fvalues
[i
] = (GLfloat
) values
[i
];
3106 for (i
= 0; i
< mapsize
; i
++) {
3107 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3110 save_PixelMapfv(map
, mapsize
, fvalues
);
3114 static void GLAPIENTRY
3115 save_PixelTransferf(GLenum pname
, GLfloat param
)
3117 GET_CURRENT_CONTEXT(ctx
);
3119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3120 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3125 if (ctx
->ExecuteFlag
) {
3126 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3131 static void GLAPIENTRY
3132 save_PixelTransferi(GLenum pname
, GLint param
)
3134 save_PixelTransferf(pname
, (GLfloat
) param
);
3138 static void GLAPIENTRY
3139 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3141 GET_CURRENT_CONTEXT(ctx
);
3143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3144 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3149 if (ctx
->ExecuteFlag
) {
3150 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3155 static void GLAPIENTRY
3156 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3158 GET_CURRENT_CONTEXT(ctx
);
3160 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3161 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3168 if (ctx
->ExecuteFlag
) {
3169 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3174 static void GLAPIENTRY
3175 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3179 parray
[1] = parray
[2] = 0.0F
;
3180 save_PointParameterfvEXT(pname
, parray
);
3183 static void GLAPIENTRY
3184 save_PointParameteriNV(GLenum pname
, GLint param
)
3187 parray
[0] = (GLfloat
) param
;
3188 parray
[1] = parray
[2] = 0.0F
;
3189 save_PointParameterfvEXT(pname
, parray
);
3192 static void GLAPIENTRY
3193 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3196 parray
[0] = (GLfloat
) param
[0];
3197 parray
[1] = parray
[2] = 0.0F
;
3198 save_PointParameterfvEXT(pname
, parray
);
3202 static void GLAPIENTRY
3203 save_PointSize(GLfloat size
)
3205 GET_CURRENT_CONTEXT(ctx
);
3207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3208 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3212 if (ctx
->ExecuteFlag
) {
3213 CALL_PointSize(ctx
->Exec
, (size
));
3218 static void GLAPIENTRY
3219 save_PolygonMode(GLenum face
, GLenum mode
)
3221 GET_CURRENT_CONTEXT(ctx
);
3223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3224 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3229 if (ctx
->ExecuteFlag
) {
3230 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3235 static void GLAPIENTRY
3236 save_PolygonStipple(const GLubyte
* pattern
)
3238 GET_CURRENT_CONTEXT(ctx
);
3241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3243 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3245 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3246 pattern
, &ctx
->Unpack
);
3248 if (ctx
->ExecuteFlag
) {
3249 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3254 static void GLAPIENTRY
3255 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3257 GET_CURRENT_CONTEXT(ctx
);
3259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3260 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3265 if (ctx
->ExecuteFlag
) {
3266 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3271 static void GLAPIENTRY
3272 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3274 GET_CURRENT_CONTEXT(ctx
);
3275 /* XXX mult by DepthMaxF here??? */
3276 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3280 static void GLAPIENTRY
3281 save_PopAttrib(void)
3283 GET_CURRENT_CONTEXT(ctx
);
3284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3285 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3286 if (ctx
->ExecuteFlag
) {
3287 CALL_PopAttrib(ctx
->Exec
, ());
3292 static void GLAPIENTRY
3293 save_PopMatrix(void)
3295 GET_CURRENT_CONTEXT(ctx
);
3296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3297 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3298 if (ctx
->ExecuteFlag
) {
3299 CALL_PopMatrix(ctx
->Exec
, ());
3304 static void GLAPIENTRY
3307 GET_CURRENT_CONTEXT(ctx
);
3308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3309 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3310 if (ctx
->ExecuteFlag
) {
3311 CALL_PopName(ctx
->Exec
, ());
3316 static void GLAPIENTRY
3317 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3318 const GLclampf
* priorities
)
3320 GET_CURRENT_CONTEXT(ctx
);
3322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3324 for (i
= 0; i
< num
; i
++) {
3326 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3328 n
[1].ui
= textures
[i
];
3329 n
[2].f
= priorities
[i
];
3332 if (ctx
->ExecuteFlag
) {
3333 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3338 static void GLAPIENTRY
3339 save_PushAttrib(GLbitfield mask
)
3341 GET_CURRENT_CONTEXT(ctx
);
3343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3344 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3348 if (ctx
->ExecuteFlag
) {
3349 CALL_PushAttrib(ctx
->Exec
, (mask
));
3354 static void GLAPIENTRY
3355 save_PushMatrix(void)
3357 GET_CURRENT_CONTEXT(ctx
);
3358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3359 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3360 if (ctx
->ExecuteFlag
) {
3361 CALL_PushMatrix(ctx
->Exec
, ());
3366 static void GLAPIENTRY
3367 save_PushName(GLuint name
)
3369 GET_CURRENT_CONTEXT(ctx
);
3371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3372 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3376 if (ctx
->ExecuteFlag
) {
3377 CALL_PushName(ctx
->Exec
, (name
));
3382 static void GLAPIENTRY
3383 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3385 GET_CURRENT_CONTEXT(ctx
);
3387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3388 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3395 if (ctx
->ExecuteFlag
) {
3396 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3400 static void GLAPIENTRY
3401 save_RasterPos2d(GLdouble x
, GLdouble y
)
3403 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3406 static void GLAPIENTRY
3407 save_RasterPos2f(GLfloat x
, GLfloat y
)
3409 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3412 static void GLAPIENTRY
3413 save_RasterPos2i(GLint x
, GLint y
)
3415 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3418 static void GLAPIENTRY
3419 save_RasterPos2s(GLshort x
, GLshort y
)
3421 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3424 static void GLAPIENTRY
3425 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3427 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3430 static void GLAPIENTRY
3431 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3433 save_RasterPos4f(x
, y
, z
, 1.0F
);
3436 static void GLAPIENTRY
3437 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3439 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3442 static void GLAPIENTRY
3443 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3445 save_RasterPos4f(x
, y
, z
, 1.0F
);
3448 static void GLAPIENTRY
3449 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3451 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3454 static void GLAPIENTRY
3455 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3457 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3460 static void GLAPIENTRY
3461 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3463 save_RasterPos4f(x
, y
, z
, w
);
3466 static void GLAPIENTRY
3467 save_RasterPos2dv(const GLdouble
* v
)
3469 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3472 static void GLAPIENTRY
3473 save_RasterPos2fv(const GLfloat
* v
)
3475 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3478 static void GLAPIENTRY
3479 save_RasterPos2iv(const GLint
* v
)
3481 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3484 static void GLAPIENTRY
3485 save_RasterPos2sv(const GLshort
* v
)
3487 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3490 static void GLAPIENTRY
3491 save_RasterPos3dv(const GLdouble
* v
)
3493 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3496 static void GLAPIENTRY
3497 save_RasterPos3fv(const GLfloat
* v
)
3499 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3502 static void GLAPIENTRY
3503 save_RasterPos3iv(const GLint
* v
)
3505 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3508 static void GLAPIENTRY
3509 save_RasterPos3sv(const GLshort
* v
)
3511 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3514 static void GLAPIENTRY
3515 save_RasterPos4dv(const GLdouble
* v
)
3517 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3518 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3521 static void GLAPIENTRY
3522 save_RasterPos4fv(const GLfloat
* v
)
3524 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3527 static void GLAPIENTRY
3528 save_RasterPos4iv(const GLint
* v
)
3530 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3531 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3534 static void GLAPIENTRY
3535 save_RasterPos4sv(const GLshort
* v
)
3537 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3541 static void GLAPIENTRY
3542 save_PassThrough(GLfloat token
)
3544 GET_CURRENT_CONTEXT(ctx
);
3546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3547 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3551 if (ctx
->ExecuteFlag
) {
3552 CALL_PassThrough(ctx
->Exec
, (token
));
3557 static void GLAPIENTRY
3558 save_ReadBuffer(GLenum mode
)
3560 GET_CURRENT_CONTEXT(ctx
);
3562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3563 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3567 if (ctx
->ExecuteFlag
) {
3568 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3573 static void GLAPIENTRY
3574 save_ResetHistogram(GLenum target
)
3576 GET_CURRENT_CONTEXT(ctx
);
3578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3579 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3583 if (ctx
->ExecuteFlag
) {
3584 CALL_ResetHistogram(ctx
->Exec
, (target
));
3589 static void GLAPIENTRY
3590 save_ResetMinmax(GLenum target
)
3592 GET_CURRENT_CONTEXT(ctx
);
3594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3595 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3599 if (ctx
->ExecuteFlag
) {
3600 CALL_ResetMinmax(ctx
->Exec
, (target
));
3605 static void GLAPIENTRY
3606 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3608 GET_CURRENT_CONTEXT(ctx
);
3610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3611 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3618 if (ctx
->ExecuteFlag
) {
3619 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3624 static void GLAPIENTRY
3625 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3627 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3631 static void GLAPIENTRY
3632 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3634 GET_CURRENT_CONTEXT(ctx
);
3636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3637 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3643 if (ctx
->ExecuteFlag
) {
3644 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3649 static void GLAPIENTRY
3650 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3652 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3656 static void GLAPIENTRY
3657 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3659 GET_CURRENT_CONTEXT(ctx
);
3661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3662 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3669 if (ctx
->ExecuteFlag
) {
3670 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3675 static void GLAPIENTRY
3676 save_ShadeModel(GLenum mode
)
3678 GET_CURRENT_CONTEXT(ctx
);
3680 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3682 if (ctx
->ExecuteFlag
) {
3683 CALL_ShadeModel(ctx
->Exec
, (mode
));
3686 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3689 SAVE_FLUSH_VERTICES(ctx
);
3691 /* Only save the value if we know the statechange will take effect:
3693 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3694 ctx
->ListState
.Current
.ShadeModel
= mode
;
3696 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3703 static void GLAPIENTRY
3704 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3706 GET_CURRENT_CONTEXT(ctx
);
3708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3709 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3715 if (ctx
->ExecuteFlag
) {
3716 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3721 static void GLAPIENTRY
3722 save_StencilMask(GLuint mask
)
3724 GET_CURRENT_CONTEXT(ctx
);
3726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3727 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3731 if (ctx
->ExecuteFlag
) {
3732 CALL_StencilMask(ctx
->Exec
, (mask
));
3737 static void GLAPIENTRY
3738 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3740 GET_CURRENT_CONTEXT(ctx
);
3742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3743 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3749 if (ctx
->ExecuteFlag
) {
3750 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3755 static void GLAPIENTRY
3756 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3758 GET_CURRENT_CONTEXT(ctx
);
3760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3761 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3768 if (ctx
->ExecuteFlag
) {
3769 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3774 static void GLAPIENTRY
3775 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3778 GET_CURRENT_CONTEXT(ctx
);
3780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3782 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3790 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3797 if (ctx
->ExecuteFlag
) {
3798 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3799 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3804 static void GLAPIENTRY
3805 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3807 GET_CURRENT_CONTEXT(ctx
);
3809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3810 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3815 if (ctx
->ExecuteFlag
) {
3816 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3821 static void GLAPIENTRY
3822 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3824 GET_CURRENT_CONTEXT(ctx
);
3826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3827 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3834 if (ctx
->ExecuteFlag
) {
3835 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3840 static void GLAPIENTRY
3841 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3843 GET_CURRENT_CONTEXT(ctx
);
3845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3846 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3850 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3858 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3861 if (ctx
->ExecuteFlag
) {
3862 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3867 static void GLAPIENTRY
3868 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3871 parray
[0] = (GLfloat
) param
;
3872 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3873 save_TexEnvfv(target
, pname
, parray
);
3877 static void GLAPIENTRY
3878 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3881 p
[0] = (GLfloat
) param
;
3882 p
[1] = p
[2] = p
[3] = 0.0F
;
3883 save_TexEnvfv(target
, pname
, p
);
3887 static void GLAPIENTRY
3888 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3891 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3892 p
[0] = INT_TO_FLOAT(param
[0]);
3893 p
[1] = INT_TO_FLOAT(param
[1]);
3894 p
[2] = INT_TO_FLOAT(param
[2]);
3895 p
[3] = INT_TO_FLOAT(param
[3]);
3898 p
[0] = (GLfloat
) param
[0];
3899 p
[1] = p
[2] = p
[3] = 0.0F
;
3901 save_TexEnvfv(target
, pname
, p
);
3905 static void GLAPIENTRY
3906 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3908 GET_CURRENT_CONTEXT(ctx
);
3910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3911 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3920 if (ctx
->ExecuteFlag
) {
3921 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3926 static void GLAPIENTRY
3927 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3930 p
[0] = (GLfloat
) params
[0];
3931 p
[1] = (GLfloat
) params
[1];
3932 p
[2] = (GLfloat
) params
[2];
3933 p
[3] = (GLfloat
) params
[3];
3934 save_TexGenfv(coord
, pname
, p
);
3938 static void GLAPIENTRY
3939 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3942 parray
[0] = (GLfloat
) param
;
3943 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3944 save_TexGenfv(coord
, pname
, parray
);
3948 static void GLAPIENTRY
3949 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3952 p
[0] = (GLfloat
) params
[0];
3953 p
[1] = (GLfloat
) params
[1];
3954 p
[2] = (GLfloat
) params
[2];
3955 p
[3] = (GLfloat
) params
[3];
3956 save_TexGenfv(coord
, pname
, p
);
3960 static void GLAPIENTRY
3961 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3965 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3966 save_TexGenfv(coord
, pname
, parray
);
3970 static void GLAPIENTRY
3971 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3975 parray
[1] = parray
[2] = parray
[3] = 0;
3976 save_TexGeniv(coord
, pname
, parray
);
3980 static void GLAPIENTRY
3981 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3983 GET_CURRENT_CONTEXT(ctx
);
3985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3986 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3995 if (ctx
->ExecuteFlag
) {
3996 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4001 static void GLAPIENTRY
4002 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4006 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4007 save_TexParameterfv(target
, pname
, parray
);
4011 static void GLAPIENTRY
4012 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4015 fparam
[0] = (GLfloat
) param
;
4016 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4017 save_TexParameterfv(target
, pname
, fparam
);
4021 static void GLAPIENTRY
4022 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4025 fparam
[0] = (GLfloat
) params
[0];
4026 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4027 save_TexParameterfv(target
, pname
, fparam
);
4031 static void GLAPIENTRY
4032 save_TexImage1D(GLenum target
,
4033 GLint level
, GLint components
,
4034 GLsizei width
, GLint border
,
4035 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4037 GET_CURRENT_CONTEXT(ctx
);
4038 if (target
== GL_PROXY_TEXTURE_1D
) {
4039 /* don't compile, execute immediately */
4040 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4041 border
, format
, type
, pixels
));
4045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4046 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4050 n
[3].i
= components
;
4051 n
[4].i
= (GLint
) width
;
4055 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4056 pixels
, &ctx
->Unpack
);
4058 if (ctx
->ExecuteFlag
) {
4059 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4060 border
, format
, type
, pixels
));
4066 static void GLAPIENTRY
4067 save_TexImage2D(GLenum target
,
4068 GLint level
, GLint components
,
4069 GLsizei width
, GLsizei height
, GLint border
,
4070 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4072 GET_CURRENT_CONTEXT(ctx
);
4073 if (target
== GL_PROXY_TEXTURE_2D
) {
4074 /* don't compile, execute immediately */
4075 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4076 height
, border
, format
, type
, pixels
));
4080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4081 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4085 n
[3].i
= components
;
4086 n
[4].i
= (GLint
) width
;
4087 n
[5].i
= (GLint
) height
;
4091 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4092 pixels
, &ctx
->Unpack
);
4094 if (ctx
->ExecuteFlag
) {
4095 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4096 height
, border
, format
, type
, pixels
));
4102 static void GLAPIENTRY
4103 save_TexImage3D(GLenum target
,
4104 GLint level
, GLint internalFormat
,
4105 GLsizei width
, GLsizei height
, GLsizei depth
,
4107 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4109 GET_CURRENT_CONTEXT(ctx
);
4110 if (target
== GL_PROXY_TEXTURE_3D
) {
4111 /* don't compile, execute immediately */
4112 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4113 height
, depth
, border
, format
, type
,
4118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4119 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4123 n
[3].i
= (GLint
) internalFormat
;
4124 n
[4].i
= (GLint
) width
;
4125 n
[5].i
= (GLint
) height
;
4126 n
[6].i
= (GLint
) depth
;
4130 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4131 pixels
, &ctx
->Unpack
);
4133 if (ctx
->ExecuteFlag
) {
4134 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4135 height
, depth
, border
, format
, type
,
4142 static void GLAPIENTRY
4143 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4144 GLsizei width
, GLenum format
, GLenum type
,
4145 const GLvoid
* pixels
)
4147 GET_CURRENT_CONTEXT(ctx
);
4150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4152 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4157 n
[4].i
= (GLint
) width
;
4160 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4161 pixels
, &ctx
->Unpack
);
4163 if (ctx
->ExecuteFlag
) {
4164 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4165 format
, type
, pixels
));
4170 static void GLAPIENTRY
4171 save_TexSubImage2D(GLenum target
, GLint level
,
4172 GLint xoffset
, GLint yoffset
,
4173 GLsizei width
, GLsizei height
,
4174 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4176 GET_CURRENT_CONTEXT(ctx
);
4179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4181 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4187 n
[5].i
= (GLint
) width
;
4188 n
[6].i
= (GLint
) height
;
4191 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4192 pixels
, &ctx
->Unpack
);
4194 if (ctx
->ExecuteFlag
) {
4195 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4196 width
, height
, format
, type
, pixels
));
4201 static void GLAPIENTRY
4202 save_TexSubImage3D(GLenum target
, GLint level
,
4203 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4204 GLsizei width
, GLsizei height
, GLsizei depth
,
4205 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4207 GET_CURRENT_CONTEXT(ctx
);
4210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4212 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4219 n
[6].i
= (GLint
) width
;
4220 n
[7].i
= (GLint
) height
;
4221 n
[8].i
= (GLint
) depth
;
4224 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4225 pixels
, &ctx
->Unpack
);
4227 if (ctx
->ExecuteFlag
) {
4228 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4229 xoffset
, yoffset
, zoffset
,
4230 width
, height
, depth
, format
, type
,
4236 static void GLAPIENTRY
4237 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4239 GET_CURRENT_CONTEXT(ctx
);
4241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4242 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4248 if (ctx
->ExecuteFlag
) {
4249 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4254 static void GLAPIENTRY
4255 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4257 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4262 static void GLAPIENTRY
4263 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4265 GET_CURRENT_CONTEXT(ctx
);
4267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4268 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4272 n
[3].i
= (GLint
) width
;
4273 n
[4].i
= (GLint
) height
;
4275 if (ctx
->ExecuteFlag
) {
4276 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4281 static void GLAPIENTRY
4282 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4284 GET_CURRENT_CONTEXT(ctx
);
4286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4287 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4294 if (ctx
->ExecuteFlag
) {
4295 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4299 static void GLAPIENTRY
4300 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4302 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4305 static void GLAPIENTRY
4306 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4308 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4311 static void GLAPIENTRY
4312 save_WindowPos2iMESA(GLint x
, GLint y
)
4314 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4317 static void GLAPIENTRY
4318 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4320 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4323 static void GLAPIENTRY
4324 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4326 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4329 static void GLAPIENTRY
4330 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4332 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4335 static void GLAPIENTRY
4336 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4338 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4341 static void GLAPIENTRY
4342 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4344 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4347 static void GLAPIENTRY
4348 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4350 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4353 static void GLAPIENTRY
4354 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4356 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4359 static void GLAPIENTRY
4360 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4362 save_WindowPos4fMESA(x
, y
, z
, w
);
4365 static void GLAPIENTRY
4366 save_WindowPos2dvMESA(const GLdouble
* v
)
4368 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4371 static void GLAPIENTRY
4372 save_WindowPos2fvMESA(const GLfloat
* v
)
4374 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4377 static void GLAPIENTRY
4378 save_WindowPos2ivMESA(const GLint
* v
)
4380 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4383 static void GLAPIENTRY
4384 save_WindowPos2svMESA(const GLshort
* v
)
4386 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4389 static void GLAPIENTRY
4390 save_WindowPos3dvMESA(const GLdouble
* v
)
4392 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4395 static void GLAPIENTRY
4396 save_WindowPos3fvMESA(const GLfloat
* v
)
4398 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4401 static void GLAPIENTRY
4402 save_WindowPos3ivMESA(const GLint
* v
)
4404 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4407 static void GLAPIENTRY
4408 save_WindowPos3svMESA(const GLshort
* v
)
4410 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4413 static void GLAPIENTRY
4414 save_WindowPos4dvMESA(const GLdouble
* v
)
4416 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4417 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4420 static void GLAPIENTRY
4421 save_WindowPos4fvMESA(const GLfloat
* v
)
4423 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4426 static void GLAPIENTRY
4427 save_WindowPos4ivMESA(const GLint
* v
)
4429 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4430 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4433 static void GLAPIENTRY
4434 save_WindowPos4svMESA(const GLshort
* v
)
4436 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4441 /* GL_ARB_multitexture */
4442 static void GLAPIENTRY
4443 save_ActiveTextureARB(GLenum target
)
4445 GET_CURRENT_CONTEXT(ctx
);
4447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4448 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4452 if (ctx
->ExecuteFlag
) {
4453 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4458 /* GL_ARB_transpose_matrix */
4460 static void GLAPIENTRY
4461 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4464 _math_transposefd(tm
, m
);
4465 save_LoadMatrixf(tm
);
4469 static void GLAPIENTRY
4470 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4473 _math_transposef(tm
, m
);
4474 save_LoadMatrixf(tm
);
4478 static void GLAPIENTRY
4479 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4482 _math_transposefd(tm
, m
);
4483 save_MultMatrixf(tm
);
4487 static void GLAPIENTRY
4488 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4491 _math_transposef(tm
, m
);
4492 save_MultMatrixf(tm
);
4496 /* GL_ARB_texture_compression */
4497 static void GLAPIENTRY
4498 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4499 GLenum internalFormat
, GLsizei width
,
4500 GLint border
, GLsizei imageSize
,
4501 const GLvoid
* data
)
4503 GET_CURRENT_CONTEXT(ctx
);
4504 if (target
== GL_PROXY_TEXTURE_1D
) {
4505 /* don't compile, execute immediately */
4506 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4507 width
, border
, imageSize
,
4513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4514 /* make copy of image */
4515 image
= malloc(imageSize
);
4517 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4520 memcpy(image
, data
, imageSize
);
4521 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4525 n
[3].e
= internalFormat
;
4526 n
[4].i
= (GLint
) width
;
4534 if (ctx
->ExecuteFlag
) {
4535 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4536 (target
, level
, internalFormat
, width
,
4537 border
, imageSize
, data
));
4543 static void GLAPIENTRY
4544 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4545 GLenum internalFormat
, GLsizei width
,
4546 GLsizei height
, GLint border
, GLsizei imageSize
,
4547 const GLvoid
* data
)
4549 GET_CURRENT_CONTEXT(ctx
);
4550 if (target
== GL_PROXY_TEXTURE_2D
) {
4551 /* don't compile, execute immediately */
4552 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4553 width
, height
, border
,
4559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4560 /* make copy of image */
4561 image
= malloc(imageSize
);
4563 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4566 memcpy(image
, data
, imageSize
);
4567 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4571 n
[3].e
= internalFormat
;
4572 n
[4].i
= (GLint
) width
;
4573 n
[5].i
= (GLint
) height
;
4581 if (ctx
->ExecuteFlag
) {
4582 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4583 (target
, level
, internalFormat
, width
,
4584 height
, border
, imageSize
, data
));
4590 static void GLAPIENTRY
4591 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4592 GLenum internalFormat
, GLsizei width
,
4593 GLsizei height
, GLsizei depth
, GLint border
,
4594 GLsizei imageSize
, const GLvoid
* data
)
4596 GET_CURRENT_CONTEXT(ctx
);
4597 if (target
== GL_PROXY_TEXTURE_3D
) {
4598 /* don't compile, execute immediately */
4599 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4600 width
, height
, depth
, border
,
4606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4607 /* make copy of image */
4608 image
= malloc(imageSize
);
4610 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4613 memcpy(image
, data
, imageSize
);
4614 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4618 n
[3].e
= internalFormat
;
4619 n
[4].i
= (GLint
) width
;
4620 n
[5].i
= (GLint
) height
;
4621 n
[6].i
= (GLint
) depth
;
4629 if (ctx
->ExecuteFlag
) {
4630 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4631 (target
, level
, internalFormat
, width
,
4632 height
, depth
, border
, imageSize
,
4639 static void GLAPIENTRY
4640 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4641 GLsizei width
, GLenum format
,
4642 GLsizei imageSize
, const GLvoid
* data
)
4647 GET_CURRENT_CONTEXT(ctx
);
4648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4650 /* make copy of image */
4651 image
= malloc(imageSize
);
4653 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4656 memcpy(image
, data
, imageSize
);
4657 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4662 n
[4].i
= (GLint
) width
;
4670 if (ctx
->ExecuteFlag
) {
4671 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4672 width
, format
, imageSize
,
4678 static void GLAPIENTRY
4679 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4680 GLint yoffset
, GLsizei width
, GLsizei height
,
4681 GLenum format
, GLsizei imageSize
,
4682 const GLvoid
* data
)
4687 GET_CURRENT_CONTEXT(ctx
);
4688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4690 /* make copy of image */
4691 image
= malloc(imageSize
);
4693 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4696 memcpy(image
, data
, imageSize
);
4697 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4703 n
[5].i
= (GLint
) width
;
4704 n
[6].i
= (GLint
) height
;
4712 if (ctx
->ExecuteFlag
) {
4713 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4714 (target
, level
, xoffset
, yoffset
, width
,
4715 height
, format
, imageSize
, data
));
4720 static void GLAPIENTRY
4721 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4722 GLint yoffset
, GLint zoffset
, GLsizei width
,
4723 GLsizei height
, GLsizei depth
, GLenum format
,
4724 GLsizei imageSize
, const GLvoid
* data
)
4729 GET_CURRENT_CONTEXT(ctx
);
4730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4732 /* make copy of image */
4733 image
= malloc(imageSize
);
4735 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4738 memcpy(image
, data
, imageSize
);
4739 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4746 n
[6].i
= (GLint
) width
;
4747 n
[7].i
= (GLint
) height
;
4748 n
[8].i
= (GLint
) depth
;
4750 n
[10].i
= imageSize
;
4756 if (ctx
->ExecuteFlag
) {
4757 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4758 (target
, level
, xoffset
, yoffset
,
4759 zoffset
, width
, height
, depth
, format
,
4765 /* GL_ARB_multisample */
4766 static void GLAPIENTRY
4767 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4769 GET_CURRENT_CONTEXT(ctx
);
4771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4772 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4777 if (ctx
->ExecuteFlag
) {
4778 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4784 * GL_NV_vertex_program
4786 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4787 static void GLAPIENTRY
4788 save_BindProgramNV(GLenum target
, GLuint id
)
4790 GET_CURRENT_CONTEXT(ctx
);
4792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4793 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4798 if (ctx
->ExecuteFlag
) {
4799 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4803 static void GLAPIENTRY
4804 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4805 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4807 GET_CURRENT_CONTEXT(ctx
);
4809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4810 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4819 if (ctx
->ExecuteFlag
) {
4820 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4825 static void GLAPIENTRY
4826 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4827 const GLfloat
*params
)
4829 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4830 params
[2], params
[3]);
4834 static void GLAPIENTRY
4835 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4836 const GLfloat
* params
)
4838 GET_CURRENT_CONTEXT(ctx
);
4840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4844 const GLfloat
* p
= params
;
4846 for (i
= 0 ; i
< count
; i
++) {
4847 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4860 if (ctx
->ExecuteFlag
) {
4861 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4866 static void GLAPIENTRY
4867 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4868 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4870 save_ProgramEnvParameter4fARB(target
, index
,
4872 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4876 static void GLAPIENTRY
4877 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4878 const GLdouble
*params
)
4880 save_ProgramEnvParameter4fARB(target
, index
,
4881 (GLfloat
) params
[0],
4882 (GLfloat
) params
[1],
4883 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4886 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4888 #if FEATURE_NV_vertex_program
4889 static void GLAPIENTRY
4890 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4892 GET_CURRENT_CONTEXT(ctx
);
4894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4895 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4904 if (ctx
->ExecuteFlag
) {
4905 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4910 static void GLAPIENTRY
4911 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4912 GLsizei num
, const GLdouble
*params
)
4915 for (i
= 0; i
< num
; i
++) {
4916 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4921 static void GLAPIENTRY
4922 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4923 GLsizei num
, const GLfloat
*params
)
4926 for (i
= 0; i
< num
; i
++) {
4927 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4932 static void GLAPIENTRY
4933 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4934 const GLubyte
* program
)
4936 GET_CURRENT_CONTEXT(ctx
);
4939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4941 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4943 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
4945 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4948 memcpy(programCopy
, program
, len
);
4952 n
[4].data
= programCopy
;
4954 if (ctx
->ExecuteFlag
) {
4955 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4960 static void GLAPIENTRY
4961 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4963 GET_CURRENT_CONTEXT(ctx
);
4966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4968 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4970 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
4972 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4975 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4979 if (ctx
->ExecuteFlag
) {
4980 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4985 static void GLAPIENTRY
4986 save_TrackMatrixNV(GLenum target
, GLuint address
,
4987 GLenum matrix
, GLenum transform
)
4989 GET_CURRENT_CONTEXT(ctx
);
4991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4992 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4999 if (ctx
->ExecuteFlag
) {
5000 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
5003 #endif /* FEATURE_NV_vertex_program */
5007 * GL_NV_fragment_program
5009 #if FEATURE_NV_fragment_program
5010 static void GLAPIENTRY
5011 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5012 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5014 GET_CURRENT_CONTEXT(ctx
);
5016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5017 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5026 if (ctx
->ExecuteFlag
) {
5027 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5032 static void GLAPIENTRY
5033 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5034 const GLfloat
*params
)
5036 GET_CURRENT_CONTEXT(ctx
);
5038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5039 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5048 if (ctx
->ExecuteFlag
) {
5049 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5054 static void GLAPIENTRY
5055 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5056 const GLfloat
*params
)
5058 GET_CURRENT_CONTEXT(ctx
);
5060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5064 const GLfloat
* p
= params
;
5066 for (i
= 0 ; i
< count
; i
++) {
5067 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5080 if (ctx
->ExecuteFlag
) {
5081 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5086 static void GLAPIENTRY
5087 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5088 GLdouble x
, GLdouble y
,
5089 GLdouble z
, GLdouble w
)
5091 GET_CURRENT_CONTEXT(ctx
);
5093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5094 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5098 n
[3].f
= (GLfloat
) x
;
5099 n
[4].f
= (GLfloat
) y
;
5100 n
[5].f
= (GLfloat
) z
;
5101 n
[6].f
= (GLfloat
) w
;
5103 if (ctx
->ExecuteFlag
) {
5104 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5109 static void GLAPIENTRY
5110 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5111 const GLdouble
*params
)
5113 GET_CURRENT_CONTEXT(ctx
);
5115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5116 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5120 n
[3].f
= (GLfloat
) params
[0];
5121 n
[4].f
= (GLfloat
) params
[1];
5122 n
[5].f
= (GLfloat
) params
[2];
5123 n
[6].f
= (GLfloat
) params
[3];
5125 if (ctx
->ExecuteFlag
) {
5126 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5130 static void GLAPIENTRY
5131 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5132 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5134 GET_CURRENT_CONTEXT(ctx
);
5137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5139 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5141 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
5143 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5146 memcpy(nameCopy
, name
, len
);
5149 n
[3].data
= nameCopy
;
5155 if (ctx
->ExecuteFlag
) {
5156 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5161 static void GLAPIENTRY
5162 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5165 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5169 static void GLAPIENTRY
5170 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5171 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5173 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5174 (GLfloat
) z
, (GLfloat
) w
);
5178 static void GLAPIENTRY
5179 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5182 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5183 (GLfloat
) v
[1], (GLfloat
) v
[2],
5187 #endif /* FEATURE_NV_fragment_program */
5191 /* GL_EXT_stencil_two_side */
5192 static void GLAPIENTRY
5193 save_ActiveStencilFaceEXT(GLenum face
)
5195 GET_CURRENT_CONTEXT(ctx
);
5197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5198 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5202 if (ctx
->ExecuteFlag
) {
5203 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5208 /* GL_EXT_depth_bounds_test */
5209 static void GLAPIENTRY
5210 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5212 GET_CURRENT_CONTEXT(ctx
);
5214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5215 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5217 n
[1].f
= (GLfloat
) zmin
;
5218 n
[2].f
= (GLfloat
) zmax
;
5220 if (ctx
->ExecuteFlag
) {
5221 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5227 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5229 static void GLAPIENTRY
5230 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5231 const GLvoid
* string
)
5233 GET_CURRENT_CONTEXT(ctx
);
5236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5238 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5240 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5242 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5245 memcpy(programCopy
, string
, len
);
5249 n
[4].data
= programCopy
;
5251 if (ctx
->ExecuteFlag
) {
5252 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5256 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5259 #if FEATURE_queryobj
5261 static void GLAPIENTRY
5262 save_BeginQueryARB(GLenum target
, GLuint id
)
5264 GET_CURRENT_CONTEXT(ctx
);
5266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5267 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5272 if (ctx
->ExecuteFlag
) {
5273 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5278 static void GLAPIENTRY
5279 save_EndQueryARB(GLenum target
)
5281 GET_CURRENT_CONTEXT(ctx
);
5283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5284 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5288 if (ctx
->ExecuteFlag
) {
5289 CALL_EndQueryARB(ctx
->Exec
, (target
));
5293 #endif /* FEATURE_queryobj */
5296 static void GLAPIENTRY
5297 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5299 GET_CURRENT_CONTEXT(ctx
);
5301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5302 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5306 if (count
> MAX_DRAW_BUFFERS
)
5307 count
= MAX_DRAW_BUFFERS
;
5308 for (i
= 0; i
< count
; i
++) {
5309 n
[2 + i
].e
= buffers
[i
];
5312 if (ctx
->ExecuteFlag
) {
5313 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5317 static void GLAPIENTRY
5318 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5320 GET_CURRENT_CONTEXT(ctx
);
5323 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5331 if (ctx
->ExecuteFlag
) {
5332 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5336 static void GLAPIENTRY
5337 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5340 p
[0] = INT_TO_FLOAT(param
[0]);
5341 p
[1] = INT_TO_FLOAT(param
[1]);
5342 p
[2] = INT_TO_FLOAT(param
[2]);
5343 p
[3] = INT_TO_FLOAT(param
[3]);
5344 save_TexBumpParameterfvATI(pname
, p
);
5347 #if FEATURE_ATI_fragment_shader
5348 static void GLAPIENTRY
5349 save_BindFragmentShaderATI(GLuint id
)
5351 GET_CURRENT_CONTEXT(ctx
);
5354 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5358 if (ctx
->ExecuteFlag
) {
5359 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5363 static void GLAPIENTRY
5364 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5366 GET_CURRENT_CONTEXT(ctx
);
5369 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5377 if (ctx
->ExecuteFlag
) {
5378 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5383 static void GLAPIENTRY
5384 save_Attr1fNV(GLenum attr
, GLfloat x
)
5386 GET_CURRENT_CONTEXT(ctx
);
5388 SAVE_FLUSH_VERTICES(ctx
);
5389 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5395 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5396 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5397 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5399 if (ctx
->ExecuteFlag
) {
5400 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5404 static void GLAPIENTRY
5405 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5407 GET_CURRENT_CONTEXT(ctx
);
5409 SAVE_FLUSH_VERTICES(ctx
);
5410 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5417 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5418 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5419 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5421 if (ctx
->ExecuteFlag
) {
5422 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5426 static void GLAPIENTRY
5427 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5429 GET_CURRENT_CONTEXT(ctx
);
5431 SAVE_FLUSH_VERTICES(ctx
);
5432 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5440 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5441 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5442 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5444 if (ctx
->ExecuteFlag
) {
5445 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5449 static void GLAPIENTRY
5450 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5452 GET_CURRENT_CONTEXT(ctx
);
5454 SAVE_FLUSH_VERTICES(ctx
);
5455 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5464 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5465 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5466 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5468 if (ctx
->ExecuteFlag
) {
5469 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5474 static void GLAPIENTRY
5475 save_Attr1fARB(GLenum attr
, GLfloat x
)
5477 GET_CURRENT_CONTEXT(ctx
);
5479 SAVE_FLUSH_VERTICES(ctx
);
5480 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5486 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5487 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5488 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5490 if (ctx
->ExecuteFlag
) {
5491 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5495 static void GLAPIENTRY
5496 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5498 GET_CURRENT_CONTEXT(ctx
);
5500 SAVE_FLUSH_VERTICES(ctx
);
5501 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5508 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5509 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5510 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5512 if (ctx
->ExecuteFlag
) {
5513 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5517 static void GLAPIENTRY
5518 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5520 GET_CURRENT_CONTEXT(ctx
);
5522 SAVE_FLUSH_VERTICES(ctx
);
5523 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5531 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5532 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5533 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5535 if (ctx
->ExecuteFlag
) {
5536 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5540 static void GLAPIENTRY
5541 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5543 GET_CURRENT_CONTEXT(ctx
);
5545 SAVE_FLUSH_VERTICES(ctx
);
5546 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5555 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5556 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5557 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5559 if (ctx
->ExecuteFlag
) {
5560 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5565 static void GLAPIENTRY
5566 save_EvalCoord1f(GLfloat x
)
5568 GET_CURRENT_CONTEXT(ctx
);
5570 SAVE_FLUSH_VERTICES(ctx
);
5571 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5575 if (ctx
->ExecuteFlag
) {
5576 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5580 static void GLAPIENTRY
5581 save_EvalCoord1fv(const GLfloat
* v
)
5583 save_EvalCoord1f(v
[0]);
5586 static void GLAPIENTRY
5587 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5589 GET_CURRENT_CONTEXT(ctx
);
5591 SAVE_FLUSH_VERTICES(ctx
);
5592 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5597 if (ctx
->ExecuteFlag
) {
5598 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5602 static void GLAPIENTRY
5603 save_EvalCoord2fv(const GLfloat
* v
)
5605 save_EvalCoord2f(v
[0], v
[1]);
5609 static void GLAPIENTRY
5610 save_EvalPoint1(GLint x
)
5612 GET_CURRENT_CONTEXT(ctx
);
5614 SAVE_FLUSH_VERTICES(ctx
);
5615 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5619 if (ctx
->ExecuteFlag
) {
5620 CALL_EvalPoint1(ctx
->Exec
, (x
));
5624 static void GLAPIENTRY
5625 save_EvalPoint2(GLint x
, GLint y
)
5627 GET_CURRENT_CONTEXT(ctx
);
5629 SAVE_FLUSH_VERTICES(ctx
);
5630 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5635 if (ctx
->ExecuteFlag
) {
5636 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5640 static void GLAPIENTRY
5641 save_Indexf(GLfloat x
)
5643 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5646 static void GLAPIENTRY
5647 save_Indexfv(const GLfloat
* v
)
5649 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5652 static void GLAPIENTRY
5653 save_EdgeFlag(GLboolean x
)
5655 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5658 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5662 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5666 static void GLAPIENTRY
5667 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5669 GET_CURRENT_CONTEXT(ctx
);
5677 case GL_FRONT_AND_BACK
:
5680 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5689 case GL_AMBIENT_AND_DIFFUSE
:
5695 case GL_COLOR_INDEXES
:
5699 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5703 if (ctx
->ExecuteFlag
) {
5704 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5707 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5709 /* Try to eliminate redundant statechanges. Because it is legal to
5710 * call glMaterial even inside begin/end calls, don't need to worry
5711 * about ctx->Driver.CurrentSavePrimitive here.
5713 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5714 if (bitmask
& (1 << i
)) {
5715 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5716 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5717 bitmask
&= ~(1 << i
);
5720 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5721 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5726 /* If this call has effect, return early:
5731 SAVE_FLUSH_VERTICES(ctx
);
5733 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5737 for (i
= 0; i
< args
; i
++)
5738 n
[3 + i
].f
= param
[i
];
5742 static void GLAPIENTRY
5743 save_Begin(GLenum mode
)
5745 GET_CURRENT_CONTEXT(ctx
);
5747 GLboolean error
= GL_FALSE
;
5749 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5750 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5753 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5754 /* Typically the first begin. This may raise an error on
5755 * playback, depending on whether CallList is issued from inside
5756 * a begin/end or not.
5758 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5760 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5761 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5764 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5769 /* Give the driver an opportunity to hook in an optimized
5770 * display list compiler.
5772 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5775 SAVE_FLUSH_VERTICES(ctx
);
5776 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5782 if (ctx
->ExecuteFlag
) {
5783 CALL_Begin(ctx
->Exec
, (mode
));
5787 static void GLAPIENTRY
5790 GET_CURRENT_CONTEXT(ctx
);
5791 SAVE_FLUSH_VERTICES(ctx
);
5792 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5793 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5794 if (ctx
->ExecuteFlag
) {
5795 CALL_End(ctx
->Exec
, ());
5799 static void GLAPIENTRY
5800 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5802 GET_CURRENT_CONTEXT(ctx
);
5804 SAVE_FLUSH_VERTICES(ctx
);
5805 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5812 if (ctx
->ExecuteFlag
) {
5813 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5818 static void GLAPIENTRY
5819 save_Vertex2f(GLfloat x
, GLfloat y
)
5821 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5824 static void GLAPIENTRY
5825 save_Vertex2fv(const GLfloat
* v
)
5827 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5830 static void GLAPIENTRY
5831 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5833 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5836 static void GLAPIENTRY
5837 save_Vertex3fv(const GLfloat
* v
)
5839 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5842 static void GLAPIENTRY
5843 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5845 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5848 static void GLAPIENTRY
5849 save_Vertex4fv(const GLfloat
* v
)
5851 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5854 static void GLAPIENTRY
5855 save_TexCoord1f(GLfloat x
)
5857 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5860 static void GLAPIENTRY
5861 save_TexCoord1fv(const GLfloat
* v
)
5863 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5866 static void GLAPIENTRY
5867 save_TexCoord2f(GLfloat x
, GLfloat y
)
5869 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5872 static void GLAPIENTRY
5873 save_TexCoord2fv(const GLfloat
* v
)
5875 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5878 static void GLAPIENTRY
5879 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5881 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5884 static void GLAPIENTRY
5885 save_TexCoord3fv(const GLfloat
* v
)
5887 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5890 static void GLAPIENTRY
5891 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5893 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5896 static void GLAPIENTRY
5897 save_TexCoord4fv(const GLfloat
* v
)
5899 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5902 static void GLAPIENTRY
5903 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5905 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5908 static void GLAPIENTRY
5909 save_Normal3fv(const GLfloat
* v
)
5911 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5914 static void GLAPIENTRY
5915 save_FogCoordfEXT(GLfloat x
)
5917 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5920 static void GLAPIENTRY
5921 save_FogCoordfvEXT(const GLfloat
* v
)
5923 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5926 static void GLAPIENTRY
5927 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5929 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5932 static void GLAPIENTRY
5933 save_Color3fv(const GLfloat
* v
)
5935 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5938 static void GLAPIENTRY
5939 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5941 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5944 static void GLAPIENTRY
5945 save_Color4fv(const GLfloat
* v
)
5947 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5950 static void GLAPIENTRY
5951 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5953 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5956 static void GLAPIENTRY
5957 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5959 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5963 /* Just call the respective ATTR for texcoord
5965 static void GLAPIENTRY
5966 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5968 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5969 save_Attr1fNV(attr
, x
);
5972 static void GLAPIENTRY
5973 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5975 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5976 save_Attr1fNV(attr
, v
[0]);
5979 static void GLAPIENTRY
5980 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5982 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5983 save_Attr2fNV(attr
, x
, y
);
5986 static void GLAPIENTRY
5987 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5989 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5990 save_Attr2fNV(attr
, v
[0], v
[1]);
5993 static void GLAPIENTRY
5994 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5996 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5997 save_Attr3fNV(attr
, x
, y
, z
);
6000 static void GLAPIENTRY
6001 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6003 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6004 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6007 static void GLAPIENTRY
6008 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6009 GLfloat z
, GLfloat w
)
6011 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6012 save_Attr4fNV(attr
, x
, y
, z
, w
);
6015 static void GLAPIENTRY
6016 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6018 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6019 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6024 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
6030 GET_CURRENT_CONTEXT(ctx
);
6031 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6035 /* First level for NV_vertex_program:
6037 * Check for errors at compile time?.
6039 static void GLAPIENTRY
6040 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
6042 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6043 save_Attr1fNV(index
, x
);
6048 static void GLAPIENTRY
6049 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
6051 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6052 save_Attr1fNV(index
, v
[0]);
6057 static void GLAPIENTRY
6058 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
6060 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6061 save_Attr2fNV(index
, x
, y
);
6066 static void GLAPIENTRY
6067 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
6069 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6070 save_Attr2fNV(index
, v
[0], v
[1]);
6075 static void GLAPIENTRY
6076 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6078 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6079 save_Attr3fNV(index
, x
, y
, z
);
6084 static void GLAPIENTRY
6085 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
6087 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6088 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
6093 static void GLAPIENTRY
6094 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
6095 GLfloat z
, GLfloat w
)
6097 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6098 save_Attr4fNV(index
, x
, y
, z
, w
);
6103 static void GLAPIENTRY
6104 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
6106 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
6107 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
6115 static void GLAPIENTRY
6116 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6118 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6119 save_Attr1fARB(index
, x
);
6124 static void GLAPIENTRY
6125 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6127 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6128 save_Attr1fARB(index
, v
[0]);
6133 static void GLAPIENTRY
6134 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6136 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6137 save_Attr2fARB(index
, x
, y
);
6142 static void GLAPIENTRY
6143 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6145 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6146 save_Attr2fARB(index
, v
[0], v
[1]);
6151 static void GLAPIENTRY
6152 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6154 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6155 save_Attr3fARB(index
, x
, y
, z
);
6160 static void GLAPIENTRY
6161 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6163 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6164 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6169 static void GLAPIENTRY
6170 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6173 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6174 save_Attr4fARB(index
, x
, y
, z
, w
);
6179 static void GLAPIENTRY
6180 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6182 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6183 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6189 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6191 static void GLAPIENTRY
6192 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6194 GET_CURRENT_CONTEXT(ctx
);
6195 FLUSH_VERTICES(ctx
, 0);
6196 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6199 static GLint GLAPIENTRY
6200 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6202 GET_CURRENT_CONTEXT(ctx
);
6203 FLUSH_VERTICES(ctx
, 0);
6204 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6207 static GLint GLAPIENTRY
6208 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6210 GET_CURRENT_CONTEXT(ctx
);
6211 FLUSH_VERTICES(ctx
, 0);
6212 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6214 /* XXX more shader functions needed here */
6217 #if FEATURE_EXT_framebuffer_blit
6218 static void GLAPIENTRY
6219 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6220 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6221 GLbitfield mask
, GLenum filter
)
6223 GET_CURRENT_CONTEXT(ctx
);
6225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6226 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6239 if (ctx
->ExecuteFlag
) {
6240 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6241 dstX0
, dstY0
, dstX1
, dstY1
,
6248 /** GL_EXT_provoking_vertex */
6249 static void GLAPIENTRY
6250 save_ProvokingVertexEXT(GLenum mode
)
6252 GET_CURRENT_CONTEXT(ctx
);
6254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6255 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6259 if (ctx
->ExecuteFlag
) {
6260 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6261 _mesa_ProvokingVertexEXT(mode
);
6266 /** GL_EXT_transform_feedback */
6267 static void GLAPIENTRY
6268 save_BeginTransformFeedback(GLenum mode
)
6270 GET_CURRENT_CONTEXT(ctx
);
6272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6273 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6277 if (ctx
->ExecuteFlag
) {
6278 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6283 /** GL_EXT_transform_feedback */
6284 static void GLAPIENTRY
6285 save_EndTransformFeedback(void)
6287 GET_CURRENT_CONTEXT(ctx
);
6288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6289 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6290 if (ctx
->ExecuteFlag
) {
6291 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6295 static void GLAPIENTRY
6296 save_TransformFeedbackVaryings(GLuint program
, GLsizei count
,
6297 const GLchar
**varyings
, GLenum bufferMode
)
6299 GET_CURRENT_CONTEXT(ctx
);
6301 "glTransformFeedbackVarying() display list support not done");
6304 static void GLAPIENTRY
6305 save_BindTransformFeedback(GLenum target
, GLuint name
)
6307 GET_CURRENT_CONTEXT(ctx
);
6309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6310 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6315 if (ctx
->ExecuteFlag
) {
6316 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6320 static void GLAPIENTRY
6321 save_PauseTransformFeedback(void)
6323 GET_CURRENT_CONTEXT(ctx
);
6324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6325 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6326 if (ctx
->ExecuteFlag
) {
6327 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6331 static void GLAPIENTRY
6332 save_ResumeTransformFeedback(void)
6334 GET_CURRENT_CONTEXT(ctx
);
6335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6336 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6337 if (ctx
->ExecuteFlag
) {
6338 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6342 static void GLAPIENTRY
6343 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6345 GET_CURRENT_CONTEXT(ctx
);
6347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6348 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6353 if (ctx
->ExecuteFlag
) {
6354 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6359 /* aka UseProgram() */
6360 static void GLAPIENTRY
6361 save_UseProgramObjectARB(GLhandleARB program
)
6363 GET_CURRENT_CONTEXT(ctx
);
6365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6366 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6370 if (ctx
->ExecuteFlag
) {
6371 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6376 static void GLAPIENTRY
6377 save_Uniform1fARB(GLint location
, GLfloat x
)
6379 GET_CURRENT_CONTEXT(ctx
);
6381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6382 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6387 if (ctx
->ExecuteFlag
) {
6388 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6393 static void GLAPIENTRY
6394 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6396 GET_CURRENT_CONTEXT(ctx
);
6398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6399 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6405 if (ctx
->ExecuteFlag
) {
6406 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6411 static void GLAPIENTRY
6412 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6414 GET_CURRENT_CONTEXT(ctx
);
6416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6417 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6424 if (ctx
->ExecuteFlag
) {
6425 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6430 static void GLAPIENTRY
6431 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6433 GET_CURRENT_CONTEXT(ctx
);
6435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6436 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6444 if (ctx
->ExecuteFlag
) {
6445 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6450 /** Return copy of memory */
6452 memdup(const void *src
, GLsizei bytes
)
6454 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6456 memcpy(b
, src
, bytes
);
6461 static void GLAPIENTRY
6462 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6464 GET_CURRENT_CONTEXT(ctx
);
6466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6467 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6471 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6473 if (ctx
->ExecuteFlag
) {
6474 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6478 static void GLAPIENTRY
6479 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6481 GET_CURRENT_CONTEXT(ctx
);
6483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6484 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6488 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6490 if (ctx
->ExecuteFlag
) {
6491 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6495 static void GLAPIENTRY
6496 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6498 GET_CURRENT_CONTEXT(ctx
);
6500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6501 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6505 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6507 if (ctx
->ExecuteFlag
) {
6508 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6512 static void GLAPIENTRY
6513 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6515 GET_CURRENT_CONTEXT(ctx
);
6517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6518 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6522 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6524 if (ctx
->ExecuteFlag
) {
6525 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6530 static void GLAPIENTRY
6531 save_Uniform1iARB(GLint location
, GLint x
)
6533 GET_CURRENT_CONTEXT(ctx
);
6535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6536 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6541 if (ctx
->ExecuteFlag
) {
6542 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6546 static void GLAPIENTRY
6547 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6549 GET_CURRENT_CONTEXT(ctx
);
6551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6552 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6558 if (ctx
->ExecuteFlag
) {
6559 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6563 static void GLAPIENTRY
6564 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6566 GET_CURRENT_CONTEXT(ctx
);
6568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6569 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6576 if (ctx
->ExecuteFlag
) {
6577 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6581 static void GLAPIENTRY
6582 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6584 GET_CURRENT_CONTEXT(ctx
);
6586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6587 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6595 if (ctx
->ExecuteFlag
) {
6596 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6602 static void GLAPIENTRY
6603 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6605 GET_CURRENT_CONTEXT(ctx
);
6607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6608 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6612 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6614 if (ctx
->ExecuteFlag
) {
6615 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6619 static void GLAPIENTRY
6620 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6622 GET_CURRENT_CONTEXT(ctx
);
6624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6625 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6629 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6631 if (ctx
->ExecuteFlag
) {
6632 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6636 static void GLAPIENTRY
6637 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6639 GET_CURRENT_CONTEXT(ctx
);
6641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6642 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6646 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6648 if (ctx
->ExecuteFlag
) {
6649 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6653 static void GLAPIENTRY
6654 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6656 GET_CURRENT_CONTEXT(ctx
);
6658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6659 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6663 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6665 if (ctx
->ExecuteFlag
) {
6666 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6672 static void GLAPIENTRY
6673 save_Uniform1ui(GLint location
, GLuint x
)
6675 GET_CURRENT_CONTEXT(ctx
);
6677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6678 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6683 if (ctx
->ExecuteFlag
) {
6684 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6688 static void GLAPIENTRY
6689 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6691 GET_CURRENT_CONTEXT(ctx
);
6693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6694 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6700 if (ctx
->ExecuteFlag
) {
6701 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6705 static void GLAPIENTRY
6706 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6708 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6718 if (ctx
->ExecuteFlag
) {
6719 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6723 static void GLAPIENTRY
6724 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6726 GET_CURRENT_CONTEXT(ctx
);
6728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6729 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6737 if (ctx
->ExecuteFlag
) {
6738 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6744 static void GLAPIENTRY
6745 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6747 GET_CURRENT_CONTEXT(ctx
);
6749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6750 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6754 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6756 if (ctx
->ExecuteFlag
) {
6757 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6761 static void GLAPIENTRY
6762 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6764 GET_CURRENT_CONTEXT(ctx
);
6766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6767 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6771 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6773 if (ctx
->ExecuteFlag
) {
6774 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6778 static void GLAPIENTRY
6779 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6781 GET_CURRENT_CONTEXT(ctx
);
6783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6784 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6788 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6790 if (ctx
->ExecuteFlag
) {
6791 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6795 static void GLAPIENTRY
6796 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6798 GET_CURRENT_CONTEXT(ctx
);
6800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6801 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6805 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6807 if (ctx
->ExecuteFlag
) {
6808 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6814 static void GLAPIENTRY
6815 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6818 GET_CURRENT_CONTEXT(ctx
);
6820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6821 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6826 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6828 if (ctx
->ExecuteFlag
) {
6829 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6833 static void GLAPIENTRY
6834 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6837 GET_CURRENT_CONTEXT(ctx
);
6839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6840 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6845 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6847 if (ctx
->ExecuteFlag
) {
6848 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6852 static void GLAPIENTRY
6853 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6856 GET_CURRENT_CONTEXT(ctx
);
6858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6859 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6864 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6866 if (ctx
->ExecuteFlag
) {
6867 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6872 static void GLAPIENTRY
6873 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6876 GET_CURRENT_CONTEXT(ctx
);
6878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6879 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6884 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6886 if (ctx
->ExecuteFlag
) {
6887 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6891 static void GLAPIENTRY
6892 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6895 GET_CURRENT_CONTEXT(ctx
);
6897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6898 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6903 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6905 if (ctx
->ExecuteFlag
) {
6906 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6911 static void GLAPIENTRY
6912 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6915 GET_CURRENT_CONTEXT(ctx
);
6917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6918 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6923 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6925 if (ctx
->ExecuteFlag
) {
6926 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6930 static void GLAPIENTRY
6931 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6934 GET_CURRENT_CONTEXT(ctx
);
6936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6937 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6942 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6944 if (ctx
->ExecuteFlag
) {
6945 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6950 static void GLAPIENTRY
6951 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6954 GET_CURRENT_CONTEXT(ctx
);
6956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6957 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6962 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6964 if (ctx
->ExecuteFlag
) {
6965 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6969 static void GLAPIENTRY
6970 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6973 GET_CURRENT_CONTEXT(ctx
);
6975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6976 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6981 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6983 if (ctx
->ExecuteFlag
) {
6984 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6988 static void GLAPIENTRY
6989 save_ClampColorARB(GLenum target
, GLenum clamp
)
6991 GET_CURRENT_CONTEXT(ctx
);
6993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6994 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
6999 if (ctx
->ExecuteFlag
) {
7000 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
7004 static void GLAPIENTRY
7005 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
7007 GET_CURRENT_CONTEXT(ctx
);
7009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7010 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
7015 if (ctx
->ExecuteFlag
) {
7016 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
7020 static void GLAPIENTRY
7021 save_ActiveProgramEXT(GLuint program
)
7023 GET_CURRENT_CONTEXT(ctx
);
7025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7026 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
7030 if (ctx
->ExecuteFlag
) {
7031 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
7035 /** GL_EXT_texture_integer */
7036 static void GLAPIENTRY
7037 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7039 GET_CURRENT_CONTEXT(ctx
);
7041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7042 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7049 if (ctx
->ExecuteFlag
) {
7050 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7054 /** GL_EXT_texture_integer */
7055 static void GLAPIENTRY
7056 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7058 GET_CURRENT_CONTEXT(ctx
);
7060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7061 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7068 if (ctx
->ExecuteFlag
) {
7069 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7073 /** GL_EXT_texture_integer */
7074 static void GLAPIENTRY
7075 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7077 GET_CURRENT_CONTEXT(ctx
);
7079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7080 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7089 if (ctx
->ExecuteFlag
) {
7090 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7094 /** GL_EXT_texture_integer */
7095 static void GLAPIENTRY
7096 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7098 GET_CURRENT_CONTEXT(ctx
);
7100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7101 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7105 n
[3].ui
= params
[0];
7106 n
[4].ui
= params
[1];
7107 n
[5].ui
= params
[2];
7108 n
[6].ui
= params
[3];
7110 if (ctx
->ExecuteFlag
) {
7111 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7115 /** GL_EXT_texture_integer */
7116 static void GLAPIENTRY
7117 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
7119 GET_CURRENT_CONTEXT(ctx
);
7120 FLUSH_VERTICES(ctx
, 0);
7121 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
7124 /** GL_EXT_texture_integer */
7125 static void GLAPIENTRY
7126 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7128 GET_CURRENT_CONTEXT(ctx
);
7129 FLUSH_VERTICES(ctx
, 0);
7130 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7134 /* GL_ARB_instanced_arrays */
7135 static void GLAPIENTRY
7136 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7138 GET_CURRENT_CONTEXT(ctx
);
7140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7141 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7146 if (ctx
->ExecuteFlag
) {
7147 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7152 /* GL_NV_texture_barrier */
7153 static void GLAPIENTRY
7154 save_TextureBarrierNV(void)
7156 GET_CURRENT_CONTEXT(ctx
);
7157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7158 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7159 if (ctx
->ExecuteFlag
) {
7160 CALL_TextureBarrierNV(ctx
->Exec
, ());
7165 /* GL_ARB_sampler_objects */
7166 static void GLAPIENTRY
7167 save_BindSampler(GLuint unit
, GLuint sampler
)
7170 GET_CURRENT_CONTEXT(ctx
);
7171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7172 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7177 if (ctx
->ExecuteFlag
) {
7178 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7182 static void GLAPIENTRY
7183 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7186 GET_CURRENT_CONTEXT(ctx
);
7187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7188 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7193 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7199 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7202 if (ctx
->ExecuteFlag
) {
7203 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7207 static void GLAPIENTRY
7208 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7210 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7213 static void GLAPIENTRY
7214 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7217 GET_CURRENT_CONTEXT(ctx
);
7218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7219 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7224 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7230 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7233 if (ctx
->ExecuteFlag
) {
7234 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7238 static void GLAPIENTRY
7239 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7241 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7244 static void GLAPIENTRY
7245 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7248 GET_CURRENT_CONTEXT(ctx
);
7249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7250 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7255 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7261 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7264 if (ctx
->ExecuteFlag
) {
7265 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7269 static void GLAPIENTRY
7270 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7275 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7279 n
[3].ui
= params
[0];
7280 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7281 n
[4].ui
= params
[1];
7282 n
[5].ui
= params
[2];
7283 n
[6].ui
= params
[3];
7286 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7289 if (ctx
->ExecuteFlag
) {
7290 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7294 /* GL_ARB_geometry_shader4 */
7295 static void GLAPIENTRY
7296 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7299 GET_CURRENT_CONTEXT(ctx
);
7300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7301 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7307 if (ctx
->ExecuteFlag
) {
7308 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7312 static void GLAPIENTRY
7313 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7314 GLuint texture
, GLint level
)
7317 GET_CURRENT_CONTEXT(ctx
);
7318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7319 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7322 n
[2].e
= attachment
;
7326 if (ctx
->ExecuteFlag
) {
7327 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7331 static void GLAPIENTRY
7332 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7333 GLuint texture
, GLint level
, GLenum face
)
7336 GET_CURRENT_CONTEXT(ctx
);
7337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7338 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7341 n
[2].e
= attachment
;
7346 if (ctx
->ExecuteFlag
) {
7347 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7354 static void GLAPIENTRY
7355 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7358 GET_CURRENT_CONTEXT(ctx
);
7359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7360 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7362 union uint64_pair p
;
7366 n
[3].ui
= p
.uint32
[0];
7367 n
[4].ui
= p
.uint32
[1];
7369 if (ctx
->ExecuteFlag
) {
7370 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7376 * Save an error-generating command into display list.
7378 * KW: Will appear in the list before the vertex buffer containing the
7379 * command that provoked the error. I don't see this as a problem.
7382 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7385 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7388 n
[2].data
= (void *) s
;
7394 * Compile an error into current display list.
7397 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7399 if (ctx
->CompileFlag
)
7400 save_error(ctx
, error
, s
);
7401 if (ctx
->ExecuteFlag
)
7402 _mesa_error(ctx
, error
, "%s", s
);
7407 * Test if ID names a display list.
7410 islist(struct gl_context
*ctx
, GLuint list
)
7412 if (list
> 0 && lookup_list(ctx
, list
)) {
7422 /**********************************************************************/
7423 /* Display list execution */
7424 /**********************************************************************/
7428 * Execute a display list. Note that the ListBase offset must have already
7429 * been added before calling this function. I.e. the list argument is
7430 * the absolute list number, not relative to ListBase.
7431 * \param list - display list number
7434 execute_list(struct gl_context
*ctx
, GLuint list
)
7436 struct gl_display_list
*dlist
;
7440 if (list
== 0 || !islist(ctx
, list
))
7443 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7444 /* raise an error? */
7448 dlist
= lookup_list(ctx
, list
);
7452 ctx
->ListState
.CallDepth
++;
7454 if (ctx
->Driver
.BeginCallList
)
7455 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7461 const OpCode opcode
= n
[0].opcode
;
7463 if (is_ext_opcode(opcode
)) {
7464 n
+= ext_opcode_execute(ctx
, n
);
7469 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7472 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7474 case OPCODE_ALPHA_FUNC
:
7475 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7477 case OPCODE_BIND_TEXTURE
:
7478 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7482 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7483 ctx
->Unpack
= ctx
->DefaultPacking
;
7484 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7485 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7486 (const GLubyte
*) n
[7].data
));
7487 ctx
->Unpack
= save
; /* restore */
7490 case OPCODE_BLEND_COLOR
:
7491 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7493 case OPCODE_BLEND_EQUATION
:
7494 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7496 case OPCODE_BLEND_EQUATION_SEPARATE
:
7497 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7499 case OPCODE_BLEND_FUNC_SEPARATE
:
7500 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7501 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7504 case OPCODE_BLEND_FUNC_I
:
7505 /* GL_ARB_draw_buffers_blend */
7506 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7508 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7509 /* GL_ARB_draw_buffers_blend */
7510 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7513 case OPCODE_BLEND_EQUATION_I
:
7514 /* GL_ARB_draw_buffers_blend */
7515 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7517 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7518 /* GL_ARB_draw_buffers_blend */
7519 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7520 (n
[1].ui
, n
[2].e
, n
[3].e
));
7523 case OPCODE_CALL_LIST
:
7524 /* Generated by glCallList(), don't add ListBase */
7525 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7526 execute_list(ctx
, n
[1].ui
);
7529 case OPCODE_CALL_LIST_OFFSET
:
7530 /* Generated by glCallLists() so we must add ListBase */
7532 /* user specified a bad data type at compile time */
7533 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7535 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7536 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7537 execute_list(ctx
, list
);
7541 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7543 case OPCODE_CLEAR_BUFFER_IV
:
7551 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
7555 case OPCODE_CLEAR_BUFFER_UIV
:
7563 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
7567 case OPCODE_CLEAR_BUFFER_FV
:
7575 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
7579 case OPCODE_CLEAR_BUFFER_FI
:
7580 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
7582 case OPCODE_CLEAR_COLOR
:
7583 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7585 case OPCODE_CLEAR_ACCUM
:
7586 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7588 case OPCODE_CLEAR_DEPTH
:
7589 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7591 case OPCODE_CLEAR_INDEX
:
7592 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7594 case OPCODE_CLEAR_STENCIL
:
7595 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7597 case OPCODE_CLIP_PLANE
:
7604 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7607 case OPCODE_COLOR_MASK
:
7608 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7610 case OPCODE_COLOR_MASK_INDEXED
:
7611 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7614 case OPCODE_COLOR_MATERIAL
:
7615 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7617 case OPCODE_COLOR_TABLE
:
7619 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7620 ctx
->Unpack
= ctx
->DefaultPacking
;
7621 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7622 n
[5].e
, n
[6].data
));
7623 ctx
->Unpack
= save
; /* restore */
7626 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7633 CALL_ColorTableParameterfv(ctx
->Exec
,
7634 (n
[1].e
, n
[2].e
, params
));
7637 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7644 CALL_ColorTableParameteriv(ctx
->Exec
,
7645 (n
[1].e
, n
[2].e
, params
));
7648 case OPCODE_COLOR_SUB_TABLE
:
7650 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7651 ctx
->Unpack
= ctx
->DefaultPacking
;
7652 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7653 n
[4].e
, n
[5].e
, n
[6].data
));
7654 ctx
->Unpack
= save
; /* restore */
7657 case OPCODE_CONVOLUTION_FILTER_1D
:
7659 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7660 ctx
->Unpack
= ctx
->DefaultPacking
;
7661 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7664 ctx
->Unpack
= save
; /* restore */
7667 case OPCODE_CONVOLUTION_FILTER_2D
:
7669 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7670 ctx
->Unpack
= ctx
->DefaultPacking
;
7671 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7672 n
[4].i
, n
[5].e
, n
[6].e
,
7674 ctx
->Unpack
= save
; /* restore */
7677 case OPCODE_CONVOLUTION_PARAMETER_I
:
7678 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7680 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7687 CALL_ConvolutionParameteriv(ctx
->Exec
,
7688 (n
[1].e
, n
[2].e
, params
));
7691 case OPCODE_CONVOLUTION_PARAMETER_F
:
7692 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7694 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7701 CALL_ConvolutionParameterfv(ctx
->Exec
,
7702 (n
[1].e
, n
[2].e
, params
));
7705 case OPCODE_COPY_COLOR_SUB_TABLE
:
7706 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7707 n
[3].i
, n
[4].i
, n
[5].i
));
7709 case OPCODE_COPY_COLOR_TABLE
:
7710 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7711 n
[3].i
, n
[4].i
, n
[5].i
));
7713 case OPCODE_COPY_PIXELS
:
7714 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7715 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7718 case OPCODE_COPY_TEX_IMAGE1D
:
7719 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7720 n
[5].i
, n
[6].i
, n
[7].i
));
7722 case OPCODE_COPY_TEX_IMAGE2D
:
7723 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7724 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7726 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7727 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7728 n
[4].i
, n
[5].i
, n
[6].i
));
7730 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7731 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7732 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7735 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7736 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7737 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7740 case OPCODE_CULL_FACE
:
7741 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7743 case OPCODE_DEPTH_FUNC
:
7744 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7746 case OPCODE_DEPTH_MASK
:
7747 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7749 case OPCODE_DEPTH_RANGE
:
7750 CALL_DepthRange(ctx
->Exec
,
7751 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7753 case OPCODE_DISABLE
:
7754 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7756 case OPCODE_DISABLE_INDEXED
:
7757 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7759 case OPCODE_DRAW_BUFFER
:
7760 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7762 case OPCODE_DRAW_PIXELS
:
7764 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7765 ctx
->Unpack
= ctx
->DefaultPacking
;
7766 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7768 ctx
->Unpack
= save
; /* restore */
7772 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7774 case OPCODE_ENABLE_INDEXED
:
7775 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7777 case OPCODE_EVALMESH1
:
7778 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7780 case OPCODE_EVALMESH2
:
7781 CALL_EvalMesh2(ctx
->Exec
,
7782 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7791 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7794 case OPCODE_FRONT_FACE
:
7795 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7797 case OPCODE_FRUSTUM
:
7798 CALL_Frustum(ctx
->Exec
,
7799 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7802 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7804 case OPCODE_HISTOGRAM
:
7805 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7807 case OPCODE_INDEX_MASK
:
7808 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7810 case OPCODE_INIT_NAMES
:
7811 CALL_InitNames(ctx
->Exec
, ());
7820 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7823 case OPCODE_LIGHT_MODEL
:
7830 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7833 case OPCODE_LINE_STIPPLE
:
7834 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7836 case OPCODE_LINE_WIDTH
:
7837 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7839 case OPCODE_LIST_BASE
:
7840 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7842 case OPCODE_LOAD_IDENTITY
:
7843 CALL_LoadIdentity(ctx
->Exec
, ());
7845 case OPCODE_LOAD_MATRIX
:
7846 if (sizeof(Node
) == sizeof(GLfloat
)) {
7847 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7852 for (i
= 0; i
< 16; i
++) {
7855 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7858 case OPCODE_LOAD_NAME
:
7859 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7861 case OPCODE_LOGIC_OP
:
7862 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7866 GLenum target
= n
[1].e
;
7867 GLint ustride
= _mesa_evaluator_components(target
);
7868 GLint uorder
= n
[5].i
;
7869 GLfloat u1
= n
[2].f
;
7870 GLfloat u2
= n
[3].f
;
7871 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7872 (GLfloat
*) n
[6].data
));
7877 GLenum target
= n
[1].e
;
7878 GLfloat u1
= n
[2].f
;
7879 GLfloat u2
= n
[3].f
;
7880 GLfloat v1
= n
[4].f
;
7881 GLfloat v2
= n
[5].f
;
7882 GLint ustride
= n
[6].i
;
7883 GLint vstride
= n
[7].i
;
7884 GLint uorder
= n
[8].i
;
7885 GLint vorder
= n
[9].i
;
7886 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7887 v1
, v2
, vstride
, vorder
,
7888 (GLfloat
*) n
[10].data
));
7891 case OPCODE_MAPGRID1
:
7892 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7894 case OPCODE_MAPGRID2
:
7895 CALL_MapGrid2f(ctx
->Exec
,
7896 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7898 case OPCODE_MATRIX_MODE
:
7899 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7901 case OPCODE_MIN_MAX
:
7902 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7904 case OPCODE_MULT_MATRIX
:
7905 if (sizeof(Node
) == sizeof(GLfloat
)) {
7906 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7911 for (i
= 0; i
< 16; i
++) {
7914 CALL_MultMatrixf(ctx
->Exec
, (m
));
7918 CALL_Ortho(ctx
->Exec
,
7919 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7921 case OPCODE_PASSTHROUGH
:
7922 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7924 case OPCODE_PIXEL_MAP
:
7925 CALL_PixelMapfv(ctx
->Exec
,
7926 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7928 case OPCODE_PIXEL_TRANSFER
:
7929 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7931 case OPCODE_PIXEL_ZOOM
:
7932 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7934 case OPCODE_POINT_SIZE
:
7935 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7937 case OPCODE_POINT_PARAMETERS
:
7943 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7946 case OPCODE_POLYGON_MODE
:
7947 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7949 case OPCODE_POLYGON_STIPPLE
:
7951 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7952 ctx
->Unpack
= ctx
->DefaultPacking
;
7953 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7954 ctx
->Unpack
= save
; /* restore */
7957 case OPCODE_POLYGON_OFFSET
:
7958 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7960 case OPCODE_POP_ATTRIB
:
7961 CALL_PopAttrib(ctx
->Exec
, ());
7963 case OPCODE_POP_MATRIX
:
7964 CALL_PopMatrix(ctx
->Exec
, ());
7966 case OPCODE_POP_NAME
:
7967 CALL_PopName(ctx
->Exec
, ());
7969 case OPCODE_PRIORITIZE_TEXTURE
:
7970 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7972 case OPCODE_PUSH_ATTRIB
:
7973 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7975 case OPCODE_PUSH_MATRIX
:
7976 CALL_PushMatrix(ctx
->Exec
, ());
7978 case OPCODE_PUSH_NAME
:
7979 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7981 case OPCODE_RASTER_POS
:
7982 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7984 case OPCODE_READ_BUFFER
:
7985 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7987 case OPCODE_RESET_HISTOGRAM
:
7988 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7990 case OPCODE_RESET_MIN_MAX
:
7991 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7994 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7997 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7999 case OPCODE_SCISSOR
:
8000 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8002 case OPCODE_SHADE_MODEL
:
8003 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8005 case OPCODE_PROVOKING_VERTEX
:
8006 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
8008 case OPCODE_STENCIL_FUNC
:
8009 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8011 case OPCODE_STENCIL_MASK
:
8012 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8014 case OPCODE_STENCIL_OP
:
8015 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8017 case OPCODE_STENCIL_FUNC_SEPARATE
:
8018 CALL_StencilFuncSeparate(ctx
->Exec
,
8019 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8021 case OPCODE_STENCIL_MASK_SEPARATE
:
8022 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8024 case OPCODE_STENCIL_OP_SEPARATE
:
8025 CALL_StencilOpSeparate(ctx
->Exec
,
8026 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8035 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8045 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8048 case OPCODE_TEXPARAMETER
:
8055 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8058 case OPCODE_TEX_IMAGE1D
:
8060 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8061 ctx
->Unpack
= ctx
->DefaultPacking
;
8062 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8064 n
[3].i
, /* components */
8066 n
[5].e
, /* border */
8067 n
[6].e
, /* format */
8070 ctx
->Unpack
= save
; /* restore */
8073 case OPCODE_TEX_IMAGE2D
:
8075 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8076 ctx
->Unpack
= ctx
->DefaultPacking
;
8077 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8079 n
[3].i
, /* components */
8081 n
[5].i
, /* height */
8082 n
[6].e
, /* border */
8083 n
[7].e
, /* format */
8086 ctx
->Unpack
= save
; /* restore */
8089 case OPCODE_TEX_IMAGE3D
:
8091 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8092 ctx
->Unpack
= ctx
->DefaultPacking
;
8093 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8095 n
[3].i
, /* components */
8097 n
[5].i
, /* height */
8099 n
[7].e
, /* border */
8100 n
[8].e
, /* format */
8103 ctx
->Unpack
= save
; /* restore */
8106 case OPCODE_TEX_SUB_IMAGE1D
:
8108 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8109 ctx
->Unpack
= ctx
->DefaultPacking
;
8110 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8112 n
[6].e
, n
[7].data
));
8113 ctx
->Unpack
= save
; /* restore */
8116 case OPCODE_TEX_SUB_IMAGE2D
:
8118 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8119 ctx
->Unpack
= ctx
->DefaultPacking
;
8120 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8122 n
[6].i
, n
[7].e
, n
[8].e
,
8124 ctx
->Unpack
= save
; /* restore */
8127 case OPCODE_TEX_SUB_IMAGE3D
:
8129 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8130 ctx
->Unpack
= ctx
->DefaultPacking
;
8131 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8132 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8133 n
[8].i
, n
[9].e
, n
[10].e
,
8135 ctx
->Unpack
= save
; /* restore */
8138 case OPCODE_TRANSLATE
:
8139 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8141 case OPCODE_VIEWPORT
:
8142 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8143 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8145 case OPCODE_WINDOW_POS
:
8146 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8148 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8149 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8151 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8152 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8153 n
[4].i
, n
[5].i
, n
[6].i
,
8156 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8157 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8158 n
[4].i
, n
[5].i
, n
[6].i
,
8159 n
[7].i
, n
[8].data
));
8161 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8162 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8163 n
[4].i
, n
[5].i
, n
[6].i
,
8167 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8168 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8169 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8170 n
[5].e
, n
[6].i
, n
[7].data
));
8172 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8173 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8174 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8175 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8178 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8179 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8180 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8181 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8182 n
[9].e
, n
[10].i
, n
[11].data
));
8184 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8185 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8187 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8188 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8190 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8191 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
8192 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8195 #if FEATURE_NV_vertex_program
8196 case OPCODE_EXECUTE_PROGRAM_NV
:
8203 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
8206 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
8207 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
8208 (GLuint
*) n
[2].data
));
8210 case OPCODE_LOAD_PROGRAM_NV
:
8211 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
8212 (const GLubyte
*) n
[4].data
));
8214 case OPCODE_TRACK_MATRIX_NV
:
8215 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
8219 #if FEATURE_NV_fragment_program
8220 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8221 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8222 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8225 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
8226 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8227 (const GLubyte
*) n
[3].
8228 data
, n
[4].f
, n
[5].f
,
8233 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8234 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8236 case OPCODE_DEPTH_BOUNDS_EXT
:
8237 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8239 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8240 case OPCODE_PROGRAM_STRING_ARB
:
8241 CALL_ProgramStringARB(ctx
->Exec
,
8242 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8245 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
8246 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8247 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8252 #if FEATURE_queryobj
8253 case OPCODE_BEGIN_QUERY_ARB
:
8254 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8256 case OPCODE_END_QUERY_ARB
:
8257 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8260 case OPCODE_DRAW_BUFFERS_ARB
:
8262 GLenum buffers
[MAX_DRAW_BUFFERS
];
8263 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8264 for (i
= 0; i
< count
; i
++)
8265 buffers
[i
] = n
[2 + i
].e
;
8266 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8269 #if FEATURE_EXT_framebuffer_blit
8270 case OPCODE_BLIT_FRAMEBUFFER
:
8271 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8272 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8277 case OPCODE_USE_PROGRAM
:
8278 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8280 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8281 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8283 case OPCODE_ACTIVE_PROGRAM_EXT
:
8284 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8286 case OPCODE_UNIFORM_1F
:
8287 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8289 case OPCODE_UNIFORM_2F
:
8290 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8292 case OPCODE_UNIFORM_3F
:
8293 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8295 case OPCODE_UNIFORM_4F
:
8296 CALL_Uniform4fARB(ctx
->Exec
,
8297 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8299 case OPCODE_UNIFORM_1FV
:
8300 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8302 case OPCODE_UNIFORM_2FV
:
8303 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8305 case OPCODE_UNIFORM_3FV
:
8306 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8308 case OPCODE_UNIFORM_4FV
:
8309 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8311 case OPCODE_UNIFORM_1I
:
8312 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8314 case OPCODE_UNIFORM_2I
:
8315 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8317 case OPCODE_UNIFORM_3I
:
8318 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8320 case OPCODE_UNIFORM_4I
:
8321 CALL_Uniform4iARB(ctx
->Exec
,
8322 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8324 case OPCODE_UNIFORM_1IV
:
8325 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8327 case OPCODE_UNIFORM_2IV
:
8328 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8330 case OPCODE_UNIFORM_3IV
:
8331 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8333 case OPCODE_UNIFORM_4IV
:
8334 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8336 case OPCODE_UNIFORM_1UI
:
8337 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8339 case OPCODE_UNIFORM_2UI
:
8340 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8342 case OPCODE_UNIFORM_3UI
:
8343 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8345 case OPCODE_UNIFORM_4UI
:
8346 /*CALL_Uniform4uiARB(ctx->Exec,
8347 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8350 case OPCODE_UNIFORM_1UIV
:
8351 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8353 case OPCODE_UNIFORM_2UIV
:
8354 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8356 case OPCODE_UNIFORM_3UIV
:
8357 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8359 case OPCODE_UNIFORM_4UIV
:
8360 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8362 case OPCODE_UNIFORM_MATRIX22
:
8363 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8364 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8366 case OPCODE_UNIFORM_MATRIX33
:
8367 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8368 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8370 case OPCODE_UNIFORM_MATRIX44
:
8371 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8372 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8374 case OPCODE_UNIFORM_MATRIX23
:
8375 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8376 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8378 case OPCODE_UNIFORM_MATRIX32
:
8379 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8380 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8382 case OPCODE_UNIFORM_MATRIX24
:
8383 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8384 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8386 case OPCODE_UNIFORM_MATRIX42
:
8387 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8388 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8390 case OPCODE_UNIFORM_MATRIX34
:
8391 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8392 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8394 case OPCODE_UNIFORM_MATRIX43
:
8395 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8396 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8399 case OPCODE_CLAMP_COLOR
:
8400 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8403 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8406 GLuint i
, pname
= n
[1].ui
;
8408 for (i
= 0; i
< 4; i
++)
8409 values
[i
] = n
[1 + i
].f
;
8410 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8413 #if FEATURE_ATI_fragment_shader
8414 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8415 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8417 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8420 GLuint i
, dst
= n
[1].ui
;
8422 for (i
= 0; i
< 4; i
++)
8423 values
[i
] = n
[1 + i
].f
;
8424 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8428 case OPCODE_ATTR_1F_NV
:
8429 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8431 case OPCODE_ATTR_2F_NV
:
8432 /* Really shouldn't have to do this - the Node structure
8433 * is convenient, but it would be better to store the data
8434 * packed appropriately so that it can be sent directly
8435 * on. With x86_64 becoming common, this will start to
8438 if (sizeof(Node
) == sizeof(GLfloat
))
8439 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8441 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8443 case OPCODE_ATTR_3F_NV
:
8444 if (sizeof(Node
) == sizeof(GLfloat
))
8445 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8447 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8450 case OPCODE_ATTR_4F_NV
:
8451 if (sizeof(Node
) == sizeof(GLfloat
))
8452 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8454 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8457 case OPCODE_ATTR_1F_ARB
:
8458 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8460 case OPCODE_ATTR_2F_ARB
:
8461 /* Really shouldn't have to do this - the Node structure
8462 * is convenient, but it would be better to store the data
8463 * packed appropriately so that it can be sent directly
8464 * on. With x86_64 becoming common, this will start to
8467 if (sizeof(Node
) == sizeof(GLfloat
))
8468 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8470 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8472 case OPCODE_ATTR_3F_ARB
:
8473 if (sizeof(Node
) == sizeof(GLfloat
))
8474 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8476 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8479 case OPCODE_ATTR_4F_ARB
:
8480 if (sizeof(Node
) == sizeof(GLfloat
))
8481 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8483 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8486 case OPCODE_MATERIAL
:
8487 if (sizeof(Node
) == sizeof(GLfloat
))
8488 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8495 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8499 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8502 CALL_End(ctx
->Exec
, ());
8505 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8507 case OPCODE_EVAL_C1
:
8508 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8510 case OPCODE_EVAL_C2
:
8511 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8513 case OPCODE_EVAL_P1
:
8514 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8516 case OPCODE_EVAL_P2
:
8517 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8520 /* GL_EXT_texture_integer */
8521 case OPCODE_CLEARCOLOR_I
:
8522 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8524 case OPCODE_CLEARCOLOR_UI
:
8525 CALL_ClearColorIuiEXT(ctx
->Exec
,
8526 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8528 case OPCODE_TEXPARAMETER_I
:
8535 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8538 case OPCODE_TEXPARAMETER_UI
:
8541 params
[0] = n
[3].ui
;
8542 params
[1] = n
[4].ui
;
8543 params
[2] = n
[5].ui
;
8544 params
[3] = n
[6].ui
;
8545 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8549 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8550 /* GL_ARB_instanced_arrays */
8551 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8554 case OPCODE_TEXTURE_BARRIER_NV
:
8555 CALL_TextureBarrierNV(ctx
->Exec
, ());
8558 /* GL_EXT/ARB_transform_feedback */
8559 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8560 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8562 case OPCODE_END_TRANSFORM_FEEDBACK
:
8563 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8565 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8566 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8568 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8569 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8571 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8572 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8574 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8575 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8579 case OPCODE_BIND_SAMPLER
:
8580 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8582 case OPCODE_SAMPLER_PARAMETERIV
:
8589 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8592 case OPCODE_SAMPLER_PARAMETERFV
:
8599 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8602 case OPCODE_SAMPLER_PARAMETERIIV
:
8609 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8612 case OPCODE_SAMPLER_PARAMETERUIV
:
8615 params
[0] = n
[3].ui
;
8616 params
[1] = n
[4].ui
;
8617 params
[2] = n
[5].ui
;
8618 params
[3] = n
[6].ui
;
8619 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8623 /* GL_ARB_geometry_shader4 */
8624 case OPCODE_PROGRAM_PARAMETERI
:
8625 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8627 case OPCODE_FRAMEBUFFER_TEXTURE
:
8628 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8631 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8632 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8633 n
[3].ui
, n
[4].i
, n
[5].e
));
8637 case OPCODE_WAIT_SYNC
:
8639 union uint64_pair p
;
8640 p
.uint32
[0] = n
[3].ui
;
8641 p
.uint32
[1] = n
[4].ui
;
8642 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8646 case OPCODE_CONTINUE
:
8647 n
= (Node
*) n
[1].next
;
8649 case OPCODE_END_OF_LIST
:
8655 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8657 _mesa_problem(ctx
, "%s", msg
);
8662 /* increment n to point to next compiled command */
8663 if (opcode
!= OPCODE_CONTINUE
) {
8664 n
+= InstSize
[opcode
];
8669 if (ctx
->Driver
.EndCallList
)
8670 ctx
->Driver
.EndCallList(ctx
);
8672 ctx
->ListState
.CallDepth
--;
8677 /**********************************************************************/
8679 /**********************************************************************/
8682 * Test if a display list number is valid.
8684 static GLboolean GLAPIENTRY
8685 _mesa_IsList(GLuint list
)
8687 GET_CURRENT_CONTEXT(ctx
);
8688 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8689 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8690 return islist(ctx
, list
);
8695 * Delete a sequence of consecutive display lists.
8697 static void GLAPIENTRY
8698 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8700 GET_CURRENT_CONTEXT(ctx
);
8702 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8703 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8706 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8709 for (i
= list
; i
< list
+ range
; i
++) {
8710 destroy_list(ctx
, i
);
8716 * Return a display list number, n, such that lists n through n+range-1
8719 static GLuint GLAPIENTRY
8720 _mesa_GenLists(GLsizei range
)
8722 GET_CURRENT_CONTEXT(ctx
);
8724 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8725 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8728 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8736 * Make this an atomic operation
8738 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8740 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8742 /* reserve the list IDs by with empty/dummy lists */
8744 for (i
= 0; i
< range
; i
++) {
8745 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8746 make_list(base
+ i
, 1));
8750 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8757 * Begin a new display list.
8759 static void GLAPIENTRY
8760 _mesa_NewList(GLuint name
, GLenum mode
)
8762 GET_CURRENT_CONTEXT(ctx
);
8764 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8765 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8767 if (MESA_VERBOSE
& VERBOSE_API
)
8768 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8769 _mesa_lookup_enum_by_nr(mode
));
8772 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8776 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8777 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8781 if (ctx
->ListState
.CurrentList
) {
8782 /* already compiling a display list */
8783 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8787 ctx
->CompileFlag
= GL_TRUE
;
8788 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8790 /* Reset acumulated list state:
8792 invalidate_saved_current_state( ctx
);
8794 /* Allocate new display list */
8795 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8796 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8797 ctx
->ListState
.CurrentPos
= 0;
8799 ctx
->Driver
.NewList(ctx
, name
, mode
);
8801 ctx
->CurrentDispatch
= ctx
->Save
;
8802 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8807 * End definition of current display list.
8809 static void GLAPIENTRY
8812 GET_CURRENT_CONTEXT(ctx
);
8813 SAVE_FLUSH_VERTICES(ctx
);
8814 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8816 if (MESA_VERBOSE
& VERBOSE_API
)
8817 _mesa_debug(ctx
, "glEndList\n");
8819 /* Check that a list is under construction */
8820 if (!ctx
->ListState
.CurrentList
) {
8821 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8825 /* Call before emitting END_OF_LIST, in case the driver wants to
8826 * emit opcodes itself.
8828 ctx
->Driver
.EndList(ctx
);
8830 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8832 /* Destroy old list, if any */
8833 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8835 /* Install the new list */
8836 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8837 ctx
->ListState
.CurrentList
->Name
,
8838 ctx
->ListState
.CurrentList
);
8841 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8842 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8844 ctx
->ListState
.CurrentList
= NULL
;
8845 ctx
->ExecuteFlag
= GL_TRUE
;
8846 ctx
->CompileFlag
= GL_FALSE
;
8848 ctx
->CurrentDispatch
= ctx
->Exec
;
8849 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8854 _mesa_CallList(GLuint list
)
8856 GLboolean save_compile_flag
;
8857 GET_CURRENT_CONTEXT(ctx
);
8858 FLUSH_CURRENT(ctx
, 0);
8860 if (MESA_VERBOSE
& VERBOSE_API
)
8861 _mesa_debug(ctx
, "glCallList %d\n", list
);
8864 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8869 mesa_print_display_list( list
);
8871 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
8872 * execute the display list, and restore the CompileFlag.
8874 save_compile_flag
= ctx
->CompileFlag
;
8875 if (save_compile_flag
) {
8876 ctx
->CompileFlag
= GL_FALSE
;
8879 execute_list(ctx
, list
);
8880 ctx
->CompileFlag
= save_compile_flag
;
8882 /* also restore API function pointers to point to "save" versions */
8883 if (save_compile_flag
) {
8884 ctx
->CurrentDispatch
= ctx
->Save
;
8885 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8891 * Execute glCallLists: call multiple display lists.
8894 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
8896 GET_CURRENT_CONTEXT(ctx
);
8898 GLboolean save_compile_flag
;
8900 if (MESA_VERBOSE
& VERBOSE_API
)
8901 _mesa_debug(ctx
, "glCallLists %d\n", n
);
8905 case GL_UNSIGNED_BYTE
:
8907 case GL_UNSIGNED_SHORT
:
8909 case GL_UNSIGNED_INT
:
8917 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
8921 /* Save the CompileFlag status, turn it off, execute display list,
8922 * and restore the CompileFlag.
8924 save_compile_flag
= ctx
->CompileFlag
;
8925 ctx
->CompileFlag
= GL_FALSE
;
8927 for (i
= 0; i
< n
; i
++) {
8928 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
8929 execute_list(ctx
, list
);
8932 ctx
->CompileFlag
= save_compile_flag
;
8934 /* also restore API function pointers to point to "save" versions */
8935 if (save_compile_flag
) {
8936 ctx
->CurrentDispatch
= ctx
->Save
;
8937 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8943 * Set the offset added to list numbers in glCallLists.
8945 static void GLAPIENTRY
8946 _mesa_ListBase(GLuint base
)
8948 GET_CURRENT_CONTEXT(ctx
);
8949 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8950 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8951 ctx
->List
.ListBase
= base
;
8955 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8957 static void GLAPIENTRY
8960 GET_CURRENT_CONTEXT(ctx
);
8961 FLUSH_VERTICES(ctx
, 0);
8962 CALL_Finish(ctx
->Exec
, ());
8965 static void GLAPIENTRY
8968 GET_CURRENT_CONTEXT(ctx
);
8969 FLUSH_VERTICES(ctx
, 0);
8970 CALL_Flush(ctx
->Exec
, ());
8973 static void GLAPIENTRY
8974 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8976 GET_CURRENT_CONTEXT(ctx
);
8977 FLUSH_VERTICES(ctx
, 0);
8978 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8981 static void GLAPIENTRY
8982 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8984 GET_CURRENT_CONTEXT(ctx
);
8985 FLUSH_VERTICES(ctx
, 0);
8986 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8989 static void GLAPIENTRY
8990 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8992 GET_CURRENT_CONTEXT(ctx
);
8993 FLUSH_VERTICES(ctx
, 0);
8994 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8997 static GLenum GLAPIENTRY
9000 GET_CURRENT_CONTEXT(ctx
);
9001 FLUSH_VERTICES(ctx
, 0);
9002 return CALL_GetError(ctx
->Exec
, ());
9005 static void GLAPIENTRY
9006 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
9008 GET_CURRENT_CONTEXT(ctx
);
9009 FLUSH_VERTICES(ctx
, 0);
9010 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
9013 static void GLAPIENTRY
9014 exec_GetIntegerv(GLenum pname
, GLint
*params
)
9016 GET_CURRENT_CONTEXT(ctx
);
9017 FLUSH_VERTICES(ctx
, 0);
9018 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
9021 static void GLAPIENTRY
9022 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
9024 GET_CURRENT_CONTEXT(ctx
);
9025 FLUSH_VERTICES(ctx
, 0);
9026 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
9029 static void GLAPIENTRY
9030 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
9032 GET_CURRENT_CONTEXT(ctx
);
9033 FLUSH_VERTICES(ctx
, 0);
9034 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
9037 static void GLAPIENTRY
9038 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
9040 GET_CURRENT_CONTEXT(ctx
);
9041 FLUSH_VERTICES(ctx
, 0);
9042 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
9045 static void GLAPIENTRY
9046 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
9048 GET_CURRENT_CONTEXT(ctx
);
9049 FLUSH_VERTICES(ctx
, 0);
9050 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
9053 static void GLAPIENTRY
9054 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
9056 GET_CURRENT_CONTEXT(ctx
);
9057 FLUSH_VERTICES(ctx
, 0);
9058 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
9061 static void GLAPIENTRY
9062 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
9064 GET_CURRENT_CONTEXT(ctx
);
9065 FLUSH_VERTICES(ctx
, 0);
9066 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
9069 static void GLAPIENTRY
9070 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
9072 GET_CURRENT_CONTEXT(ctx
);
9073 FLUSH_VERTICES(ctx
, 0);
9074 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
9077 static void GLAPIENTRY
9078 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
9080 GET_CURRENT_CONTEXT(ctx
);
9081 FLUSH_VERTICES(ctx
, 0);
9082 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
9085 static void GLAPIENTRY
9086 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
9088 GET_CURRENT_CONTEXT(ctx
);
9089 FLUSH_VERTICES(ctx
, 0);
9090 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
9093 static void GLAPIENTRY
9094 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
9096 GET_CURRENT_CONTEXT(ctx
);
9097 FLUSH_VERTICES(ctx
, 0);
9098 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9101 static void GLAPIENTRY
9102 exec_GetPolygonStipple(GLubyte
* dest
)
9104 GET_CURRENT_CONTEXT(ctx
);
9105 FLUSH_VERTICES(ctx
, 0);
9106 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9109 static const GLubyte
*GLAPIENTRY
9110 exec_GetString(GLenum name
)
9112 GET_CURRENT_CONTEXT(ctx
);
9113 FLUSH_VERTICES(ctx
, 0);
9114 return CALL_GetString(ctx
->Exec
, (name
));
9117 static void GLAPIENTRY
9118 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9120 GET_CURRENT_CONTEXT(ctx
);
9121 FLUSH_VERTICES(ctx
, 0);
9122 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9125 static void GLAPIENTRY
9126 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9128 GET_CURRENT_CONTEXT(ctx
);
9129 FLUSH_VERTICES(ctx
, 0);
9130 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9133 static void GLAPIENTRY
9134 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9136 GET_CURRENT_CONTEXT(ctx
);
9137 FLUSH_VERTICES(ctx
, 0);
9138 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9141 static void GLAPIENTRY
9142 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9144 GET_CURRENT_CONTEXT(ctx
);
9145 FLUSH_VERTICES(ctx
, 0);
9146 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9149 static void GLAPIENTRY
9150 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9152 GET_CURRENT_CONTEXT(ctx
);
9153 FLUSH_VERTICES(ctx
, 0);
9154 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9157 static void GLAPIENTRY
9158 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9159 GLenum type
, GLvoid
* pixels
)
9161 GET_CURRENT_CONTEXT(ctx
);
9162 FLUSH_VERTICES(ctx
, 0);
9163 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9166 static void GLAPIENTRY
9167 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9168 GLenum pname
, GLfloat
*params
)
9170 GET_CURRENT_CONTEXT(ctx
);
9171 FLUSH_VERTICES(ctx
, 0);
9172 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9175 static void GLAPIENTRY
9176 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9177 GLenum pname
, GLint
*params
)
9179 GET_CURRENT_CONTEXT(ctx
);
9180 FLUSH_VERTICES(ctx
, 0);
9181 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9184 static void GLAPIENTRY
9185 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9187 GET_CURRENT_CONTEXT(ctx
);
9188 FLUSH_VERTICES(ctx
, 0);
9189 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9192 static void GLAPIENTRY
9193 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9195 GET_CURRENT_CONTEXT(ctx
);
9196 FLUSH_VERTICES(ctx
, 0);
9197 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9200 static GLboolean GLAPIENTRY
9201 exec_IsEnabled(GLenum cap
)
9203 GET_CURRENT_CONTEXT(ctx
);
9204 FLUSH_VERTICES(ctx
, 0);
9205 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9208 static void GLAPIENTRY
9209 exec_PixelStoref(GLenum pname
, GLfloat param
)
9211 GET_CURRENT_CONTEXT(ctx
);
9212 FLUSH_VERTICES(ctx
, 0);
9213 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9216 static void GLAPIENTRY
9217 exec_PixelStorei(GLenum pname
, GLint param
)
9219 GET_CURRENT_CONTEXT(ctx
);
9220 FLUSH_VERTICES(ctx
, 0);
9221 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9224 static void GLAPIENTRY
9225 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9226 GLenum format
, GLenum type
, GLvoid
* pixels
)
9228 GET_CURRENT_CONTEXT(ctx
);
9229 FLUSH_VERTICES(ctx
, 0);
9230 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9233 static GLint GLAPIENTRY
9234 exec_RenderMode(GLenum mode
)
9236 GET_CURRENT_CONTEXT(ctx
);
9237 FLUSH_VERTICES(ctx
, 0);
9238 return CALL_RenderMode(ctx
->Exec
, (mode
));
9241 static void GLAPIENTRY
9242 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9244 GET_CURRENT_CONTEXT(ctx
);
9245 FLUSH_VERTICES(ctx
, 0);
9246 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9249 static void GLAPIENTRY
9250 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9252 GET_CURRENT_CONTEXT(ctx
);
9253 FLUSH_VERTICES(ctx
, 0);
9254 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9257 static GLboolean GLAPIENTRY
9258 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9259 GLboolean
* residences
)
9261 GET_CURRENT_CONTEXT(ctx
);
9262 FLUSH_VERTICES(ctx
, 0);
9263 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9266 static void GLAPIENTRY
9267 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9269 GET_CURRENT_CONTEXT(ctx
);
9270 FLUSH_VERTICES(ctx
, 0);
9271 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9274 static void GLAPIENTRY
9275 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9277 GET_CURRENT_CONTEXT(ctx
);
9278 FLUSH_VERTICES(ctx
, 0);
9279 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9282 static void GLAPIENTRY
9283 exec_DisableClientState(GLenum cap
)
9285 GET_CURRENT_CONTEXT(ctx
);
9286 FLUSH_VERTICES(ctx
, 0);
9287 CALL_DisableClientState(ctx
->Exec
, (cap
));
9290 static void GLAPIENTRY
9291 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9293 GET_CURRENT_CONTEXT(ctx
);
9294 FLUSH_VERTICES(ctx
, 0);
9295 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9298 static void GLAPIENTRY
9299 exec_EnableClientState(GLenum cap
)
9301 GET_CURRENT_CONTEXT(ctx
);
9302 FLUSH_VERTICES(ctx
, 0);
9303 CALL_EnableClientState(ctx
->Exec
, (cap
));
9306 static void GLAPIENTRY
9307 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9309 GET_CURRENT_CONTEXT(ctx
);
9310 FLUSH_VERTICES(ctx
, 0);
9311 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9314 static void GLAPIENTRY
9315 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9317 GET_CURRENT_CONTEXT(ctx
);
9318 FLUSH_VERTICES(ctx
, 0);
9319 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9322 static void GLAPIENTRY
9323 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9325 GET_CURRENT_CONTEXT(ctx
);
9326 FLUSH_VERTICES(ctx
, 0);
9327 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9330 static void GLAPIENTRY
9331 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9333 GET_CURRENT_CONTEXT(ctx
);
9334 FLUSH_VERTICES(ctx
, 0);
9335 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9338 static GLboolean GLAPIENTRY
9339 exec_IsTexture(GLuint texture
)
9341 GET_CURRENT_CONTEXT(ctx
);
9342 FLUSH_VERTICES(ctx
, 0);
9343 return CALL_IsTexture(ctx
->Exec
, (texture
));
9346 static void GLAPIENTRY
9347 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9349 GET_CURRENT_CONTEXT(ctx
);
9350 FLUSH_VERTICES(ctx
, 0);
9351 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9354 static void GLAPIENTRY
9355 exec_PopClientAttrib(void)
9357 GET_CURRENT_CONTEXT(ctx
);
9358 FLUSH_VERTICES(ctx
, 0);
9359 CALL_PopClientAttrib(ctx
->Exec
, ());
9362 static void GLAPIENTRY
9363 exec_PushClientAttrib(GLbitfield mask
)
9365 GET_CURRENT_CONTEXT(ctx
);
9366 FLUSH_VERTICES(ctx
, 0);
9367 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9370 static void GLAPIENTRY
9371 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9374 GET_CURRENT_CONTEXT(ctx
);
9375 FLUSH_VERTICES(ctx
, 0);
9376 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9379 static void GLAPIENTRY
9380 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9382 GET_CURRENT_CONTEXT(ctx
);
9383 FLUSH_VERTICES(ctx
, 0);
9384 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9387 static void GLAPIENTRY
9388 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9391 GET_CURRENT_CONTEXT(ctx
);
9392 FLUSH_VERTICES(ctx
, 0);
9393 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9396 static void GLAPIENTRY
9397 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9398 GLint x
, GLint y
, GLsizei width
)
9400 GET_CURRENT_CONTEXT(ctx
);
9401 FLUSH_VERTICES(ctx
, 0);
9402 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9403 (target
, internalFormat
, x
, y
, width
));
9406 static void GLAPIENTRY
9407 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9408 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9410 GET_CURRENT_CONTEXT(ctx
);
9411 FLUSH_VERTICES(ctx
, 0);
9412 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9413 (target
, internalFormat
, x
, y
, width
,
9417 static void GLAPIENTRY
9418 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9420 GET_CURRENT_CONTEXT(ctx
);
9421 FLUSH_VERTICES(ctx
, 0);
9422 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9425 static void GLAPIENTRY
9426 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9428 GET_CURRENT_CONTEXT(ctx
);
9429 FLUSH_VERTICES(ctx
, 0);
9430 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9433 static void GLAPIENTRY
9434 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9436 GET_CURRENT_CONTEXT(ctx
);
9437 FLUSH_VERTICES(ctx
, 0);
9438 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9441 static void GLAPIENTRY
9442 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9445 GET_CURRENT_CONTEXT(ctx
);
9446 FLUSH_VERTICES(ctx
, 0);
9447 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9450 static void GLAPIENTRY
9451 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9453 GET_CURRENT_CONTEXT(ctx
);
9454 FLUSH_VERTICES(ctx
, 0);
9455 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9458 static void GLAPIENTRY
9459 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9461 GET_CURRENT_CONTEXT(ctx
);
9462 FLUSH_VERTICES(ctx
, 0);
9463 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9466 static void GLAPIENTRY
9467 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9468 GLenum type
, GLvoid
*values
)
9470 GET_CURRENT_CONTEXT(ctx
);
9471 FLUSH_VERTICES(ctx
, 0);
9472 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9475 static void GLAPIENTRY
9476 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9478 GET_CURRENT_CONTEXT(ctx
);
9479 FLUSH_VERTICES(ctx
, 0);
9480 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9483 static void GLAPIENTRY
9484 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9486 GET_CURRENT_CONTEXT(ctx
);
9487 FLUSH_VERTICES(ctx
, 0);
9488 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9491 static void GLAPIENTRY
9492 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9493 GLenum type
, GLvoid
*values
)
9495 GET_CURRENT_CONTEXT(ctx
);
9496 FLUSH_VERTICES(ctx
, 0);
9497 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9500 static void GLAPIENTRY
9501 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9503 GET_CURRENT_CONTEXT(ctx
);
9504 FLUSH_VERTICES(ctx
, 0);
9505 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9508 static void GLAPIENTRY
9509 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9511 GET_CURRENT_CONTEXT(ctx
);
9512 FLUSH_VERTICES(ctx
, 0);
9513 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9516 static void GLAPIENTRY
9517 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9518 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9520 GET_CURRENT_CONTEXT(ctx
);
9521 FLUSH_VERTICES(ctx
, 0);
9522 CALL_GetSeparableFilter(ctx
->Exec
,
9523 (target
, format
, type
, row
, column
, span
));
9526 static void GLAPIENTRY
9527 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9528 GLsizei width
, GLsizei height
, GLenum format
,
9529 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9531 GET_CURRENT_CONTEXT(ctx
);
9532 FLUSH_VERTICES(ctx
, 0);
9533 CALL_SeparableFilter2D(ctx
->Exec
,
9534 (target
, internalFormat
, width
, height
, format
,
9535 type
, row
, column
));
9538 static void GLAPIENTRY
9539 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9540 GLsizei count
, const GLvoid
*ptr
)
9542 GET_CURRENT_CONTEXT(ctx
);
9543 FLUSH_VERTICES(ctx
, 0);
9544 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9547 static void GLAPIENTRY
9548 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9550 GET_CURRENT_CONTEXT(ctx
);
9551 FLUSH_VERTICES(ctx
, 0);
9552 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9555 static void GLAPIENTRY
9556 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9559 GET_CURRENT_CONTEXT(ctx
);
9560 FLUSH_VERTICES(ctx
, 0);
9561 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9564 static void GLAPIENTRY
9565 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9568 GET_CURRENT_CONTEXT(ctx
);
9569 FLUSH_VERTICES(ctx
, 0);
9570 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9573 static void GLAPIENTRY
9574 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9575 GLsizei count
, const GLvoid
*ptr
)
9577 GET_CURRENT_CONTEXT(ctx
);
9578 FLUSH_VERTICES(ctx
, 0);
9579 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9582 static void GLAPIENTRY
9583 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9584 GLsizei count
, const GLvoid
*ptr
)
9586 GET_CURRENT_CONTEXT(ctx
);
9587 FLUSH_VERTICES(ctx
, 0);
9588 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9591 static void GLAPIENTRY
9592 exec_LockArraysEXT(GLint first
, GLsizei count
)
9594 GET_CURRENT_CONTEXT(ctx
);
9595 FLUSH_VERTICES(ctx
, 0);
9596 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9599 static void GLAPIENTRY
9600 exec_UnlockArraysEXT(void)
9602 GET_CURRENT_CONTEXT(ctx
);
9603 FLUSH_VERTICES(ctx
, 0);
9604 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9607 static void GLAPIENTRY
9608 exec_ClientActiveTextureARB(GLenum target
)
9610 GET_CURRENT_CONTEXT(ctx
);
9611 FLUSH_VERTICES(ctx
, 0);
9612 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9615 static void GLAPIENTRY
9616 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9617 GLsizei stride
, const GLvoid
*ptr
)
9619 GET_CURRENT_CONTEXT(ctx
);
9620 FLUSH_VERTICES(ctx
, 0);
9621 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9624 static void GLAPIENTRY
9625 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9627 GET_CURRENT_CONTEXT(ctx
);
9628 FLUSH_VERTICES(ctx
, 0);
9629 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9632 /* GL_EXT_multi_draw_arrays */
9633 static void GLAPIENTRY
9634 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9635 const GLsizei
*count
, GLsizei primcount
)
9637 GET_CURRENT_CONTEXT(ctx
);
9638 FLUSH_VERTICES(ctx
, 0);
9639 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9642 /* GL_IBM_multimode_draw_arrays */
9643 static void GLAPIENTRY
9644 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9645 const GLsizei
* count
, GLsizei primcount
,
9648 GET_CURRENT_CONTEXT(ctx
);
9649 FLUSH_VERTICES(ctx
, 0);
9650 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9651 (mode
, first
, count
, primcount
, modestride
));
9654 /* GL_IBM_multimode_draw_arrays */
9655 static void GLAPIENTRY
9656 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9657 const GLsizei
* count
,
9659 const GLvoid
* const *indices
,
9660 GLsizei primcount
, GLint modestride
)
9662 GET_CURRENT_CONTEXT(ctx
);
9663 FLUSH_VERTICES(ctx
, 0);
9664 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9665 (mode
, count
, type
, indices
, primcount
,
9672 * Setup the given dispatch table to point to Mesa's display list
9673 * building functions.
9675 * This does not include any of the tnl functions - they are
9676 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9679 struct _glapi_table
*
9680 _mesa_create_save_table(void)
9682 struct _glapi_table
*table
;
9684 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9688 _mesa_loopback_init_api_table(table
);
9691 SET_Accum(table
, save_Accum
);
9692 SET_AlphaFunc(table
, save_AlphaFunc
);
9693 SET_Bitmap(table
, save_Bitmap
);
9694 SET_BlendFunc(table
, save_BlendFunc
);
9695 SET_CallList(table
, save_CallList
);
9696 SET_CallLists(table
, save_CallLists
);
9697 SET_Clear(table
, save_Clear
);
9698 SET_ClearAccum(table
, save_ClearAccum
);
9699 SET_ClearColor(table
, save_ClearColor
);
9700 SET_ClearDepth(table
, save_ClearDepth
);
9701 SET_ClearIndex(table
, save_ClearIndex
);
9702 SET_ClearStencil(table
, save_ClearStencil
);
9703 SET_ClipPlane(table
, save_ClipPlane
);
9704 SET_ColorMask(table
, save_ColorMask
);
9705 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9706 SET_ColorMaterial(table
, save_ColorMaterial
);
9707 SET_CopyPixels(table
, save_CopyPixels
);
9708 SET_CullFace(table
, save_CullFace
);
9709 SET_DeleteLists(table
, _mesa_DeleteLists
);
9710 SET_DepthFunc(table
, save_DepthFunc
);
9711 SET_DepthMask(table
, save_DepthMask
);
9712 SET_DepthRange(table
, save_DepthRange
);
9713 SET_Disable(table
, save_Disable
);
9714 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9715 SET_DrawBuffer(table
, save_DrawBuffer
);
9716 SET_DrawPixels(table
, save_DrawPixels
);
9717 SET_Enable(table
, save_Enable
);
9718 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9719 SET_EndList(table
, _mesa_EndList
);
9720 SET_EvalMesh1(table
, save_EvalMesh1
);
9721 SET_EvalMesh2(table
, save_EvalMesh2
);
9722 SET_Finish(table
, exec_Finish
);
9723 SET_Flush(table
, exec_Flush
);
9724 SET_Fogf(table
, save_Fogf
);
9725 SET_Fogfv(table
, save_Fogfv
);
9726 SET_Fogi(table
, save_Fogi
);
9727 SET_Fogiv(table
, save_Fogiv
);
9728 SET_FrontFace(table
, save_FrontFace
);
9729 SET_Frustum(table
, save_Frustum
);
9730 SET_GenLists(table
, _mesa_GenLists
);
9731 SET_GetBooleanv(table
, exec_GetBooleanv
);
9732 SET_GetClipPlane(table
, exec_GetClipPlane
);
9733 SET_GetDoublev(table
, exec_GetDoublev
);
9734 SET_GetError(table
, exec_GetError
);
9735 SET_GetFloatv(table
, exec_GetFloatv
);
9736 SET_GetIntegerv(table
, exec_GetIntegerv
);
9737 SET_GetLightfv(table
, exec_GetLightfv
);
9738 SET_GetLightiv(table
, exec_GetLightiv
);
9739 SET_GetMapdv(table
, exec_GetMapdv
);
9740 SET_GetMapfv(table
, exec_GetMapfv
);
9741 SET_GetMapiv(table
, exec_GetMapiv
);
9742 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9743 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9744 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9745 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9746 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9747 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9748 SET_GetString(table
, exec_GetString
);
9749 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9750 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9751 SET_GetTexGendv(table
, exec_GetTexGendv
);
9752 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9753 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9754 SET_GetTexImage(table
, exec_GetTexImage
);
9755 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9756 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9757 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9758 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9759 SET_Hint(table
, save_Hint
);
9760 SET_IndexMask(table
, save_IndexMask
);
9761 SET_InitNames(table
, save_InitNames
);
9762 SET_IsEnabled(table
, exec_IsEnabled
);
9763 SET_IsList(table
, _mesa_IsList
);
9764 SET_LightModelf(table
, save_LightModelf
);
9765 SET_LightModelfv(table
, save_LightModelfv
);
9766 SET_LightModeli(table
, save_LightModeli
);
9767 SET_LightModeliv(table
, save_LightModeliv
);
9768 SET_Lightf(table
, save_Lightf
);
9769 SET_Lightfv(table
, save_Lightfv
);
9770 SET_Lighti(table
, save_Lighti
);
9771 SET_Lightiv(table
, save_Lightiv
);
9772 SET_LineStipple(table
, save_LineStipple
);
9773 SET_LineWidth(table
, save_LineWidth
);
9774 SET_ListBase(table
, save_ListBase
);
9775 SET_LoadIdentity(table
, save_LoadIdentity
);
9776 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9777 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9778 SET_LoadName(table
, save_LoadName
);
9779 SET_LogicOp(table
, save_LogicOp
);
9780 SET_Map1d(table
, save_Map1d
);
9781 SET_Map1f(table
, save_Map1f
);
9782 SET_Map2d(table
, save_Map2d
);
9783 SET_Map2f(table
, save_Map2f
);
9784 SET_MapGrid1d(table
, save_MapGrid1d
);
9785 SET_MapGrid1f(table
, save_MapGrid1f
);
9786 SET_MapGrid2d(table
, save_MapGrid2d
);
9787 SET_MapGrid2f(table
, save_MapGrid2f
);
9788 SET_MatrixMode(table
, save_MatrixMode
);
9789 SET_MultMatrixd(table
, save_MultMatrixd
);
9790 SET_MultMatrixf(table
, save_MultMatrixf
);
9791 SET_NewList(table
, save_NewList
);
9792 SET_Ortho(table
, save_Ortho
);
9793 SET_PassThrough(table
, save_PassThrough
);
9794 SET_PixelMapfv(table
, save_PixelMapfv
);
9795 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9796 SET_PixelMapusv(table
, save_PixelMapusv
);
9797 SET_PixelStoref(table
, exec_PixelStoref
);
9798 SET_PixelStorei(table
, exec_PixelStorei
);
9799 SET_PixelTransferf(table
, save_PixelTransferf
);
9800 SET_PixelTransferi(table
, save_PixelTransferi
);
9801 SET_PixelZoom(table
, save_PixelZoom
);
9802 SET_PointSize(table
, save_PointSize
);
9803 SET_PolygonMode(table
, save_PolygonMode
);
9804 SET_PolygonOffset(table
, save_PolygonOffset
);
9805 SET_PolygonStipple(table
, save_PolygonStipple
);
9806 SET_PopAttrib(table
, save_PopAttrib
);
9807 SET_PopMatrix(table
, save_PopMatrix
);
9808 SET_PopName(table
, save_PopName
);
9809 SET_PushAttrib(table
, save_PushAttrib
);
9810 SET_PushMatrix(table
, save_PushMatrix
);
9811 SET_PushName(table
, save_PushName
);
9812 SET_RasterPos2d(table
, save_RasterPos2d
);
9813 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9814 SET_RasterPos2f(table
, save_RasterPos2f
);
9815 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9816 SET_RasterPos2i(table
, save_RasterPos2i
);
9817 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9818 SET_RasterPos2s(table
, save_RasterPos2s
);
9819 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9820 SET_RasterPos3d(table
, save_RasterPos3d
);
9821 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9822 SET_RasterPos3f(table
, save_RasterPos3f
);
9823 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9824 SET_RasterPos3i(table
, save_RasterPos3i
);
9825 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9826 SET_RasterPos3s(table
, save_RasterPos3s
);
9827 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9828 SET_RasterPos4d(table
, save_RasterPos4d
);
9829 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9830 SET_RasterPos4f(table
, save_RasterPos4f
);
9831 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9832 SET_RasterPos4i(table
, save_RasterPos4i
);
9833 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9834 SET_RasterPos4s(table
, save_RasterPos4s
);
9835 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9836 SET_ReadBuffer(table
, save_ReadBuffer
);
9837 SET_ReadPixels(table
, exec_ReadPixels
);
9838 SET_RenderMode(table
, exec_RenderMode
);
9839 SET_Rotated(table
, save_Rotated
);
9840 SET_Rotatef(table
, save_Rotatef
);
9841 SET_Scaled(table
, save_Scaled
);
9842 SET_Scalef(table
, save_Scalef
);
9843 SET_Scissor(table
, save_Scissor
);
9844 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9845 SET_SelectBuffer(table
, exec_SelectBuffer
);
9846 SET_ShadeModel(table
, save_ShadeModel
);
9847 SET_StencilFunc(table
, save_StencilFunc
);
9848 SET_StencilMask(table
, save_StencilMask
);
9849 SET_StencilOp(table
, save_StencilOp
);
9850 SET_TexEnvf(table
, save_TexEnvf
);
9851 SET_TexEnvfv(table
, save_TexEnvfv
);
9852 SET_TexEnvi(table
, save_TexEnvi
);
9853 SET_TexEnviv(table
, save_TexEnviv
);
9854 SET_TexGend(table
, save_TexGend
);
9855 SET_TexGendv(table
, save_TexGendv
);
9856 SET_TexGenf(table
, save_TexGenf
);
9857 SET_TexGenfv(table
, save_TexGenfv
);
9858 SET_TexGeni(table
, save_TexGeni
);
9859 SET_TexGeniv(table
, save_TexGeniv
);
9860 SET_TexImage1D(table
, save_TexImage1D
);
9861 SET_TexImage2D(table
, save_TexImage2D
);
9862 SET_TexParameterf(table
, save_TexParameterf
);
9863 SET_TexParameterfv(table
, save_TexParameterfv
);
9864 SET_TexParameteri(table
, save_TexParameteri
);
9865 SET_TexParameteriv(table
, save_TexParameteriv
);
9866 SET_Translated(table
, save_Translated
);
9867 SET_Translatef(table
, save_Translatef
);
9868 SET_Viewport(table
, save_Viewport
);
9871 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9872 SET_BindTexture(table
, save_BindTexture
);
9873 SET_ColorPointer(table
, exec_ColorPointer
);
9874 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9875 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9876 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9877 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9878 SET_DeleteTextures(table
, exec_DeleteTextures
);
9879 SET_DisableClientState(table
, exec_DisableClientState
);
9880 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9881 SET_EnableClientState(table
, exec_EnableClientState
);
9882 SET_GenTextures(table
, exec_GenTextures
);
9883 SET_GetPointerv(table
, exec_GetPointerv
);
9884 SET_IndexPointer(table
, exec_IndexPointer
);
9885 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
9886 SET_IsTexture(table
, exec_IsTexture
);
9887 SET_NormalPointer(table
, exec_NormalPointer
);
9888 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
9889 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9890 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
9891 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
9892 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9893 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9894 SET_VertexPointer(table
, exec_VertexPointer
);
9897 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9898 SET_TexImage3D(table
, save_TexImage3D
);
9899 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9902 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9903 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9904 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9906 /* ATI_separate_stencil */
9907 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9909 /* GL_ARB_imaging */
9910 /* Not all are supported */
9911 SET_BlendColor(table
, save_BlendColor
);
9912 SET_BlendEquation(table
, save_BlendEquation
);
9913 SET_ColorSubTable(table
, save_ColorSubTable
);
9914 SET_ColorTable(table
, save_ColorTable
);
9915 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
9916 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
9917 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
9918 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
9919 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
9920 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
9921 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
9922 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
9923 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
9924 SET_CopyColorTable(table
, save_CopyColorTable
);
9925 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
9926 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
9927 SET_GetColorTable(table
, exec_GetColorTable
);
9928 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
9929 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
9930 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
9931 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
9932 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
9933 SET_GetHistogram(table
, exec_GetHistogram
);
9934 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
9935 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
9936 SET_GetMinmax(table
, exec_GetMinmax
);
9937 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
9938 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
9939 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
9940 SET_Histogram(table
, save_Histogram
);
9941 SET_Minmax(table
, save_Minmax
);
9942 SET_ResetHistogram(table
, save_ResetHistogram
);
9943 SET_ResetMinmax(table
, save_ResetMinmax
);
9944 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
9946 /* 2. GL_EXT_blend_color */
9948 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9951 /* 3. GL_EXT_polygon_offset */
9952 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9954 /* 6. GL_EXT_texture3d */
9956 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9957 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9958 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9961 /* 14. GL_SGI_color_table */
9963 SET_ColorTableSGI(table
, save_ColorTable
);
9964 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9965 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9966 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9967 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9970 /* 30. GL_EXT_vertex_array */
9971 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9972 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9973 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9974 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9975 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9976 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9978 /* 37. GL_EXT_blend_minmax */
9980 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9983 /* 54. GL_EXT_point_parameters */
9984 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9985 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9987 /* 97. GL_EXT_compiled_vertex_array */
9988 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9989 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9991 /* 145. GL_EXT_secondary_color */
9992 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9994 /* 148. GL_EXT_multi_draw_arrays */
9995 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9997 /* 149. GL_EXT_fog_coord */
9998 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
10000 /* 173. GL_EXT_blend_func_separate */
10001 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
10003 /* 196. GL_MESA_resize_buffers */
10004 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
10006 /* 197. GL_MESA_window_pos */
10007 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
10008 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
10009 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
10010 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
10011 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
10012 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
10013 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
10014 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
10015 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
10016 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
10017 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
10018 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
10019 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
10020 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
10021 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
10022 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
10023 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
10024 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
10025 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
10026 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
10027 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
10028 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
10029 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
10030 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
10032 /* 200. GL_IBM_multimode_draw_arrays */
10033 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
10034 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
10036 #if FEATURE_NV_vertex_program
10037 /* 233. GL_NV_vertex_program */
10038 /* The following commands DO NOT go into display lists:
10039 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
10040 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
10042 SET_BindProgramNV(table
, save_BindProgramNV
);
10043 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10044 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
10045 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10046 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
10047 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
10048 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
10049 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
10050 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
10051 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
10052 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
10053 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
10054 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
10055 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
10056 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10057 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10058 SET_LoadProgramNV(table
, save_LoadProgramNV
);
10059 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10060 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10061 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10062 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10063 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
10064 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
10065 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
10066 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
10069 /* 244. GL_ATI_envmap_bumpmap */
10070 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
10071 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
10073 /* 245. GL_ATI_fragment_shader */
10074 #if FEATURE_ATI_fragment_shader
10075 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
10076 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
10079 /* 282. GL_NV_fragment_program */
10080 #if FEATURE_NV_fragment_program
10081 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
10082 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
10083 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
10084 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
10085 SET_GetProgramNamedParameterfvNV(table
,
10086 _mesa_GetProgramNamedParameterfvNV
);
10087 SET_GetProgramNamedParameterdvNV(table
,
10088 _mesa_GetProgramNamedParameterdvNV
);
10089 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10090 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10091 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10092 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10093 SET_GetProgramLocalParameterdvARB(table
,
10094 _mesa_GetProgramLocalParameterdvARB
);
10095 SET_GetProgramLocalParameterfvARB(table
,
10096 _mesa_GetProgramLocalParameterfvARB
);
10099 /* 262. GL_NV_point_sprite */
10100 SET_PointParameteriNV(table
, save_PointParameteriNV
);
10101 SET_PointParameterivNV(table
, save_PointParameterivNV
);
10103 /* 268. GL_EXT_stencil_two_side */
10104 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
10106 /* 273. GL_APPLE_vertex_array_object */
10107 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
10108 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
10109 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
10110 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
10112 /* GL_ARB_vertex_array_object */
10113 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
10114 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
10116 /* ???. GL_EXT_depth_bounds_test */
10117 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
10119 /* ARB 1. GL_ARB_multitexture */
10120 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
10121 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
10123 /* ARB 3. GL_ARB_transpose_matrix */
10124 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
10125 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
10126 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
10127 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
10129 /* ARB 5. GL_ARB_multisample */
10130 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10132 /* ARB 12. GL_ARB_texture_compression */
10133 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10134 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10135 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10136 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10137 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10138 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10139 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10141 /* ARB 14. GL_ARB_point_parameters */
10142 /* aliased with EXT_point_parameters functions */
10144 /* ARB 25. GL_ARB_window_pos */
10145 /* aliased with MESA_window_pos functions */
10147 /* ARB 26. GL_ARB_vertex_program */
10148 /* ARB 27. GL_ARB_fragment_program */
10149 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10150 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10151 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10152 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10153 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10154 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10155 SET_BindProgramNV(table
, save_BindProgramNV
);
10156 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10157 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10158 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10159 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10160 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10161 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10162 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
10163 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10164 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10165 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10166 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10167 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10168 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10169 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10170 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10171 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10172 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10173 SET_GetProgramLocalParameterdvARB(table
,
10174 _mesa_GetProgramLocalParameterdvARB
);
10175 SET_GetProgramLocalParameterfvARB(table
,
10176 _mesa_GetProgramLocalParameterfvARB
);
10177 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10178 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10181 /* ARB 28. GL_ARB_vertex_buffer_object */
10182 #if FEATURE_ARB_vertex_buffer_object
10183 /* None of the extension's functions get compiled */
10184 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10185 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10186 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10187 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10188 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10189 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10190 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10191 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10192 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10193 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10194 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10197 #if FEATURE_queryobj
10198 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10199 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10200 SET_EndQueryARB(table
, save_EndQueryARB
);
10203 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10205 #if FEATURE_EXT_framebuffer_blit
10206 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10209 /* GL_ARB_shader_objects */
10210 _mesa_init_shader_dispatch(table
); /* Plug in glCreate/Delete/Get, etc */
10211 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10212 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10213 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10214 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10215 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10216 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10217 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10218 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10219 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10220 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10221 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10222 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10223 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10224 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10225 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10226 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10227 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10228 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10229 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10230 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10231 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10232 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10233 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10234 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10235 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10236 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10238 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10239 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10240 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10241 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10242 /* XXX additional functions need to be implemented here! */
10244 /* 299. GL_EXT_blend_equation_separate */
10245 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10247 /* GL_EXT_gpu_program_parameters */
10248 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
10249 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10250 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10253 /* ARB 50. GL_ARB_map_buffer_range */
10254 #if FEATURE_ARB_map_buffer_range
10255 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10256 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10259 /* ARB 59. GL_ARB_copy_buffer */
10260 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10262 /* 364. GL_EXT_provoking_vertex */
10263 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10265 /* 371. GL_APPLE_object_purgeable */
10266 #if FEATURE_APPLE_object_purgeable
10267 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10268 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10269 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10272 /* GL_EXT_texture_integer */
10273 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10274 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10275 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10276 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10277 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10278 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10280 /* 377. GL_EXT_separate_shader_objects */
10281 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10282 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10284 /* GL_ARB_color_buffer_float */
10285 SET_ClampColorARB(table
, save_ClampColorARB
);
10286 SET_ClampColor(table
, save_ClampColorARB
);
10289 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10290 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10291 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10292 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10294 SET_Uniform1ui(table
, save_Uniform1ui
);
10295 SET_Uniform2ui(table
, save_Uniform2ui
);
10296 SET_Uniform3ui(table
, save_Uniform3ui
);
10297 SET_Uniform4ui(table
, save_Uniform4ui
);
10298 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10299 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10300 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10301 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10303 (void) save_Uniform1ui
;
10304 (void) save_Uniform2ui
;
10305 (void) save_Uniform3ui
;
10306 (void) save_Uniform4ui
;
10307 (void) save_Uniform1uiv
;
10308 (void) save_Uniform2uiv
;
10309 (void) save_Uniform3uiv
;
10310 (void) save_Uniform4uiv
;
10313 #if FEATURE_EXT_transform_feedback
10314 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10315 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10316 SET_TransformFeedbackVaryingsEXT(table
, save_TransformFeedbackVaryings
);
10317 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10318 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10319 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10320 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10323 /* GL_ARB_instanced_arrays */
10324 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10326 /* GL_NV_texture_barrier */
10327 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10329 /* GL_ARB_sampler_objects */
10330 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10331 SET_BindSampler(table
, save_BindSampler
);
10332 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10333 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10334 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10335 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10336 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10337 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10339 /* GL_ARB_draw_buffer_blend */
10340 SET_BlendFunciARB(table
, save_BlendFunci
);
10341 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10342 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10343 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10345 /* GL_ARB_geometry_shader4 */
10346 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10347 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10348 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10351 _mesa_init_sync_dispatch(table
);
10352 SET_WaitSync(table
, save_WaitSync
);
10359 static const char *
10360 enum_string(GLenum k
)
10362 return _mesa_lookup_enum_by_nr(k
);
10367 * Print the commands in a display list. For debugging only.
10368 * TODO: many commands aren't handled yet.
10370 static void GLAPIENTRY
10371 print_list(struct gl_context
*ctx
, GLuint list
)
10373 struct gl_display_list
*dlist
;
10377 if (!islist(ctx
, list
)) {
10378 printf("%u is not a display list ID\n", list
);
10382 dlist
= lookup_list(ctx
, list
);
10388 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10390 done
= n
? GL_FALSE
: GL_TRUE
;
10392 const OpCode opcode
= n
[0].opcode
;
10394 if (is_ext_opcode(opcode
)) {
10395 n
+= ext_opcode_print(ctx
, n
);
10400 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10402 case OPCODE_BITMAP
:
10403 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10404 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10406 case OPCODE_CALL_LIST
:
10407 printf("CallList %d\n", (int) n
[1].ui
);
10409 case OPCODE_CALL_LIST_OFFSET
:
10410 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10411 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10413 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10414 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10415 enum_string(n
[1].e
), enum_string(n
[2].e
),
10416 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10418 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10419 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10420 enum_string(n
[1].e
), enum_string(n
[2].e
),
10421 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10423 case OPCODE_DISABLE
:
10424 printf("Disable %s\n", enum_string(n
[1].e
));
10426 case OPCODE_ENABLE
:
10427 printf("Enable %s\n", enum_string(n
[1].e
));
10429 case OPCODE_FRUSTUM
:
10430 printf("Frustum %g %g %g %g %g %g\n",
10431 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10433 case OPCODE_LINE_STIPPLE
:
10434 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10436 case OPCODE_LOAD_IDENTITY
:
10437 printf("LoadIdentity\n");
10439 case OPCODE_LOAD_MATRIX
:
10440 printf("LoadMatrix\n");
10441 printf(" %8f %8f %8f %8f\n",
10442 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10443 printf(" %8f %8f %8f %8f\n",
10444 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10445 printf(" %8f %8f %8f %8f\n",
10446 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10447 printf(" %8f %8f %8f %8f\n",
10448 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10450 case OPCODE_MULT_MATRIX
:
10451 printf("MultMatrix (or Rotate)\n");
10452 printf(" %8f %8f %8f %8f\n",
10453 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10454 printf(" %8f %8f %8f %8f\n",
10455 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10456 printf(" %8f %8f %8f %8f\n",
10457 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10458 printf(" %8f %8f %8f %8f\n",
10459 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10462 printf("Ortho %g %g %g %g %g %g\n",
10463 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10465 case OPCODE_POP_ATTRIB
:
10466 printf("PopAttrib\n");
10468 case OPCODE_POP_MATRIX
:
10469 printf("PopMatrix\n");
10471 case OPCODE_POP_NAME
:
10472 printf("PopName\n");
10474 case OPCODE_PUSH_ATTRIB
:
10475 printf("PushAttrib %x\n", n
[1].bf
);
10477 case OPCODE_PUSH_MATRIX
:
10478 printf("PushMatrix\n");
10480 case OPCODE_PUSH_NAME
:
10481 printf("PushName %d\n", (int) n
[1].ui
);
10483 case OPCODE_RASTER_POS
:
10484 printf("RasterPos %g %g %g %g\n",
10485 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10487 case OPCODE_ROTATE
:
10488 printf("Rotate %g %g %g %g\n",
10489 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10492 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10494 case OPCODE_TRANSLATE
:
10495 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10497 case OPCODE_BIND_TEXTURE
:
10498 printf("BindTexture %s %d\n",
10499 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10501 case OPCODE_SHADE_MODEL
:
10502 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10505 printf("Map1 %s %.3f %.3f %d %d\n",
10506 _mesa_lookup_enum_by_nr(n
[1].ui
),
10507 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10510 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10511 _mesa_lookup_enum_by_nr(n
[1].ui
),
10512 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10513 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10515 case OPCODE_MAPGRID1
:
10516 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10518 case OPCODE_MAPGRID2
:
10519 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10520 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10522 case OPCODE_EVALMESH1
:
10523 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10525 case OPCODE_EVALMESH2
:
10526 printf("EvalMesh2 %d %d %d %d\n",
10527 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10530 case OPCODE_ATTR_1F_NV
:
10531 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10533 case OPCODE_ATTR_2F_NV
:
10534 printf("ATTR_2F_NV attr %d: %f %f\n",
10535 n
[1].i
, n
[2].f
, n
[3].f
);
10537 case OPCODE_ATTR_3F_NV
:
10538 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10539 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10541 case OPCODE_ATTR_4F_NV
:
10542 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10543 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10545 case OPCODE_ATTR_1F_ARB
:
10546 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10548 case OPCODE_ATTR_2F_ARB
:
10549 printf("ATTR_2F_ARB attr %d: %f %f\n",
10550 n
[1].i
, n
[2].f
, n
[3].f
);
10552 case OPCODE_ATTR_3F_ARB
:
10553 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10554 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10556 case OPCODE_ATTR_4F_ARB
:
10557 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10558 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10561 case OPCODE_MATERIAL
:
10562 printf("MATERIAL %x %x: %f %f %f %f\n",
10563 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10566 printf("BEGIN %x\n", n
[1].i
);
10572 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10575 case OPCODE_EVAL_C1
:
10576 printf("EVAL_C1 %f\n", n
[1].f
);
10578 case OPCODE_EVAL_C2
:
10579 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10581 case OPCODE_EVAL_P1
:
10582 printf("EVAL_P1 %d\n", n
[1].i
);
10584 case OPCODE_EVAL_P2
:
10585 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10588 case OPCODE_PROVOKING_VERTEX
:
10589 printf("ProvokingVertex %s\n",
10590 _mesa_lookup_enum_by_nr(n
[1].ui
));
10594 * meta opcodes/commands
10597 printf("Error: %s %s\n",
10598 enum_string(n
[1].e
), (const char *) n
[2].data
);
10600 case OPCODE_CONTINUE
:
10601 printf("DISPLAY-LIST-CONTINUE\n");
10602 n
= (Node
*) n
[1].next
;
10604 case OPCODE_END_OF_LIST
:
10605 printf("END-LIST %u\n", list
);
10609 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10611 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10612 opcode
, (void *) n
);
10616 printf("command %d, %u operands\n", opcode
,
10620 /* increment n to point to next compiled command */
10621 if (opcode
!= OPCODE_CONTINUE
) {
10622 n
+= InstSize
[opcode
];
10631 * Clients may call this function to help debug display list problems.
10632 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10633 * changed, or break in the future without notice.
10636 mesa_print_display_list(GLuint list
)
10638 GET_CURRENT_CONTEXT(ctx
);
10639 print_list(ctx
, list
);
10643 /**********************************************************************/
10644 /***** Initialization *****/
10645 /**********************************************************************/
10648 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10650 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10652 vfmt
->Begin
= save_Begin
;
10654 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10656 vfmt
->Color3f
= save_Color3f
;
10657 vfmt
->Color3fv
= save_Color3fv
;
10658 vfmt
->Color4f
= save_Color4f
;
10659 vfmt
->Color4fv
= save_Color4fv
;
10660 vfmt
->EdgeFlag
= save_EdgeFlag
;
10661 vfmt
->End
= save_End
;
10663 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10665 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10666 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10667 vfmt
->Indexf
= save_Indexf
;
10668 vfmt
->Indexfv
= save_Indexfv
;
10669 vfmt
->Materialfv
= save_Materialfv
;
10670 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10671 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10672 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10673 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10674 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10675 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10676 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10677 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10678 vfmt
->Normal3f
= save_Normal3f
;
10679 vfmt
->Normal3fv
= save_Normal3fv
;
10680 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10681 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10682 vfmt
->TexCoord1f
= save_TexCoord1f
;
10683 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10684 vfmt
->TexCoord2f
= save_TexCoord2f
;
10685 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10686 vfmt
->TexCoord3f
= save_TexCoord3f
;
10687 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10688 vfmt
->TexCoord4f
= save_TexCoord4f
;
10689 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10690 vfmt
->Vertex2f
= save_Vertex2f
;
10691 vfmt
->Vertex2fv
= save_Vertex2fv
;
10692 vfmt
->Vertex3f
= save_Vertex3f
;
10693 vfmt
->Vertex3fv
= save_Vertex3fv
;
10694 vfmt
->Vertex4f
= save_Vertex4f
;
10695 vfmt
->Vertex4fv
= save_Vertex4fv
;
10696 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
10697 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
10698 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
10699 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
10700 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
10701 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
10702 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
10703 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
10704 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10705 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10706 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10707 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10708 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10709 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10710 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10711 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10713 vfmt
->Rectf
= save_Rectf
;
10715 /* The driver is required to implement these as
10716 * 1) They can probably do a better job.
10717 * 2) A lot of new mechanisms would have to be added to this module
10718 * to support it. That code would probably never get used,
10722 vfmt
->DrawArrays
= 0;
10723 vfmt
->DrawElements
= 0;
10724 vfmt
->DrawRangeElements
= 0;
10725 vfmt
->MultiDrawElemementsEXT
= 0;
10726 vfmt
->DrawElementsBaseVertex
= 0;
10727 vfmt
->DrawRangeElementsBaseVertex
= 0;
10728 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10734 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10735 const GLvertexformat
*vfmt
)
10737 SET_CallList(disp
, vfmt
->CallList
);
10738 SET_CallLists(disp
, vfmt
->CallLists
);
10742 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10744 SET_CallList(disp
, _mesa_CallList
);
10745 SET_CallLists(disp
, _mesa_CallLists
);
10747 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10748 SET_EndList(disp
, _mesa_EndList
);
10749 SET_GenLists(disp
, _mesa_GenLists
);
10750 SET_IsList(disp
, _mesa_IsList
);
10751 SET_ListBase(disp
, _mesa_ListBase
);
10752 SET_NewList(disp
, _mesa_NewList
);
10756 #endif /* FEATURE_dlist */
10760 * Initialize display list state for given context.
10763 _mesa_init_display_list(struct gl_context
*ctx
)
10765 static GLboolean tableInitialized
= GL_FALSE
;
10767 /* zero-out the instruction size table, just once */
10768 if (!tableInitialized
) {
10769 memset(InstSize
, 0, sizeof(InstSize
));
10770 tableInitialized
= GL_TRUE
;
10773 /* extension info */
10774 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10777 ctx
->ListState
.CallDepth
= 0;
10778 ctx
->ExecuteFlag
= GL_TRUE
;
10779 ctx
->CompileFlag
= GL_FALSE
;
10780 ctx
->ListState
.CurrentBlock
= NULL
;
10781 ctx
->ListState
.CurrentPos
= 0;
10783 /* Display List group */
10784 ctx
->List
.ListBase
= 0;
10787 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10793 _mesa_free_display_list_data(struct gl_context
*ctx
)
10795 free(ctx
->ListExt
);
10796 ctx
->ListExt
= NULL
;