2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
34 #include "api_arrayelt.h"
36 #include "api_loopback.h"
37 #include "api_validate.h"
38 #include "atifragshader.h"
40 #include "mfeatures.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 * Other parts of Mesa (such as the VBO module) can plug into the display
76 * list system. This structure describes new display list instructions.
78 struct gl_list_instruction
81 void (*Execute
)( struct gl_context
*ctx
, void *data
);
82 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
83 void (*Print
)( struct gl_context
*ctx
, void *data
);
87 #define MAX_DLIST_EXT_OPCODES 16
90 * Used by device drivers to hook new commands into display lists.
92 struct gl_list_extensions
94 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
103 * \param ctx GL context.
105 * Checks if dd_function_table::SaveNeedFlush is marked to flush
106 * stored (save) vertices, and calls
107 * dd_function_table::SaveFlushVertices if so.
109 #define SAVE_FLUSH_VERTICES(ctx) \
111 if (ctx->Driver.SaveNeedFlush) \
112 ctx->Driver.SaveFlushVertices(ctx); \
117 * Macro to assert that the API call was made outside the
118 * glBegin()/glEnd() pair, with return value.
120 * \param ctx GL context.
121 * \param retval value to return value in case the assertion fails.
123 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
125 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
126 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
127 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
133 * Macro to assert that the API call was made outside the
134 * glBegin()/glEnd() pair.
136 * \param ctx GL context.
138 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
140 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
141 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
142 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
148 * Macro to assert that the API call was made outside the
149 * glBegin()/glEnd() pair and flush the vertices.
151 * \param ctx GL context.
153 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
155 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
156 SAVE_FLUSH_VERTICES(ctx); \
160 * Macro to assert that the API call was made outside the
161 * glBegin()/glEnd() pair and flush the vertices, with return value.
163 * \param ctx GL context.
164 * \param retval value to return value in case the assertion fails.
166 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
168 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
169 SAVE_FLUSH_VERTICES(ctx); \
175 * Display list opcodes.
177 * The fact that these identifiers are assigned consecutive
178 * integer values starting at 0 is very important, see InstSize array usage)
182 OPCODE_INVALID
= -1, /* Force signed enum */
188 OPCODE_BLEND_EQUATION
,
189 OPCODE_BLEND_EQUATION_SEPARATE
,
190 OPCODE_BLEND_FUNC_SEPARATE
,
192 OPCODE_BLEND_EQUATION_I
,
193 OPCODE_BLEND_EQUATION_SEPARATE_I
,
195 OPCODE_BLEND_FUNC_SEPARATE_I
,
198 OPCODE_CALL_LIST_OFFSET
,
204 OPCODE_CLEAR_STENCIL
,
205 OPCODE_CLEAR_BUFFER_IV
,
206 OPCODE_CLEAR_BUFFER_UIV
,
207 OPCODE_CLEAR_BUFFER_FV
,
208 OPCODE_CLEAR_BUFFER_FI
,
211 OPCODE_COLOR_MASK_INDEXED
,
212 OPCODE_COLOR_MATERIAL
,
214 OPCODE_COLOR_TABLE_PARAMETER_FV
,
215 OPCODE_COLOR_TABLE_PARAMETER_IV
,
216 OPCODE_COLOR_SUB_TABLE
,
217 OPCODE_CONVOLUTION_FILTER_1D
,
218 OPCODE_CONVOLUTION_FILTER_2D
,
219 OPCODE_CONVOLUTION_PARAMETER_I
,
220 OPCODE_CONVOLUTION_PARAMETER_IV
,
221 OPCODE_CONVOLUTION_PARAMETER_F
,
222 OPCODE_CONVOLUTION_PARAMETER_FV
,
223 OPCODE_COPY_COLOR_SUB_TABLE
,
224 OPCODE_COPY_COLOR_TABLE
,
226 OPCODE_COPY_TEX_IMAGE1D
,
227 OPCODE_COPY_TEX_IMAGE2D
,
228 OPCODE_COPY_TEX_SUB_IMAGE1D
,
229 OPCODE_COPY_TEX_SUB_IMAGE2D
,
230 OPCODE_COPY_TEX_SUB_IMAGE3D
,
236 OPCODE_DISABLE_INDEXED
,
240 OPCODE_ENABLE_INDEXED
,
255 OPCODE_LOAD_IDENTITY
,
269 OPCODE_PIXEL_TRANSFER
,
272 OPCODE_POINT_PARAMETERS
,
274 OPCODE_POLYGON_STIPPLE
,
275 OPCODE_POLYGON_OFFSET
,
279 OPCODE_PRIORITIZE_TEXTURE
,
285 OPCODE_RESET_HISTOGRAM
,
286 OPCODE_RESET_MIN_MAX
,
290 OPCODE_SELECT_TEXTURE_SGIS
,
291 OPCODE_SELECT_TEXTURE_COORD_SET
,
302 OPCODE_TEX_SUB_IMAGE1D
,
303 OPCODE_TEX_SUB_IMAGE2D
,
304 OPCODE_TEX_SUB_IMAGE3D
,
308 /* GL_ARB_multitexture */
309 OPCODE_ACTIVE_TEXTURE
,
310 /* GL_ARB_texture_compression */
311 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
312 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
313 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
314 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
315 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
316 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
317 /* GL_ARB_multisample */
318 OPCODE_SAMPLE_COVERAGE
,
319 /* GL_ARB_window_pos */
320 OPCODE_WINDOW_POS_ARB
,
321 /* GL_NV_fragment_program */
322 OPCODE_BIND_PROGRAM_NV
,
323 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
324 /* GL_EXT_stencil_two_side */
325 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
326 /* GL_EXT_depth_bounds_test */
327 OPCODE_DEPTH_BOUNDS_EXT
,
328 /* GL_ARB_vertex/fragment_program */
329 OPCODE_PROGRAM_STRING_ARB
,
330 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
331 /* GL_ARB_occlusion_query */
332 OPCODE_BEGIN_QUERY_ARB
,
333 OPCODE_END_QUERY_ARB
,
334 /* GL_ARB_draw_buffers */
335 OPCODE_DRAW_BUFFERS_ARB
,
336 /* GL_ATI_fragment_shader */
337 OPCODE_TEX_BUMP_PARAMETER_ATI
,
338 /* GL_ATI_fragment_shader */
339 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
340 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
342 OPCODE_STENCIL_FUNC_SEPARATE
,
343 OPCODE_STENCIL_OP_SEPARATE
,
344 OPCODE_STENCIL_MASK_SEPARATE
,
346 /* GL_ARB_shader_objects */
364 OPCODE_UNIFORM_MATRIX22
,
365 OPCODE_UNIFORM_MATRIX33
,
366 OPCODE_UNIFORM_MATRIX44
,
367 OPCODE_UNIFORM_MATRIX23
,
368 OPCODE_UNIFORM_MATRIX32
,
369 OPCODE_UNIFORM_MATRIX24
,
370 OPCODE_UNIFORM_MATRIX42
,
371 OPCODE_UNIFORM_MATRIX34
,
372 OPCODE_UNIFORM_MATRIX43
,
384 /* GL_ARB_color_buffer_float */
387 /* GL_EXT_framebuffer_blit */
388 OPCODE_BLIT_FRAMEBUFFER
,
390 /* Vertex attributes -- fallback for when optimized display
391 * list build isn't active.
410 /* GL_EXT_provoking_vertex */
411 OPCODE_PROVOKING_VERTEX
,
413 /* GL_EXT_transform_feedback */
414 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
415 OPCODE_END_TRANSFORM_FEEDBACK
,
416 OPCODE_BIND_TRANSFORM_FEEDBACK
,
417 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
418 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
419 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
421 /* GL_EXT_texture_integer */
423 OPCODE_CLEARCOLOR_UI
,
424 OPCODE_TEXPARAMETER_I
,
425 OPCODE_TEXPARAMETER_UI
,
427 /* GL_EXT_separate_shader_objects */
428 OPCODE_ACTIVE_PROGRAM_EXT
,
429 OPCODE_USE_SHADER_PROGRAM_EXT
,
431 /* GL_ARB_instanced_arrays */
432 OPCODE_VERTEX_ATTRIB_DIVISOR
,
434 /* GL_NV_texture_barrier */
435 OPCODE_TEXTURE_BARRIER_NV
,
437 /* GL_ARB_sampler_object */
439 OPCODE_SAMPLER_PARAMETERIV
,
440 OPCODE_SAMPLER_PARAMETERFV
,
441 OPCODE_SAMPLER_PARAMETERIIV
,
442 OPCODE_SAMPLER_PARAMETERUIV
,
444 /* GL_ARB_geometry_shader4 */
445 OPCODE_PROGRAM_PARAMETERI
,
446 OPCODE_FRAMEBUFFER_TEXTURE
,
447 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
452 /* GL_NV_conditional_render */
453 OPCODE_BEGIN_CONDITIONAL_RENDER
,
454 OPCODE_END_CONDITIONAL_RENDER
,
456 /* ARB_timer_query */
457 OPCODE_QUERY_COUNTER
,
459 /* ARB_transform_feedback3 */
460 OPCODE_BEGIN_QUERY_INDEXED
,
461 OPCODE_END_QUERY_INDEXED
,
462 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
464 /* ARB_transform_feedback_instanced */
465 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
466 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
468 /* ARB_uniform_buffer_object */
469 OPCODE_UNIFORM_BLOCK_BINDING
,
471 /* The following three are meta instructions */
472 OPCODE_ERROR
, /* raise compiled-in error */
483 * Display list instructions are stored as sequences of "nodes". Nodes
484 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
485 * are linked together with a pointer.
487 * Each instruction in the display list is stored as a sequence of
488 * contiguous nodes in memory.
489 * Each node is the union of a variety of data types.
505 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
509 typedef union gl_dlist_node Node
;
513 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
514 * environment. In 64-bit env, sizeof(Node)==8 anyway.
524 * How many nodes to allocate at a time.
526 * \note Reduced now that we hold vertices etc. elsewhere.
528 #define BLOCK_SIZE 256
533 * Number of nodes of storage needed for each instruction.
534 * Sizes for dynamically allocated opcodes are stored in the context struct.
536 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
539 void mesa_print_display_list(GLuint list
);
542 /**********************************************************************/
543 /***** Private *****/
544 /**********************************************************************/
548 * Make an empty display list. This is used by glGenLists() to
549 * reserve display list IDs.
551 static struct gl_display_list
*
552 make_list(GLuint name
, GLuint count
)
554 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
556 dlist
->Head
= malloc(sizeof(Node
) * count
);
557 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
563 * Lookup function to just encapsulate casting.
565 static inline struct gl_display_list
*
566 lookup_list(struct gl_context
*ctx
, GLuint list
)
568 return (struct gl_display_list
*)
569 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
573 /** Is the given opcode an extension code? */
574 static inline GLboolean
575 is_ext_opcode(OpCode opcode
)
577 return (opcode
>= OPCODE_EXT_0
);
581 /** Destroy an extended opcode instruction */
583 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
585 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
587 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
588 step
= ctx
->ListExt
->Opcode
[i
].Size
;
593 /** Execute an extended opcode instruction */
595 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
597 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
599 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
600 step
= ctx
->ListExt
->Opcode
[i
].Size
;
605 /** Print an extended opcode instruction */
607 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
609 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
611 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
612 step
= ctx
->ListExt
->Opcode
[i
].Size
;
618 * Delete the named display list, but don't remove from hash table.
619 * \param dlist - display list pointer
622 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
627 n
= block
= dlist
->Head
;
629 done
= block
? GL_FALSE
: GL_TRUE
;
631 const OpCode opcode
= n
[0].opcode
;
633 /* check for extension opcodes first */
634 if (is_ext_opcode(opcode
)) {
635 n
+= ext_opcode_destroy(ctx
, n
);
639 /* for some commands, we need to free malloc'd memory */
642 n
+= InstSize
[n
[0].opcode
];
646 n
+= InstSize
[n
[0].opcode
];
648 case OPCODE_DRAW_PIXELS
:
650 n
+= InstSize
[n
[0].opcode
];
654 n
+= InstSize
[n
[0].opcode
];
656 case OPCODE_COLOR_TABLE
:
658 n
+= InstSize
[n
[0].opcode
];
660 case OPCODE_COLOR_SUB_TABLE
:
662 n
+= InstSize
[n
[0].opcode
];
664 case OPCODE_CONVOLUTION_FILTER_1D
:
666 n
+= InstSize
[n
[0].opcode
];
668 case OPCODE_CONVOLUTION_FILTER_2D
:
670 n
+= InstSize
[n
[0].opcode
];
672 case OPCODE_POLYGON_STIPPLE
:
674 n
+= InstSize
[n
[0].opcode
];
676 case OPCODE_TEX_IMAGE1D
:
678 n
+= InstSize
[n
[0].opcode
];
680 case OPCODE_TEX_IMAGE2D
:
682 n
+= InstSize
[n
[0].opcode
];
684 case OPCODE_TEX_IMAGE3D
:
686 n
+= InstSize
[n
[0].opcode
];
688 case OPCODE_TEX_SUB_IMAGE1D
:
690 n
+= InstSize
[n
[0].opcode
];
692 case OPCODE_TEX_SUB_IMAGE2D
:
694 n
+= InstSize
[n
[0].opcode
];
696 case OPCODE_TEX_SUB_IMAGE3D
:
698 n
+= InstSize
[n
[0].opcode
];
700 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
702 n
+= InstSize
[n
[0].opcode
];
704 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
706 n
+= InstSize
[n
[0].opcode
];
708 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
710 n
+= InstSize
[n
[0].opcode
];
712 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
714 n
+= InstSize
[n
[0].opcode
];
716 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
718 n
+= InstSize
[n
[0].opcode
];
720 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
722 n
+= InstSize
[n
[0].opcode
];
724 case OPCODE_PROGRAM_STRING_ARB
:
725 free(n
[4].data
); /* program string */
726 n
+= InstSize
[n
[0].opcode
];
728 case OPCODE_UNIFORM_1FV
:
729 case OPCODE_UNIFORM_2FV
:
730 case OPCODE_UNIFORM_3FV
:
731 case OPCODE_UNIFORM_4FV
:
732 case OPCODE_UNIFORM_1IV
:
733 case OPCODE_UNIFORM_2IV
:
734 case OPCODE_UNIFORM_3IV
:
735 case OPCODE_UNIFORM_4IV
:
736 case OPCODE_UNIFORM_1UIV
:
737 case OPCODE_UNIFORM_2UIV
:
738 case OPCODE_UNIFORM_3UIV
:
739 case OPCODE_UNIFORM_4UIV
:
741 n
+= InstSize
[n
[0].opcode
];
743 case OPCODE_UNIFORM_MATRIX22
:
744 case OPCODE_UNIFORM_MATRIX33
:
745 case OPCODE_UNIFORM_MATRIX44
:
746 case OPCODE_UNIFORM_MATRIX24
:
747 case OPCODE_UNIFORM_MATRIX42
:
748 case OPCODE_UNIFORM_MATRIX23
:
749 case OPCODE_UNIFORM_MATRIX32
:
750 case OPCODE_UNIFORM_MATRIX34
:
751 case OPCODE_UNIFORM_MATRIX43
:
753 n
+= InstSize
[n
[0].opcode
];
756 case OPCODE_CONTINUE
:
757 n
= (Node
*) n
[1].next
;
761 case OPCODE_END_OF_LIST
:
766 /* Most frequent case */
767 n
+= InstSize
[n
[0].opcode
];
778 * Destroy a display list and remove from hash table.
779 * \param list - display list number
782 destroy_list(struct gl_context
*ctx
, GLuint list
)
784 struct gl_display_list
*dlist
;
789 dlist
= lookup_list(ctx
, list
);
793 _mesa_delete_list(ctx
, dlist
);
794 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
799 * Translate the nth element of list from <type> to GLint.
802 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
814 bptr
= (GLbyte
*) list
;
815 return (GLint
) bptr
[n
];
816 case GL_UNSIGNED_BYTE
:
817 ubptr
= (GLubyte
*) list
;
818 return (GLint
) ubptr
[n
];
820 sptr
= (GLshort
*) list
;
821 return (GLint
) sptr
[n
];
822 case GL_UNSIGNED_SHORT
:
823 usptr
= (GLushort
*) list
;
824 return (GLint
) usptr
[n
];
826 iptr
= (GLint
*) list
;
828 case GL_UNSIGNED_INT
:
829 uiptr
= (GLuint
*) list
;
830 return (GLint
) uiptr
[n
];
832 fptr
= (GLfloat
*) list
;
833 return (GLint
) FLOORF(fptr
[n
]);
835 ubptr
= ((GLubyte
*) list
) + 2 * n
;
836 return (GLint
) ubptr
[0] * 256
839 ubptr
= ((GLubyte
*) list
) + 3 * n
;
840 return (GLint
) ubptr
[0] * 65536
841 + (GLint
) ubptr
[1] * 256
844 ubptr
= ((GLubyte
*) list
) + 4 * n
;
845 return (GLint
) ubptr
[0] * 16777216
846 + (GLint
) ubptr
[1] * 65536
847 + (GLint
) ubptr
[2] * 256
857 /**********************************************************************/
859 /**********************************************************************/
862 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
863 * If width < 0 or height < 0 or format or type are invalid we'll just
864 * return NULL. We will not generate an error since OpenGL command
865 * arguments aren't error-checked until the command is actually executed
866 * (not when they're compiled).
867 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
870 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
871 GLsizei width
, GLsizei height
, GLsizei depth
,
872 GLenum format
, GLenum type
, const GLvoid
* pixels
,
873 const struct gl_pixelstore_attrib
*unpack
)
875 if (width
<= 0 || height
<= 0) {
879 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
880 /* bad format and/or type */
884 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
888 if (type
== GL_BITMAP
)
889 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
891 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
892 format
, type
, pixels
, unpack
);
893 if (pixels
&& !image
) {
894 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
898 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
899 depth
, format
, type
, INT_MAX
, pixels
)) {
900 const GLubyte
*map
, *src
;
904 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
905 GL_MAP_READ_BIT
, unpack
->BufferObj
);
907 /* unable to map src buffer! */
908 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
912 src
= ADD_POINTERS(map
, pixels
);
913 if (type
== GL_BITMAP
)
914 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
916 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
917 format
, type
, src
, unpack
);
919 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
);
922 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
928 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
933 * Allocate space for a display list instruction (opcode + payload space).
934 * \param opcode the instruction opcode (OPCODE_* value)
935 * \param bytes instruction payload size (not counting opcode)
936 * \return pointer to allocated memory (the opcode space)
939 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
941 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
944 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
945 if (InstSize
[opcode
] == 0) {
946 /* save instruction size now */
947 InstSize
[opcode
] = numNodes
;
950 /* make sure instruction size agrees */
951 ASSERT(numNodes
== InstSize
[opcode
]);
955 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
956 /* This block is full. Allocate a new block and chain to it */
958 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
959 n
[0].opcode
= OPCODE_CONTINUE
;
960 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
962 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
965 n
[1].next
= (Node
*) newblock
;
966 ctx
->ListState
.CurrentBlock
= newblock
;
967 ctx
->ListState
.CurrentPos
= 0;
970 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
971 ctx
->ListState
.CurrentPos
+= numNodes
;
973 n
[0].opcode
= opcode
;
981 * Allocate space for a display list instruction. Used by callers outside
982 * this file for things like VBO vertex data.
984 * \param opcode the instruction opcode (OPCODE_* value)
985 * \param bytes instruction size in bytes, not counting opcode.
986 * \return pointer to the usable data area (not including the internal
990 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
992 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
994 return n
+ 1; /* return pointer to payload area, after opcode */
1001 * This function allows modules and drivers to get their own opcodes
1002 * for extending display list functionality.
1003 * \param ctx the rendering context
1004 * \param size number of bytes for storing the new display list command
1005 * \param execute function to execute the new display list command
1006 * \param destroy function to destroy the new display list command
1007 * \param print function to print the new display list command
1008 * \return the new opcode number or -1 if error
1011 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1013 void (*execute
) (struct gl_context
*, void *),
1014 void (*destroy
) (struct gl_context
*, void *),
1015 void (*print
) (struct gl_context
*, void *))
1017 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1018 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1019 ctx
->ListExt
->Opcode
[i
].Size
=
1020 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1021 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1022 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1023 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1024 return i
+ OPCODE_EXT_0
;
1031 * Allocate space for a display list instruction. The space is basically
1032 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1033 * function parameter, node[2] is the second parameter, etc.
1035 * \param opcode one of OPCODE_x
1036 * \param nparams number of function parameters
1037 * \return pointer to start of instruction space
1039 static inline Node
*
1040 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1042 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1048 * Display List compilation functions
1050 static void GLAPIENTRY
1051 save_Accum(GLenum op
, GLfloat value
)
1053 GET_CURRENT_CONTEXT(ctx
);
1055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1056 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1061 if (ctx
->ExecuteFlag
) {
1062 CALL_Accum(ctx
->Exec
, (op
, value
));
1067 static void GLAPIENTRY
1068 save_AlphaFunc(GLenum func
, GLclampf ref
)
1070 GET_CURRENT_CONTEXT(ctx
);
1072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1073 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1076 n
[2].f
= (GLfloat
) ref
;
1078 if (ctx
->ExecuteFlag
) {
1079 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1084 static void GLAPIENTRY
1085 save_BindTexture(GLenum target
, GLuint texture
)
1087 GET_CURRENT_CONTEXT(ctx
);
1089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1090 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1095 if (ctx
->ExecuteFlag
) {
1096 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1101 static void GLAPIENTRY
1102 save_Bitmap(GLsizei width
, GLsizei height
,
1103 GLfloat xorig
, GLfloat yorig
,
1104 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1106 GET_CURRENT_CONTEXT(ctx
);
1108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1109 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1111 n
[1].i
= (GLint
) width
;
1112 n
[2].i
= (GLint
) height
;
1117 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1118 GL_BITMAP
, pixels
, &ctx
->Unpack
);
1120 if (ctx
->ExecuteFlag
) {
1121 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1122 xorig
, yorig
, xmove
, ymove
, pixels
));
1127 static void GLAPIENTRY
1128 save_BlendEquation(GLenum mode
)
1130 GET_CURRENT_CONTEXT(ctx
);
1132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1133 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1137 if (ctx
->ExecuteFlag
) {
1138 CALL_BlendEquation(ctx
->Exec
, (mode
));
1143 static void GLAPIENTRY
1144 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1146 GET_CURRENT_CONTEXT(ctx
);
1148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1149 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1154 if (ctx
->ExecuteFlag
) {
1155 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1160 static void GLAPIENTRY
1161 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1162 GLenum sfactorA
, GLenum dfactorA
)
1164 GET_CURRENT_CONTEXT(ctx
);
1166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1167 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1169 n
[1].e
= sfactorRGB
;
1170 n
[2].e
= dfactorRGB
;
1174 if (ctx
->ExecuteFlag
) {
1175 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1176 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1181 static void GLAPIENTRY
1182 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1184 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1188 static void GLAPIENTRY
1189 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1191 GET_CURRENT_CONTEXT(ctx
);
1193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1194 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1201 if (ctx
->ExecuteFlag
) {
1202 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1206 /* GL_ARB_draw_buffers_blend */
1207 static void GLAPIENTRY
1208 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1209 GLenum sfactorA
, GLenum dfactorA
)
1211 GET_CURRENT_CONTEXT(ctx
);
1213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1214 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1217 n
[2].e
= sfactorRGB
;
1218 n
[3].e
= dfactorRGB
;
1222 if (ctx
->ExecuteFlag
) {
1223 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1224 sfactorA
, dfactorA
));
1228 /* GL_ARB_draw_buffers_blend */
1229 static void GLAPIENTRY
1230 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1232 GET_CURRENT_CONTEXT(ctx
);
1234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1235 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1241 if (ctx
->ExecuteFlag
) {
1242 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1246 /* GL_ARB_draw_buffers_blend */
1247 static void GLAPIENTRY
1248 save_BlendEquationi(GLuint buf
, GLenum mode
)
1250 GET_CURRENT_CONTEXT(ctx
);
1252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1253 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1258 if (ctx
->ExecuteFlag
) {
1259 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1263 /* GL_ARB_draw_buffers_blend */
1264 static void GLAPIENTRY
1265 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1267 GET_CURRENT_CONTEXT(ctx
);
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1276 if (ctx
->ExecuteFlag
) {
1277 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1282 /* GL_ARB_draw_instanced. */
1283 static void GLAPIENTRY
1284 save_DrawArraysInstancedARB(GLenum mode
,
1289 GET_CURRENT_CONTEXT(ctx
);
1290 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1291 "glDrawArraysInstanced() during display list compile");
1294 static void GLAPIENTRY
1295 save_DrawElementsInstancedARB(GLenum mode
,
1298 const GLvoid
*indices
,
1301 GET_CURRENT_CONTEXT(ctx
);
1302 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1303 "glDrawElementsInstanced() during display list compile");
1306 static void GLAPIENTRY
1307 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1310 const GLvoid
*indices
,
1314 GET_CURRENT_CONTEXT(ctx
);
1315 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1316 "glDrawElementsInstancedBaseVertex() during display list compile");
1319 /* GL_ARB_base_instance. */
1320 static void GLAPIENTRY
1321 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1325 GLuint baseinstance
)
1327 GET_CURRENT_CONTEXT(ctx
);
1328 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1329 "glDrawArraysInstancedBaseInstance() during display list compile");
1332 static void APIENTRY
1333 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1336 const void *indices
,
1338 GLuint baseinstance
)
1340 GET_CURRENT_CONTEXT(ctx
);
1341 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1342 "glDrawElementsInstancedBaseInstance() during display list compile");
1345 static void APIENTRY
1346 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1349 const void *indices
,
1352 GLuint baseinstance
)
1354 GET_CURRENT_CONTEXT(ctx
);
1355 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1356 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1359 static void invalidate_saved_current_state( struct gl_context
*ctx
)
1363 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1364 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1366 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1367 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1369 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1371 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1374 static void GLAPIENTRY
1375 save_CallList(GLuint list
)
1377 GET_CURRENT_CONTEXT(ctx
);
1379 SAVE_FLUSH_VERTICES(ctx
);
1381 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1386 /* After this, we don't know what state we're in. Invalidate all
1387 * cached information previously gathered:
1389 invalidate_saved_current_state( ctx
);
1391 if (ctx
->ExecuteFlag
) {
1392 _mesa_CallList(list
);
1397 static void GLAPIENTRY
1398 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1400 GET_CURRENT_CONTEXT(ctx
);
1402 GLboolean typeErrorFlag
;
1404 SAVE_FLUSH_VERTICES(ctx
);
1408 case GL_UNSIGNED_BYTE
:
1410 case GL_UNSIGNED_SHORT
:
1412 case GL_UNSIGNED_INT
:
1417 typeErrorFlag
= GL_FALSE
;
1420 typeErrorFlag
= GL_TRUE
;
1423 for (i
= 0; i
< num
; i
++) {
1424 GLint list
= translate_id(i
, type
, lists
);
1425 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1428 n
[2].b
= typeErrorFlag
;
1432 /* After this, we don't know what state we're in. Invalidate all
1433 * cached information previously gathered:
1435 invalidate_saved_current_state( ctx
);
1437 if (ctx
->ExecuteFlag
) {
1438 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1443 static void GLAPIENTRY
1444 save_Clear(GLbitfield mask
)
1446 GET_CURRENT_CONTEXT(ctx
);
1448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1449 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1453 if (ctx
->ExecuteFlag
) {
1454 CALL_Clear(ctx
->Exec
, (mask
));
1459 static void GLAPIENTRY
1460 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1462 GET_CURRENT_CONTEXT(ctx
);
1464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1465 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1468 n
[2].i
= drawbuffer
;
1470 if (buffer
== GL_COLOR
) {
1481 if (ctx
->ExecuteFlag
) {
1482 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1487 static void GLAPIENTRY
1488 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1490 GET_CURRENT_CONTEXT(ctx
);
1492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1493 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1496 n
[2].i
= drawbuffer
;
1498 if (buffer
== GL_COLOR
) {
1509 if (ctx
->ExecuteFlag
) {
1510 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1515 static void GLAPIENTRY
1516 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1518 GET_CURRENT_CONTEXT(ctx
);
1520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1521 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1524 n
[2].i
= drawbuffer
;
1526 if (buffer
== GL_COLOR
) {
1537 if (ctx
->ExecuteFlag
) {
1538 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1543 static void GLAPIENTRY
1544 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1545 GLfloat depth
, GLint stencil
)
1547 GET_CURRENT_CONTEXT(ctx
);
1549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1550 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1553 n
[2].i
= drawbuffer
;
1557 if (ctx
->ExecuteFlag
) {
1558 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1563 static void GLAPIENTRY
1564 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1566 GET_CURRENT_CONTEXT(ctx
);
1568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1569 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1576 if (ctx
->ExecuteFlag
) {
1577 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1582 static void GLAPIENTRY
1583 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1585 GET_CURRENT_CONTEXT(ctx
);
1587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1588 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1595 if (ctx
->ExecuteFlag
) {
1596 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1601 static void GLAPIENTRY
1602 save_ClearDepth(GLclampd depth
)
1604 GET_CURRENT_CONTEXT(ctx
);
1606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1607 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1609 n
[1].f
= (GLfloat
) depth
;
1611 if (ctx
->ExecuteFlag
) {
1612 CALL_ClearDepth(ctx
->Exec
, (depth
));
1617 static void GLAPIENTRY
1618 save_ClearIndex(GLfloat c
)
1620 GET_CURRENT_CONTEXT(ctx
);
1622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1623 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1627 if (ctx
->ExecuteFlag
) {
1628 CALL_ClearIndex(ctx
->Exec
, (c
));
1633 static void GLAPIENTRY
1634 save_ClearStencil(GLint s
)
1636 GET_CURRENT_CONTEXT(ctx
);
1638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1639 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1643 if (ctx
->ExecuteFlag
) {
1644 CALL_ClearStencil(ctx
->Exec
, (s
));
1649 static void GLAPIENTRY
1650 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1652 GET_CURRENT_CONTEXT(ctx
);
1654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1655 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1658 n
[2].f
= (GLfloat
) equ
[0];
1659 n
[3].f
= (GLfloat
) equ
[1];
1660 n
[4].f
= (GLfloat
) equ
[2];
1661 n
[5].f
= (GLfloat
) equ
[3];
1663 if (ctx
->ExecuteFlag
) {
1664 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1670 static void GLAPIENTRY
1671 save_ColorMask(GLboolean red
, GLboolean green
,
1672 GLboolean blue
, GLboolean alpha
)
1674 GET_CURRENT_CONTEXT(ctx
);
1676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1677 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1684 if (ctx
->ExecuteFlag
) {
1685 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1690 static void GLAPIENTRY
1691 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1692 GLboolean blue
, GLboolean alpha
)
1694 GET_CURRENT_CONTEXT(ctx
);
1696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1697 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1705 if (ctx
->ExecuteFlag
) {
1706 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1711 static void GLAPIENTRY
1712 save_ColorMaterial(GLenum face
, GLenum mode
)
1714 GET_CURRENT_CONTEXT(ctx
);
1716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1718 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1723 if (ctx
->ExecuteFlag
) {
1724 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1729 static void GLAPIENTRY
1730 save_ColorTable(GLenum target
, GLenum internalFormat
,
1731 GLsizei width
, GLenum format
, GLenum type
,
1732 const GLvoid
* table
)
1734 GET_CURRENT_CONTEXT(ctx
);
1735 if (_mesa_is_proxy_texture(target
)) {
1736 /* execute immediately */
1737 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1738 format
, type
, table
));
1742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1743 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1746 n
[2].e
= internalFormat
;
1750 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1753 if (ctx
->ExecuteFlag
) {
1754 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1755 format
, type
, table
));
1762 static void GLAPIENTRY
1763 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1764 const GLfloat
*params
)
1766 GET_CURRENT_CONTEXT(ctx
);
1769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1771 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1776 if (pname
== GL_COLOR_TABLE_SGI
||
1777 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1778 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1785 if (ctx
->ExecuteFlag
) {
1786 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1791 static void GLAPIENTRY
1792 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1794 GET_CURRENT_CONTEXT(ctx
);
1797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1799 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1804 if (pname
== GL_COLOR_TABLE_SGI
||
1805 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1806 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1813 if (ctx
->ExecuteFlag
) {
1814 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1820 static void GLAPIENTRY
1821 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1822 GLenum format
, GLenum type
, const GLvoid
* table
)
1824 GET_CURRENT_CONTEXT(ctx
);
1826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1827 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1834 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1837 if (ctx
->ExecuteFlag
) {
1838 CALL_ColorSubTable(ctx
->Exec
,
1839 (target
, start
, count
, format
, type
, table
));
1844 static void GLAPIENTRY
1845 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1846 GLint x
, GLint y
, GLsizei width
)
1848 GET_CURRENT_CONTEXT(ctx
);
1851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1852 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1860 if (ctx
->ExecuteFlag
) {
1861 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1866 static void GLAPIENTRY
1867 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1868 GLint x
, GLint y
, GLsizei width
)
1870 GET_CURRENT_CONTEXT(ctx
);
1873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1874 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1877 n
[2].e
= internalformat
;
1882 if (ctx
->ExecuteFlag
) {
1883 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1888 static void GLAPIENTRY
1889 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1890 GLenum format
, GLenum type
, const GLvoid
* filter
)
1892 GET_CURRENT_CONTEXT(ctx
);
1895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1897 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1900 n
[2].e
= internalFormat
;
1904 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1907 if (ctx
->ExecuteFlag
) {
1908 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1909 format
, type
, filter
));
1914 static void GLAPIENTRY
1915 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1916 GLsizei width
, GLsizei height
, GLenum format
,
1917 GLenum type
, const GLvoid
* filter
)
1919 GET_CURRENT_CONTEXT(ctx
);
1922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1924 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1927 n
[2].e
= internalFormat
;
1932 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1935 if (ctx
->ExecuteFlag
) {
1936 CALL_ConvolutionFilter2D(ctx
->Exec
,
1937 (target
, internalFormat
, width
, height
, format
,
1943 static void GLAPIENTRY
1944 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1946 GET_CURRENT_CONTEXT(ctx
);
1948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1949 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1955 if (ctx
->ExecuteFlag
) {
1956 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1961 static void GLAPIENTRY
1962 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1964 GET_CURRENT_CONTEXT(ctx
);
1966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1967 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1972 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1973 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1974 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1980 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1983 if (ctx
->ExecuteFlag
) {
1984 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1989 static void GLAPIENTRY
1990 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1992 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
2001 if (ctx
->ExecuteFlag
) {
2002 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
2007 static void GLAPIENTRY
2008 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
2009 const GLfloat
*params
)
2011 GET_CURRENT_CONTEXT(ctx
);
2013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2014 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
2019 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
2020 pname
== GL_CONVOLUTION_FILTER_SCALE
||
2021 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
2027 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
2030 if (ctx
->ExecuteFlag
) {
2031 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
2036 static void GLAPIENTRY
2037 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2039 GET_CURRENT_CONTEXT(ctx
);
2041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2042 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2046 n
[3].i
= (GLint
) width
;
2047 n
[4].i
= (GLint
) height
;
2050 if (ctx
->ExecuteFlag
) {
2051 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2057 static void GLAPIENTRY
2058 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2059 GLint x
, GLint y
, GLsizei width
, GLint border
)
2061 GET_CURRENT_CONTEXT(ctx
);
2063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2064 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2068 n
[3].e
= internalformat
;
2074 if (ctx
->ExecuteFlag
) {
2075 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2076 x
, y
, width
, border
));
2081 static void GLAPIENTRY
2082 save_CopyTexImage2D(GLenum target
, GLint level
,
2083 GLenum internalformat
,
2084 GLint x
, GLint y
, GLsizei width
,
2085 GLsizei height
, GLint border
)
2087 GET_CURRENT_CONTEXT(ctx
);
2089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2090 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2094 n
[3].e
= internalformat
;
2101 if (ctx
->ExecuteFlag
) {
2102 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2103 x
, y
, width
, height
, border
));
2109 static void GLAPIENTRY
2110 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2111 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2113 GET_CURRENT_CONTEXT(ctx
);
2115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2116 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2125 if (ctx
->ExecuteFlag
) {
2126 CALL_CopyTexSubImage1D(ctx
->Exec
,
2127 (target
, level
, xoffset
, x
, y
, width
));
2132 static void GLAPIENTRY
2133 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2134 GLint xoffset
, GLint yoffset
,
2135 GLint x
, GLint y
, GLsizei width
, GLint height
)
2137 GET_CURRENT_CONTEXT(ctx
);
2139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2140 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2151 if (ctx
->ExecuteFlag
) {
2152 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2153 x
, y
, width
, height
));
2158 static void GLAPIENTRY
2159 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2160 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2161 GLint x
, GLint y
, GLsizei width
, GLint height
)
2163 GET_CURRENT_CONTEXT(ctx
);
2165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2166 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2178 if (ctx
->ExecuteFlag
) {
2179 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2180 xoffset
, yoffset
, zoffset
,
2181 x
, y
, width
, height
));
2186 static void GLAPIENTRY
2187 save_CullFace(GLenum mode
)
2189 GET_CURRENT_CONTEXT(ctx
);
2191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2192 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2196 if (ctx
->ExecuteFlag
) {
2197 CALL_CullFace(ctx
->Exec
, (mode
));
2202 static void GLAPIENTRY
2203 save_DepthFunc(GLenum func
)
2205 GET_CURRENT_CONTEXT(ctx
);
2207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2208 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2212 if (ctx
->ExecuteFlag
) {
2213 CALL_DepthFunc(ctx
->Exec
, (func
));
2218 static void GLAPIENTRY
2219 save_DepthMask(GLboolean mask
)
2221 GET_CURRENT_CONTEXT(ctx
);
2223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2224 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2228 if (ctx
->ExecuteFlag
) {
2229 CALL_DepthMask(ctx
->Exec
, (mask
));
2234 static void GLAPIENTRY
2235 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2237 GET_CURRENT_CONTEXT(ctx
);
2239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2240 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2242 n
[1].f
= (GLfloat
) nearval
;
2243 n
[2].f
= (GLfloat
) farval
;
2245 if (ctx
->ExecuteFlag
) {
2246 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2251 static void GLAPIENTRY
2252 save_Disable(GLenum cap
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2261 if (ctx
->ExecuteFlag
) {
2262 CALL_Disable(ctx
->Exec
, (cap
));
2267 static void GLAPIENTRY
2268 save_DisableIndexed(GLuint index
, GLenum cap
)
2270 GET_CURRENT_CONTEXT(ctx
);
2272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2273 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2278 if (ctx
->ExecuteFlag
) {
2279 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2284 static void GLAPIENTRY
2285 save_DrawBuffer(GLenum mode
)
2287 GET_CURRENT_CONTEXT(ctx
);
2289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2290 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2294 if (ctx
->ExecuteFlag
) {
2295 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2300 static void GLAPIENTRY
2301 save_DrawPixels(GLsizei width
, GLsizei height
,
2302 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2304 GET_CURRENT_CONTEXT(ctx
);
2307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2315 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2316 pixels
, &ctx
->Unpack
);
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2325 static void GLAPIENTRY
2326 save_Enable(GLenum cap
)
2328 GET_CURRENT_CONTEXT(ctx
);
2330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2331 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2335 if (ctx
->ExecuteFlag
) {
2336 CALL_Enable(ctx
->Exec
, (cap
));
2342 static void GLAPIENTRY
2343 save_EnableIndexed(GLuint index
, GLenum cap
)
2345 GET_CURRENT_CONTEXT(ctx
);
2347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2348 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2353 if (ctx
->ExecuteFlag
) {
2354 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2360 static void GLAPIENTRY
2361 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2363 GET_CURRENT_CONTEXT(ctx
);
2365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2366 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2372 if (ctx
->ExecuteFlag
) {
2373 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2378 static void GLAPIENTRY
2379 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2381 GET_CURRENT_CONTEXT(ctx
);
2383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2384 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2392 if (ctx
->ExecuteFlag
) {
2393 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2400 static void GLAPIENTRY
2401 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2403 GET_CURRENT_CONTEXT(ctx
);
2405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2406 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2414 if (ctx
->ExecuteFlag
) {
2415 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2420 static void GLAPIENTRY
2421 save_Fogf(GLenum pname
, GLfloat param
)
2425 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2426 save_Fogfv(pname
, parray
);
2430 static void GLAPIENTRY
2431 save_Fogiv(GLenum pname
, const GLint
*params
)
2436 case GL_FOG_DENSITY
:
2440 p
[0] = (GLfloat
) *params
;
2446 p
[0] = INT_TO_FLOAT(params
[0]);
2447 p
[1] = INT_TO_FLOAT(params
[1]);
2448 p
[2] = INT_TO_FLOAT(params
[2]);
2449 p
[3] = INT_TO_FLOAT(params
[3]);
2452 /* Error will be caught later in gl_Fogfv */
2453 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2455 save_Fogfv(pname
, p
);
2459 static void GLAPIENTRY
2460 save_Fogi(GLenum pname
, GLint param
)
2464 parray
[1] = parray
[2] = parray
[3] = 0;
2465 save_Fogiv(pname
, parray
);
2469 static void GLAPIENTRY
2470 save_FrontFace(GLenum mode
)
2472 GET_CURRENT_CONTEXT(ctx
);
2474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2475 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2479 if (ctx
->ExecuteFlag
) {
2480 CALL_FrontFace(ctx
->Exec
, (mode
));
2485 static void GLAPIENTRY
2486 save_Frustum(GLdouble left
, GLdouble right
,
2487 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2489 GET_CURRENT_CONTEXT(ctx
);
2491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2492 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2494 n
[1].f
= (GLfloat
) left
;
2495 n
[2].f
= (GLfloat
) right
;
2496 n
[3].f
= (GLfloat
) bottom
;
2497 n
[4].f
= (GLfloat
) top
;
2498 n
[5].f
= (GLfloat
) nearval
;
2499 n
[6].f
= (GLfloat
) farval
;
2501 if (ctx
->ExecuteFlag
) {
2502 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2507 static void GLAPIENTRY
2508 save_Hint(GLenum target
, GLenum mode
)
2510 GET_CURRENT_CONTEXT(ctx
);
2512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2513 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2518 if (ctx
->ExecuteFlag
) {
2519 CALL_Hint(ctx
->Exec
, (target
, mode
));
2524 static void GLAPIENTRY
2525 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2528 GET_CURRENT_CONTEXT(ctx
);
2531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2532 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2536 n
[3].e
= internalFormat
;
2539 if (ctx
->ExecuteFlag
) {
2540 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2545 static void GLAPIENTRY
2546 save_IndexMask(GLuint mask
)
2548 GET_CURRENT_CONTEXT(ctx
);
2550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2551 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2555 if (ctx
->ExecuteFlag
) {
2556 CALL_IndexMask(ctx
->Exec
, (mask
));
2561 static void GLAPIENTRY
2562 save_InitNames(void)
2564 GET_CURRENT_CONTEXT(ctx
);
2565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2566 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2567 if (ctx
->ExecuteFlag
) {
2568 CALL_InitNames(ctx
->Exec
, ());
2573 static void GLAPIENTRY
2574 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2576 GET_CURRENT_CONTEXT(ctx
);
2578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2579 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2597 case GL_SPOT_DIRECTION
:
2600 case GL_SPOT_EXPONENT
:
2603 case GL_SPOT_CUTOFF
:
2606 case GL_CONSTANT_ATTENUATION
:
2609 case GL_LINEAR_ATTENUATION
:
2612 case GL_QUADRATIC_ATTENUATION
:
2618 for (i
= 0; i
< nParams
; i
++) {
2619 n
[3 + i
].f
= params
[i
];
2622 if (ctx
->ExecuteFlag
) {
2623 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2628 static void GLAPIENTRY
2629 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2633 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2634 save_Lightfv(light
, pname
, parray
);
2638 static void GLAPIENTRY
2639 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2646 fparam
[0] = INT_TO_FLOAT(params
[0]);
2647 fparam
[1] = INT_TO_FLOAT(params
[1]);
2648 fparam
[2] = INT_TO_FLOAT(params
[2]);
2649 fparam
[3] = INT_TO_FLOAT(params
[3]);
2652 fparam
[0] = (GLfloat
) params
[0];
2653 fparam
[1] = (GLfloat
) params
[1];
2654 fparam
[2] = (GLfloat
) params
[2];
2655 fparam
[3] = (GLfloat
) params
[3];
2657 case GL_SPOT_DIRECTION
:
2658 fparam
[0] = (GLfloat
) params
[0];
2659 fparam
[1] = (GLfloat
) params
[1];
2660 fparam
[2] = (GLfloat
) params
[2];
2662 case GL_SPOT_EXPONENT
:
2663 case GL_SPOT_CUTOFF
:
2664 case GL_CONSTANT_ATTENUATION
:
2665 case GL_LINEAR_ATTENUATION
:
2666 case GL_QUADRATIC_ATTENUATION
:
2667 fparam
[0] = (GLfloat
) params
[0];
2670 /* error will be caught later in gl_Lightfv */
2673 save_Lightfv(light
, pname
, fparam
);
2677 static void GLAPIENTRY
2678 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2682 parray
[1] = parray
[2] = parray
[3] = 0;
2683 save_Lightiv(light
, pname
, parray
);
2687 static void GLAPIENTRY
2688 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2690 GET_CURRENT_CONTEXT(ctx
);
2692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2693 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2701 if (ctx
->ExecuteFlag
) {
2702 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2707 static void GLAPIENTRY
2708 save_LightModelf(GLenum pname
, GLfloat param
)
2712 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2713 save_LightModelfv(pname
, parray
);
2717 static void GLAPIENTRY
2718 save_LightModeliv(GLenum pname
, const GLint
*params
)
2722 case GL_LIGHT_MODEL_AMBIENT
:
2723 fparam
[0] = INT_TO_FLOAT(params
[0]);
2724 fparam
[1] = INT_TO_FLOAT(params
[1]);
2725 fparam
[2] = INT_TO_FLOAT(params
[2]);
2726 fparam
[3] = INT_TO_FLOAT(params
[3]);
2728 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2729 case GL_LIGHT_MODEL_TWO_SIDE
:
2730 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2731 fparam
[0] = (GLfloat
) params
[0];
2737 /* Error will be caught later in gl_LightModelfv */
2738 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2740 save_LightModelfv(pname
, fparam
);
2744 static void GLAPIENTRY
2745 save_LightModeli(GLenum pname
, GLint param
)
2749 parray
[1] = parray
[2] = parray
[3] = 0;
2750 save_LightModeliv(pname
, parray
);
2754 static void GLAPIENTRY
2755 save_LineStipple(GLint factor
, GLushort pattern
)
2757 GET_CURRENT_CONTEXT(ctx
);
2759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2760 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2765 if (ctx
->ExecuteFlag
) {
2766 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2771 static void GLAPIENTRY
2772 save_LineWidth(GLfloat width
)
2774 GET_CURRENT_CONTEXT(ctx
);
2776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2777 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2781 if (ctx
->ExecuteFlag
) {
2782 CALL_LineWidth(ctx
->Exec
, (width
));
2787 static void GLAPIENTRY
2788 save_ListBase(GLuint base
)
2790 GET_CURRENT_CONTEXT(ctx
);
2792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2793 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2797 if (ctx
->ExecuteFlag
) {
2798 CALL_ListBase(ctx
->Exec
, (base
));
2803 static void GLAPIENTRY
2804 save_LoadIdentity(void)
2806 GET_CURRENT_CONTEXT(ctx
);
2807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2808 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2809 if (ctx
->ExecuteFlag
) {
2810 CALL_LoadIdentity(ctx
->Exec
, ());
2815 static void GLAPIENTRY
2816 save_LoadMatrixf(const GLfloat
* m
)
2818 GET_CURRENT_CONTEXT(ctx
);
2820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2821 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2824 for (i
= 0; i
< 16; i
++) {
2828 if (ctx
->ExecuteFlag
) {
2829 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2834 static void GLAPIENTRY
2835 save_LoadMatrixd(const GLdouble
* m
)
2839 for (i
= 0; i
< 16; i
++) {
2840 f
[i
] = (GLfloat
) m
[i
];
2842 save_LoadMatrixf(f
);
2846 static void GLAPIENTRY
2847 save_LoadName(GLuint name
)
2849 GET_CURRENT_CONTEXT(ctx
);
2851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2852 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2856 if (ctx
->ExecuteFlag
) {
2857 CALL_LoadName(ctx
->Exec
, (name
));
2862 static void GLAPIENTRY
2863 save_LogicOp(GLenum opcode
)
2865 GET_CURRENT_CONTEXT(ctx
);
2867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2868 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2872 if (ctx
->ExecuteFlag
) {
2873 CALL_LogicOp(ctx
->Exec
, (opcode
));
2878 static void GLAPIENTRY
2879 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2880 GLint order
, const GLdouble
* points
)
2882 GET_CURRENT_CONTEXT(ctx
);
2884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2885 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2887 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2889 n
[2].f
= (GLfloat
) u1
;
2890 n
[3].f
= (GLfloat
) u2
;
2891 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2893 n
[6].data
= (void *) pnts
;
2895 if (ctx
->ExecuteFlag
) {
2896 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2900 static void GLAPIENTRY
2901 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2902 GLint order
, const GLfloat
* points
)
2904 GET_CURRENT_CONTEXT(ctx
);
2906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2907 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2909 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2913 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2915 n
[6].data
= (void *) pnts
;
2917 if (ctx
->ExecuteFlag
) {
2918 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2923 static void GLAPIENTRY
2924 save_Map2d(GLenum target
,
2925 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2926 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2927 const GLdouble
* points
)
2929 GET_CURRENT_CONTEXT(ctx
);
2931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2932 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2934 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2935 vstride
, vorder
, points
);
2937 n
[2].f
= (GLfloat
) u1
;
2938 n
[3].f
= (GLfloat
) u2
;
2939 n
[4].f
= (GLfloat
) v1
;
2940 n
[5].f
= (GLfloat
) v2
;
2941 /* XXX verify these strides are correct */
2942 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2943 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2946 n
[10].data
= (void *) pnts
;
2948 if (ctx
->ExecuteFlag
) {
2949 CALL_Map2d(ctx
->Exec
, (target
,
2950 u1
, u2
, ustride
, uorder
,
2951 v1
, v2
, vstride
, vorder
, points
));
2956 static void GLAPIENTRY
2957 save_Map2f(GLenum target
,
2958 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2959 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2960 const GLfloat
* points
)
2962 GET_CURRENT_CONTEXT(ctx
);
2964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2965 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2967 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2968 vstride
, vorder
, points
);
2974 /* XXX verify these strides are correct */
2975 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2976 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2979 n
[10].data
= (void *) pnts
;
2981 if (ctx
->ExecuteFlag
) {
2982 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2983 v1
, v2
, vstride
, vorder
, points
));
2988 static void GLAPIENTRY
2989 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2991 GET_CURRENT_CONTEXT(ctx
);
2993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2994 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3000 if (ctx
->ExecuteFlag
) {
3001 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3006 static void GLAPIENTRY
3007 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3009 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3013 static void GLAPIENTRY
3014 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3015 GLint vn
, GLfloat v1
, GLfloat v2
)
3017 GET_CURRENT_CONTEXT(ctx
);
3019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3020 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3029 if (ctx
->ExecuteFlag
) {
3030 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3036 static void GLAPIENTRY
3037 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3038 GLint vn
, GLdouble v1
, GLdouble v2
)
3040 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3041 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3045 static void GLAPIENTRY
3046 save_MatrixMode(GLenum mode
)
3048 GET_CURRENT_CONTEXT(ctx
);
3050 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3051 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3055 if (ctx
->ExecuteFlag
) {
3056 CALL_MatrixMode(ctx
->Exec
, (mode
));
3061 static void GLAPIENTRY
3062 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
3064 GET_CURRENT_CONTEXT(ctx
);
3067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3068 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
3071 n
[2].e
= internalFormat
;
3074 if (ctx
->ExecuteFlag
) {
3075 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
3080 static void GLAPIENTRY
3081 save_MultMatrixf(const GLfloat
* m
)
3083 GET_CURRENT_CONTEXT(ctx
);
3085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3086 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3089 for (i
= 0; i
< 16; i
++) {
3093 if (ctx
->ExecuteFlag
) {
3094 CALL_MultMatrixf(ctx
->Exec
, (m
));
3099 static void GLAPIENTRY
3100 save_MultMatrixd(const GLdouble
* m
)
3104 for (i
= 0; i
< 16; i
++) {
3105 f
[i
] = (GLfloat
) m
[i
];
3107 save_MultMatrixf(f
);
3111 static void GLAPIENTRY
3112 save_NewList(GLuint name
, GLenum mode
)
3114 GET_CURRENT_CONTEXT(ctx
);
3115 /* It's an error to call this function while building a display list */
3116 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3123 static void GLAPIENTRY
3124 save_Ortho(GLdouble left
, GLdouble right
,
3125 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3127 GET_CURRENT_CONTEXT(ctx
);
3129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3130 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3132 n
[1].f
= (GLfloat
) left
;
3133 n
[2].f
= (GLfloat
) right
;
3134 n
[3].f
= (GLfloat
) bottom
;
3135 n
[4].f
= (GLfloat
) top
;
3136 n
[5].f
= (GLfloat
) nearval
;
3137 n
[6].f
= (GLfloat
) farval
;
3139 if (ctx
->ExecuteFlag
) {
3140 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3145 static void GLAPIENTRY
3146 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
3155 n
[3].data
= malloc(mapsize
* sizeof(GLfloat
));
3156 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
3158 if (ctx
->ExecuteFlag
) {
3159 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3164 static void GLAPIENTRY
3165 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3167 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3169 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3170 for (i
= 0; i
< mapsize
; i
++) {
3171 fvalues
[i
] = (GLfloat
) values
[i
];
3175 for (i
= 0; i
< mapsize
; i
++) {
3176 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3179 save_PixelMapfv(map
, mapsize
, fvalues
);
3183 static void GLAPIENTRY
3184 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3186 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3188 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3189 for (i
= 0; i
< mapsize
; i
++) {
3190 fvalues
[i
] = (GLfloat
) values
[i
];
3194 for (i
= 0; i
< mapsize
; i
++) {
3195 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3198 save_PixelMapfv(map
, mapsize
, fvalues
);
3202 static void GLAPIENTRY
3203 save_PixelTransferf(GLenum pname
, GLfloat param
)
3205 GET_CURRENT_CONTEXT(ctx
);
3207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3208 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3213 if (ctx
->ExecuteFlag
) {
3214 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3219 static void GLAPIENTRY
3220 save_PixelTransferi(GLenum pname
, GLint param
)
3222 save_PixelTransferf(pname
, (GLfloat
) param
);
3226 static void GLAPIENTRY
3227 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3229 GET_CURRENT_CONTEXT(ctx
);
3231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3232 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3237 if (ctx
->ExecuteFlag
) {
3238 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3243 static void GLAPIENTRY
3244 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3246 GET_CURRENT_CONTEXT(ctx
);
3248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3249 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3256 if (ctx
->ExecuteFlag
) {
3257 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3262 static void GLAPIENTRY
3263 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3267 parray
[1] = parray
[2] = 0.0F
;
3268 save_PointParameterfvEXT(pname
, parray
);
3271 static void GLAPIENTRY
3272 save_PointParameteriNV(GLenum pname
, GLint param
)
3275 parray
[0] = (GLfloat
) param
;
3276 parray
[1] = parray
[2] = 0.0F
;
3277 save_PointParameterfvEXT(pname
, parray
);
3280 static void GLAPIENTRY
3281 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3284 parray
[0] = (GLfloat
) param
[0];
3285 parray
[1] = parray
[2] = 0.0F
;
3286 save_PointParameterfvEXT(pname
, parray
);
3290 static void GLAPIENTRY
3291 save_PointSize(GLfloat size
)
3293 GET_CURRENT_CONTEXT(ctx
);
3295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3296 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3300 if (ctx
->ExecuteFlag
) {
3301 CALL_PointSize(ctx
->Exec
, (size
));
3306 static void GLAPIENTRY
3307 save_PolygonMode(GLenum face
, GLenum mode
)
3309 GET_CURRENT_CONTEXT(ctx
);
3311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3312 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3317 if (ctx
->ExecuteFlag
) {
3318 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3323 static void GLAPIENTRY
3324 save_PolygonStipple(const GLubyte
* pattern
)
3326 GET_CURRENT_CONTEXT(ctx
);
3329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3331 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3333 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3334 pattern
, &ctx
->Unpack
);
3336 if (ctx
->ExecuteFlag
) {
3337 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3342 static void GLAPIENTRY
3343 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3345 GET_CURRENT_CONTEXT(ctx
);
3347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3348 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3353 if (ctx
->ExecuteFlag
) {
3354 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3359 static void GLAPIENTRY
3360 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3362 GET_CURRENT_CONTEXT(ctx
);
3363 /* XXX mult by DepthMaxF here??? */
3364 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3368 static void GLAPIENTRY
3369 save_PopAttrib(void)
3371 GET_CURRENT_CONTEXT(ctx
);
3372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3373 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3374 if (ctx
->ExecuteFlag
) {
3375 CALL_PopAttrib(ctx
->Exec
, ());
3380 static void GLAPIENTRY
3381 save_PopMatrix(void)
3383 GET_CURRENT_CONTEXT(ctx
);
3384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3385 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3386 if (ctx
->ExecuteFlag
) {
3387 CALL_PopMatrix(ctx
->Exec
, ());
3392 static void GLAPIENTRY
3395 GET_CURRENT_CONTEXT(ctx
);
3396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3397 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3398 if (ctx
->ExecuteFlag
) {
3399 CALL_PopName(ctx
->Exec
, ());
3404 static void GLAPIENTRY
3405 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3406 const GLclampf
* priorities
)
3408 GET_CURRENT_CONTEXT(ctx
);
3410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3412 for (i
= 0; i
< num
; i
++) {
3414 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3416 n
[1].ui
= textures
[i
];
3417 n
[2].f
= priorities
[i
];
3420 if (ctx
->ExecuteFlag
) {
3421 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3426 static void GLAPIENTRY
3427 save_PushAttrib(GLbitfield mask
)
3429 GET_CURRENT_CONTEXT(ctx
);
3431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3432 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3436 if (ctx
->ExecuteFlag
) {
3437 CALL_PushAttrib(ctx
->Exec
, (mask
));
3442 static void GLAPIENTRY
3443 save_PushMatrix(void)
3445 GET_CURRENT_CONTEXT(ctx
);
3446 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3447 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3448 if (ctx
->ExecuteFlag
) {
3449 CALL_PushMatrix(ctx
->Exec
, ());
3454 static void GLAPIENTRY
3455 save_PushName(GLuint name
)
3457 GET_CURRENT_CONTEXT(ctx
);
3459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3460 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3464 if (ctx
->ExecuteFlag
) {
3465 CALL_PushName(ctx
->Exec
, (name
));
3470 static void GLAPIENTRY
3471 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3473 GET_CURRENT_CONTEXT(ctx
);
3475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3476 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3483 if (ctx
->ExecuteFlag
) {
3484 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3488 static void GLAPIENTRY
3489 save_RasterPos2d(GLdouble x
, GLdouble y
)
3491 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3494 static void GLAPIENTRY
3495 save_RasterPos2f(GLfloat x
, GLfloat y
)
3497 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3500 static void GLAPIENTRY
3501 save_RasterPos2i(GLint x
, GLint y
)
3503 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3506 static void GLAPIENTRY
3507 save_RasterPos2s(GLshort x
, GLshort y
)
3509 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3512 static void GLAPIENTRY
3513 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3515 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3518 static void GLAPIENTRY
3519 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3521 save_RasterPos4f(x
, y
, z
, 1.0F
);
3524 static void GLAPIENTRY
3525 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3527 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3530 static void GLAPIENTRY
3531 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3533 save_RasterPos4f(x
, y
, z
, 1.0F
);
3536 static void GLAPIENTRY
3537 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3539 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3542 static void GLAPIENTRY
3543 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3545 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3548 static void GLAPIENTRY
3549 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3551 save_RasterPos4f(x
, y
, z
, w
);
3554 static void GLAPIENTRY
3555 save_RasterPos2dv(const GLdouble
* v
)
3557 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3560 static void GLAPIENTRY
3561 save_RasterPos2fv(const GLfloat
* v
)
3563 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3566 static void GLAPIENTRY
3567 save_RasterPos2iv(const GLint
* v
)
3569 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3572 static void GLAPIENTRY
3573 save_RasterPos2sv(const GLshort
* v
)
3575 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3578 static void GLAPIENTRY
3579 save_RasterPos3dv(const GLdouble
* v
)
3581 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3584 static void GLAPIENTRY
3585 save_RasterPos3fv(const GLfloat
* v
)
3587 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3590 static void GLAPIENTRY
3591 save_RasterPos3iv(const GLint
* v
)
3593 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3596 static void GLAPIENTRY
3597 save_RasterPos3sv(const GLshort
* v
)
3599 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3602 static void GLAPIENTRY
3603 save_RasterPos4dv(const GLdouble
* v
)
3605 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3606 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3609 static void GLAPIENTRY
3610 save_RasterPos4fv(const GLfloat
* v
)
3612 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3615 static void GLAPIENTRY
3616 save_RasterPos4iv(const GLint
* v
)
3618 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3619 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3622 static void GLAPIENTRY
3623 save_RasterPos4sv(const GLshort
* v
)
3625 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3629 static void GLAPIENTRY
3630 save_PassThrough(GLfloat token
)
3632 GET_CURRENT_CONTEXT(ctx
);
3634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3635 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3639 if (ctx
->ExecuteFlag
) {
3640 CALL_PassThrough(ctx
->Exec
, (token
));
3645 static void GLAPIENTRY
3646 save_ReadBuffer(GLenum mode
)
3648 GET_CURRENT_CONTEXT(ctx
);
3650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3651 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3655 if (ctx
->ExecuteFlag
) {
3656 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3661 static void GLAPIENTRY
3662 save_ResetHistogram(GLenum target
)
3664 GET_CURRENT_CONTEXT(ctx
);
3666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3667 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3671 if (ctx
->ExecuteFlag
) {
3672 CALL_ResetHistogram(ctx
->Exec
, (target
));
3677 static void GLAPIENTRY
3678 save_ResetMinmax(GLenum target
)
3680 GET_CURRENT_CONTEXT(ctx
);
3682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3683 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3687 if (ctx
->ExecuteFlag
) {
3688 CALL_ResetMinmax(ctx
->Exec
, (target
));
3693 static void GLAPIENTRY
3694 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3696 GET_CURRENT_CONTEXT(ctx
);
3698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3699 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3706 if (ctx
->ExecuteFlag
) {
3707 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3712 static void GLAPIENTRY
3713 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3715 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3719 static void GLAPIENTRY
3720 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3722 GET_CURRENT_CONTEXT(ctx
);
3724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3725 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3731 if (ctx
->ExecuteFlag
) {
3732 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3737 static void GLAPIENTRY
3738 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3740 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3744 static void GLAPIENTRY
3745 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3747 GET_CURRENT_CONTEXT(ctx
);
3749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3750 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3757 if (ctx
->ExecuteFlag
) {
3758 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3763 static void GLAPIENTRY
3764 save_ShadeModel(GLenum mode
)
3766 GET_CURRENT_CONTEXT(ctx
);
3768 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3770 if (ctx
->ExecuteFlag
) {
3771 CALL_ShadeModel(ctx
->Exec
, (mode
));
3774 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3777 SAVE_FLUSH_VERTICES(ctx
);
3779 /* Only save the value if we know the statechange will take effect:
3781 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3782 ctx
->ListState
.Current
.ShadeModel
= mode
;
3784 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3791 static void GLAPIENTRY
3792 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3794 GET_CURRENT_CONTEXT(ctx
);
3796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3797 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3803 if (ctx
->ExecuteFlag
) {
3804 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3809 static void GLAPIENTRY
3810 save_StencilMask(GLuint mask
)
3812 GET_CURRENT_CONTEXT(ctx
);
3814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3815 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3819 if (ctx
->ExecuteFlag
) {
3820 CALL_StencilMask(ctx
->Exec
, (mask
));
3825 static void GLAPIENTRY
3826 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3828 GET_CURRENT_CONTEXT(ctx
);
3830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3831 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3837 if (ctx
->ExecuteFlag
) {
3838 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3843 static void GLAPIENTRY
3844 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3846 GET_CURRENT_CONTEXT(ctx
);
3848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3849 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3856 if (ctx
->ExecuteFlag
) {
3857 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3862 static void GLAPIENTRY
3863 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3866 GET_CURRENT_CONTEXT(ctx
);
3868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3870 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3878 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3885 if (ctx
->ExecuteFlag
) {
3886 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3887 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3892 static void GLAPIENTRY
3893 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3895 GET_CURRENT_CONTEXT(ctx
);
3897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3898 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3903 if (ctx
->ExecuteFlag
) {
3904 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3909 static void GLAPIENTRY
3910 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3912 GET_CURRENT_CONTEXT(ctx
);
3914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3915 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3922 if (ctx
->ExecuteFlag
) {
3923 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3928 static void GLAPIENTRY
3929 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3931 GET_CURRENT_CONTEXT(ctx
);
3933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3934 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3938 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3946 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3949 if (ctx
->ExecuteFlag
) {
3950 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3955 static void GLAPIENTRY
3956 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3959 parray
[0] = (GLfloat
) param
;
3960 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3961 save_TexEnvfv(target
, pname
, parray
);
3965 static void GLAPIENTRY
3966 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3969 p
[0] = (GLfloat
) param
;
3970 p
[1] = p
[2] = p
[3] = 0.0F
;
3971 save_TexEnvfv(target
, pname
, p
);
3975 static void GLAPIENTRY
3976 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3979 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3980 p
[0] = INT_TO_FLOAT(param
[0]);
3981 p
[1] = INT_TO_FLOAT(param
[1]);
3982 p
[2] = INT_TO_FLOAT(param
[2]);
3983 p
[3] = INT_TO_FLOAT(param
[3]);
3986 p
[0] = (GLfloat
) param
[0];
3987 p
[1] = p
[2] = p
[3] = 0.0F
;
3989 save_TexEnvfv(target
, pname
, p
);
3993 static void GLAPIENTRY
3994 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3996 GET_CURRENT_CONTEXT(ctx
);
3998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3999 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4008 if (ctx
->ExecuteFlag
) {
4009 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4014 static void GLAPIENTRY
4015 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4018 p
[0] = (GLfloat
) params
[0];
4019 p
[1] = (GLfloat
) params
[1];
4020 p
[2] = (GLfloat
) params
[2];
4021 p
[3] = (GLfloat
) params
[3];
4022 save_TexGenfv(coord
, pname
, p
);
4026 static void GLAPIENTRY
4027 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4030 parray
[0] = (GLfloat
) param
;
4031 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4032 save_TexGenfv(coord
, pname
, parray
);
4036 static void GLAPIENTRY
4037 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4040 p
[0] = (GLfloat
) params
[0];
4041 p
[1] = (GLfloat
) params
[1];
4042 p
[2] = (GLfloat
) params
[2];
4043 p
[3] = (GLfloat
) params
[3];
4044 save_TexGenfv(coord
, pname
, p
);
4048 static void GLAPIENTRY
4049 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4053 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4054 save_TexGenfv(coord
, pname
, parray
);
4058 static void GLAPIENTRY
4059 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4063 parray
[1] = parray
[2] = parray
[3] = 0;
4064 save_TexGeniv(coord
, pname
, parray
);
4068 static void GLAPIENTRY
4069 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4071 GET_CURRENT_CONTEXT(ctx
);
4073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4074 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4083 if (ctx
->ExecuteFlag
) {
4084 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4089 static void GLAPIENTRY
4090 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4094 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4095 save_TexParameterfv(target
, pname
, parray
);
4099 static void GLAPIENTRY
4100 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4103 fparam
[0] = (GLfloat
) param
;
4104 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4105 save_TexParameterfv(target
, pname
, fparam
);
4109 static void GLAPIENTRY
4110 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4113 fparam
[0] = (GLfloat
) params
[0];
4114 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4115 save_TexParameterfv(target
, pname
, fparam
);
4119 static void GLAPIENTRY
4120 save_TexImage1D(GLenum target
,
4121 GLint level
, GLint components
,
4122 GLsizei width
, GLint border
,
4123 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4125 GET_CURRENT_CONTEXT(ctx
);
4126 if (target
== GL_PROXY_TEXTURE_1D
) {
4127 /* don't compile, execute immediately */
4128 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4129 border
, format
, type
, pixels
));
4133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4134 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
4138 n
[3].i
= components
;
4139 n
[4].i
= (GLint
) width
;
4143 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4144 pixels
, &ctx
->Unpack
);
4146 if (ctx
->ExecuteFlag
) {
4147 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4148 border
, format
, type
, pixels
));
4154 static void GLAPIENTRY
4155 save_TexImage2D(GLenum target
,
4156 GLint level
, GLint components
,
4157 GLsizei width
, GLsizei height
, GLint border
,
4158 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4160 GET_CURRENT_CONTEXT(ctx
);
4161 if (target
== GL_PROXY_TEXTURE_2D
) {
4162 /* don't compile, execute immediately */
4163 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4164 height
, border
, format
, type
, pixels
));
4168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4169 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
4173 n
[3].i
= components
;
4174 n
[4].i
= (GLint
) width
;
4175 n
[5].i
= (GLint
) height
;
4179 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4180 pixels
, &ctx
->Unpack
);
4182 if (ctx
->ExecuteFlag
) {
4183 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4184 height
, border
, format
, type
, pixels
));
4190 static void GLAPIENTRY
4191 save_TexImage3D(GLenum target
,
4192 GLint level
, GLint internalFormat
,
4193 GLsizei width
, GLsizei height
, GLsizei depth
,
4195 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4197 GET_CURRENT_CONTEXT(ctx
);
4198 if (target
== GL_PROXY_TEXTURE_3D
) {
4199 /* don't compile, execute immediately */
4200 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4201 height
, depth
, border
, format
, type
,
4206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4207 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
4211 n
[3].i
= (GLint
) internalFormat
;
4212 n
[4].i
= (GLint
) width
;
4213 n
[5].i
= (GLint
) height
;
4214 n
[6].i
= (GLint
) depth
;
4218 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4219 pixels
, &ctx
->Unpack
);
4221 if (ctx
->ExecuteFlag
) {
4222 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4223 height
, depth
, border
, format
, type
,
4230 static void GLAPIENTRY
4231 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4232 GLsizei width
, GLenum format
, GLenum type
,
4233 const GLvoid
* pixels
)
4235 GET_CURRENT_CONTEXT(ctx
);
4238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4240 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4245 n
[4].i
= (GLint
) width
;
4248 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4249 pixels
, &ctx
->Unpack
);
4251 if (ctx
->ExecuteFlag
) {
4252 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4253 format
, type
, pixels
));
4258 static void GLAPIENTRY
4259 save_TexSubImage2D(GLenum target
, GLint level
,
4260 GLint xoffset
, GLint yoffset
,
4261 GLsizei width
, GLsizei height
,
4262 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4264 GET_CURRENT_CONTEXT(ctx
);
4267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4269 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4275 n
[5].i
= (GLint
) width
;
4276 n
[6].i
= (GLint
) height
;
4279 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4280 pixels
, &ctx
->Unpack
);
4282 if (ctx
->ExecuteFlag
) {
4283 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4284 width
, height
, format
, type
, pixels
));
4289 static void GLAPIENTRY
4290 save_TexSubImage3D(GLenum target
, GLint level
,
4291 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4292 GLsizei width
, GLsizei height
, GLsizei depth
,
4293 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4295 GET_CURRENT_CONTEXT(ctx
);
4298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4300 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4307 n
[6].i
= (GLint
) width
;
4308 n
[7].i
= (GLint
) height
;
4309 n
[8].i
= (GLint
) depth
;
4312 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4313 pixels
, &ctx
->Unpack
);
4315 if (ctx
->ExecuteFlag
) {
4316 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4317 xoffset
, yoffset
, zoffset
,
4318 width
, height
, depth
, format
, type
,
4324 static void GLAPIENTRY
4325 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4327 GET_CURRENT_CONTEXT(ctx
);
4329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4330 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4336 if (ctx
->ExecuteFlag
) {
4337 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4342 static void GLAPIENTRY
4343 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4345 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4350 static void GLAPIENTRY
4351 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4353 GET_CURRENT_CONTEXT(ctx
);
4355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4356 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4360 n
[3].i
= (GLint
) width
;
4361 n
[4].i
= (GLint
) height
;
4363 if (ctx
->ExecuteFlag
) {
4364 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4369 static void GLAPIENTRY
4370 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4372 GET_CURRENT_CONTEXT(ctx
);
4374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4375 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4382 if (ctx
->ExecuteFlag
) {
4383 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4387 static void GLAPIENTRY
4388 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4390 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4393 static void GLAPIENTRY
4394 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4396 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4399 static void GLAPIENTRY
4400 save_WindowPos2iMESA(GLint x
, GLint y
)
4402 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4405 static void GLAPIENTRY
4406 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4408 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4411 static void GLAPIENTRY
4412 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4414 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4417 static void GLAPIENTRY
4418 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4420 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4423 static void GLAPIENTRY
4424 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4426 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4429 static void GLAPIENTRY
4430 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4432 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4435 static void GLAPIENTRY
4436 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4438 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4441 static void GLAPIENTRY
4442 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4444 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4447 static void GLAPIENTRY
4448 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4450 save_WindowPos4fMESA(x
, y
, z
, w
);
4453 static void GLAPIENTRY
4454 save_WindowPos2dvMESA(const GLdouble
* v
)
4456 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4459 static void GLAPIENTRY
4460 save_WindowPos2fvMESA(const GLfloat
* v
)
4462 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4465 static void GLAPIENTRY
4466 save_WindowPos2ivMESA(const GLint
* v
)
4468 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4471 static void GLAPIENTRY
4472 save_WindowPos2svMESA(const GLshort
* v
)
4474 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4477 static void GLAPIENTRY
4478 save_WindowPos3dvMESA(const GLdouble
* v
)
4480 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4483 static void GLAPIENTRY
4484 save_WindowPos3fvMESA(const GLfloat
* v
)
4486 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4489 static void GLAPIENTRY
4490 save_WindowPos3ivMESA(const GLint
* v
)
4492 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4495 static void GLAPIENTRY
4496 save_WindowPos3svMESA(const GLshort
* v
)
4498 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4501 static void GLAPIENTRY
4502 save_WindowPos4dvMESA(const GLdouble
* v
)
4504 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4505 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4508 static void GLAPIENTRY
4509 save_WindowPos4fvMESA(const GLfloat
* v
)
4511 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4514 static void GLAPIENTRY
4515 save_WindowPos4ivMESA(const GLint
* v
)
4517 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4518 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4521 static void GLAPIENTRY
4522 save_WindowPos4svMESA(const GLshort
* v
)
4524 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4529 /* GL_ARB_multitexture */
4530 static void GLAPIENTRY
4531 save_ActiveTextureARB(GLenum target
)
4533 GET_CURRENT_CONTEXT(ctx
);
4535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4536 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4540 if (ctx
->ExecuteFlag
) {
4541 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4546 /* GL_ARB_transpose_matrix */
4548 static void GLAPIENTRY
4549 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4552 _math_transposefd(tm
, m
);
4553 save_LoadMatrixf(tm
);
4557 static void GLAPIENTRY
4558 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4561 _math_transposef(tm
, m
);
4562 save_LoadMatrixf(tm
);
4566 static void GLAPIENTRY
4567 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4570 _math_transposefd(tm
, m
);
4571 save_MultMatrixf(tm
);
4575 static void GLAPIENTRY
4576 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4579 _math_transposef(tm
, m
);
4580 save_MultMatrixf(tm
);
4583 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4585 GET_CURRENT_CONTEXT(ctx
);
4591 image
= malloc(size
);
4593 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4596 memcpy(image
, data
, size
);
4602 /* GL_ARB_texture_compression */
4603 static void GLAPIENTRY
4604 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4605 GLenum internalFormat
, GLsizei width
,
4606 GLint border
, GLsizei imageSize
,
4607 const GLvoid
* data
)
4609 GET_CURRENT_CONTEXT(ctx
);
4610 if (target
== GL_PROXY_TEXTURE_1D
) {
4611 /* don't compile, execute immediately */
4612 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4613 width
, border
, imageSize
,
4618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4620 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4624 n
[3].e
= internalFormat
;
4625 n
[4].i
= (GLint
) width
;
4628 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexImage1DARB");
4630 if (ctx
->ExecuteFlag
) {
4631 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4632 (target
, level
, internalFormat
, width
,
4633 border
, imageSize
, data
));
4639 static void GLAPIENTRY
4640 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4641 GLenum internalFormat
, GLsizei width
,
4642 GLsizei height
, GLint border
, GLsizei imageSize
,
4643 const GLvoid
* data
)
4645 GET_CURRENT_CONTEXT(ctx
);
4646 if (target
== GL_PROXY_TEXTURE_2D
) {
4647 /* don't compile, execute immediately */
4648 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4649 width
, height
, border
,
4654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4656 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4660 n
[3].e
= internalFormat
;
4661 n
[4].i
= (GLint
) width
;
4662 n
[5].i
= (GLint
) height
;
4665 n
[8].data
= copy_data(data
, imageSize
, "glCompressedTexImage2DARB");
4667 if (ctx
->ExecuteFlag
) {
4668 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4669 (target
, level
, internalFormat
, width
,
4670 height
, border
, imageSize
, data
));
4676 static void GLAPIENTRY
4677 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4678 GLenum internalFormat
, GLsizei width
,
4679 GLsizei height
, GLsizei depth
, GLint border
,
4680 GLsizei imageSize
, const GLvoid
* data
)
4682 GET_CURRENT_CONTEXT(ctx
);
4683 if (target
== GL_PROXY_TEXTURE_3D
) {
4684 /* don't compile, execute immediately */
4685 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4686 width
, height
, depth
, border
,
4691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4693 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4697 n
[3].e
= internalFormat
;
4698 n
[4].i
= (GLint
) width
;
4699 n
[5].i
= (GLint
) height
;
4700 n
[6].i
= (GLint
) depth
;
4703 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexImage3DARB");
4705 if (ctx
->ExecuteFlag
) {
4706 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4707 (target
, level
, internalFormat
, width
,
4708 height
, depth
, border
, imageSize
,
4715 static void GLAPIENTRY
4716 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4717 GLsizei width
, GLenum format
,
4718 GLsizei imageSize
, const GLvoid
* data
)
4721 GET_CURRENT_CONTEXT(ctx
);
4722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4724 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4729 n
[4].i
= (GLint
) width
;
4732 n
[7].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB");
4734 if (ctx
->ExecuteFlag
) {
4735 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4736 width
, format
, imageSize
,
4742 static void GLAPIENTRY
4743 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4744 GLint yoffset
, GLsizei width
, GLsizei height
,
4745 GLenum format
, GLsizei imageSize
,
4746 const GLvoid
* data
)
4749 GET_CURRENT_CONTEXT(ctx
);
4750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4752 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4758 n
[5].i
= (GLint
) width
;
4759 n
[6].i
= (GLint
) height
;
4762 n
[9].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB");
4764 if (ctx
->ExecuteFlag
) {
4765 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4766 (target
, level
, xoffset
, yoffset
, width
,
4767 height
, format
, imageSize
, data
));
4772 static void GLAPIENTRY
4773 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4774 GLint yoffset
, GLint zoffset
, GLsizei width
,
4775 GLsizei height
, GLsizei depth
, GLenum format
,
4776 GLsizei imageSize
, const GLvoid
* data
)
4779 GET_CURRENT_CONTEXT(ctx
);
4780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4782 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4789 n
[6].i
= (GLint
) width
;
4790 n
[7].i
= (GLint
) height
;
4791 n
[8].i
= (GLint
) depth
;
4793 n
[10].i
= imageSize
;
4794 n
[11].data
= copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB");
4796 if (ctx
->ExecuteFlag
) {
4797 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4798 (target
, level
, xoffset
, yoffset
,
4799 zoffset
, width
, height
, depth
, format
,
4805 /* GL_ARB_multisample */
4806 static void GLAPIENTRY
4807 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4809 GET_CURRENT_CONTEXT(ctx
);
4811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4812 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4817 if (ctx
->ExecuteFlag
) {
4818 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4824 * GL_NV_fragment_program
4826 static void GLAPIENTRY
4827 save_BindProgramNV(GLenum target
, GLuint id
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4832 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4837 if (ctx
->ExecuteFlag
) {
4838 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4842 static void GLAPIENTRY
4843 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4844 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4846 GET_CURRENT_CONTEXT(ctx
);
4848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4849 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4858 if (ctx
->ExecuteFlag
) {
4859 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4864 static void GLAPIENTRY
4865 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4866 const GLfloat
*params
)
4868 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4869 params
[2], params
[3]);
4873 static void GLAPIENTRY
4874 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4875 const GLfloat
* params
)
4877 GET_CURRENT_CONTEXT(ctx
);
4879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4883 const GLfloat
* p
= params
;
4885 for (i
= 0 ; i
< count
; i
++) {
4886 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4899 if (ctx
->ExecuteFlag
) {
4900 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4905 static void GLAPIENTRY
4906 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4907 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4909 save_ProgramEnvParameter4fARB(target
, index
,
4911 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4915 static void GLAPIENTRY
4916 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4917 const GLdouble
*params
)
4919 save_ProgramEnvParameter4fARB(target
, index
,
4920 (GLfloat
) params
[0],
4921 (GLfloat
) params
[1],
4922 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4926 static void GLAPIENTRY
4927 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4928 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4930 GET_CURRENT_CONTEXT(ctx
);
4932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4933 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4942 if (ctx
->ExecuteFlag
) {
4943 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4948 static void GLAPIENTRY
4949 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4950 const GLfloat
*params
)
4952 GET_CURRENT_CONTEXT(ctx
);
4954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4955 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4964 if (ctx
->ExecuteFlag
) {
4965 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4970 static void GLAPIENTRY
4971 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4972 const GLfloat
*params
)
4974 GET_CURRENT_CONTEXT(ctx
);
4976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4980 const GLfloat
* p
= params
;
4982 for (i
= 0 ; i
< count
; i
++) {
4983 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4996 if (ctx
->ExecuteFlag
) {
4997 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5002 static void GLAPIENTRY
5003 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5004 GLdouble x
, GLdouble y
,
5005 GLdouble z
, GLdouble w
)
5007 GET_CURRENT_CONTEXT(ctx
);
5009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5010 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5014 n
[3].f
= (GLfloat
) x
;
5015 n
[4].f
= (GLfloat
) y
;
5016 n
[5].f
= (GLfloat
) z
;
5017 n
[6].f
= (GLfloat
) w
;
5019 if (ctx
->ExecuteFlag
) {
5020 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5025 static void GLAPIENTRY
5026 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5027 const GLdouble
*params
)
5029 GET_CURRENT_CONTEXT(ctx
);
5031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5032 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5036 n
[3].f
= (GLfloat
) params
[0];
5037 n
[4].f
= (GLfloat
) params
[1];
5038 n
[5].f
= (GLfloat
) params
[2];
5039 n
[6].f
= (GLfloat
) params
[3];
5041 if (ctx
->ExecuteFlag
) {
5042 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5047 /* GL_EXT_stencil_two_side */
5048 static void GLAPIENTRY
5049 save_ActiveStencilFaceEXT(GLenum face
)
5051 GET_CURRENT_CONTEXT(ctx
);
5053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5054 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5058 if (ctx
->ExecuteFlag
) {
5059 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5064 /* GL_EXT_depth_bounds_test */
5065 static void GLAPIENTRY
5066 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5068 GET_CURRENT_CONTEXT(ctx
);
5070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5071 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5073 n
[1].f
= (GLfloat
) zmin
;
5074 n
[2].f
= (GLfloat
) zmax
;
5076 if (ctx
->ExecuteFlag
) {
5077 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5083 static void GLAPIENTRY
5084 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5085 const GLvoid
* string
)
5087 GET_CURRENT_CONTEXT(ctx
);
5090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5092 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5094 GLubyte
*programCopy
= malloc(len
);
5096 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5099 memcpy(programCopy
, string
, len
);
5103 n
[4].data
= programCopy
;
5105 if (ctx
->ExecuteFlag
) {
5106 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5111 static void GLAPIENTRY
5112 save_BeginQueryARB(GLenum target
, GLuint id
)
5114 GET_CURRENT_CONTEXT(ctx
);
5116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5117 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5122 if (ctx
->ExecuteFlag
) {
5123 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5127 static void GLAPIENTRY
5128 save_EndQueryARB(GLenum target
)
5130 GET_CURRENT_CONTEXT(ctx
);
5132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5133 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5137 if (ctx
->ExecuteFlag
) {
5138 CALL_EndQueryARB(ctx
->Exec
, (target
));
5142 static void GLAPIENTRY
5143 save_QueryCounter(GLuint id
, GLenum target
)
5145 GET_CURRENT_CONTEXT(ctx
);
5147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5148 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5153 if (ctx
->ExecuteFlag
) {
5154 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5158 static void GLAPIENTRY
5159 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5161 GET_CURRENT_CONTEXT(ctx
);
5163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5164 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5170 if (ctx
->ExecuteFlag
) {
5171 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5175 static void GLAPIENTRY
5176 save_EndQueryIndexed(GLenum target
, GLuint index
)
5178 GET_CURRENT_CONTEXT(ctx
);
5180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5181 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5186 if (ctx
->ExecuteFlag
) {
5187 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5192 static void GLAPIENTRY
5193 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5195 GET_CURRENT_CONTEXT(ctx
);
5197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5198 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5202 if (count
> MAX_DRAW_BUFFERS
)
5203 count
= MAX_DRAW_BUFFERS
;
5204 for (i
= 0; i
< count
; i
++) {
5205 n
[2 + i
].e
= buffers
[i
];
5208 if (ctx
->ExecuteFlag
) {
5209 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5213 static void GLAPIENTRY
5214 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5216 GET_CURRENT_CONTEXT(ctx
);
5219 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5227 if (ctx
->ExecuteFlag
) {
5228 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5232 static void GLAPIENTRY
5233 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5236 p
[0] = INT_TO_FLOAT(param
[0]);
5237 p
[1] = INT_TO_FLOAT(param
[1]);
5238 p
[2] = INT_TO_FLOAT(param
[2]);
5239 p
[3] = INT_TO_FLOAT(param
[3]);
5240 save_TexBumpParameterfvATI(pname
, p
);
5243 static void GLAPIENTRY
5244 save_BindFragmentShaderATI(GLuint id
)
5246 GET_CURRENT_CONTEXT(ctx
);
5249 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5253 if (ctx
->ExecuteFlag
) {
5254 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5258 static void GLAPIENTRY
5259 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5261 GET_CURRENT_CONTEXT(ctx
);
5264 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5272 if (ctx
->ExecuteFlag
) {
5273 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5277 static void GLAPIENTRY
5278 save_Attr1fNV(GLenum attr
, GLfloat x
)
5280 GET_CURRENT_CONTEXT(ctx
);
5282 SAVE_FLUSH_VERTICES(ctx
);
5283 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5289 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5290 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5291 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5293 if (ctx
->ExecuteFlag
) {
5294 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5298 static void GLAPIENTRY
5299 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5301 GET_CURRENT_CONTEXT(ctx
);
5303 SAVE_FLUSH_VERTICES(ctx
);
5304 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5311 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5312 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5313 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5315 if (ctx
->ExecuteFlag
) {
5316 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5320 static void GLAPIENTRY
5321 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5323 GET_CURRENT_CONTEXT(ctx
);
5325 SAVE_FLUSH_VERTICES(ctx
);
5326 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5334 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5335 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5336 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5338 if (ctx
->ExecuteFlag
) {
5339 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5343 static void GLAPIENTRY
5344 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5346 GET_CURRENT_CONTEXT(ctx
);
5348 SAVE_FLUSH_VERTICES(ctx
);
5349 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5358 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5359 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5360 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5362 if (ctx
->ExecuteFlag
) {
5363 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5368 static void GLAPIENTRY
5369 save_Attr1fARB(GLenum attr
, GLfloat x
)
5371 GET_CURRENT_CONTEXT(ctx
);
5373 SAVE_FLUSH_VERTICES(ctx
);
5374 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5380 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5381 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5382 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5384 if (ctx
->ExecuteFlag
) {
5385 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5389 static void GLAPIENTRY
5390 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5392 GET_CURRENT_CONTEXT(ctx
);
5394 SAVE_FLUSH_VERTICES(ctx
);
5395 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5402 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5403 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5404 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5406 if (ctx
->ExecuteFlag
) {
5407 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5411 static void GLAPIENTRY
5412 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5414 GET_CURRENT_CONTEXT(ctx
);
5416 SAVE_FLUSH_VERTICES(ctx
);
5417 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5425 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5426 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5427 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5429 if (ctx
->ExecuteFlag
) {
5430 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5434 static void GLAPIENTRY
5435 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5437 GET_CURRENT_CONTEXT(ctx
);
5439 SAVE_FLUSH_VERTICES(ctx
);
5440 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5449 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5450 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5451 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5453 if (ctx
->ExecuteFlag
) {
5454 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5459 static void GLAPIENTRY
5460 save_EvalCoord1f(GLfloat x
)
5462 GET_CURRENT_CONTEXT(ctx
);
5464 SAVE_FLUSH_VERTICES(ctx
);
5465 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5469 if (ctx
->ExecuteFlag
) {
5470 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5474 static void GLAPIENTRY
5475 save_EvalCoord1fv(const GLfloat
* v
)
5477 save_EvalCoord1f(v
[0]);
5480 static void GLAPIENTRY
5481 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5483 GET_CURRENT_CONTEXT(ctx
);
5485 SAVE_FLUSH_VERTICES(ctx
);
5486 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5491 if (ctx
->ExecuteFlag
) {
5492 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5496 static void GLAPIENTRY
5497 save_EvalCoord2fv(const GLfloat
* v
)
5499 save_EvalCoord2f(v
[0], v
[1]);
5503 static void GLAPIENTRY
5504 save_EvalPoint1(GLint x
)
5506 GET_CURRENT_CONTEXT(ctx
);
5508 SAVE_FLUSH_VERTICES(ctx
);
5509 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5513 if (ctx
->ExecuteFlag
) {
5514 CALL_EvalPoint1(ctx
->Exec
, (x
));
5518 static void GLAPIENTRY
5519 save_EvalPoint2(GLint x
, GLint y
)
5521 GET_CURRENT_CONTEXT(ctx
);
5523 SAVE_FLUSH_VERTICES(ctx
);
5524 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5529 if (ctx
->ExecuteFlag
) {
5530 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5534 static void GLAPIENTRY
5535 save_Indexf(GLfloat x
)
5537 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5540 static void GLAPIENTRY
5541 save_Indexfv(const GLfloat
* v
)
5543 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5546 static void GLAPIENTRY
5547 save_EdgeFlag(GLboolean x
)
5549 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5554 * Compare 'count' elements of vectors 'a' and 'b'.
5555 * \return GL_TRUE if equal, GL_FALSE if different.
5557 static inline GLboolean
5558 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5560 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5565 * This glMaterial function is used for glMaterial calls that are outside
5566 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5568 static void GLAPIENTRY
5569 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5571 GET_CURRENT_CONTEXT(ctx
);
5579 case GL_FRONT_AND_BACK
:
5582 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5591 case GL_AMBIENT_AND_DIFFUSE
:
5597 case GL_COLOR_INDEXES
:
5601 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5605 if (ctx
->ExecuteFlag
) {
5606 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5609 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5611 /* Try to eliminate redundant statechanges. Because it is legal to
5612 * call glMaterial even inside begin/end calls, don't need to worry
5613 * about ctx->Driver.CurrentSavePrimitive here.
5615 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5616 if (bitmask
& (1 << i
)) {
5617 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5618 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5619 /* no change in material value */
5620 bitmask
&= ~(1 << i
);
5623 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5624 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5629 /* If this call has no effect, return early */
5633 SAVE_FLUSH_VERTICES(ctx
);
5635 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5639 for (i
= 0; i
< args
; i
++)
5640 n
[3 + i
].f
= param
[i
];
5644 static void GLAPIENTRY
5645 save_Begin(GLenum mode
)
5647 GET_CURRENT_CONTEXT(ctx
);
5649 GLboolean error
= GL_FALSE
;
5651 if (mode
> GL_POLYGON
) {
5652 _mesa_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode=%x)", mode
);
5655 if (ctx
->ExecuteFlag
) {
5656 if (!_mesa_valid_prim_mode(ctx
, mode
, "glBegin")) {
5661 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5662 /* Typically the first begin. This may raise an error on
5663 * playback, depending on whether CallList is issued from inside
5664 * a begin/end or not.
5666 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5668 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5669 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5672 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5677 /* Give the driver an opportunity to hook in an optimized
5678 * display list compiler.
5680 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5683 SAVE_FLUSH_VERTICES(ctx
);
5684 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_Begin(ctx
->Exec
, (mode
));
5695 static void GLAPIENTRY
5698 GET_CURRENT_CONTEXT(ctx
);
5699 SAVE_FLUSH_VERTICES(ctx
);
5700 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5701 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5702 if (ctx
->ExecuteFlag
) {
5703 CALL_End(ctx
->Exec
, ());
5707 static void GLAPIENTRY
5708 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5710 GET_CURRENT_CONTEXT(ctx
);
5712 SAVE_FLUSH_VERTICES(ctx
);
5713 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5720 if (ctx
->ExecuteFlag
) {
5721 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5726 static void GLAPIENTRY
5727 save_Vertex2f(GLfloat x
, GLfloat y
)
5729 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5732 static void GLAPIENTRY
5733 save_Vertex2fv(const GLfloat
* v
)
5735 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5738 static void GLAPIENTRY
5739 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5741 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5744 static void GLAPIENTRY
5745 save_Vertex3fv(const GLfloat
* v
)
5747 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5750 static void GLAPIENTRY
5751 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5753 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5756 static void GLAPIENTRY
5757 save_Vertex4fv(const GLfloat
* v
)
5759 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5762 static void GLAPIENTRY
5763 save_TexCoord1f(GLfloat x
)
5765 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5768 static void GLAPIENTRY
5769 save_TexCoord1fv(const GLfloat
* v
)
5771 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5774 static void GLAPIENTRY
5775 save_TexCoord2f(GLfloat x
, GLfloat y
)
5777 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5780 static void GLAPIENTRY
5781 save_TexCoord2fv(const GLfloat
* v
)
5783 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5786 static void GLAPIENTRY
5787 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5789 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5792 static void GLAPIENTRY
5793 save_TexCoord3fv(const GLfloat
* v
)
5795 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5798 static void GLAPIENTRY
5799 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5801 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5804 static void GLAPIENTRY
5805 save_TexCoord4fv(const GLfloat
* v
)
5807 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5810 static void GLAPIENTRY
5811 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5813 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5816 static void GLAPIENTRY
5817 save_Normal3fv(const GLfloat
* v
)
5819 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5822 static void GLAPIENTRY
5823 save_FogCoordfEXT(GLfloat x
)
5825 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5828 static void GLAPIENTRY
5829 save_FogCoordfvEXT(const GLfloat
* v
)
5831 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5834 static void GLAPIENTRY
5835 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5837 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5840 static void GLAPIENTRY
5841 save_Color3fv(const GLfloat
* v
)
5843 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5846 static void GLAPIENTRY
5847 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5849 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5852 static void GLAPIENTRY
5853 save_Color4fv(const GLfloat
* v
)
5855 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5858 static void GLAPIENTRY
5859 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5861 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5864 static void GLAPIENTRY
5865 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5867 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5871 /* Just call the respective ATTR for texcoord
5873 static void GLAPIENTRY
5874 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5876 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5877 save_Attr1fNV(attr
, x
);
5880 static void GLAPIENTRY
5881 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5883 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5884 save_Attr1fNV(attr
, v
[0]);
5887 static void GLAPIENTRY
5888 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5890 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5891 save_Attr2fNV(attr
, x
, y
);
5894 static void GLAPIENTRY
5895 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5897 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5898 save_Attr2fNV(attr
, v
[0], v
[1]);
5901 static void GLAPIENTRY
5902 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5904 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5905 save_Attr3fNV(attr
, x
, y
, z
);
5908 static void GLAPIENTRY
5909 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5911 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5912 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5915 static void GLAPIENTRY
5916 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5917 GLfloat z
, GLfloat w
)
5919 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5920 save_Attr4fNV(attr
, x
, y
, z
, w
);
5923 static void GLAPIENTRY
5924 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5926 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5927 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5932 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5938 GET_CURRENT_CONTEXT(ctx
);
5939 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5944 static void GLAPIENTRY
5945 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5947 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5948 save_Attr1fARB(index
, x
);
5953 static void GLAPIENTRY
5954 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5956 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5957 save_Attr1fARB(index
, v
[0]);
5962 static void GLAPIENTRY
5963 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5965 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5966 save_Attr2fARB(index
, x
, y
);
5971 static void GLAPIENTRY
5972 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5974 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5975 save_Attr2fARB(index
, v
[0], v
[1]);
5980 static void GLAPIENTRY
5981 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5983 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5984 save_Attr3fARB(index
, x
, y
, z
);
5989 static void GLAPIENTRY
5990 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5992 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5993 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5998 static void GLAPIENTRY
5999 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6002 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6003 save_Attr4fARB(index
, x
, y
, z
, w
);
6008 static void GLAPIENTRY
6009 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6011 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6012 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6018 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6020 static void GLAPIENTRY
6021 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6023 GET_CURRENT_CONTEXT(ctx
);
6024 FLUSH_VERTICES(ctx
, 0);
6025 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6028 static GLint GLAPIENTRY
6029 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6031 GET_CURRENT_CONTEXT(ctx
);
6032 FLUSH_VERTICES(ctx
, 0);
6033 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6036 static GLint GLAPIENTRY
6037 exec_GetUniformLocationARB(GLuint program
, const GLchar
*name
)
6039 GET_CURRENT_CONTEXT(ctx
);
6040 FLUSH_VERTICES(ctx
, 0);
6041 return CALL_GetUniformLocationARB(ctx
->Exec
, (program
, name
));
6043 /* XXX more shader functions needed here */
6046 static void GLAPIENTRY
6047 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6048 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6049 GLbitfield mask
, GLenum filter
)
6051 GET_CURRENT_CONTEXT(ctx
);
6053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6054 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6067 if (ctx
->ExecuteFlag
) {
6068 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6069 dstX0
, dstY0
, dstX1
, dstY1
,
6075 /** GL_EXT_provoking_vertex */
6076 static void GLAPIENTRY
6077 save_ProvokingVertexEXT(GLenum mode
)
6079 GET_CURRENT_CONTEXT(ctx
);
6081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6082 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6086 if (ctx
->ExecuteFlag
) {
6087 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6088 _mesa_ProvokingVertexEXT(mode
);
6093 /** GL_EXT_transform_feedback */
6094 static void GLAPIENTRY
6095 save_BeginTransformFeedback(GLenum mode
)
6097 GET_CURRENT_CONTEXT(ctx
);
6099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6100 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6104 if (ctx
->ExecuteFlag
) {
6105 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6110 /** GL_EXT_transform_feedback */
6111 static void GLAPIENTRY
6112 save_EndTransformFeedback(void)
6114 GET_CURRENT_CONTEXT(ctx
);
6115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6116 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6117 if (ctx
->ExecuteFlag
) {
6118 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6122 static void GLAPIENTRY
6123 save_BindTransformFeedback(GLenum target
, GLuint name
)
6125 GET_CURRENT_CONTEXT(ctx
);
6127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6128 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6133 if (ctx
->ExecuteFlag
) {
6134 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6138 static void GLAPIENTRY
6139 save_PauseTransformFeedback(void)
6141 GET_CURRENT_CONTEXT(ctx
);
6142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6143 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6144 if (ctx
->ExecuteFlag
) {
6145 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6149 static void GLAPIENTRY
6150 save_ResumeTransformFeedback(void)
6152 GET_CURRENT_CONTEXT(ctx
);
6153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6154 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6155 if (ctx
->ExecuteFlag
) {
6156 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6160 static void GLAPIENTRY
6161 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6163 GET_CURRENT_CONTEXT(ctx
);
6165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6166 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6171 if (ctx
->ExecuteFlag
) {
6172 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6176 static void GLAPIENTRY
6177 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6179 GET_CURRENT_CONTEXT(ctx
);
6181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6182 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6188 if (ctx
->ExecuteFlag
) {
6189 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6193 static void GLAPIENTRY
6194 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6197 GET_CURRENT_CONTEXT(ctx
);
6199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6200 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6204 n
[3].si
= primcount
;
6206 if (ctx
->ExecuteFlag
) {
6207 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6211 static void GLAPIENTRY
6212 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6213 GLuint stream
, GLsizei primcount
)
6215 GET_CURRENT_CONTEXT(ctx
);
6217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6218 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6223 n
[4].si
= primcount
;
6225 if (ctx
->ExecuteFlag
) {
6226 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6231 /* aka UseProgram() */
6232 static void GLAPIENTRY
6233 save_UseProgramObjectARB(GLhandleARB program
)
6235 GET_CURRENT_CONTEXT(ctx
);
6237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6238 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6242 if (ctx
->ExecuteFlag
) {
6243 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6248 static void GLAPIENTRY
6249 save_Uniform1fARB(GLint location
, GLfloat x
)
6251 GET_CURRENT_CONTEXT(ctx
);
6253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6254 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6259 if (ctx
->ExecuteFlag
) {
6260 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6265 static void GLAPIENTRY
6266 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6268 GET_CURRENT_CONTEXT(ctx
);
6270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6271 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6277 if (ctx
->ExecuteFlag
) {
6278 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6283 static void GLAPIENTRY
6284 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6286 GET_CURRENT_CONTEXT(ctx
);
6288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6289 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6296 if (ctx
->ExecuteFlag
) {
6297 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6302 static void GLAPIENTRY
6303 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6305 GET_CURRENT_CONTEXT(ctx
);
6307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6308 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6316 if (ctx
->ExecuteFlag
) {
6317 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6322 /** Return copy of memory */
6324 memdup(const void *src
, GLsizei bytes
)
6326 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6328 memcpy(b
, src
, bytes
);
6333 static void GLAPIENTRY
6334 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6336 GET_CURRENT_CONTEXT(ctx
);
6338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6339 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6343 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6345 if (ctx
->ExecuteFlag
) {
6346 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6350 static void GLAPIENTRY
6351 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6353 GET_CURRENT_CONTEXT(ctx
);
6355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6356 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6360 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6362 if (ctx
->ExecuteFlag
) {
6363 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6367 static void GLAPIENTRY
6368 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6370 GET_CURRENT_CONTEXT(ctx
);
6372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6373 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6377 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6379 if (ctx
->ExecuteFlag
) {
6380 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6384 static void GLAPIENTRY
6385 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6387 GET_CURRENT_CONTEXT(ctx
);
6389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6390 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6394 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6396 if (ctx
->ExecuteFlag
) {
6397 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6402 static void GLAPIENTRY
6403 save_Uniform1iARB(GLint location
, GLint x
)
6405 GET_CURRENT_CONTEXT(ctx
);
6407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6408 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6413 if (ctx
->ExecuteFlag
) {
6414 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6418 static void GLAPIENTRY
6419 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6421 GET_CURRENT_CONTEXT(ctx
);
6423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6424 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6430 if (ctx
->ExecuteFlag
) {
6431 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6435 static void GLAPIENTRY
6436 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6438 GET_CURRENT_CONTEXT(ctx
);
6440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6441 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6448 if (ctx
->ExecuteFlag
) {
6449 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6453 static void GLAPIENTRY
6454 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6456 GET_CURRENT_CONTEXT(ctx
);
6458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6459 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6467 if (ctx
->ExecuteFlag
) {
6468 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6474 static void GLAPIENTRY
6475 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6477 GET_CURRENT_CONTEXT(ctx
);
6479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6480 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6484 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6486 if (ctx
->ExecuteFlag
) {
6487 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6491 static void GLAPIENTRY
6492 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6494 GET_CURRENT_CONTEXT(ctx
);
6496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6497 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6501 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6503 if (ctx
->ExecuteFlag
) {
6504 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6508 static void GLAPIENTRY
6509 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6511 GET_CURRENT_CONTEXT(ctx
);
6513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6514 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6518 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6520 if (ctx
->ExecuteFlag
) {
6521 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6525 static void GLAPIENTRY
6526 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6528 GET_CURRENT_CONTEXT(ctx
);
6530 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6531 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6535 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6537 if (ctx
->ExecuteFlag
) {
6538 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6544 static void GLAPIENTRY
6545 save_Uniform1ui(GLint location
, GLuint x
)
6547 GET_CURRENT_CONTEXT(ctx
);
6549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6550 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6555 if (ctx
->ExecuteFlag
) {
6556 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6560 static void GLAPIENTRY
6561 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6563 GET_CURRENT_CONTEXT(ctx
);
6565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6566 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6572 if (ctx
->ExecuteFlag
) {
6573 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6577 static void GLAPIENTRY
6578 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6580 GET_CURRENT_CONTEXT(ctx
);
6582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6583 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6590 if (ctx
->ExecuteFlag
) {
6591 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6595 static void GLAPIENTRY
6596 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6598 GET_CURRENT_CONTEXT(ctx
);
6600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6601 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6609 if (ctx
->ExecuteFlag
) {
6610 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6616 static void GLAPIENTRY
6617 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6619 GET_CURRENT_CONTEXT(ctx
);
6621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6622 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6626 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6628 if (ctx
->ExecuteFlag
) {
6629 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6633 static void GLAPIENTRY
6634 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6636 GET_CURRENT_CONTEXT(ctx
);
6638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6639 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6643 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6645 if (ctx
->ExecuteFlag
) {
6646 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6650 static void GLAPIENTRY
6651 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6653 GET_CURRENT_CONTEXT(ctx
);
6655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6656 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6660 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6662 if (ctx
->ExecuteFlag
) {
6663 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6667 static void GLAPIENTRY
6668 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6670 GET_CURRENT_CONTEXT(ctx
);
6672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6673 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6677 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6679 if (ctx
->ExecuteFlag
) {
6680 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6686 static void GLAPIENTRY
6687 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6690 GET_CURRENT_CONTEXT(ctx
);
6692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6693 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6698 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6700 if (ctx
->ExecuteFlag
) {
6701 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6705 static void GLAPIENTRY
6706 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6709 GET_CURRENT_CONTEXT(ctx
);
6711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6712 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6717 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6719 if (ctx
->ExecuteFlag
) {
6720 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6724 static void GLAPIENTRY
6725 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6728 GET_CURRENT_CONTEXT(ctx
);
6730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6731 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6736 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6738 if (ctx
->ExecuteFlag
) {
6739 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6744 static void GLAPIENTRY
6745 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6748 GET_CURRENT_CONTEXT(ctx
);
6750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6751 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6756 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6758 if (ctx
->ExecuteFlag
) {
6759 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6763 static void GLAPIENTRY
6764 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6767 GET_CURRENT_CONTEXT(ctx
);
6769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6770 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6775 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6777 if (ctx
->ExecuteFlag
) {
6778 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6783 static void GLAPIENTRY
6784 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6787 GET_CURRENT_CONTEXT(ctx
);
6789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6790 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6795 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6797 if (ctx
->ExecuteFlag
) {
6798 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6802 static void GLAPIENTRY
6803 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6806 GET_CURRENT_CONTEXT(ctx
);
6808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6809 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6814 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6816 if (ctx
->ExecuteFlag
) {
6817 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6822 static void GLAPIENTRY
6823 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6826 GET_CURRENT_CONTEXT(ctx
);
6828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6829 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6834 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6836 if (ctx
->ExecuteFlag
) {
6837 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6841 static void GLAPIENTRY
6842 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6853 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6855 if (ctx
->ExecuteFlag
) {
6856 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6860 static void GLAPIENTRY
6861 save_ClampColorARB(GLenum target
, GLenum clamp
)
6863 GET_CURRENT_CONTEXT(ctx
);
6865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6866 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
6871 if (ctx
->ExecuteFlag
) {
6872 CALL_ClampColorARB(ctx
->Exec
, (target
, clamp
));
6876 static void GLAPIENTRY
6877 save_UseShaderProgramEXT(GLenum type
, GLuint program
)
6879 GET_CURRENT_CONTEXT(ctx
);
6881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6882 n
= alloc_instruction(ctx
, OPCODE_USE_SHADER_PROGRAM_EXT
, 2);
6887 if (ctx
->ExecuteFlag
) {
6888 CALL_UseShaderProgramEXT(ctx
->Exec
, (type
, program
));
6892 static void GLAPIENTRY
6893 save_ActiveProgramEXT(GLuint program
)
6895 GET_CURRENT_CONTEXT(ctx
);
6897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6898 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_PROGRAM_EXT
, 1);
6902 if (ctx
->ExecuteFlag
) {
6903 CALL_ActiveProgramEXT(ctx
->Exec
, (program
));
6907 /** GL_EXT_texture_integer */
6908 static void GLAPIENTRY
6909 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
6911 GET_CURRENT_CONTEXT(ctx
);
6913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6914 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
6921 if (ctx
->ExecuteFlag
) {
6922 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
6926 /** GL_EXT_texture_integer */
6927 static void GLAPIENTRY
6928 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
6930 GET_CURRENT_CONTEXT(ctx
);
6932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6933 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
6940 if (ctx
->ExecuteFlag
) {
6941 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
6945 /** GL_EXT_texture_integer */
6946 static void GLAPIENTRY
6947 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
6949 GET_CURRENT_CONTEXT(ctx
);
6951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6952 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
6961 if (ctx
->ExecuteFlag
) {
6962 CALL_TexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
6966 /** GL_EXT_texture_integer */
6967 static void GLAPIENTRY
6968 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
6970 GET_CURRENT_CONTEXT(ctx
);
6972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6973 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
6977 n
[3].ui
= params
[0];
6978 n
[4].ui
= params
[1];
6979 n
[5].ui
= params
[2];
6980 n
[6].ui
= params
[3];
6982 if (ctx
->ExecuteFlag
) {
6983 CALL_TexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
6987 /** GL_EXT_texture_integer */
6988 static void GLAPIENTRY
6989 exec_GetTexParameterIiv(GLenum target
, GLenum pname
, GLint
*params
)
6991 GET_CURRENT_CONTEXT(ctx
);
6992 FLUSH_VERTICES(ctx
, 0);
6993 CALL_GetTexParameterIivEXT(ctx
->Exec
, (target
, pname
, params
));
6996 /** GL_EXT_texture_integer */
6997 static void GLAPIENTRY
6998 exec_GetTexParameterIuiv(GLenum target
, GLenum pname
, GLuint
*params
)
7000 GET_CURRENT_CONTEXT(ctx
);
7001 FLUSH_VERTICES(ctx
, 0);
7002 CALL_GetTexParameterIuivEXT(ctx
->Exec
, (target
, pname
, params
));
7006 /* GL_ARB_instanced_arrays */
7007 static void GLAPIENTRY
7008 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7010 GET_CURRENT_CONTEXT(ctx
);
7012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7013 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7018 if (ctx
->ExecuteFlag
) {
7019 CALL_VertexAttribDivisorARB(ctx
->Exec
, (index
, divisor
));
7024 /* GL_NV_texture_barrier */
7025 static void GLAPIENTRY
7026 save_TextureBarrierNV(void)
7028 GET_CURRENT_CONTEXT(ctx
);
7029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7030 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7031 if (ctx
->ExecuteFlag
) {
7032 CALL_TextureBarrierNV(ctx
->Exec
, ());
7037 /* GL_ARB_sampler_objects */
7038 static void GLAPIENTRY
7039 save_BindSampler(GLuint unit
, GLuint sampler
)
7042 GET_CURRENT_CONTEXT(ctx
);
7043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7044 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7049 if (ctx
->ExecuteFlag
) {
7050 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7054 static void GLAPIENTRY
7055 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7058 GET_CURRENT_CONTEXT(ctx
);
7059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7060 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7065 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7071 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7074 if (ctx
->ExecuteFlag
) {
7075 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7079 static void GLAPIENTRY
7080 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7082 save_SamplerParameteriv(sampler
, pname
, ¶m
);
7085 static void GLAPIENTRY
7086 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7089 GET_CURRENT_CONTEXT(ctx
);
7090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7091 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7096 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7102 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7105 if (ctx
->ExecuteFlag
) {
7106 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7110 static void GLAPIENTRY
7111 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7113 save_SamplerParameterfv(sampler
, pname
, ¶m
);
7116 static void GLAPIENTRY
7117 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7120 GET_CURRENT_CONTEXT(ctx
);
7121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7122 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7127 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7133 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7136 if (ctx
->ExecuteFlag
) {
7137 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7141 static void GLAPIENTRY
7142 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7145 GET_CURRENT_CONTEXT(ctx
);
7146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7147 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7151 n
[3].ui
= params
[0];
7152 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7153 n
[4].ui
= params
[1];
7154 n
[5].ui
= params
[2];
7155 n
[6].ui
= params
[3];
7158 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7161 if (ctx
->ExecuteFlag
) {
7162 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7166 /* GL_ARB_geometry_shader4 */
7167 static void GLAPIENTRY
7168 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7171 GET_CURRENT_CONTEXT(ctx
);
7172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7173 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7179 if (ctx
->ExecuteFlag
) {
7180 CALL_ProgramParameteriARB(ctx
->Exec
, (program
, pname
, value
));
7184 static void GLAPIENTRY
7185 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7186 GLuint texture
, GLint level
)
7189 GET_CURRENT_CONTEXT(ctx
);
7190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7191 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7194 n
[2].e
= attachment
;
7198 if (ctx
->ExecuteFlag
) {
7199 CALL_FramebufferTextureARB(ctx
->Exec
, (target
, attachment
, texture
, level
));
7203 static void GLAPIENTRY
7204 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7205 GLuint texture
, GLint level
, GLenum face
)
7208 GET_CURRENT_CONTEXT(ctx
);
7209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7210 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7213 n
[2].e
= attachment
;
7218 if (ctx
->ExecuteFlag
) {
7219 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7226 static void GLAPIENTRY
7227 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7230 GET_CURRENT_CONTEXT(ctx
);
7231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7232 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7234 union uint64_pair p
;
7238 n
[3].ui
= p
.uint32
[0];
7239 n
[4].ui
= p
.uint32
[1];
7241 if (ctx
->ExecuteFlag
) {
7242 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7247 /** GL_NV_conditional_render */
7248 static void GLAPIENTRY
7249 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7251 GET_CURRENT_CONTEXT(ctx
);
7253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7254 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7259 if (ctx
->ExecuteFlag
) {
7260 CALL_BeginConditionalRenderNV(ctx
->Exec
, (queryId
, mode
));
7264 static void GLAPIENTRY
7265 save_EndConditionalRender(void)
7267 GET_CURRENT_CONTEXT(ctx
);
7268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7269 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7270 if (ctx
->ExecuteFlag
) {
7271 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
7275 static void GLAPIENTRY
7276 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7278 GET_CURRENT_CONTEXT(ctx
);
7280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7281 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7287 if (ctx
->ExecuteFlag
) {
7288 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7294 * Save an error-generating command into display list.
7296 * KW: Will appear in the list before the vertex buffer containing the
7297 * command that provoked the error. I don't see this as a problem.
7300 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7303 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
7306 n
[2].data
= (void *) s
;
7312 * Compile an error into current display list.
7315 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7317 if (ctx
->CompileFlag
)
7318 save_error(ctx
, error
, s
);
7319 if (ctx
->ExecuteFlag
)
7320 _mesa_error(ctx
, error
, "%s", s
);
7325 * Test if ID names a display list.
7328 islist(struct gl_context
*ctx
, GLuint list
)
7330 if (list
> 0 && lookup_list(ctx
, list
)) {
7340 /**********************************************************************/
7341 /* Display list execution */
7342 /**********************************************************************/
7346 * Execute a display list. Note that the ListBase offset must have already
7347 * been added before calling this function. I.e. the list argument is
7348 * the absolute list number, not relative to ListBase.
7349 * \param list - display list number
7352 execute_list(struct gl_context
*ctx
, GLuint list
)
7354 struct gl_display_list
*dlist
;
7358 if (list
== 0 || !islist(ctx
, list
))
7361 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7362 /* raise an error? */
7366 dlist
= lookup_list(ctx
, list
);
7370 ctx
->ListState
.CallDepth
++;
7372 if (ctx
->Driver
.BeginCallList
)
7373 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7379 const OpCode opcode
= n
[0].opcode
;
7381 if (is_ext_opcode(opcode
)) {
7382 n
+= ext_opcode_execute(ctx
, n
);
7387 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) n
[2].data
);
7390 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7392 case OPCODE_ALPHA_FUNC
:
7393 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7395 case OPCODE_BIND_TEXTURE
:
7396 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7400 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7401 ctx
->Unpack
= ctx
->DefaultPacking
;
7402 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7403 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7404 (const GLubyte
*) n
[7].data
));
7405 ctx
->Unpack
= save
; /* restore */
7408 case OPCODE_BLEND_COLOR
:
7409 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7411 case OPCODE_BLEND_EQUATION
:
7412 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7414 case OPCODE_BLEND_EQUATION_SEPARATE
:
7415 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7417 case OPCODE_BLEND_FUNC_SEPARATE
:
7418 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
7419 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7422 case OPCODE_BLEND_FUNC_I
:
7423 /* GL_ARB_draw_buffers_blend */
7424 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7426 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7427 /* GL_ARB_draw_buffers_blend */
7428 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7431 case OPCODE_BLEND_EQUATION_I
:
7432 /* GL_ARB_draw_buffers_blend */
7433 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7435 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7436 /* GL_ARB_draw_buffers_blend */
7437 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7438 (n
[1].ui
, n
[2].e
, n
[3].e
));
7441 case OPCODE_CALL_LIST
:
7442 /* Generated by glCallList(), don't add ListBase */
7443 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7444 execute_list(ctx
, n
[1].ui
);
7447 case OPCODE_CALL_LIST_OFFSET
:
7448 /* Generated by glCallLists() so we must add ListBase */
7450 /* user specified a bad data type at compile time */
7451 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7453 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7454 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7455 execute_list(ctx
, list
);
7459 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7461 case OPCODE_CLEAR_BUFFER_IV
:
7468 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7471 case OPCODE_CLEAR_BUFFER_UIV
:
7478 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7481 case OPCODE_CLEAR_BUFFER_FV
:
7488 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7491 case OPCODE_CLEAR_BUFFER_FI
:
7492 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7494 case OPCODE_CLEAR_COLOR
:
7495 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7497 case OPCODE_CLEAR_ACCUM
:
7498 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7500 case OPCODE_CLEAR_DEPTH
:
7501 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7503 case OPCODE_CLEAR_INDEX
:
7504 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7506 case OPCODE_CLEAR_STENCIL
:
7507 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7509 case OPCODE_CLIP_PLANE
:
7516 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7519 case OPCODE_COLOR_MASK
:
7520 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7522 case OPCODE_COLOR_MASK_INDEXED
:
7523 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7526 case OPCODE_COLOR_MATERIAL
:
7527 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7529 case OPCODE_COLOR_TABLE
:
7531 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7532 ctx
->Unpack
= ctx
->DefaultPacking
;
7533 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7534 n
[5].e
, n
[6].data
));
7535 ctx
->Unpack
= save
; /* restore */
7538 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7545 CALL_ColorTableParameterfv(ctx
->Exec
,
7546 (n
[1].e
, n
[2].e
, params
));
7549 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7556 CALL_ColorTableParameteriv(ctx
->Exec
,
7557 (n
[1].e
, n
[2].e
, params
));
7560 case OPCODE_COLOR_SUB_TABLE
:
7562 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7563 ctx
->Unpack
= ctx
->DefaultPacking
;
7564 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7565 n
[4].e
, n
[5].e
, n
[6].data
));
7566 ctx
->Unpack
= save
; /* restore */
7569 case OPCODE_CONVOLUTION_FILTER_1D
:
7571 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7572 ctx
->Unpack
= ctx
->DefaultPacking
;
7573 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7576 ctx
->Unpack
= save
; /* restore */
7579 case OPCODE_CONVOLUTION_FILTER_2D
:
7581 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7582 ctx
->Unpack
= ctx
->DefaultPacking
;
7583 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7584 n
[4].i
, n
[5].e
, n
[6].e
,
7586 ctx
->Unpack
= save
; /* restore */
7589 case OPCODE_CONVOLUTION_PARAMETER_I
:
7590 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7592 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7599 CALL_ConvolutionParameteriv(ctx
->Exec
,
7600 (n
[1].e
, n
[2].e
, params
));
7603 case OPCODE_CONVOLUTION_PARAMETER_F
:
7604 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7606 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7613 CALL_ConvolutionParameterfv(ctx
->Exec
,
7614 (n
[1].e
, n
[2].e
, params
));
7617 case OPCODE_COPY_COLOR_SUB_TABLE
:
7618 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7619 n
[3].i
, n
[4].i
, n
[5].i
));
7621 case OPCODE_COPY_COLOR_TABLE
:
7622 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7623 n
[3].i
, n
[4].i
, n
[5].i
));
7625 case OPCODE_COPY_PIXELS
:
7626 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7627 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7630 case OPCODE_COPY_TEX_IMAGE1D
:
7631 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7632 n
[5].i
, n
[6].i
, n
[7].i
));
7634 case OPCODE_COPY_TEX_IMAGE2D
:
7635 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7636 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7638 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7639 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7640 n
[4].i
, n
[5].i
, n
[6].i
));
7642 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7643 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7644 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7647 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7648 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7649 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7652 case OPCODE_CULL_FACE
:
7653 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7655 case OPCODE_DEPTH_FUNC
:
7656 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7658 case OPCODE_DEPTH_MASK
:
7659 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7661 case OPCODE_DEPTH_RANGE
:
7662 CALL_DepthRange(ctx
->Exec
,
7663 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7665 case OPCODE_DISABLE
:
7666 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7668 case OPCODE_DISABLE_INDEXED
:
7669 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7671 case OPCODE_DRAW_BUFFER
:
7672 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7674 case OPCODE_DRAW_PIXELS
:
7676 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7677 ctx
->Unpack
= ctx
->DefaultPacking
;
7678 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7680 ctx
->Unpack
= save
; /* restore */
7684 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7686 case OPCODE_ENABLE_INDEXED
:
7687 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7689 case OPCODE_EVALMESH1
:
7690 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7692 case OPCODE_EVALMESH2
:
7693 CALL_EvalMesh2(ctx
->Exec
,
7694 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7703 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7706 case OPCODE_FRONT_FACE
:
7707 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7709 case OPCODE_FRUSTUM
:
7710 CALL_Frustum(ctx
->Exec
,
7711 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7714 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7716 case OPCODE_HISTOGRAM
:
7717 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7719 case OPCODE_INDEX_MASK
:
7720 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7722 case OPCODE_INIT_NAMES
:
7723 CALL_InitNames(ctx
->Exec
, ());
7732 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7735 case OPCODE_LIGHT_MODEL
:
7742 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7745 case OPCODE_LINE_STIPPLE
:
7746 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7748 case OPCODE_LINE_WIDTH
:
7749 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7751 case OPCODE_LIST_BASE
:
7752 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7754 case OPCODE_LOAD_IDENTITY
:
7755 CALL_LoadIdentity(ctx
->Exec
, ());
7757 case OPCODE_LOAD_MATRIX
:
7758 if (sizeof(Node
) == sizeof(GLfloat
)) {
7759 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7764 for (i
= 0; i
< 16; i
++) {
7767 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7770 case OPCODE_LOAD_NAME
:
7771 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7773 case OPCODE_LOGIC_OP
:
7774 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7778 GLenum target
= n
[1].e
;
7779 GLint ustride
= _mesa_evaluator_components(target
);
7780 GLint uorder
= n
[5].i
;
7781 GLfloat u1
= n
[2].f
;
7782 GLfloat u2
= n
[3].f
;
7783 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7784 (GLfloat
*) n
[6].data
));
7789 GLenum target
= n
[1].e
;
7790 GLfloat u1
= n
[2].f
;
7791 GLfloat u2
= n
[3].f
;
7792 GLfloat v1
= n
[4].f
;
7793 GLfloat v2
= n
[5].f
;
7794 GLint ustride
= n
[6].i
;
7795 GLint vstride
= n
[7].i
;
7796 GLint uorder
= n
[8].i
;
7797 GLint vorder
= n
[9].i
;
7798 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7799 v1
, v2
, vstride
, vorder
,
7800 (GLfloat
*) n
[10].data
));
7803 case OPCODE_MAPGRID1
:
7804 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7806 case OPCODE_MAPGRID2
:
7807 CALL_MapGrid2f(ctx
->Exec
,
7808 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7810 case OPCODE_MATRIX_MODE
:
7811 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7813 case OPCODE_MIN_MAX
:
7814 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7816 case OPCODE_MULT_MATRIX
:
7817 if (sizeof(Node
) == sizeof(GLfloat
)) {
7818 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7823 for (i
= 0; i
< 16; i
++) {
7826 CALL_MultMatrixf(ctx
->Exec
, (m
));
7830 CALL_Ortho(ctx
->Exec
,
7831 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7833 case OPCODE_PASSTHROUGH
:
7834 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7836 case OPCODE_PIXEL_MAP
:
7837 CALL_PixelMapfv(ctx
->Exec
,
7838 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7840 case OPCODE_PIXEL_TRANSFER
:
7841 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7843 case OPCODE_PIXEL_ZOOM
:
7844 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7846 case OPCODE_POINT_SIZE
:
7847 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7849 case OPCODE_POINT_PARAMETERS
:
7855 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7858 case OPCODE_POLYGON_MODE
:
7859 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7861 case OPCODE_POLYGON_STIPPLE
:
7863 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7864 ctx
->Unpack
= ctx
->DefaultPacking
;
7865 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7866 ctx
->Unpack
= save
; /* restore */
7869 case OPCODE_POLYGON_OFFSET
:
7870 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7872 case OPCODE_POP_ATTRIB
:
7873 CALL_PopAttrib(ctx
->Exec
, ());
7875 case OPCODE_POP_MATRIX
:
7876 CALL_PopMatrix(ctx
->Exec
, ());
7878 case OPCODE_POP_NAME
:
7879 CALL_PopName(ctx
->Exec
, ());
7881 case OPCODE_PRIORITIZE_TEXTURE
:
7882 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7884 case OPCODE_PUSH_ATTRIB
:
7885 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7887 case OPCODE_PUSH_MATRIX
:
7888 CALL_PushMatrix(ctx
->Exec
, ());
7890 case OPCODE_PUSH_NAME
:
7891 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7893 case OPCODE_RASTER_POS
:
7894 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7896 case OPCODE_READ_BUFFER
:
7897 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7899 case OPCODE_RESET_HISTOGRAM
:
7900 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7902 case OPCODE_RESET_MIN_MAX
:
7903 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7906 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7909 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7911 case OPCODE_SCISSOR
:
7912 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7914 case OPCODE_SHADE_MODEL
:
7915 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7917 case OPCODE_PROVOKING_VERTEX
:
7918 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7920 case OPCODE_STENCIL_FUNC
:
7921 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7923 case OPCODE_STENCIL_MASK
:
7924 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7926 case OPCODE_STENCIL_OP
:
7927 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7929 case OPCODE_STENCIL_FUNC_SEPARATE
:
7930 CALL_StencilFuncSeparate(ctx
->Exec
,
7931 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7933 case OPCODE_STENCIL_MASK_SEPARATE
:
7934 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7936 case OPCODE_STENCIL_OP_SEPARATE
:
7937 CALL_StencilOpSeparate(ctx
->Exec
,
7938 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7947 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7957 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7960 case OPCODE_TEXPARAMETER
:
7967 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7970 case OPCODE_TEX_IMAGE1D
:
7972 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7973 ctx
->Unpack
= ctx
->DefaultPacking
;
7974 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7976 n
[3].i
, /* components */
7978 n
[5].e
, /* border */
7979 n
[6].e
, /* format */
7982 ctx
->Unpack
= save
; /* restore */
7985 case OPCODE_TEX_IMAGE2D
:
7987 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7988 ctx
->Unpack
= ctx
->DefaultPacking
;
7989 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7991 n
[3].i
, /* components */
7993 n
[5].i
, /* height */
7994 n
[6].e
, /* border */
7995 n
[7].e
, /* format */
7998 ctx
->Unpack
= save
; /* restore */
8001 case OPCODE_TEX_IMAGE3D
:
8003 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8004 ctx
->Unpack
= ctx
->DefaultPacking
;
8005 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8007 n
[3].i
, /* components */
8009 n
[5].i
, /* height */
8011 n
[7].e
, /* border */
8012 n
[8].e
, /* format */
8015 ctx
->Unpack
= save
; /* restore */
8018 case OPCODE_TEX_SUB_IMAGE1D
:
8020 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8021 ctx
->Unpack
= ctx
->DefaultPacking
;
8022 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8024 n
[6].e
, n
[7].data
));
8025 ctx
->Unpack
= save
; /* restore */
8028 case OPCODE_TEX_SUB_IMAGE2D
:
8030 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8031 ctx
->Unpack
= ctx
->DefaultPacking
;
8032 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8034 n
[6].i
, n
[7].e
, n
[8].e
,
8036 ctx
->Unpack
= save
; /* restore */
8039 case OPCODE_TEX_SUB_IMAGE3D
:
8041 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8042 ctx
->Unpack
= ctx
->DefaultPacking
;
8043 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8044 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8045 n
[8].i
, n
[9].e
, n
[10].e
,
8047 ctx
->Unpack
= save
; /* restore */
8050 case OPCODE_TRANSLATE
:
8051 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8053 case OPCODE_VIEWPORT
:
8054 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8055 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8057 case OPCODE_WINDOW_POS
:
8058 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8060 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8061 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
8063 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8064 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8065 n
[4].i
, n
[5].i
, n
[6].i
,
8068 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8069 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8070 n
[4].i
, n
[5].i
, n
[6].i
,
8071 n
[7].i
, n
[8].data
));
8073 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8074 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8075 n
[4].i
, n
[5].i
, n
[6].i
,
8079 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8080 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
8081 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8082 n
[5].e
, n
[6].i
, n
[7].data
));
8084 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8085 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
8086 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8087 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8090 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8091 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
8092 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8093 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8094 n
[9].e
, n
[10].i
, n
[11].data
));
8096 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8097 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8099 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8100 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8102 case OPCODE_BIND_PROGRAM_NV
: /* GL_ARB_vertex_program */
8103 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8105 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8106 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8107 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8110 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8111 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8113 case OPCODE_DEPTH_BOUNDS_EXT
:
8114 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8116 case OPCODE_PROGRAM_STRING_ARB
:
8117 CALL_ProgramStringARB(ctx
->Exec
,
8118 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
8120 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8121 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8125 case OPCODE_BEGIN_QUERY_ARB
:
8126 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8128 case OPCODE_END_QUERY_ARB
:
8129 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
8131 case OPCODE_QUERY_COUNTER
:
8132 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8134 case OPCODE_BEGIN_QUERY_INDEXED
:
8135 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8137 case OPCODE_END_QUERY_INDEXED
:
8138 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8140 case OPCODE_DRAW_BUFFERS_ARB
:
8142 GLenum buffers
[MAX_DRAW_BUFFERS
];
8143 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8144 for (i
= 0; i
< count
; i
++)
8145 buffers
[i
] = n
[2 + i
].e
;
8146 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
8149 case OPCODE_BLIT_FRAMEBUFFER
:
8150 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8151 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8154 case OPCODE_USE_PROGRAM
:
8155 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
8157 case OPCODE_USE_SHADER_PROGRAM_EXT
:
8158 CALL_UseShaderProgramEXT(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8160 case OPCODE_ACTIVE_PROGRAM_EXT
:
8161 CALL_ActiveProgramEXT(ctx
->Exec
, (n
[1].ui
));
8163 case OPCODE_UNIFORM_1F
:
8164 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8166 case OPCODE_UNIFORM_2F
:
8167 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8169 case OPCODE_UNIFORM_3F
:
8170 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8172 case OPCODE_UNIFORM_4F
:
8173 CALL_Uniform4fARB(ctx
->Exec
,
8174 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8176 case OPCODE_UNIFORM_1FV
:
8177 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8179 case OPCODE_UNIFORM_2FV
:
8180 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8182 case OPCODE_UNIFORM_3FV
:
8183 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8185 case OPCODE_UNIFORM_4FV
:
8186 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8188 case OPCODE_UNIFORM_1I
:
8189 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8191 case OPCODE_UNIFORM_2I
:
8192 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8194 case OPCODE_UNIFORM_3I
:
8195 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8197 case OPCODE_UNIFORM_4I
:
8198 CALL_Uniform4iARB(ctx
->Exec
,
8199 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8201 case OPCODE_UNIFORM_1IV
:
8202 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8204 case OPCODE_UNIFORM_2IV
:
8205 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8207 case OPCODE_UNIFORM_3IV
:
8208 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8210 case OPCODE_UNIFORM_4IV
:
8211 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
8213 case OPCODE_UNIFORM_1UI
:
8214 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8216 case OPCODE_UNIFORM_2UI
:
8217 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8219 case OPCODE_UNIFORM_3UI
:
8220 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8222 case OPCODE_UNIFORM_4UI
:
8223 /*CALL_Uniform4uiARB(ctx->Exec,
8224 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8227 case OPCODE_UNIFORM_1UIV
:
8228 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8230 case OPCODE_UNIFORM_2UIV
:
8231 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8233 case OPCODE_UNIFORM_3UIV
:
8234 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8236 case OPCODE_UNIFORM_4UIV
:
8237 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
8239 case OPCODE_UNIFORM_MATRIX22
:
8240 CALL_UniformMatrix2fvARB(ctx
->Exec
,
8241 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8243 case OPCODE_UNIFORM_MATRIX33
:
8244 CALL_UniformMatrix3fvARB(ctx
->Exec
,
8245 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8247 case OPCODE_UNIFORM_MATRIX44
:
8248 CALL_UniformMatrix4fvARB(ctx
->Exec
,
8249 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8251 case OPCODE_UNIFORM_MATRIX23
:
8252 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8253 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8255 case OPCODE_UNIFORM_MATRIX32
:
8256 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8257 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8259 case OPCODE_UNIFORM_MATRIX24
:
8260 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8261 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8263 case OPCODE_UNIFORM_MATRIX42
:
8264 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8265 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8267 case OPCODE_UNIFORM_MATRIX34
:
8268 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8269 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8271 case OPCODE_UNIFORM_MATRIX43
:
8272 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8273 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
8276 case OPCODE_CLAMP_COLOR
:
8277 CALL_ClampColorARB(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8280 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
8283 GLuint i
, pname
= n
[1].ui
;
8285 for (i
= 0; i
< 4; i
++)
8286 values
[i
] = n
[1 + i
].f
;
8287 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
8290 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8291 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8293 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8296 GLuint i
, dst
= n
[1].ui
;
8298 for (i
= 0; i
< 4; i
++)
8299 values
[i
] = n
[1 + i
].f
;
8300 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8303 case OPCODE_ATTR_1F_NV
:
8304 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8306 case OPCODE_ATTR_2F_NV
:
8307 /* Really shouldn't have to do this - the Node structure
8308 * is convenient, but it would be better to store the data
8309 * packed appropriately so that it can be sent directly
8310 * on. With x86_64 becoming common, this will start to
8313 if (sizeof(Node
) == sizeof(GLfloat
))
8314 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8316 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8318 case OPCODE_ATTR_3F_NV
:
8319 if (sizeof(Node
) == sizeof(GLfloat
))
8320 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8322 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8325 case OPCODE_ATTR_4F_NV
:
8326 if (sizeof(Node
) == sizeof(GLfloat
))
8327 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8329 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8332 case OPCODE_ATTR_1F_ARB
:
8333 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8335 case OPCODE_ATTR_2F_ARB
:
8336 /* Really shouldn't have to do this - the Node structure
8337 * is convenient, but it would be better to store the data
8338 * packed appropriately so that it can be sent directly
8339 * on. With x86_64 becoming common, this will start to
8342 if (sizeof(Node
) == sizeof(GLfloat
))
8343 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8345 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8347 case OPCODE_ATTR_3F_ARB
:
8348 if (sizeof(Node
) == sizeof(GLfloat
))
8349 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8351 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8354 case OPCODE_ATTR_4F_ARB
:
8355 if (sizeof(Node
) == sizeof(GLfloat
))
8356 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8358 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8361 case OPCODE_MATERIAL
:
8362 if (sizeof(Node
) == sizeof(GLfloat
))
8363 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8370 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8374 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8377 CALL_End(ctx
->Exec
, ());
8380 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8382 case OPCODE_EVAL_C1
:
8383 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8385 case OPCODE_EVAL_C2
:
8386 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8388 case OPCODE_EVAL_P1
:
8389 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8391 case OPCODE_EVAL_P2
:
8392 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8395 /* GL_EXT_texture_integer */
8396 case OPCODE_CLEARCOLOR_I
:
8397 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8399 case OPCODE_CLEARCOLOR_UI
:
8400 CALL_ClearColorIuiEXT(ctx
->Exec
,
8401 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8403 case OPCODE_TEXPARAMETER_I
:
8410 CALL_TexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8413 case OPCODE_TEXPARAMETER_UI
:
8416 params
[0] = n
[3].ui
;
8417 params
[1] = n
[4].ui
;
8418 params
[2] = n
[5].ui
;
8419 params
[3] = n
[6].ui
;
8420 CALL_TexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8424 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8425 /* GL_ARB_instanced_arrays */
8426 CALL_VertexAttribDivisorARB(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8429 case OPCODE_TEXTURE_BARRIER_NV
:
8430 CALL_TextureBarrierNV(ctx
->Exec
, ());
8433 /* GL_EXT/ARB_transform_feedback */
8434 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8435 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
8437 case OPCODE_END_TRANSFORM_FEEDBACK
:
8438 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
8440 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8441 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8443 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8444 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8446 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8447 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8449 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8450 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8452 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8453 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8454 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8456 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8457 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8458 (n
[1].e
, n
[2].ui
, n
[3].si
));
8460 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8461 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8462 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8466 case OPCODE_BIND_SAMPLER
:
8467 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8469 case OPCODE_SAMPLER_PARAMETERIV
:
8476 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8479 case OPCODE_SAMPLER_PARAMETERFV
:
8486 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8489 case OPCODE_SAMPLER_PARAMETERIIV
:
8496 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8499 case OPCODE_SAMPLER_PARAMETERUIV
:
8502 params
[0] = n
[3].ui
;
8503 params
[1] = n
[4].ui
;
8504 params
[2] = n
[5].ui
;
8505 params
[3] = n
[6].ui
;
8506 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8510 /* GL_ARB_geometry_shader4 */
8511 case OPCODE_PROGRAM_PARAMETERI
:
8512 CALL_ProgramParameteriARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8514 case OPCODE_FRAMEBUFFER_TEXTURE
:
8515 CALL_FramebufferTextureARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8518 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8519 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8520 n
[3].ui
, n
[4].i
, n
[5].e
));
8524 case OPCODE_WAIT_SYNC
:
8526 union uint64_pair p
;
8527 p
.uint32
[0] = n
[3].ui
;
8528 p
.uint32
[1] = n
[4].ui
;
8529 CALL_WaitSync(ctx
->Exec
, (n
[1].data
, n
[2].bf
, p
.uint64
));
8533 /* GL_NV_conditional_render */
8534 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8535 CALL_BeginConditionalRenderNV(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8537 case OPCODE_END_CONDITIONAL_RENDER
:
8538 CALL_EndConditionalRenderNV(ctx
->Exec
, ());
8541 case OPCODE_UNIFORM_BLOCK_BINDING
:
8542 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8545 case OPCODE_CONTINUE
:
8546 n
= (Node
*) n
[1].next
;
8548 case OPCODE_END_OF_LIST
:
8554 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8556 _mesa_problem(ctx
, "%s", msg
);
8561 /* increment n to point to next compiled command */
8562 if (opcode
!= OPCODE_CONTINUE
) {
8563 n
+= InstSize
[opcode
];
8568 if (ctx
->Driver
.EndCallList
)
8569 ctx
->Driver
.EndCallList(ctx
);
8571 ctx
->ListState
.CallDepth
--;
8576 /**********************************************************************/
8578 /**********************************************************************/
8581 * Test if a display list number is valid.
8583 static GLboolean GLAPIENTRY
8584 _mesa_IsList(GLuint list
)
8586 GET_CURRENT_CONTEXT(ctx
);
8587 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8588 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8589 return islist(ctx
, list
);
8594 * Delete a sequence of consecutive display lists.
8596 static void GLAPIENTRY
8597 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8599 GET_CURRENT_CONTEXT(ctx
);
8601 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8602 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8605 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8608 for (i
= list
; i
< list
+ range
; i
++) {
8609 destroy_list(ctx
, i
);
8615 * Return a display list number, n, such that lists n through n+range-1
8618 static GLuint GLAPIENTRY
8619 _mesa_GenLists(GLsizei range
)
8621 GET_CURRENT_CONTEXT(ctx
);
8623 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8624 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8627 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8635 * Make this an atomic operation
8637 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
8639 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8641 /* reserve the list IDs by with empty/dummy lists */
8643 for (i
= 0; i
< range
; i
++) {
8644 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8645 make_list(base
+ i
, 1));
8649 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8656 * Begin a new display list.
8658 static void GLAPIENTRY
8659 _mesa_NewList(GLuint name
, GLenum mode
)
8661 GET_CURRENT_CONTEXT(ctx
);
8663 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8664 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8666 if (MESA_VERBOSE
& VERBOSE_API
)
8667 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8668 _mesa_lookup_enum_by_nr(mode
));
8671 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8675 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8676 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8680 if (ctx
->ListState
.CurrentList
) {
8681 /* already compiling a display list */
8682 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8686 ctx
->CompileFlag
= GL_TRUE
;
8687 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8689 /* Reset acumulated list state:
8691 invalidate_saved_current_state( ctx
);
8693 /* Allocate new display list */
8694 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8695 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8696 ctx
->ListState
.CurrentPos
= 0;
8698 ctx
->Driver
.NewList(ctx
, name
, mode
);
8700 ctx
->CurrentDispatch
= ctx
->Save
;
8701 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8706 * End definition of current display list.
8708 static void GLAPIENTRY
8711 GET_CURRENT_CONTEXT(ctx
);
8712 SAVE_FLUSH_VERTICES(ctx
);
8713 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8715 if (MESA_VERBOSE
& VERBOSE_API
)
8716 _mesa_debug(ctx
, "glEndList\n");
8718 /* Check that a list is under construction */
8719 if (!ctx
->ListState
.CurrentList
) {
8720 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8724 /* Call before emitting END_OF_LIST, in case the driver wants to
8725 * emit opcodes itself.
8727 ctx
->Driver
.EndList(ctx
);
8729 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8731 /* Destroy old list, if any */
8732 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8734 /* Install the new list */
8735 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8736 ctx
->ListState
.CurrentList
->Name
,
8737 ctx
->ListState
.CurrentList
);
8740 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8741 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8743 ctx
->ListState
.CurrentList
= NULL
;
8744 ctx
->ExecuteFlag
= GL_TRUE
;
8745 ctx
->CompileFlag
= GL_FALSE
;
8747 ctx
->CurrentDispatch
= ctx
->Exec
;
8748 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8753 _mesa_CallList(GLuint list
)
8755 GLboolean save_compile_flag
;
8756 GET_CURRENT_CONTEXT(ctx
);
8757 FLUSH_CURRENT(ctx
, 0);
8759 if (MESA_VERBOSE
& VERBOSE_API
)
8760 _mesa_debug(ctx
, "glCallList %d\n", list
);
8763 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8768 mesa_print_display_list( list
);
8770 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
8771 * execute the display list, and restore the CompileFlag.
8773 save_compile_flag
= ctx
->CompileFlag
;
8774 if (save_compile_flag
) {
8775 ctx
->CompileFlag
= GL_FALSE
;
8778 execute_list(ctx
, list
);
8779 ctx
->CompileFlag
= save_compile_flag
;
8781 /* also restore API function pointers to point to "save" versions */
8782 if (save_compile_flag
) {
8783 ctx
->CurrentDispatch
= ctx
->Save
;
8784 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8790 * Execute glCallLists: call multiple display lists.
8793 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
8795 GET_CURRENT_CONTEXT(ctx
);
8797 GLboolean save_compile_flag
;
8799 if (MESA_VERBOSE
& VERBOSE_API
)
8800 _mesa_debug(ctx
, "glCallLists %d\n", n
);
8804 case GL_UNSIGNED_BYTE
:
8806 case GL_UNSIGNED_SHORT
:
8808 case GL_UNSIGNED_INT
:
8816 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
8820 /* Save the CompileFlag status, turn it off, execute display list,
8821 * and restore the CompileFlag.
8823 save_compile_flag
= ctx
->CompileFlag
;
8824 ctx
->CompileFlag
= GL_FALSE
;
8826 for (i
= 0; i
< n
; i
++) {
8827 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
8828 execute_list(ctx
, list
);
8831 ctx
->CompileFlag
= save_compile_flag
;
8833 /* also restore API function pointers to point to "save" versions */
8834 if (save_compile_flag
) {
8835 ctx
->CurrentDispatch
= ctx
->Save
;
8836 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8842 * Set the offset added to list numbers in glCallLists.
8844 static void GLAPIENTRY
8845 _mesa_ListBase(GLuint base
)
8847 GET_CURRENT_CONTEXT(ctx
);
8848 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8849 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8850 ctx
->List
.ListBase
= base
;
8854 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8856 static void GLAPIENTRY
8859 GET_CURRENT_CONTEXT(ctx
);
8860 FLUSH_VERTICES(ctx
, 0);
8861 CALL_Finish(ctx
->Exec
, ());
8864 static void GLAPIENTRY
8867 GET_CURRENT_CONTEXT(ctx
);
8868 FLUSH_VERTICES(ctx
, 0);
8869 CALL_Flush(ctx
->Exec
, ());
8872 static void GLAPIENTRY
8873 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8875 GET_CURRENT_CONTEXT(ctx
);
8876 FLUSH_VERTICES(ctx
, 0);
8877 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8880 static void GLAPIENTRY
8881 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8883 GET_CURRENT_CONTEXT(ctx
);
8884 FLUSH_VERTICES(ctx
, 0);
8885 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8888 static void GLAPIENTRY
8889 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8891 GET_CURRENT_CONTEXT(ctx
);
8892 FLUSH_VERTICES(ctx
, 0);
8893 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8896 static GLenum GLAPIENTRY
8899 GET_CURRENT_CONTEXT(ctx
);
8900 FLUSH_VERTICES(ctx
, 0);
8901 return CALL_GetError(ctx
->Exec
, ());
8904 static void GLAPIENTRY
8905 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8907 GET_CURRENT_CONTEXT(ctx
);
8908 FLUSH_VERTICES(ctx
, 0);
8909 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8912 static void GLAPIENTRY
8913 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8915 GET_CURRENT_CONTEXT(ctx
);
8916 FLUSH_VERTICES(ctx
, 0);
8917 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8920 static void GLAPIENTRY
8921 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8923 GET_CURRENT_CONTEXT(ctx
);
8924 FLUSH_VERTICES(ctx
, 0);
8925 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8928 static void GLAPIENTRY
8929 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8931 GET_CURRENT_CONTEXT(ctx
);
8932 FLUSH_VERTICES(ctx
, 0);
8933 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8936 static void GLAPIENTRY
8937 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8939 GET_CURRENT_CONTEXT(ctx
);
8940 FLUSH_VERTICES(ctx
, 0);
8941 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8944 static void GLAPIENTRY
8945 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8947 GET_CURRENT_CONTEXT(ctx
);
8948 FLUSH_VERTICES(ctx
, 0);
8949 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8952 static void GLAPIENTRY
8953 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8955 GET_CURRENT_CONTEXT(ctx
);
8956 FLUSH_VERTICES(ctx
, 0);
8957 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8960 static void GLAPIENTRY
8961 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8963 GET_CURRENT_CONTEXT(ctx
);
8964 FLUSH_VERTICES(ctx
, 0);
8965 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8968 static void GLAPIENTRY
8969 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8971 GET_CURRENT_CONTEXT(ctx
);
8972 FLUSH_VERTICES(ctx
, 0);
8973 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8976 static void GLAPIENTRY
8977 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8979 GET_CURRENT_CONTEXT(ctx
);
8980 FLUSH_VERTICES(ctx
, 0);
8981 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8984 static void GLAPIENTRY
8985 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8987 GET_CURRENT_CONTEXT(ctx
);
8988 FLUSH_VERTICES(ctx
, 0);
8989 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8992 static void GLAPIENTRY
8993 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8995 GET_CURRENT_CONTEXT(ctx
);
8996 FLUSH_VERTICES(ctx
, 0);
8997 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
9000 static void GLAPIENTRY
9001 exec_GetPolygonStipple(GLubyte
* dest
)
9003 GET_CURRENT_CONTEXT(ctx
);
9004 FLUSH_VERTICES(ctx
, 0);
9005 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
9008 static const GLubyte
*GLAPIENTRY
9009 exec_GetString(GLenum name
)
9011 GET_CURRENT_CONTEXT(ctx
);
9012 FLUSH_VERTICES(ctx
, 0);
9013 return CALL_GetString(ctx
->Exec
, (name
));
9016 static void GLAPIENTRY
9017 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9019 GET_CURRENT_CONTEXT(ctx
);
9020 FLUSH_VERTICES(ctx
, 0);
9021 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
9024 static void GLAPIENTRY
9025 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
9027 GET_CURRENT_CONTEXT(ctx
);
9028 FLUSH_VERTICES(ctx
, 0);
9029 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
9032 static void GLAPIENTRY
9033 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
9035 GET_CURRENT_CONTEXT(ctx
);
9036 FLUSH_VERTICES(ctx
, 0);
9037 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
9040 static void GLAPIENTRY
9041 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
9043 GET_CURRENT_CONTEXT(ctx
);
9044 FLUSH_VERTICES(ctx
, 0);
9045 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
9048 static void GLAPIENTRY
9049 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
9051 GET_CURRENT_CONTEXT(ctx
);
9052 FLUSH_VERTICES(ctx
, 0);
9053 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
9056 static void GLAPIENTRY
9057 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
9058 GLenum type
, GLvoid
* pixels
)
9060 GET_CURRENT_CONTEXT(ctx
);
9061 FLUSH_VERTICES(ctx
, 0);
9062 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
9065 static void GLAPIENTRY
9066 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
9067 GLenum pname
, GLfloat
*params
)
9069 GET_CURRENT_CONTEXT(ctx
);
9070 FLUSH_VERTICES(ctx
, 0);
9071 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
9074 static void GLAPIENTRY
9075 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
9076 GLenum pname
, GLint
*params
)
9078 GET_CURRENT_CONTEXT(ctx
);
9079 FLUSH_VERTICES(ctx
, 0);
9080 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
9083 static void GLAPIENTRY
9084 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9086 GET_CURRENT_CONTEXT(ctx
);
9087 FLUSH_VERTICES(ctx
, 0);
9088 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
9091 static void GLAPIENTRY
9092 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9094 GET_CURRENT_CONTEXT(ctx
);
9095 FLUSH_VERTICES(ctx
, 0);
9096 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
9099 static GLboolean GLAPIENTRY
9100 exec_IsEnabled(GLenum cap
)
9102 GET_CURRENT_CONTEXT(ctx
);
9103 FLUSH_VERTICES(ctx
, 0);
9104 return CALL_IsEnabled(ctx
->Exec
, (cap
));
9107 static void GLAPIENTRY
9108 exec_PixelStoref(GLenum pname
, GLfloat param
)
9110 GET_CURRENT_CONTEXT(ctx
);
9111 FLUSH_VERTICES(ctx
, 0);
9112 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
9115 static void GLAPIENTRY
9116 exec_PixelStorei(GLenum pname
, GLint param
)
9118 GET_CURRENT_CONTEXT(ctx
);
9119 FLUSH_VERTICES(ctx
, 0);
9120 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
9123 static void GLAPIENTRY
9124 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
9125 GLenum format
, GLenum type
, GLvoid
* pixels
)
9127 GET_CURRENT_CONTEXT(ctx
);
9128 FLUSH_VERTICES(ctx
, 0);
9129 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
9132 static GLint GLAPIENTRY
9133 exec_RenderMode(GLenum mode
)
9135 GET_CURRENT_CONTEXT(ctx
);
9136 FLUSH_VERTICES(ctx
, 0);
9137 return CALL_RenderMode(ctx
->Exec
, (mode
));
9140 static void GLAPIENTRY
9141 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
9143 GET_CURRENT_CONTEXT(ctx
);
9144 FLUSH_VERTICES(ctx
, 0);
9145 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
9148 static void GLAPIENTRY
9149 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
9151 GET_CURRENT_CONTEXT(ctx
);
9152 FLUSH_VERTICES(ctx
, 0);
9153 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
9156 static GLboolean GLAPIENTRY
9157 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
9158 GLboolean
* residences
)
9160 GET_CURRENT_CONTEXT(ctx
);
9161 FLUSH_VERTICES(ctx
, 0);
9162 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
9165 static void GLAPIENTRY
9166 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9168 GET_CURRENT_CONTEXT(ctx
);
9169 FLUSH_VERTICES(ctx
, 0);
9170 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9173 static void GLAPIENTRY
9174 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
9176 GET_CURRENT_CONTEXT(ctx
);
9177 FLUSH_VERTICES(ctx
, 0);
9178 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
9181 static void GLAPIENTRY
9182 exec_DisableClientState(GLenum cap
)
9184 GET_CURRENT_CONTEXT(ctx
);
9185 FLUSH_VERTICES(ctx
, 0);
9186 CALL_DisableClientState(ctx
->Exec
, (cap
));
9189 static void GLAPIENTRY
9190 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
9192 GET_CURRENT_CONTEXT(ctx
);
9193 FLUSH_VERTICES(ctx
, 0);
9194 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
9197 static void GLAPIENTRY
9198 exec_EnableClientState(GLenum cap
)
9200 GET_CURRENT_CONTEXT(ctx
);
9201 FLUSH_VERTICES(ctx
, 0);
9202 CALL_EnableClientState(ctx
->Exec
, (cap
));
9205 static void GLAPIENTRY
9206 exec_GenTextures(GLsizei n
, GLuint
* texName
)
9208 GET_CURRENT_CONTEXT(ctx
);
9209 FLUSH_VERTICES(ctx
, 0);
9210 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
9213 static void GLAPIENTRY
9214 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
9216 GET_CURRENT_CONTEXT(ctx
);
9217 FLUSH_VERTICES(ctx
, 0);
9218 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
9221 static void GLAPIENTRY
9222 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9224 GET_CURRENT_CONTEXT(ctx
);
9225 FLUSH_VERTICES(ctx
, 0);
9226 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
9229 static void GLAPIENTRY
9230 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
9232 GET_CURRENT_CONTEXT(ctx
);
9233 FLUSH_VERTICES(ctx
, 0);
9234 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
9237 static GLboolean GLAPIENTRY
9238 exec_IsTexture(GLuint texture
)
9240 GET_CURRENT_CONTEXT(ctx
);
9241 FLUSH_VERTICES(ctx
, 0);
9242 return CALL_IsTexture(ctx
->Exec
, (texture
));
9245 static void GLAPIENTRY
9246 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9248 GET_CURRENT_CONTEXT(ctx
);
9249 FLUSH_VERTICES(ctx
, 0);
9250 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
9253 static void GLAPIENTRY
9254 exec_PopClientAttrib(void)
9256 GET_CURRENT_CONTEXT(ctx
);
9257 FLUSH_VERTICES(ctx
, 0);
9258 CALL_PopClientAttrib(ctx
->Exec
, ());
9261 static void GLAPIENTRY
9262 exec_PushClientAttrib(GLbitfield mask
)
9264 GET_CURRENT_CONTEXT(ctx
);
9265 FLUSH_VERTICES(ctx
, 0);
9266 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
9269 static void GLAPIENTRY
9270 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
9273 GET_CURRENT_CONTEXT(ctx
);
9274 FLUSH_VERTICES(ctx
, 0);
9275 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9278 static void GLAPIENTRY
9279 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
9281 GET_CURRENT_CONTEXT(ctx
);
9282 FLUSH_VERTICES(ctx
, 0);
9283 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
9286 static void GLAPIENTRY
9287 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
9290 GET_CURRENT_CONTEXT(ctx
);
9291 FLUSH_VERTICES(ctx
, 0);
9292 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
9295 static void GLAPIENTRY
9296 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
9297 GLint x
, GLint y
, GLsizei width
)
9299 GET_CURRENT_CONTEXT(ctx
);
9300 FLUSH_VERTICES(ctx
, 0);
9301 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
9302 (target
, internalFormat
, x
, y
, width
));
9305 static void GLAPIENTRY
9306 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
9307 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
9309 GET_CURRENT_CONTEXT(ctx
);
9310 FLUSH_VERTICES(ctx
, 0);
9311 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
9312 (target
, internalFormat
, x
, y
, width
,
9316 static void GLAPIENTRY
9317 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
9319 GET_CURRENT_CONTEXT(ctx
);
9320 FLUSH_VERTICES(ctx
, 0);
9321 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
9324 static void GLAPIENTRY
9325 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9327 GET_CURRENT_CONTEXT(ctx
);
9328 FLUSH_VERTICES(ctx
, 0);
9329 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
9332 static void GLAPIENTRY
9333 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9335 GET_CURRENT_CONTEXT(ctx
);
9336 FLUSH_VERTICES(ctx
, 0);
9337 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
9340 static void GLAPIENTRY
9341 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
9344 GET_CURRENT_CONTEXT(ctx
);
9345 FLUSH_VERTICES(ctx
, 0);
9346 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
9349 static void GLAPIENTRY
9350 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9352 GET_CURRENT_CONTEXT(ctx
);
9353 FLUSH_VERTICES(ctx
, 0);
9354 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
9357 static void GLAPIENTRY
9358 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9360 GET_CURRENT_CONTEXT(ctx
);
9361 FLUSH_VERTICES(ctx
, 0);
9362 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
9365 static void GLAPIENTRY
9366 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
9367 GLenum type
, GLvoid
*values
)
9369 GET_CURRENT_CONTEXT(ctx
);
9370 FLUSH_VERTICES(ctx
, 0);
9371 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9374 static void GLAPIENTRY
9375 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9377 GET_CURRENT_CONTEXT(ctx
);
9378 FLUSH_VERTICES(ctx
, 0);
9379 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
9382 static void GLAPIENTRY
9383 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9385 GET_CURRENT_CONTEXT(ctx
);
9386 FLUSH_VERTICES(ctx
, 0);
9387 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
9390 static void GLAPIENTRY
9391 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
9392 GLenum type
, GLvoid
*values
)
9394 GET_CURRENT_CONTEXT(ctx
);
9395 FLUSH_VERTICES(ctx
, 0);
9396 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
9399 static void GLAPIENTRY
9400 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
9402 GET_CURRENT_CONTEXT(ctx
);
9403 FLUSH_VERTICES(ctx
, 0);
9404 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
9407 static void GLAPIENTRY
9408 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
9410 GET_CURRENT_CONTEXT(ctx
);
9411 FLUSH_VERTICES(ctx
, 0);
9412 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
9415 static void GLAPIENTRY
9416 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
9417 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
9419 GET_CURRENT_CONTEXT(ctx
);
9420 FLUSH_VERTICES(ctx
, 0);
9421 CALL_GetSeparableFilter(ctx
->Exec
,
9422 (target
, format
, type
, row
, column
, span
));
9425 static void GLAPIENTRY
9426 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
9427 GLsizei width
, GLsizei height
, GLenum format
,
9428 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
9430 GET_CURRENT_CONTEXT(ctx
);
9431 FLUSH_VERTICES(ctx
, 0);
9432 CALL_SeparableFilter2D(ctx
->Exec
,
9433 (target
, internalFormat
, width
, height
, format
,
9434 type
, row
, column
));
9437 static void GLAPIENTRY
9438 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9439 GLsizei count
, const GLvoid
*ptr
)
9441 GET_CURRENT_CONTEXT(ctx
);
9442 FLUSH_VERTICES(ctx
, 0);
9443 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9446 static void GLAPIENTRY
9447 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
9449 GET_CURRENT_CONTEXT(ctx
);
9450 FLUSH_VERTICES(ctx
, 0);
9451 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
9454 static void GLAPIENTRY
9455 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9458 GET_CURRENT_CONTEXT(ctx
);
9459 FLUSH_VERTICES(ctx
, 0);
9460 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9463 static void GLAPIENTRY
9464 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
9467 GET_CURRENT_CONTEXT(ctx
);
9468 FLUSH_VERTICES(ctx
, 0);
9469 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
9472 static void GLAPIENTRY
9473 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9474 GLsizei count
, const GLvoid
*ptr
)
9476 GET_CURRENT_CONTEXT(ctx
);
9477 FLUSH_VERTICES(ctx
, 0);
9478 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9481 static void GLAPIENTRY
9482 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
9483 GLsizei count
, const GLvoid
*ptr
)
9485 GET_CURRENT_CONTEXT(ctx
);
9486 FLUSH_VERTICES(ctx
, 0);
9487 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
9490 static void GLAPIENTRY
9491 exec_LockArraysEXT(GLint first
, GLsizei count
)
9493 GET_CURRENT_CONTEXT(ctx
);
9494 FLUSH_VERTICES(ctx
, 0);
9495 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
9498 static void GLAPIENTRY
9499 exec_UnlockArraysEXT(void)
9501 GET_CURRENT_CONTEXT(ctx
);
9502 FLUSH_VERTICES(ctx
, 0);
9503 CALL_UnlockArraysEXT(ctx
->Exec
, ());
9506 static void GLAPIENTRY
9507 exec_ClientActiveTextureARB(GLenum target
)
9509 GET_CURRENT_CONTEXT(ctx
);
9510 FLUSH_VERTICES(ctx
, 0);
9511 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
9514 static void GLAPIENTRY
9515 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
9516 GLsizei stride
, const GLvoid
*ptr
)
9518 GET_CURRENT_CONTEXT(ctx
);
9519 FLUSH_VERTICES(ctx
, 0);
9520 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
9523 static void GLAPIENTRY
9524 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
9526 GET_CURRENT_CONTEXT(ctx
);
9527 FLUSH_VERTICES(ctx
, 0);
9528 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
9531 /* GL_EXT_multi_draw_arrays */
9532 static void GLAPIENTRY
9533 exec_MultiDrawArraysEXT(GLenum mode
, const GLint
*first
,
9534 const GLsizei
*count
, GLsizei primcount
)
9536 GET_CURRENT_CONTEXT(ctx
);
9537 FLUSH_VERTICES(ctx
, 0);
9538 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
9541 /* GL_IBM_multimode_draw_arrays */
9542 static void GLAPIENTRY
9543 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
9544 const GLsizei
* count
, GLsizei primcount
,
9547 GET_CURRENT_CONTEXT(ctx
);
9548 FLUSH_VERTICES(ctx
, 0);
9549 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
9550 (mode
, first
, count
, primcount
, modestride
));
9553 /* GL_IBM_multimode_draw_arrays */
9554 static void GLAPIENTRY
9555 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
9556 const GLsizei
* count
,
9558 const GLvoid
* const *indices
,
9559 GLsizei primcount
, GLint modestride
)
9561 GET_CURRENT_CONTEXT(ctx
);
9562 FLUSH_VERTICES(ctx
, 0);
9563 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
9564 (mode
, count
, type
, indices
, primcount
,
9569 * Setup the given dispatch table to point to Mesa's display list
9570 * building functions.
9572 * This does not include any of the tnl functions - they are
9573 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9576 struct _glapi_table
*
9577 _mesa_create_save_table(const struct gl_context
*ctx
)
9579 struct _glapi_table
*table
;
9581 table
= _mesa_alloc_dispatch_table(_gloffset_COUNT
);
9585 _mesa_loopback_init_api_table(ctx
, table
);
9588 SET_Accum(table
, save_Accum
);
9589 SET_AlphaFunc(table
, save_AlphaFunc
);
9590 SET_Bitmap(table
, save_Bitmap
);
9591 SET_BlendFunc(table
, save_BlendFunc
);
9592 SET_CallList(table
, save_CallList
);
9593 SET_CallLists(table
, save_CallLists
);
9594 SET_Clear(table
, save_Clear
);
9595 SET_ClearAccum(table
, save_ClearAccum
);
9596 SET_ClearColor(table
, save_ClearColor
);
9597 SET_ClearDepth(table
, save_ClearDepth
);
9598 SET_ClearIndex(table
, save_ClearIndex
);
9599 SET_ClearStencil(table
, save_ClearStencil
);
9600 SET_ClipPlane(table
, save_ClipPlane
);
9601 SET_ColorMask(table
, save_ColorMask
);
9602 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
9603 SET_ColorMaterial(table
, save_ColorMaterial
);
9604 SET_CopyPixels(table
, save_CopyPixels
);
9605 SET_CullFace(table
, save_CullFace
);
9606 SET_DeleteLists(table
, _mesa_DeleteLists
);
9607 SET_DepthFunc(table
, save_DepthFunc
);
9608 SET_DepthMask(table
, save_DepthMask
);
9609 SET_DepthRange(table
, save_DepthRange
);
9610 SET_Disable(table
, save_Disable
);
9611 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
9612 SET_DrawBuffer(table
, save_DrawBuffer
);
9613 SET_DrawPixels(table
, save_DrawPixels
);
9614 SET_Enable(table
, save_Enable
);
9615 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
9616 SET_EndList(table
, _mesa_EndList
);
9617 SET_EvalMesh1(table
, save_EvalMesh1
);
9618 SET_EvalMesh2(table
, save_EvalMesh2
);
9619 SET_Finish(table
, exec_Finish
);
9620 SET_Flush(table
, exec_Flush
);
9621 SET_Fogf(table
, save_Fogf
);
9622 SET_Fogfv(table
, save_Fogfv
);
9623 SET_Fogi(table
, save_Fogi
);
9624 SET_Fogiv(table
, save_Fogiv
);
9625 SET_FrontFace(table
, save_FrontFace
);
9626 SET_Frustum(table
, save_Frustum
);
9627 SET_GenLists(table
, _mesa_GenLists
);
9628 SET_GetBooleanv(table
, exec_GetBooleanv
);
9629 SET_GetClipPlane(table
, exec_GetClipPlane
);
9630 SET_GetDoublev(table
, exec_GetDoublev
);
9631 SET_GetError(table
, exec_GetError
);
9632 SET_GetFloatv(table
, exec_GetFloatv
);
9633 SET_GetIntegerv(table
, exec_GetIntegerv
);
9634 SET_GetLightfv(table
, exec_GetLightfv
);
9635 SET_GetLightiv(table
, exec_GetLightiv
);
9636 SET_GetMapdv(table
, exec_GetMapdv
);
9637 SET_GetMapfv(table
, exec_GetMapfv
);
9638 SET_GetMapiv(table
, exec_GetMapiv
);
9639 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
9640 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
9641 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
9642 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9643 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9644 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9645 SET_GetString(table
, exec_GetString
);
9646 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9647 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9648 SET_GetTexGendv(table
, exec_GetTexGendv
);
9649 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9650 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9651 SET_GetTexImage(table
, exec_GetTexImage
);
9652 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9653 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9654 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9655 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9656 SET_Hint(table
, save_Hint
);
9657 SET_IndexMask(table
, save_IndexMask
);
9658 SET_InitNames(table
, save_InitNames
);
9659 SET_IsEnabled(table
, exec_IsEnabled
);
9660 SET_IsList(table
, _mesa_IsList
);
9661 SET_LightModelf(table
, save_LightModelf
);
9662 SET_LightModelfv(table
, save_LightModelfv
);
9663 SET_LightModeli(table
, save_LightModeli
);
9664 SET_LightModeliv(table
, save_LightModeliv
);
9665 SET_Lightf(table
, save_Lightf
);
9666 SET_Lightfv(table
, save_Lightfv
);
9667 SET_Lighti(table
, save_Lighti
);
9668 SET_Lightiv(table
, save_Lightiv
);
9669 SET_LineStipple(table
, save_LineStipple
);
9670 SET_LineWidth(table
, save_LineWidth
);
9671 SET_ListBase(table
, save_ListBase
);
9672 SET_LoadIdentity(table
, save_LoadIdentity
);
9673 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9674 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9675 SET_LoadName(table
, save_LoadName
);
9676 SET_LogicOp(table
, save_LogicOp
);
9677 SET_Map1d(table
, save_Map1d
);
9678 SET_Map1f(table
, save_Map1f
);
9679 SET_Map2d(table
, save_Map2d
);
9680 SET_Map2f(table
, save_Map2f
);
9681 SET_MapGrid1d(table
, save_MapGrid1d
);
9682 SET_MapGrid1f(table
, save_MapGrid1f
);
9683 SET_MapGrid2d(table
, save_MapGrid2d
);
9684 SET_MapGrid2f(table
, save_MapGrid2f
);
9685 SET_MatrixMode(table
, save_MatrixMode
);
9686 SET_MultMatrixd(table
, save_MultMatrixd
);
9687 SET_MultMatrixf(table
, save_MultMatrixf
);
9688 SET_NewList(table
, save_NewList
);
9689 SET_Ortho(table
, save_Ortho
);
9690 SET_PassThrough(table
, save_PassThrough
);
9691 SET_PixelMapfv(table
, save_PixelMapfv
);
9692 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9693 SET_PixelMapusv(table
, save_PixelMapusv
);
9694 SET_PixelStoref(table
, exec_PixelStoref
);
9695 SET_PixelStorei(table
, exec_PixelStorei
);
9696 SET_PixelTransferf(table
, save_PixelTransferf
);
9697 SET_PixelTransferi(table
, save_PixelTransferi
);
9698 SET_PixelZoom(table
, save_PixelZoom
);
9699 SET_PointSize(table
, save_PointSize
);
9700 SET_PolygonMode(table
, save_PolygonMode
);
9701 SET_PolygonOffset(table
, save_PolygonOffset
);
9702 SET_PolygonStipple(table
, save_PolygonStipple
);
9703 SET_PopAttrib(table
, save_PopAttrib
);
9704 SET_PopMatrix(table
, save_PopMatrix
);
9705 SET_PopName(table
, save_PopName
);
9706 SET_PushAttrib(table
, save_PushAttrib
);
9707 SET_PushMatrix(table
, save_PushMatrix
);
9708 SET_PushName(table
, save_PushName
);
9709 SET_RasterPos2d(table
, save_RasterPos2d
);
9710 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9711 SET_RasterPos2f(table
, save_RasterPos2f
);
9712 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9713 SET_RasterPos2i(table
, save_RasterPos2i
);
9714 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9715 SET_RasterPos2s(table
, save_RasterPos2s
);
9716 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9717 SET_RasterPos3d(table
, save_RasterPos3d
);
9718 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9719 SET_RasterPos3f(table
, save_RasterPos3f
);
9720 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9721 SET_RasterPos3i(table
, save_RasterPos3i
);
9722 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9723 SET_RasterPos3s(table
, save_RasterPos3s
);
9724 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9725 SET_RasterPos4d(table
, save_RasterPos4d
);
9726 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9727 SET_RasterPos4f(table
, save_RasterPos4f
);
9728 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9729 SET_RasterPos4i(table
, save_RasterPos4i
);
9730 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9731 SET_RasterPos4s(table
, save_RasterPos4s
);
9732 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9733 SET_ReadBuffer(table
, save_ReadBuffer
);
9734 SET_ReadPixels(table
, exec_ReadPixels
);
9735 SET_RenderMode(table
, exec_RenderMode
);
9736 SET_Rotated(table
, save_Rotated
);
9737 SET_Rotatef(table
, save_Rotatef
);
9738 SET_Scaled(table
, save_Scaled
);
9739 SET_Scalef(table
, save_Scalef
);
9740 SET_Scissor(table
, save_Scissor
);
9741 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9742 SET_SelectBuffer(table
, exec_SelectBuffer
);
9743 SET_ShadeModel(table
, save_ShadeModel
);
9744 SET_StencilFunc(table
, save_StencilFunc
);
9745 SET_StencilMask(table
, save_StencilMask
);
9746 SET_StencilOp(table
, save_StencilOp
);
9747 SET_TexEnvf(table
, save_TexEnvf
);
9748 SET_TexEnvfv(table
, save_TexEnvfv
);
9749 SET_TexEnvi(table
, save_TexEnvi
);
9750 SET_TexEnviv(table
, save_TexEnviv
);
9751 SET_TexGend(table
, save_TexGend
);
9752 SET_TexGendv(table
, save_TexGendv
);
9753 SET_TexGenf(table
, save_TexGenf
);
9754 SET_TexGenfv(table
, save_TexGenfv
);
9755 SET_TexGeni(table
, save_TexGeni
);
9756 SET_TexGeniv(table
, save_TexGeniv
);
9757 SET_TexImage1D(table
, save_TexImage1D
);
9758 SET_TexImage2D(table
, save_TexImage2D
);
9759 SET_TexParameterf(table
, save_TexParameterf
);
9760 SET_TexParameterfv(table
, save_TexParameterfv
);
9761 SET_TexParameteri(table
, save_TexParameteri
);
9762 SET_TexParameteriv(table
, save_TexParameteriv
);
9763 SET_Translated(table
, save_Translated
);
9764 SET_Translatef(table
, save_Translatef
);
9765 SET_Viewport(table
, save_Viewport
);
9768 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9769 SET_BindTexture(table
, save_BindTexture
);
9770 SET_ColorPointer(table
, exec_ColorPointer
);
9771 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9772 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9773 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9774 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9775 SET_DeleteTextures(table
, exec_DeleteTextures
);
9776 SET_DisableClientState(table
, exec_DisableClientState
);
9777 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9778 SET_EnableClientState(table
, exec_EnableClientState
);
9779 SET_GenTextures(table
, exec_GenTextures
);
9780 SET_GetPointerv(table
, exec_GetPointerv
);
9781 SET_IndexPointer(table
, exec_IndexPointer
);
9782 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
9783 SET_IsTexture(table
, exec_IsTexture
);
9784 SET_NormalPointer(table
, exec_NormalPointer
);
9785 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
9786 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9787 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
9788 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
9789 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9790 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9791 SET_VertexPointer(table
, exec_VertexPointer
);
9794 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9795 SET_TexImage3D(table
, save_TexImage3D
);
9796 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9799 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9800 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9801 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9803 /* ATI_separate_stencil */
9804 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9806 /* GL_ARB_imaging */
9807 /* Not all are supported */
9808 SET_BlendColor(table
, save_BlendColor
);
9809 SET_BlendEquation(table
, save_BlendEquation
);
9810 SET_ColorSubTable(table
, save_ColorSubTable
);
9811 SET_ColorTable(table
, save_ColorTable
);
9812 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
9813 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
9814 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
9815 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
9816 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
9817 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
9818 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
9819 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
9820 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
9821 SET_CopyColorTable(table
, save_CopyColorTable
);
9822 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
9823 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
9824 SET_GetColorTable(table
, exec_GetColorTable
);
9825 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
9826 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
9827 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
9828 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
9829 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
9830 SET_GetHistogram(table
, exec_GetHistogram
);
9831 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
9832 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
9833 SET_GetMinmax(table
, exec_GetMinmax
);
9834 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
9835 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
9836 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
9837 SET_Histogram(table
, save_Histogram
);
9838 SET_Minmax(table
, save_Minmax
);
9839 SET_ResetHistogram(table
, save_ResetHistogram
);
9840 SET_ResetMinmax(table
, save_ResetMinmax
);
9841 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
9843 /* 2. GL_EXT_blend_color */
9845 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9848 /* 3. GL_EXT_polygon_offset */
9849 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9851 /* 6. GL_EXT_texture3d */
9853 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9854 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9855 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9858 /* 14. GL_SGI_color_table */
9860 SET_ColorTableSGI(table
, save_ColorTable
);
9861 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9862 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9863 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9864 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9867 /* 30. GL_EXT_vertex_array */
9868 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9869 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9870 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9871 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9872 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9873 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9875 /* 37. GL_EXT_blend_minmax */
9877 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9880 /* 54. GL_EXT_point_parameters */
9881 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9882 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9884 /* 97. GL_EXT_compiled_vertex_array */
9885 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9886 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9888 /* 145. GL_EXT_secondary_color */
9889 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9891 /* 148. GL_EXT_multi_draw_arrays */
9892 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9894 /* 149. GL_EXT_fog_coord */
9895 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9897 /* 173. GL_EXT_blend_func_separate */
9898 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9900 /* 196. GL_MESA_resize_buffers */
9901 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9903 /* 197. GL_MESA_window_pos */
9904 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9905 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9906 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9907 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9908 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9909 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9910 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9911 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9912 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9913 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9914 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9915 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9916 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9917 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9918 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9919 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9920 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9921 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9922 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9923 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9924 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9925 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9926 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9927 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9929 /* 200. GL_IBM_multimode_draw_arrays */
9930 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9931 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9933 /* 233. GL_NV_vertex_program */
9934 /* The following commands DO NOT go into display lists:
9935 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9936 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9938 SET_BindProgramNV(table
, save_BindProgramNV
);
9939 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9940 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9941 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9943 /* 244. GL_ATI_envmap_bumpmap */
9944 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9945 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9947 /* 245. GL_ATI_fragment_shader */
9948 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9949 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9951 /* 262. GL_NV_point_sprite */
9952 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9953 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9955 /* 268. GL_EXT_stencil_two_side */
9956 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9958 /* 273. GL_APPLE_vertex_array_object */
9959 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9960 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9961 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9962 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9964 /* 310. GL_EXT_framebuffer_object */
9965 SET_GenFramebuffersEXT(table
, _mesa_GenFramebuffersEXT
);
9966 SET_BindFramebufferEXT(table
, _mesa_BindFramebufferEXT
);
9967 SET_DeleteFramebuffersEXT(table
, _mesa_DeleteFramebuffersEXT
);
9968 SET_CheckFramebufferStatusEXT(table
, _mesa_CheckFramebufferStatusEXT
);
9969 SET_GenRenderbuffersEXT(table
, _mesa_GenRenderbuffersEXT
);
9970 SET_BindRenderbufferEXT(table
, _mesa_BindRenderbufferEXT
);
9971 SET_DeleteRenderbuffersEXT(table
, _mesa_DeleteRenderbuffersEXT
);
9972 SET_RenderbufferStorageEXT(table
, _mesa_RenderbufferStorageEXT
);
9973 SET_FramebufferTexture1DEXT(table
, _mesa_FramebufferTexture1DEXT
);
9974 SET_FramebufferTexture2DEXT(table
, _mesa_FramebufferTexture2DEXT
);
9975 SET_FramebufferTexture3DEXT(table
, _mesa_FramebufferTexture3DEXT
);
9976 SET_FramebufferRenderbufferEXT(table
, _mesa_FramebufferRenderbufferEXT
);
9977 SET_GenerateMipmapEXT(table
, _mesa_GenerateMipmapEXT
);
9979 /* 317. GL_EXT_framebuffer_multisample */
9980 SET_RenderbufferStorageMultisample(table
, _mesa_RenderbufferStorageMultisample
);
9982 /* GL_ARB_vertex_array_object */
9983 SET_BindVertexArray(table
, _mesa_BindVertexArray
);
9984 SET_GenVertexArrays(table
, _mesa_GenVertexArrays
);
9986 /* ???. GL_EXT_depth_bounds_test */
9987 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9989 /* ARB 1. GL_ARB_multitexture */
9990 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9991 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9993 /* ARB 3. GL_ARB_transpose_matrix */
9994 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9995 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9996 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9997 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9999 /* ARB 5. GL_ARB_multisample */
10000 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
10002 /* ARB 12. GL_ARB_texture_compression */
10003 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
10004 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
10005 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
10006 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
10007 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
10008 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
10009 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
10011 /* ARB 14. GL_ARB_point_parameters */
10012 /* aliased with EXT_point_parameters functions */
10014 /* ARB 25. GL_ARB_window_pos */
10015 /* aliased with MESA_window_pos functions */
10017 /* ARB 26. GL_ARB_vertex_program */
10018 /* ARB 27. GL_ARB_fragment_program */
10019 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
10020 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
10021 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
10022 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
10023 SET_ProgramStringARB(table
, save_ProgramStringARB
);
10024 SET_BindProgramNV(table
, save_BindProgramNV
);
10025 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
10026 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
10027 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
10028 SET_GetVertexAttribdvARB(table
, _mesa_GetVertexAttribdvARB
);
10029 SET_GetVertexAttribfvARB(table
, _mesa_GetVertexAttribfvARB
);
10030 SET_GetVertexAttribivARB(table
, _mesa_GetVertexAttribivARB
);
10031 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervARB
);
10032 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
10033 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
10034 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
10035 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
10036 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
10037 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
10038 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
10039 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
10040 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
10041 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
10042 SET_GetProgramLocalParameterdvARB(table
,
10043 _mesa_GetProgramLocalParameterdvARB
);
10044 SET_GetProgramLocalParameterfvARB(table
,
10045 _mesa_GetProgramLocalParameterfvARB
);
10046 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
10047 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
10049 /* ARB 28. GL_ARB_vertex_buffer_object */
10050 /* None of the extension's functions get compiled */
10051 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
10052 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
10053 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
10054 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
10055 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
10056 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
10057 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
10058 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
10059 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
10060 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
10061 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
10063 _mesa_init_queryobj_dispatch(table
); /* glGetQuery, etc */
10064 SET_BeginQueryARB(table
, save_BeginQueryARB
);
10065 SET_EndQueryARB(table
, save_EndQueryARB
);
10066 SET_QueryCounter(table
, save_QueryCounter
);
10068 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
10070 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
10072 /* GL_ARB_shader_objects */
10073 _mesa_init_shader_dispatch(ctx
, table
); /* Plug in glCreate/Delete/Get, etc */
10074 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
10075 SET_Uniform1fARB(table
, save_Uniform1fARB
);
10076 SET_Uniform2fARB(table
, save_Uniform2fARB
);
10077 SET_Uniform3fARB(table
, save_Uniform3fARB
);
10078 SET_Uniform4fARB(table
, save_Uniform4fARB
);
10079 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
10080 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
10081 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
10082 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
10083 SET_Uniform1iARB(table
, save_Uniform1iARB
);
10084 SET_Uniform2iARB(table
, save_Uniform2iARB
);
10085 SET_Uniform3iARB(table
, save_Uniform3iARB
);
10086 SET_Uniform4iARB(table
, save_Uniform4iARB
);
10087 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
10088 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
10089 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
10090 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
10091 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
10092 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
10093 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
10094 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
10095 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
10096 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
10097 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
10098 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
10099 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
10101 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
10102 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
10103 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
10104 SET_GetUniformLocationARB(table
, exec_GetUniformLocationARB
);
10105 /* XXX additional functions need to be implemented here! */
10107 /* 299. GL_EXT_blend_equation_separate */
10108 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
10110 /* GL_EXT_gpu_program_parameters */
10111 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
10112 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
10114 /* ARB 50. GL_ARB_map_buffer_range */
10115 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
10116 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
10118 /* ARB 51. GL_ARB_texture_buffer_object */
10119 SET_TexBufferARB(table
, _mesa_TexBuffer
); /* no dlist save */
10121 /* ARB 59. GL_ARB_copy_buffer */
10122 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
10124 /* 364. GL_EXT_provoking_vertex */
10125 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
10127 /* 371. GL_APPLE_object_purgeable */
10128 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
10129 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
10130 SET_GetObjectParameterivAPPLE(table
, _mesa_GetObjectParameterivAPPLE
);
10132 /* GL_EXT_texture_integer */
10133 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
10134 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
10135 SET_TexParameterIivEXT(table
, save_TexParameterIiv
);
10136 SET_TexParameterIuivEXT(table
, save_TexParameterIuiv
);
10137 SET_GetTexParameterIivEXT(table
, exec_GetTexParameterIiv
);
10138 SET_GetTexParameterIuivEXT(table
, exec_GetTexParameterIuiv
);
10140 /* 377. GL_EXT_separate_shader_objects */
10141 SET_UseShaderProgramEXT(table
, save_UseShaderProgramEXT
);
10142 SET_ActiveProgramEXT(table
, save_ActiveProgramEXT
);
10144 /* GL_ARB_color_buffer_float */
10145 SET_ClampColorARB(table
, save_ClampColorARB
);
10146 SET_ClampColor(table
, save_ClampColorARB
);
10149 SET_ClearBufferiv(table
, save_ClearBufferiv
);
10150 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
10151 SET_ClearBufferfv(table
, save_ClearBufferfv
);
10152 SET_ClearBufferfi(table
, save_ClearBufferfi
);
10154 SET_Uniform1ui(table
, save_Uniform1ui
);
10155 SET_Uniform2ui(table
, save_Uniform2ui
);
10156 SET_Uniform3ui(table
, save_Uniform3ui
);
10157 SET_Uniform4ui(table
, save_Uniform4ui
);
10158 SET_Uniform1uiv(table
, save_Uniform1uiv
);
10159 SET_Uniform2uiv(table
, save_Uniform2uiv
);
10160 SET_Uniform3uiv(table
, save_Uniform3uiv
);
10161 SET_Uniform4uiv(table
, save_Uniform4uiv
);
10163 (void) save_Uniform1ui
;
10164 (void) save_Uniform2ui
;
10165 (void) save_Uniform3ui
;
10166 (void) save_Uniform4ui
;
10167 (void) save_Uniform1uiv
;
10168 (void) save_Uniform2uiv
;
10169 (void) save_Uniform3uiv
;
10170 (void) save_Uniform4uiv
;
10173 /* These are not compiled into display lists: */
10174 SET_BindBufferBaseEXT(table
, _mesa_BindBufferBase
);
10175 SET_BindBufferOffsetEXT(table
, _mesa_BindBufferOffsetEXT
);
10176 SET_BindBufferRangeEXT(table
, _mesa_BindBufferRange
);
10177 SET_TransformFeedbackVaryingsEXT(table
, _mesa_TransformFeedbackVaryings
);
10179 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
10180 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
10181 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
10182 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
10183 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
10184 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
10185 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
10186 SET_DrawTransformFeedbackInstanced(table
,
10187 save_DrawTransformFeedbackInstanced
);
10188 SET_DrawTransformFeedbackStreamInstanced(table
,
10189 save_DrawTransformFeedbackStreamInstanced
);
10190 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
10191 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
10193 /* GL_ARB_instanced_arrays */
10194 SET_VertexAttribDivisorARB(table
, save_VertexAttribDivisor
);
10196 /* GL_NV_texture_barrier */
10197 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
10199 /* GL_ARB_sampler_objects */
10200 _mesa_init_sampler_object_dispatch(table
); /* plug in Gen/Get/etc functions */
10201 SET_BindSampler(table
, save_BindSampler
);
10202 SET_SamplerParameteri(table
, save_SamplerParameteri
);
10203 SET_SamplerParameterf(table
, save_SamplerParameterf
);
10204 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
10205 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
10206 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
10207 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
10209 /* GL_ARB_draw_buffer_blend */
10210 SET_BlendFunciARB(table
, save_BlendFunci
);
10211 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
10212 SET_BlendEquationiARB(table
, save_BlendEquationi
);
10213 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
10215 /* GL_ARB_geometry_shader4 */
10216 SET_ProgramParameteriARB(table
, save_ProgramParameteri
);
10217 SET_FramebufferTextureARB(table
, save_FramebufferTexture
);
10218 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
10220 /* GL_NV_conditional_render */
10221 SET_BeginConditionalRenderNV(table
, save_BeginConditionalRender
);
10222 SET_EndConditionalRenderNV(table
, save_EndConditionalRender
);
10225 _mesa_init_sync_dispatch(table
);
10226 SET_WaitSync(table
, save_WaitSync
);
10228 /* GL_ARB_texture_storage (no dlist support) */
10229 SET_TexStorage1D(table
, _mesa_TexStorage1D
);
10230 SET_TexStorage2D(table
, _mesa_TexStorage2D
);
10231 SET_TexStorage3D(table
, _mesa_TexStorage3D
);
10232 SET_TextureStorage1DEXT(table
, _mesa_TextureStorage1DEXT
);
10233 SET_TextureStorage2DEXT(table
, _mesa_TextureStorage2DEXT
);
10234 SET_TextureStorage3DEXT(table
, _mesa_TextureStorage3DEXT
);
10236 /* GL_ARB_debug_output (no dlist support) */
10237 _mesa_init_errors_dispatch(table
);
10239 /* GL_ARB_uniform_buffer_object */
10240 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
10242 /* GL_NV_primitive_restart */
10243 SET_PrimitiveRestartIndexNV(table
, _mesa_PrimitiveRestartIndex
);
10250 static const char *
10251 enum_string(GLenum k
)
10253 return _mesa_lookup_enum_by_nr(k
);
10258 * Print the commands in a display list. For debugging only.
10259 * TODO: many commands aren't handled yet.
10261 static void GLAPIENTRY
10262 print_list(struct gl_context
*ctx
, GLuint list
)
10264 struct gl_display_list
*dlist
;
10268 if (!islist(ctx
, list
)) {
10269 printf("%u is not a display list ID\n", list
);
10273 dlist
= lookup_list(ctx
, list
);
10279 printf("START-LIST %u, address %p\n", list
, (void *) n
);
10281 done
= n
? GL_FALSE
: GL_TRUE
;
10283 const OpCode opcode
= n
[0].opcode
;
10285 if (is_ext_opcode(opcode
)) {
10286 n
+= ext_opcode_print(ctx
, n
);
10291 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
10293 case OPCODE_BITMAP
:
10294 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
10295 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
10297 case OPCODE_CALL_LIST
:
10298 printf("CallList %d\n", (int) n
[1].ui
);
10300 case OPCODE_CALL_LIST_OFFSET
:
10301 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
10302 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
10304 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
10305 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
10306 enum_string(n
[1].e
), enum_string(n
[2].e
),
10307 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10309 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
10310 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
10311 enum_string(n
[1].e
), enum_string(n
[2].e
),
10312 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
10314 case OPCODE_DISABLE
:
10315 printf("Disable %s\n", enum_string(n
[1].e
));
10317 case OPCODE_ENABLE
:
10318 printf("Enable %s\n", enum_string(n
[1].e
));
10320 case OPCODE_FRUSTUM
:
10321 printf("Frustum %g %g %g %g %g %g\n",
10322 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10324 case OPCODE_LINE_STIPPLE
:
10325 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
10327 case OPCODE_LOAD_IDENTITY
:
10328 printf("LoadIdentity\n");
10330 case OPCODE_LOAD_MATRIX
:
10331 printf("LoadMatrix\n");
10332 printf(" %8f %8f %8f %8f\n",
10333 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10334 printf(" %8f %8f %8f %8f\n",
10335 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10336 printf(" %8f %8f %8f %8f\n",
10337 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10338 printf(" %8f %8f %8f %8f\n",
10339 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10341 case OPCODE_MULT_MATRIX
:
10342 printf("MultMatrix (or Rotate)\n");
10343 printf(" %8f %8f %8f %8f\n",
10344 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
10345 printf(" %8f %8f %8f %8f\n",
10346 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
10347 printf(" %8f %8f %8f %8f\n",
10348 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
10349 printf(" %8f %8f %8f %8f\n",
10350 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
10353 printf("Ortho %g %g %g %g %g %g\n",
10354 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10356 case OPCODE_POP_ATTRIB
:
10357 printf("PopAttrib\n");
10359 case OPCODE_POP_MATRIX
:
10360 printf("PopMatrix\n");
10362 case OPCODE_POP_NAME
:
10363 printf("PopName\n");
10365 case OPCODE_PUSH_ATTRIB
:
10366 printf("PushAttrib %x\n", n
[1].bf
);
10368 case OPCODE_PUSH_MATRIX
:
10369 printf("PushMatrix\n");
10371 case OPCODE_PUSH_NAME
:
10372 printf("PushName %d\n", (int) n
[1].ui
);
10374 case OPCODE_RASTER_POS
:
10375 printf("RasterPos %g %g %g %g\n",
10376 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10378 case OPCODE_ROTATE
:
10379 printf("Rotate %g %g %g %g\n",
10380 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
10383 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10385 case OPCODE_TRANSLATE
:
10386 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
10388 case OPCODE_BIND_TEXTURE
:
10389 printf("BindTexture %s %d\n",
10390 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
10392 case OPCODE_SHADE_MODEL
:
10393 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
10396 printf("Map1 %s %.3f %.3f %d %d\n",
10397 _mesa_lookup_enum_by_nr(n
[1].ui
),
10398 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
10401 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
10402 _mesa_lookup_enum_by_nr(n
[1].ui
),
10403 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
10404 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
10406 case OPCODE_MAPGRID1
:
10407 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
10409 case OPCODE_MAPGRID2
:
10410 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
10411 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
10413 case OPCODE_EVALMESH1
:
10414 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
10416 case OPCODE_EVALMESH2
:
10417 printf("EvalMesh2 %d %d %d %d\n",
10418 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
10421 case OPCODE_ATTR_1F_NV
:
10422 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
10424 case OPCODE_ATTR_2F_NV
:
10425 printf("ATTR_2F_NV attr %d: %f %f\n",
10426 n
[1].i
, n
[2].f
, n
[3].f
);
10428 case OPCODE_ATTR_3F_NV
:
10429 printf("ATTR_3F_NV attr %d: %f %f %f\n",
10430 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10432 case OPCODE_ATTR_4F_NV
:
10433 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
10434 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10436 case OPCODE_ATTR_1F_ARB
:
10437 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
10439 case OPCODE_ATTR_2F_ARB
:
10440 printf("ATTR_2F_ARB attr %d: %f %f\n",
10441 n
[1].i
, n
[2].f
, n
[3].f
);
10443 case OPCODE_ATTR_3F_ARB
:
10444 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
10445 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
10447 case OPCODE_ATTR_4F_ARB
:
10448 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
10449 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
10452 case OPCODE_MATERIAL
:
10453 printf("MATERIAL %x %x: %f %f %f %f\n",
10454 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
10457 printf("BEGIN %x\n", n
[1].i
);
10463 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
10466 case OPCODE_EVAL_C1
:
10467 printf("EVAL_C1 %f\n", n
[1].f
);
10469 case OPCODE_EVAL_C2
:
10470 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
10472 case OPCODE_EVAL_P1
:
10473 printf("EVAL_P1 %d\n", n
[1].i
);
10475 case OPCODE_EVAL_P2
:
10476 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
10479 case OPCODE_PROVOKING_VERTEX
:
10480 printf("ProvokingVertex %s\n",
10481 _mesa_lookup_enum_by_nr(n
[1].ui
));
10485 * meta opcodes/commands
10488 printf("Error: %s %s\n",
10489 enum_string(n
[1].e
), (const char *) n
[2].data
);
10491 case OPCODE_CONTINUE
:
10492 printf("DISPLAY-LIST-CONTINUE\n");
10493 n
= (Node
*) n
[1].next
;
10495 case OPCODE_END_OF_LIST
:
10496 printf("END-LIST %u\n", list
);
10500 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
10502 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
10503 opcode
, (void *) n
);
10507 printf("command %d, %u operands\n", opcode
,
10511 /* increment n to point to next compiled command */
10512 if (opcode
!= OPCODE_CONTINUE
) {
10513 n
+= InstSize
[opcode
];
10522 * Clients may call this function to help debug display list problems.
10523 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
10524 * changed, or break in the future without notice.
10527 mesa_print_display_list(GLuint list
)
10529 GET_CURRENT_CONTEXT(ctx
);
10530 print_list(ctx
, list
);
10534 /**********************************************************************/
10535 /***** Initialization *****/
10536 /**********************************************************************/
10539 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
10541 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
10543 vfmt
->Begin
= save_Begin
;
10545 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
10547 vfmt
->Color3f
= save_Color3f
;
10548 vfmt
->Color3fv
= save_Color3fv
;
10549 vfmt
->Color4f
= save_Color4f
;
10550 vfmt
->Color4fv
= save_Color4fv
;
10551 vfmt
->EdgeFlag
= save_EdgeFlag
;
10552 vfmt
->End
= save_End
;
10554 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
10556 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10557 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10558 vfmt
->Indexf
= save_Indexf
;
10559 vfmt
->Indexfv
= save_Indexfv
;
10560 vfmt
->Materialfv
= save_Materialfv
;
10561 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10562 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10563 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10564 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10565 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10566 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10567 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10568 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10569 vfmt
->Normal3f
= save_Normal3f
;
10570 vfmt
->Normal3fv
= save_Normal3fv
;
10571 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10572 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10573 vfmt
->TexCoord1f
= save_TexCoord1f
;
10574 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10575 vfmt
->TexCoord2f
= save_TexCoord2f
;
10576 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10577 vfmt
->TexCoord3f
= save_TexCoord3f
;
10578 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10579 vfmt
->TexCoord4f
= save_TexCoord4f
;
10580 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10581 vfmt
->Vertex2f
= save_Vertex2f
;
10582 vfmt
->Vertex2fv
= save_Vertex2fv
;
10583 vfmt
->Vertex3f
= save_Vertex3f
;
10584 vfmt
->Vertex3fv
= save_Vertex3fv
;
10585 vfmt
->Vertex4f
= save_Vertex4f
;
10586 vfmt
->Vertex4fv
= save_Vertex4fv
;
10587 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10588 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10589 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10590 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10591 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10592 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10593 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10594 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10596 vfmt
->Rectf
= save_Rectf
;
10598 /* GL_ARB_draw_instanced */
10599 vfmt
->DrawArraysInstanced
= save_DrawArraysInstancedARB
;
10600 vfmt
->DrawElementsInstanced
= save_DrawElementsInstancedARB
;
10602 /* GL_ARB_draw_elements_base_vertex */
10603 vfmt
->DrawElementsInstancedBaseVertex
= save_DrawElementsInstancedBaseVertexARB
;
10605 /* GL_ARB_base_instance */
10606 vfmt
->DrawArraysInstancedBaseInstance
= save_DrawArraysInstancedBaseInstance
;
10607 vfmt
->DrawElementsInstancedBaseInstance
= save_DrawElementsInstancedBaseInstance
;
10608 vfmt
->DrawElementsInstancedBaseVertexBaseInstance
= save_DrawElementsInstancedBaseVertexBaseInstance
;
10610 /* The driver is required to implement these as
10611 * 1) They can probably do a better job.
10612 * 2) A lot of new mechanisms would have to be added to this module
10613 * to support it. That code would probably never get used,
10617 vfmt
->DrawArrays
= 0;
10618 vfmt
->DrawElements
= 0;
10619 vfmt
->DrawRangeElements
= 0;
10620 vfmt
->MultiDrawElemementsEXT
= 0;
10621 vfmt
->DrawElementsBaseVertex
= 0;
10622 vfmt
->DrawRangeElementsBaseVertex
= 0;
10623 vfmt
->MultiDrawElemementsBaseVertex
= 0;
10629 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10630 const GLvertexformat
*vfmt
)
10632 SET_CallList(disp
, vfmt
->CallList
);
10633 SET_CallLists(disp
, vfmt
->CallLists
);
10637 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
10639 SET_CallList(disp
, _mesa_CallList
);
10640 SET_CallLists(disp
, _mesa_CallLists
);
10642 SET_DeleteLists(disp
, _mesa_DeleteLists
);
10643 SET_EndList(disp
, _mesa_EndList
);
10644 SET_GenLists(disp
, _mesa_GenLists
);
10645 SET_IsList(disp
, _mesa_IsList
);
10646 SET_ListBase(disp
, _mesa_ListBase
);
10647 SET_NewList(disp
, _mesa_NewList
);
10652 * Initialize display list state for given context.
10655 _mesa_init_display_list(struct gl_context
*ctx
)
10657 static GLboolean tableInitialized
= GL_FALSE
;
10659 /* zero-out the instruction size table, just once */
10660 if (!tableInitialized
) {
10661 memset(InstSize
, 0, sizeof(InstSize
));
10662 tableInitialized
= GL_TRUE
;
10665 /* extension info */
10666 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10669 ctx
->ListState
.CallDepth
= 0;
10670 ctx
->ExecuteFlag
= GL_TRUE
;
10671 ctx
->CompileFlag
= GL_FALSE
;
10672 ctx
->ListState
.CurrentBlock
= NULL
;
10673 ctx
->ListState
.CurrentPos
= 0;
10675 /* Display List group */
10676 ctx
->List
.ListBase
= 0;
10678 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10683 _mesa_free_display_list_data(struct gl_context
*ctx
)
10685 free(ctx
->ListExt
);
10686 ctx
->ListExt
= NULL
;