2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * 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 "bufferobj.h"
47 #include "framebuffer.h"
48 #include "glapi/glapi.h"
49 #include "glformats.h"
57 #include "samplerobj.h"
58 #include "shaderapi.h"
61 #include "texstorage.h"
64 #include "arbprogram.h"
65 #include "transformfeedback.h"
67 #include "math/m_matrix.h"
69 #include "main/dispatch.h"
76 * Other parts of Mesa (such as the VBO module) can plug into the display
77 * list system. This structure describes new display list instructions.
79 struct gl_list_instruction
82 void (*Execute
)( struct gl_context
*ctx
, void *data
);
83 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
84 void (*Print
)( struct gl_context
*ctx
, void *data
);
88 #define MAX_DLIST_EXT_OPCODES 16
91 * Used by device drivers to hook new commands into display lists.
93 struct gl_list_extensions
95 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
104 * \param ctx GL context.
106 * Checks if dd_function_table::SaveNeedFlush is marked to flush
107 * stored (save) vertices, and calls
108 * dd_function_table::SaveFlushVertices if so.
110 #define SAVE_FLUSH_VERTICES(ctx) \
112 if (ctx->Driver.SaveNeedFlush) \
113 ctx->Driver.SaveFlushVertices(ctx); \
118 * Macro to assert that the API call was made outside the
119 * glBegin()/glEnd() pair, with return value.
121 * \param ctx GL context.
122 * \param retval value to return value in case the assertion fails.
124 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
126 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
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 <= PRIM_MAX) { \
141 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
147 * Macro to assert that the API call was made outside the
148 * glBegin()/glEnd() pair and flush the vertices.
150 * \param ctx GL context.
152 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
154 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
155 SAVE_FLUSH_VERTICES(ctx); \
159 * Macro to assert that the API call was made outside the
160 * glBegin()/glEnd() pair and flush the vertices, with return value.
162 * \param ctx GL context.
163 * \param retval value to return value in case the assertion fails.
165 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
167 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
168 SAVE_FLUSH_VERTICES(ctx); \
174 * Display list opcodes.
176 * The fact that these identifiers are assigned consecutive
177 * integer values starting at 0 is very important, see InstSize array usage)
181 OPCODE_INVALID
= -1, /* Force signed enum */
187 OPCODE_BLEND_EQUATION
,
188 OPCODE_BLEND_EQUATION_SEPARATE
,
189 OPCODE_BLEND_FUNC_SEPARATE
,
191 OPCODE_BLEND_EQUATION_I
,
192 OPCODE_BLEND_EQUATION_SEPARATE_I
,
194 OPCODE_BLEND_FUNC_SEPARATE_I
,
197 OPCODE_CALL_LIST_OFFSET
,
203 OPCODE_CLEAR_STENCIL
,
204 OPCODE_CLEAR_BUFFER_IV
,
205 OPCODE_CLEAR_BUFFER_UIV
,
206 OPCODE_CLEAR_BUFFER_FV
,
207 OPCODE_CLEAR_BUFFER_FI
,
210 OPCODE_COLOR_MASK_INDEXED
,
211 OPCODE_COLOR_MATERIAL
,
213 OPCODE_COPY_TEX_IMAGE1D
,
214 OPCODE_COPY_TEX_IMAGE2D
,
215 OPCODE_COPY_TEX_SUB_IMAGE1D
,
216 OPCODE_COPY_TEX_SUB_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE3D
,
223 OPCODE_DISABLE_INDEXED
,
227 OPCODE_ENABLE_INDEXED
,
241 OPCODE_LOAD_IDENTITY
,
254 OPCODE_PIXEL_TRANSFER
,
257 OPCODE_POINT_PARAMETERS
,
259 OPCODE_POLYGON_STIPPLE
,
260 OPCODE_POLYGON_OFFSET
,
264 OPCODE_PRIORITIZE_TEXTURE
,
273 OPCODE_SELECT_TEXTURE_SGIS
,
274 OPCODE_SELECT_TEXTURE_COORD_SET
,
285 OPCODE_TEX_SUB_IMAGE1D
,
286 OPCODE_TEX_SUB_IMAGE2D
,
287 OPCODE_TEX_SUB_IMAGE3D
,
291 /* GL_ARB_multitexture */
292 OPCODE_ACTIVE_TEXTURE
,
293 /* GL_ARB_texture_compression */
294 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
297 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
298 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
299 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
300 /* GL_ARB_multisample */
301 OPCODE_SAMPLE_COVERAGE
,
302 /* GL_ARB_window_pos */
303 OPCODE_WINDOW_POS_ARB
,
304 /* GL_NV_fragment_program */
305 OPCODE_BIND_PROGRAM_NV
,
306 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
307 /* GL_EXT_stencil_two_side */
308 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
309 /* GL_EXT_depth_bounds_test */
310 OPCODE_DEPTH_BOUNDS_EXT
,
311 /* GL_ARB_vertex/fragment_program */
312 OPCODE_PROGRAM_STRING_ARB
,
313 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
314 /* GL_ARB_occlusion_query */
315 OPCODE_BEGIN_QUERY_ARB
,
316 OPCODE_END_QUERY_ARB
,
317 /* GL_ARB_draw_buffers */
318 OPCODE_DRAW_BUFFERS_ARB
,
319 /* GL_ATI_fragment_shader */
320 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
321 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
323 OPCODE_STENCIL_FUNC_SEPARATE
,
324 OPCODE_STENCIL_OP_SEPARATE
,
325 OPCODE_STENCIL_MASK_SEPARATE
,
327 /* GL_ARB_shader_objects */
345 OPCODE_UNIFORM_MATRIX22
,
346 OPCODE_UNIFORM_MATRIX33
,
347 OPCODE_UNIFORM_MATRIX44
,
348 OPCODE_UNIFORM_MATRIX23
,
349 OPCODE_UNIFORM_MATRIX32
,
350 OPCODE_UNIFORM_MATRIX24
,
351 OPCODE_UNIFORM_MATRIX42
,
352 OPCODE_UNIFORM_MATRIX34
,
353 OPCODE_UNIFORM_MATRIX43
,
365 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
366 OPCODE_USE_PROGRAM_STAGES
,
367 OPCODE_PROGRAM_UNIFORM_1F
,
368 OPCODE_PROGRAM_UNIFORM_2F
,
369 OPCODE_PROGRAM_UNIFORM_3F
,
370 OPCODE_PROGRAM_UNIFORM_4F
,
371 OPCODE_PROGRAM_UNIFORM_1FV
,
372 OPCODE_PROGRAM_UNIFORM_2FV
,
373 OPCODE_PROGRAM_UNIFORM_3FV
,
374 OPCODE_PROGRAM_UNIFORM_4FV
,
375 OPCODE_PROGRAM_UNIFORM_1I
,
376 OPCODE_PROGRAM_UNIFORM_2I
,
377 OPCODE_PROGRAM_UNIFORM_3I
,
378 OPCODE_PROGRAM_UNIFORM_4I
,
379 OPCODE_PROGRAM_UNIFORM_1IV
,
380 OPCODE_PROGRAM_UNIFORM_2IV
,
381 OPCODE_PROGRAM_UNIFORM_3IV
,
382 OPCODE_PROGRAM_UNIFORM_4IV
,
383 OPCODE_PROGRAM_UNIFORM_1UI
,
384 OPCODE_PROGRAM_UNIFORM_2UI
,
385 OPCODE_PROGRAM_UNIFORM_3UI
,
386 OPCODE_PROGRAM_UNIFORM_4UI
,
387 OPCODE_PROGRAM_UNIFORM_1UIV
,
388 OPCODE_PROGRAM_UNIFORM_2UIV
,
389 OPCODE_PROGRAM_UNIFORM_3UIV
,
390 OPCODE_PROGRAM_UNIFORM_4UIV
,
391 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
392 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
393 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
394 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
395 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
396 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
397 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
398 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
399 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
401 /* GL_ARB_color_buffer_float */
404 /* GL_EXT_framebuffer_blit */
405 OPCODE_BLIT_FRAMEBUFFER
,
407 /* Vertex attributes -- fallback for when optimized display
408 * list build isn't active.
427 /* GL_EXT_provoking_vertex */
428 OPCODE_PROVOKING_VERTEX
,
430 /* GL_EXT_transform_feedback */
431 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
432 OPCODE_END_TRANSFORM_FEEDBACK
,
433 OPCODE_BIND_TRANSFORM_FEEDBACK
,
434 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
435 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
436 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
438 /* GL_EXT_texture_integer */
440 OPCODE_CLEARCOLOR_UI
,
441 OPCODE_TEXPARAMETER_I
,
442 OPCODE_TEXPARAMETER_UI
,
444 /* GL_ARB_instanced_arrays */
445 OPCODE_VERTEX_ATTRIB_DIVISOR
,
447 /* GL_NV_texture_barrier */
448 OPCODE_TEXTURE_BARRIER_NV
,
450 /* GL_ARB_sampler_object */
452 OPCODE_SAMPLER_PARAMETERIV
,
453 OPCODE_SAMPLER_PARAMETERFV
,
454 OPCODE_SAMPLER_PARAMETERIIV
,
455 OPCODE_SAMPLER_PARAMETERUIV
,
457 /* GL_ARB_geometry_shader4 */
458 OPCODE_PROGRAM_PARAMETERI
,
459 OPCODE_FRAMEBUFFER_TEXTURE
,
460 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
465 /* GL_NV_conditional_render */
466 OPCODE_BEGIN_CONDITIONAL_RENDER
,
467 OPCODE_END_CONDITIONAL_RENDER
,
469 /* ARB_timer_query */
470 OPCODE_QUERY_COUNTER
,
472 /* ARB_transform_feedback3 */
473 OPCODE_BEGIN_QUERY_INDEXED
,
474 OPCODE_END_QUERY_INDEXED
,
475 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
477 /* ARB_transform_feedback_instanced */
478 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
479 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
481 /* ARB_uniform_buffer_object */
482 OPCODE_UNIFORM_BLOCK_BINDING
,
484 /* The following three are meta instructions */
485 OPCODE_ERROR
, /* raise compiled-in error */
496 * Display list instructions are stored as sequences of "nodes". Nodes
497 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
498 * are linked together with a pointer.
500 * Each instruction in the display list is stored as a sequence of
501 * contiguous nodes in memory.
502 * Each node is the union of a variety of data types.
504 * Note, all of these members should be 4 bytes in size or less for the
505 * sake of compact display lists. We store 8-byte pointers in a pair of
506 * these nodes using the save/get_pointer() functions below.
524 typedef union gl_dlist_node Node
;
527 /** How many 4-byte dwords to store a pointer */
528 #define POINTER_DWORDS (sizeof(void *) / 4)
530 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
531 * space for display lists. The following types and functions are
532 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
537 GLuint dwords
[POINTER_DWORDS
];
542 * Save a 4 or 8-byte pointer at dest (and dest+1).
545 save_pointer(union gl_dlist_node
*dest
, void *src
)
550 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
551 STATIC_ASSERT(sizeof(union gl_dlist_node
) == 4);
555 for (i
= 0; i
< POINTER_DWORDS
; i
++)
556 dest
[i
].ui
= p
.dwords
[i
];
561 * Retrieve a 4 or 8-byte pointer from node (node+1).
564 get_pointer(const union gl_dlist_node
*node
)
569 for (i
= 0; i
< POINTER_DWORDS
; i
++)
570 p
.dwords
[i
] = node
[i
].ui
;
577 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
578 * environment. In 64-bit env, sizeof(Node)==8 anyway.
588 * How many nodes to allocate at a time. Note that bulk vertex data
589 * from glBegin/glVertex/glEnd primitives will typically wind up in
590 * a VBO, and not directly in the display list itself.
592 #define BLOCK_SIZE 256
597 * Number of nodes of storage needed for each instruction.
598 * Sizes for dynamically allocated opcodes are stored in the context struct.
600 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
603 void mesa_print_display_list(GLuint list
);
607 * Allocate a gl_display_list object with an initial block of storage.
608 * \param count how many display list nodes/tokes to allocate
610 static struct gl_display_list
*
611 make_list(GLuint name
, GLuint count
)
613 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
615 dlist
->Head
= malloc(sizeof(Node
) * count
);
616 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
622 * Lookup function to just encapsulate casting.
624 struct gl_display_list
*
625 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
627 return (struct gl_display_list
*)
628 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
632 /** Is the given opcode an extension code? */
633 static inline GLboolean
634 is_ext_opcode(OpCode opcode
)
636 return (opcode
>= OPCODE_EXT_0
);
640 /** Destroy an extended opcode instruction */
642 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
644 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
646 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
647 step
= ctx
->ListExt
->Opcode
[i
].Size
;
652 /** Execute an extended opcode instruction */
654 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
656 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
658 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
659 step
= ctx
->ListExt
->Opcode
[i
].Size
;
664 /** Print an extended opcode instruction */
666 ext_opcode_print(struct gl_context
*ctx
, Node
*node
)
668 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
670 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
671 step
= ctx
->ListExt
->Opcode
[i
].Size
;
677 * Delete the named display list, but don't remove from hash table.
678 * \param dlist - display list pointer
681 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
686 n
= block
= dlist
->Head
;
688 done
= block
? GL_FALSE
: GL_TRUE
;
690 const OpCode opcode
= n
[0].opcode
;
692 /* check for extension opcodes first */
693 if (is_ext_opcode(opcode
)) {
694 n
+= ext_opcode_destroy(ctx
, n
);
698 /* for some commands, we need to free malloc'd memory */
700 free(get_pointer(&n
[6]));
701 n
+= InstSize
[n
[0].opcode
];
704 free(get_pointer(&n
[10]));
705 n
+= InstSize
[n
[0].opcode
];
707 case OPCODE_DRAW_PIXELS
:
708 free(get_pointer(&n
[5]));
709 n
+= InstSize
[n
[0].opcode
];
712 free(get_pointer(&n
[7]));
713 n
+= InstSize
[n
[0].opcode
];
715 case OPCODE_POLYGON_STIPPLE
:
716 free(get_pointer(&n
[1]));
717 n
+= InstSize
[n
[0].opcode
];
719 case OPCODE_TEX_IMAGE1D
:
720 free(get_pointer(&n
[8]));
721 n
+= InstSize
[n
[0].opcode
];
723 case OPCODE_TEX_IMAGE2D
:
724 free(get_pointer(&n
[9]));
725 n
+= InstSize
[n
[0].opcode
];
727 case OPCODE_TEX_IMAGE3D
:
728 free(get_pointer(&n
[10]));
729 n
+= InstSize
[n
[0].opcode
];
731 case OPCODE_TEX_SUB_IMAGE1D
:
732 free(get_pointer(&n
[7]));
733 n
+= InstSize
[n
[0].opcode
];
735 case OPCODE_TEX_SUB_IMAGE2D
:
736 free(get_pointer(&n
[9]));
737 n
+= InstSize
[n
[0].opcode
];
739 case OPCODE_TEX_SUB_IMAGE3D
:
740 free(get_pointer(&n
[11]));
741 n
+= InstSize
[n
[0].opcode
];
743 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
744 free(get_pointer(&n
[7]));
745 n
+= InstSize
[n
[0].opcode
];
747 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
748 free(get_pointer(&n
[8]));
749 n
+= InstSize
[n
[0].opcode
];
751 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
752 free(get_pointer(&n
[9]));
753 n
+= InstSize
[n
[0].opcode
];
755 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
756 free(get_pointer(&n
[7]));
757 n
+= InstSize
[n
[0].opcode
];
759 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
760 free(get_pointer(&n
[9]));
761 n
+= InstSize
[n
[0].opcode
];
763 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
764 free(get_pointer(&n
[11]));
765 n
+= InstSize
[n
[0].opcode
];
767 case OPCODE_PROGRAM_STRING_ARB
:
768 free(get_pointer(&n
[4])); /* program string */
769 n
+= InstSize
[n
[0].opcode
];
771 case OPCODE_UNIFORM_1FV
:
772 case OPCODE_UNIFORM_2FV
:
773 case OPCODE_UNIFORM_3FV
:
774 case OPCODE_UNIFORM_4FV
:
775 case OPCODE_UNIFORM_1IV
:
776 case OPCODE_UNIFORM_2IV
:
777 case OPCODE_UNIFORM_3IV
:
778 case OPCODE_UNIFORM_4IV
:
779 case OPCODE_UNIFORM_1UIV
:
780 case OPCODE_UNIFORM_2UIV
:
781 case OPCODE_UNIFORM_3UIV
:
782 case OPCODE_UNIFORM_4UIV
:
783 free(get_pointer(&n
[3]));
784 n
+= InstSize
[n
[0].opcode
];
786 case OPCODE_UNIFORM_MATRIX22
:
787 case OPCODE_UNIFORM_MATRIX33
:
788 case OPCODE_UNIFORM_MATRIX44
:
789 case OPCODE_UNIFORM_MATRIX24
:
790 case OPCODE_UNIFORM_MATRIX42
:
791 case OPCODE_UNIFORM_MATRIX23
:
792 case OPCODE_UNIFORM_MATRIX32
:
793 case OPCODE_UNIFORM_MATRIX34
:
794 case OPCODE_UNIFORM_MATRIX43
:
795 free(get_pointer(&n
[4]));
796 n
+= InstSize
[n
[0].opcode
];
798 case OPCODE_PROGRAM_UNIFORM_1FV
:
799 case OPCODE_PROGRAM_UNIFORM_2FV
:
800 case OPCODE_PROGRAM_UNIFORM_3FV
:
801 case OPCODE_PROGRAM_UNIFORM_4FV
:
802 case OPCODE_PROGRAM_UNIFORM_1IV
:
803 case OPCODE_PROGRAM_UNIFORM_2IV
:
804 case OPCODE_PROGRAM_UNIFORM_3IV
:
805 case OPCODE_PROGRAM_UNIFORM_4IV
:
806 case OPCODE_PROGRAM_UNIFORM_1UIV
:
807 case OPCODE_PROGRAM_UNIFORM_2UIV
:
808 case OPCODE_PROGRAM_UNIFORM_3UIV
:
809 case OPCODE_PROGRAM_UNIFORM_4UIV
:
810 free(get_pointer(&n
[4]));
811 n
+= InstSize
[n
[0].opcode
];
813 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
814 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
815 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
816 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
817 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
818 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
819 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
820 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
821 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
822 free(get_pointer(&n
[5]));
823 n
+= InstSize
[n
[0].opcode
];
825 case OPCODE_PIXEL_MAP
:
826 free(get_pointer(&n
[3]));
827 n
+= InstSize
[n
[0].opcode
];
830 case OPCODE_CONTINUE
:
831 n
= (Node
*) get_pointer(&n
[1]);
835 case OPCODE_END_OF_LIST
:
840 /* Most frequent case */
841 n
+= InstSize
[n
[0].opcode
];
853 * Destroy a display list and remove from hash table.
854 * \param list - display list number
857 destroy_list(struct gl_context
*ctx
, GLuint list
)
859 struct gl_display_list
*dlist
;
864 dlist
= _mesa_lookup_list(ctx
, list
);
868 _mesa_delete_list(ctx
, dlist
);
869 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
874 * Translate the nth element of list from <type> to GLint.
877 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
889 bptr
= (GLbyte
*) list
;
890 return (GLint
) bptr
[n
];
891 case GL_UNSIGNED_BYTE
:
892 ubptr
= (GLubyte
*) list
;
893 return (GLint
) ubptr
[n
];
895 sptr
= (GLshort
*) list
;
896 return (GLint
) sptr
[n
];
897 case GL_UNSIGNED_SHORT
:
898 usptr
= (GLushort
*) list
;
899 return (GLint
) usptr
[n
];
901 iptr
= (GLint
*) list
;
903 case GL_UNSIGNED_INT
:
904 uiptr
= (GLuint
*) list
;
905 return (GLint
) uiptr
[n
];
907 fptr
= (GLfloat
*) list
;
908 return (GLint
) FLOORF(fptr
[n
]);
910 ubptr
= ((GLubyte
*) list
) + 2 * n
;
911 return (GLint
) ubptr
[0] * 256
914 ubptr
= ((GLubyte
*) list
) + 3 * n
;
915 return (GLint
) ubptr
[0] * 65536
916 + (GLint
) ubptr
[1] * 256
919 ubptr
= ((GLubyte
*) list
) + 4 * n
;
920 return (GLint
) ubptr
[0] * 16777216
921 + (GLint
) ubptr
[1] * 65536
922 + (GLint
) ubptr
[2] * 256
931 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
932 * If width < 0 or height < 0 or format or type are invalid we'll just
933 * return NULL. We will not generate an error since OpenGL command
934 * arguments aren't error-checked until the command is actually executed
935 * (not when they're compiled).
936 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
939 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
940 GLsizei width
, GLsizei height
, GLsizei depth
,
941 GLenum format
, GLenum type
, const GLvoid
* pixels
,
942 const struct gl_pixelstore_attrib
*unpack
)
944 if (width
<= 0 || height
<= 0) {
948 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
949 /* bad format and/or type */
953 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
957 if (type
== GL_BITMAP
)
958 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
960 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
961 format
, type
, pixels
, unpack
);
962 if (pixels
&& !image
) {
963 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
967 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
968 depth
, format
, type
, INT_MAX
, pixels
)) {
969 const GLubyte
*map
, *src
;
973 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
974 GL_MAP_READ_BIT
, unpack
->BufferObj
,
977 /* unable to map src buffer! */
978 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
982 src
= ADD_POINTERS(map
, pixels
);
983 if (type
== GL_BITMAP
)
984 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
986 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
987 format
, type
, src
, unpack
);
989 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
992 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
998 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1003 /** Return copy of memory */
1005 memdup(const void *src
, GLsizei bytes
)
1007 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1009 memcpy(b
, src
, bytes
);
1015 * Allocate space for a display list instruction (opcode + payload space).
1016 * \param opcode the instruction opcode (OPCODE_* value)
1017 * \param bytes instruction payload size (not counting opcode)
1018 * \return pointer to allocated memory (the opcode space)
1021 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
1023 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1024 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1027 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
1028 if (InstSize
[opcode
] == 0) {
1029 /* save instruction size now */
1030 InstSize
[opcode
] = numNodes
;
1033 /* make sure instruction size agrees */
1034 ASSERT(numNodes
== InstSize
[opcode
]);
1038 if (ctx
->ListState
.CurrentPos
+ numNodes
+ contNodes
> BLOCK_SIZE
) {
1039 /* This block is full. Allocate a new block and chain to it */
1041 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1042 n
[0].opcode
= OPCODE_CONTINUE
;
1043 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1045 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1048 save_pointer(&n
[1], newblock
);
1049 ctx
->ListState
.CurrentBlock
= newblock
;
1050 ctx
->ListState
.CurrentPos
= 0;
1053 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1054 ctx
->ListState
.CurrentPos
+= numNodes
;
1056 n
[0].opcode
= opcode
;
1064 * Allocate space for a display list instruction. Used by callers outside
1065 * this file for things like VBO vertex data.
1067 * \param opcode the instruction opcode (OPCODE_* value)
1068 * \param bytes instruction size in bytes, not counting opcode.
1069 * \return pointer to the usable data area (not including the internal
1073 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1075 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1077 return n
+ 1; /* return pointer to payload area, after opcode */
1084 * This function allows modules and drivers to get their own opcodes
1085 * for extending display list functionality.
1086 * \param ctx the rendering context
1087 * \param size number of bytes for storing the new display list command
1088 * \param execute function to execute the new display list command
1089 * \param destroy function to destroy the new display list command
1090 * \param print function to print the new display list command
1091 * \return the new opcode number or -1 if error
1094 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1096 void (*execute
) (struct gl_context
*, void *),
1097 void (*destroy
) (struct gl_context
*, void *),
1098 void (*print
) (struct gl_context
*, void *))
1100 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1101 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1102 ctx
->ListExt
->Opcode
[i
].Size
=
1103 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1104 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1105 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1106 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1107 return i
+ OPCODE_EXT_0
;
1114 * Allocate space for a display list instruction. The space is basically
1115 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1116 * function parameter, node[2] is the second parameter, etc.
1118 * \param opcode one of OPCODE_x
1119 * \param nparams number of function parameters
1120 * \return pointer to start of instruction space
1122 static inline Node
*
1123 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1125 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1130 * Called by EndList to try to reduce memory used for the list.
1133 trim_list(struct gl_context
*ctx
)
1135 /* If the list we're ending only has one allocated block of nodes/tokens
1136 * and its size isn't a full block size, realloc the block to use less
1137 * memory. This is important for apps that create many small display
1138 * lists and apps that use glXUseXFont (many lists each containing one
1140 * Note: we currently only trim display lists that allocated one block
1141 * of tokens. That hits the short list case which is what we're mainly
1142 * concerned with. Trimming longer lists would involve traversing the
1143 * linked list of blocks.
1145 struct gl_dlist_state
*list
= &ctx
->ListState
;
1147 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1148 (list
->CurrentPos
< BLOCK_SIZE
)) {
1149 /* There's only one block and it's not full, so realloc */
1150 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1151 list
->CurrentList
->Head
=
1152 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1153 if (!list
->CurrentBlock
) {
1154 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1162 * Display List compilation functions
1164 static void GLAPIENTRY
1165 save_Accum(GLenum op
, GLfloat value
)
1167 GET_CURRENT_CONTEXT(ctx
);
1169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1170 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1175 if (ctx
->ExecuteFlag
) {
1176 CALL_Accum(ctx
->Exec
, (op
, value
));
1181 static void GLAPIENTRY
1182 save_AlphaFunc(GLenum func
, GLclampf ref
)
1184 GET_CURRENT_CONTEXT(ctx
);
1186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1187 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1190 n
[2].f
= (GLfloat
) ref
;
1192 if (ctx
->ExecuteFlag
) {
1193 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1198 static void GLAPIENTRY
1199 save_BindTexture(GLenum target
, GLuint texture
)
1201 GET_CURRENT_CONTEXT(ctx
);
1203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1204 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1209 if (ctx
->ExecuteFlag
) {
1210 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1215 static void GLAPIENTRY
1216 save_Bitmap(GLsizei width
, GLsizei height
,
1217 GLfloat xorig
, GLfloat yorig
,
1218 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1220 GET_CURRENT_CONTEXT(ctx
);
1222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1223 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1225 n
[1].i
= (GLint
) width
;
1226 n
[2].i
= (GLint
) height
;
1232 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1233 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1235 if (ctx
->ExecuteFlag
) {
1236 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1237 xorig
, yorig
, xmove
, ymove
, pixels
));
1242 static void GLAPIENTRY
1243 save_BlendEquation(GLenum mode
)
1245 GET_CURRENT_CONTEXT(ctx
);
1247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1248 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1252 if (ctx
->ExecuteFlag
) {
1253 CALL_BlendEquation(ctx
->Exec
, (mode
));
1258 static void GLAPIENTRY
1259 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1261 GET_CURRENT_CONTEXT(ctx
);
1263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1264 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1269 if (ctx
->ExecuteFlag
) {
1270 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1275 static void GLAPIENTRY
1276 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1277 GLenum sfactorA
, GLenum dfactorA
)
1279 GET_CURRENT_CONTEXT(ctx
);
1281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1282 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1284 n
[1].e
= sfactorRGB
;
1285 n
[2].e
= dfactorRGB
;
1289 if (ctx
->ExecuteFlag
) {
1290 CALL_BlendFuncSeparate(ctx
->Exec
,
1291 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1296 static void GLAPIENTRY
1297 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1299 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1303 static void GLAPIENTRY
1304 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1306 GET_CURRENT_CONTEXT(ctx
);
1308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1309 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1316 if (ctx
->ExecuteFlag
) {
1317 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1321 /* GL_ARB_draw_buffers_blend */
1322 static void GLAPIENTRY
1323 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1324 GLenum sfactorA
, GLenum dfactorA
)
1326 GET_CURRENT_CONTEXT(ctx
);
1328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1329 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1332 n
[2].e
= sfactorRGB
;
1333 n
[3].e
= dfactorRGB
;
1337 if (ctx
->ExecuteFlag
) {
1338 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1339 sfactorA
, dfactorA
));
1343 /* GL_ARB_draw_buffers_blend */
1344 static void GLAPIENTRY
1345 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1347 GET_CURRENT_CONTEXT(ctx
);
1349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1356 if (ctx
->ExecuteFlag
) {
1357 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1361 /* GL_ARB_draw_buffers_blend */
1362 static void GLAPIENTRY
1363 save_BlendEquationi(GLuint buf
, GLenum mode
)
1365 GET_CURRENT_CONTEXT(ctx
);
1367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1368 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1373 if (ctx
->ExecuteFlag
) {
1374 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1378 /* GL_ARB_draw_buffers_blend */
1379 static void GLAPIENTRY
1380 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1382 GET_CURRENT_CONTEXT(ctx
);
1384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1385 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1391 if (ctx
->ExecuteFlag
) {
1392 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1397 /* GL_ARB_draw_instanced. */
1398 static void GLAPIENTRY
1399 save_DrawArraysInstancedARB(GLenum mode
,
1404 GET_CURRENT_CONTEXT(ctx
);
1405 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1406 "glDrawArraysInstanced() during display list compile");
1409 static void GLAPIENTRY
1410 save_DrawElementsInstancedARB(GLenum mode
,
1413 const GLvoid
*indices
,
1416 GET_CURRENT_CONTEXT(ctx
);
1417 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1418 "glDrawElementsInstanced() during display list compile");
1421 static void GLAPIENTRY
1422 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1425 const GLvoid
*indices
,
1429 GET_CURRENT_CONTEXT(ctx
);
1430 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1431 "glDrawElementsInstancedBaseVertex() during display list compile");
1434 /* GL_ARB_base_instance. */
1435 static void GLAPIENTRY
1436 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1440 GLuint baseinstance
)
1442 GET_CURRENT_CONTEXT(ctx
);
1443 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1444 "glDrawArraysInstancedBaseInstance() during display list compile");
1447 static void APIENTRY
1448 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1451 const void *indices
,
1453 GLuint baseinstance
)
1455 GET_CURRENT_CONTEXT(ctx
);
1456 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1457 "glDrawElementsInstancedBaseInstance() during display list compile");
1460 static void APIENTRY
1461 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1464 const void *indices
,
1467 GLuint baseinstance
)
1469 GET_CURRENT_CONTEXT(ctx
);
1470 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1471 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1476 * While building a display list we cache some OpenGL state.
1477 * Under some circumstances we need to invalidate that state (immediately
1478 * when we start compiling a list, or after glCallList(s)).
1481 invalidate_saved_current_state(struct gl_context
*ctx
)
1485 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1486 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1488 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1489 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1491 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1493 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1497 static void GLAPIENTRY
1498 save_CallList(GLuint list
)
1500 GET_CURRENT_CONTEXT(ctx
);
1502 SAVE_FLUSH_VERTICES(ctx
);
1504 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1509 /* After this, we don't know what state we're in. Invalidate all
1510 * cached information previously gathered:
1512 invalidate_saved_current_state( ctx
);
1514 if (ctx
->ExecuteFlag
) {
1515 _mesa_CallList(list
);
1520 static void GLAPIENTRY
1521 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1523 GET_CURRENT_CONTEXT(ctx
);
1525 GLboolean typeErrorFlag
;
1527 SAVE_FLUSH_VERTICES(ctx
);
1531 case GL_UNSIGNED_BYTE
:
1533 case GL_UNSIGNED_SHORT
:
1535 case GL_UNSIGNED_INT
:
1540 typeErrorFlag
= GL_FALSE
;
1543 typeErrorFlag
= GL_TRUE
;
1546 for (i
= 0; i
< num
; i
++) {
1547 GLint list
= translate_id(i
, type
, lists
);
1548 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1551 n
[2].b
= typeErrorFlag
;
1555 /* After this, we don't know what state we're in. Invalidate all
1556 * cached information previously gathered:
1558 invalidate_saved_current_state( ctx
);
1560 if (ctx
->ExecuteFlag
) {
1561 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1566 static void GLAPIENTRY
1567 save_Clear(GLbitfield mask
)
1569 GET_CURRENT_CONTEXT(ctx
);
1571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1572 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1576 if (ctx
->ExecuteFlag
) {
1577 CALL_Clear(ctx
->Exec
, (mask
));
1582 static void GLAPIENTRY
1583 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1585 GET_CURRENT_CONTEXT(ctx
);
1587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1588 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1591 n
[2].i
= drawbuffer
;
1593 if (buffer
== GL_COLOR
) {
1604 if (ctx
->ExecuteFlag
) {
1605 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1610 static void GLAPIENTRY
1611 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1613 GET_CURRENT_CONTEXT(ctx
);
1615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1616 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1619 n
[2].i
= drawbuffer
;
1621 if (buffer
== GL_COLOR
) {
1632 if (ctx
->ExecuteFlag
) {
1633 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1638 static void GLAPIENTRY
1639 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1641 GET_CURRENT_CONTEXT(ctx
);
1643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1644 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1647 n
[2].i
= drawbuffer
;
1649 if (buffer
== GL_COLOR
) {
1660 if (ctx
->ExecuteFlag
) {
1661 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1666 static void GLAPIENTRY
1667 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1668 GLfloat depth
, GLint stencil
)
1670 GET_CURRENT_CONTEXT(ctx
);
1672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1673 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1676 n
[2].i
= drawbuffer
;
1680 if (ctx
->ExecuteFlag
) {
1681 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1686 static void GLAPIENTRY
1687 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1689 GET_CURRENT_CONTEXT(ctx
);
1691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1692 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1699 if (ctx
->ExecuteFlag
) {
1700 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1705 static void GLAPIENTRY
1706 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1708 GET_CURRENT_CONTEXT(ctx
);
1710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1711 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1718 if (ctx
->ExecuteFlag
) {
1719 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1724 static void GLAPIENTRY
1725 save_ClearDepth(GLclampd depth
)
1727 GET_CURRENT_CONTEXT(ctx
);
1729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1730 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1732 n
[1].f
= (GLfloat
) depth
;
1734 if (ctx
->ExecuteFlag
) {
1735 CALL_ClearDepth(ctx
->Exec
, (depth
));
1740 static void GLAPIENTRY
1741 save_ClearIndex(GLfloat c
)
1743 GET_CURRENT_CONTEXT(ctx
);
1745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1746 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1750 if (ctx
->ExecuteFlag
) {
1751 CALL_ClearIndex(ctx
->Exec
, (c
));
1756 static void GLAPIENTRY
1757 save_ClearStencil(GLint s
)
1759 GET_CURRENT_CONTEXT(ctx
);
1761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1762 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1766 if (ctx
->ExecuteFlag
) {
1767 CALL_ClearStencil(ctx
->Exec
, (s
));
1772 static void GLAPIENTRY
1773 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1775 GET_CURRENT_CONTEXT(ctx
);
1777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1778 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1781 n
[2].f
= (GLfloat
) equ
[0];
1782 n
[3].f
= (GLfloat
) equ
[1];
1783 n
[4].f
= (GLfloat
) equ
[2];
1784 n
[5].f
= (GLfloat
) equ
[3];
1786 if (ctx
->ExecuteFlag
) {
1787 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1793 static void GLAPIENTRY
1794 save_ColorMask(GLboolean red
, GLboolean green
,
1795 GLboolean blue
, GLboolean alpha
)
1797 GET_CURRENT_CONTEXT(ctx
);
1799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1800 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1807 if (ctx
->ExecuteFlag
) {
1808 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1813 static void GLAPIENTRY
1814 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1815 GLboolean blue
, GLboolean alpha
)
1817 GET_CURRENT_CONTEXT(ctx
);
1819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1820 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1828 if (ctx
->ExecuteFlag
) {
1829 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
1834 static void GLAPIENTRY
1835 save_ColorMaterial(GLenum face
, GLenum mode
)
1837 GET_CURRENT_CONTEXT(ctx
);
1839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1841 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1846 if (ctx
->ExecuteFlag
) {
1847 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1852 static void GLAPIENTRY
1853 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1855 GET_CURRENT_CONTEXT(ctx
);
1857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1858 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1862 n
[3].i
= (GLint
) width
;
1863 n
[4].i
= (GLint
) height
;
1866 if (ctx
->ExecuteFlag
) {
1867 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1873 static void GLAPIENTRY
1874 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1875 GLint x
, GLint y
, GLsizei width
, GLint border
)
1877 GET_CURRENT_CONTEXT(ctx
);
1879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1880 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1884 n
[3].e
= internalformat
;
1890 if (ctx
->ExecuteFlag
) {
1891 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1892 x
, y
, width
, border
));
1897 static void GLAPIENTRY
1898 save_CopyTexImage2D(GLenum target
, GLint level
,
1899 GLenum internalformat
,
1900 GLint x
, GLint y
, GLsizei width
,
1901 GLsizei height
, GLint border
)
1903 GET_CURRENT_CONTEXT(ctx
);
1905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1906 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1910 n
[3].e
= internalformat
;
1917 if (ctx
->ExecuteFlag
) {
1918 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1919 x
, y
, width
, height
, border
));
1925 static void GLAPIENTRY
1926 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1927 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1929 GET_CURRENT_CONTEXT(ctx
);
1931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1932 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1941 if (ctx
->ExecuteFlag
) {
1942 CALL_CopyTexSubImage1D(ctx
->Exec
,
1943 (target
, level
, xoffset
, x
, y
, width
));
1948 static void GLAPIENTRY
1949 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1950 GLint xoffset
, GLint yoffset
,
1951 GLint x
, GLint y
, GLsizei width
, GLint height
)
1953 GET_CURRENT_CONTEXT(ctx
);
1955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1956 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1967 if (ctx
->ExecuteFlag
) {
1968 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1969 x
, y
, width
, height
));
1974 static void GLAPIENTRY
1975 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1976 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1977 GLint x
, GLint y
, GLsizei width
, GLint height
)
1979 GET_CURRENT_CONTEXT(ctx
);
1981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1982 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1994 if (ctx
->ExecuteFlag
) {
1995 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1996 xoffset
, yoffset
, zoffset
,
1997 x
, y
, width
, height
));
2002 static void GLAPIENTRY
2003 save_CullFace(GLenum mode
)
2005 GET_CURRENT_CONTEXT(ctx
);
2007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2008 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2012 if (ctx
->ExecuteFlag
) {
2013 CALL_CullFace(ctx
->Exec
, (mode
));
2018 static void GLAPIENTRY
2019 save_DepthFunc(GLenum func
)
2021 GET_CURRENT_CONTEXT(ctx
);
2023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2024 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2028 if (ctx
->ExecuteFlag
) {
2029 CALL_DepthFunc(ctx
->Exec
, (func
));
2034 static void GLAPIENTRY
2035 save_DepthMask(GLboolean mask
)
2037 GET_CURRENT_CONTEXT(ctx
);
2039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2040 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2044 if (ctx
->ExecuteFlag
) {
2045 CALL_DepthMask(ctx
->Exec
, (mask
));
2050 static void GLAPIENTRY
2051 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2053 GET_CURRENT_CONTEXT(ctx
);
2055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2056 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2058 n
[1].f
= (GLfloat
) nearval
;
2059 n
[2].f
= (GLfloat
) farval
;
2061 if (ctx
->ExecuteFlag
) {
2062 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2067 static void GLAPIENTRY
2068 save_Disable(GLenum cap
)
2070 GET_CURRENT_CONTEXT(ctx
);
2072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2073 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2077 if (ctx
->ExecuteFlag
) {
2078 CALL_Disable(ctx
->Exec
, (cap
));
2083 static void GLAPIENTRY
2084 save_DisableIndexed(GLuint index
, GLenum cap
)
2086 GET_CURRENT_CONTEXT(ctx
);
2088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2089 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2094 if (ctx
->ExecuteFlag
) {
2095 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2100 static void GLAPIENTRY
2101 save_DrawBuffer(GLenum mode
)
2103 GET_CURRENT_CONTEXT(ctx
);
2105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2106 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2110 if (ctx
->ExecuteFlag
) {
2111 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2116 static void GLAPIENTRY
2117 save_DrawPixels(GLsizei width
, GLsizei height
,
2118 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2120 GET_CURRENT_CONTEXT(ctx
);
2123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2125 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2132 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2133 pixels
, &ctx
->Unpack
));
2135 if (ctx
->ExecuteFlag
) {
2136 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2142 static void GLAPIENTRY
2143 save_Enable(GLenum cap
)
2145 GET_CURRENT_CONTEXT(ctx
);
2147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2148 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2152 if (ctx
->ExecuteFlag
) {
2153 CALL_Enable(ctx
->Exec
, (cap
));
2159 static void GLAPIENTRY
2160 save_EnableIndexed(GLuint index
, GLenum cap
)
2162 GET_CURRENT_CONTEXT(ctx
);
2164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2165 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2170 if (ctx
->ExecuteFlag
) {
2171 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2177 static void GLAPIENTRY
2178 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2180 GET_CURRENT_CONTEXT(ctx
);
2182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2183 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2189 if (ctx
->ExecuteFlag
) {
2190 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2195 static void GLAPIENTRY
2196 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2198 GET_CURRENT_CONTEXT(ctx
);
2200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2201 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2209 if (ctx
->ExecuteFlag
) {
2210 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2217 static void GLAPIENTRY
2218 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2220 GET_CURRENT_CONTEXT(ctx
);
2222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2223 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2231 if (ctx
->ExecuteFlag
) {
2232 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2237 static void GLAPIENTRY
2238 save_Fogf(GLenum pname
, GLfloat param
)
2242 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2243 save_Fogfv(pname
, parray
);
2247 static void GLAPIENTRY
2248 save_Fogiv(GLenum pname
, const GLint
*params
)
2253 case GL_FOG_DENSITY
:
2257 p
[0] = (GLfloat
) *params
;
2263 p
[0] = INT_TO_FLOAT(params
[0]);
2264 p
[1] = INT_TO_FLOAT(params
[1]);
2265 p
[2] = INT_TO_FLOAT(params
[2]);
2266 p
[3] = INT_TO_FLOAT(params
[3]);
2269 /* Error will be caught later in gl_Fogfv */
2270 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2272 save_Fogfv(pname
, p
);
2276 static void GLAPIENTRY
2277 save_Fogi(GLenum pname
, GLint param
)
2281 parray
[1] = parray
[2] = parray
[3] = 0;
2282 save_Fogiv(pname
, parray
);
2286 static void GLAPIENTRY
2287 save_FrontFace(GLenum mode
)
2289 GET_CURRENT_CONTEXT(ctx
);
2291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2292 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2296 if (ctx
->ExecuteFlag
) {
2297 CALL_FrontFace(ctx
->Exec
, (mode
));
2302 static void GLAPIENTRY
2303 save_Frustum(GLdouble left
, GLdouble right
,
2304 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2311 n
[1].f
= (GLfloat
) left
;
2312 n
[2].f
= (GLfloat
) right
;
2313 n
[3].f
= (GLfloat
) bottom
;
2314 n
[4].f
= (GLfloat
) top
;
2315 n
[5].f
= (GLfloat
) nearval
;
2316 n
[6].f
= (GLfloat
) farval
;
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2324 static void GLAPIENTRY
2325 save_Hint(GLenum target
, GLenum mode
)
2327 GET_CURRENT_CONTEXT(ctx
);
2329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2335 if (ctx
->ExecuteFlag
) {
2336 CALL_Hint(ctx
->Exec
, (target
, mode
));
2341 static void GLAPIENTRY
2342 save_IndexMask(GLuint mask
)
2344 GET_CURRENT_CONTEXT(ctx
);
2346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2347 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2351 if (ctx
->ExecuteFlag
) {
2352 CALL_IndexMask(ctx
->Exec
, (mask
));
2357 static void GLAPIENTRY
2358 save_InitNames(void)
2360 GET_CURRENT_CONTEXT(ctx
);
2361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2362 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2363 if (ctx
->ExecuteFlag
) {
2364 CALL_InitNames(ctx
->Exec
, ());
2369 static void GLAPIENTRY
2370 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2372 GET_CURRENT_CONTEXT(ctx
);
2374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2375 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2393 case GL_SPOT_DIRECTION
:
2396 case GL_SPOT_EXPONENT
:
2399 case GL_SPOT_CUTOFF
:
2402 case GL_CONSTANT_ATTENUATION
:
2405 case GL_LINEAR_ATTENUATION
:
2408 case GL_QUADRATIC_ATTENUATION
:
2414 for (i
= 0; i
< nParams
; i
++) {
2415 n
[3 + i
].f
= params
[i
];
2418 if (ctx
->ExecuteFlag
) {
2419 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2424 static void GLAPIENTRY
2425 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2429 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2430 save_Lightfv(light
, pname
, parray
);
2434 static void GLAPIENTRY
2435 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2442 fparam
[0] = INT_TO_FLOAT(params
[0]);
2443 fparam
[1] = INT_TO_FLOAT(params
[1]);
2444 fparam
[2] = INT_TO_FLOAT(params
[2]);
2445 fparam
[3] = INT_TO_FLOAT(params
[3]);
2448 fparam
[0] = (GLfloat
) params
[0];
2449 fparam
[1] = (GLfloat
) params
[1];
2450 fparam
[2] = (GLfloat
) params
[2];
2451 fparam
[3] = (GLfloat
) params
[3];
2453 case GL_SPOT_DIRECTION
:
2454 fparam
[0] = (GLfloat
) params
[0];
2455 fparam
[1] = (GLfloat
) params
[1];
2456 fparam
[2] = (GLfloat
) params
[2];
2458 case GL_SPOT_EXPONENT
:
2459 case GL_SPOT_CUTOFF
:
2460 case GL_CONSTANT_ATTENUATION
:
2461 case GL_LINEAR_ATTENUATION
:
2462 case GL_QUADRATIC_ATTENUATION
:
2463 fparam
[0] = (GLfloat
) params
[0];
2466 /* error will be caught later in gl_Lightfv */
2469 save_Lightfv(light
, pname
, fparam
);
2473 static void GLAPIENTRY
2474 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2478 parray
[1] = parray
[2] = parray
[3] = 0;
2479 save_Lightiv(light
, pname
, parray
);
2483 static void GLAPIENTRY
2484 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2486 GET_CURRENT_CONTEXT(ctx
);
2488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2489 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2497 if (ctx
->ExecuteFlag
) {
2498 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2503 static void GLAPIENTRY
2504 save_LightModelf(GLenum pname
, GLfloat param
)
2508 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2509 save_LightModelfv(pname
, parray
);
2513 static void GLAPIENTRY
2514 save_LightModeliv(GLenum pname
, const GLint
*params
)
2518 case GL_LIGHT_MODEL_AMBIENT
:
2519 fparam
[0] = INT_TO_FLOAT(params
[0]);
2520 fparam
[1] = INT_TO_FLOAT(params
[1]);
2521 fparam
[2] = INT_TO_FLOAT(params
[2]);
2522 fparam
[3] = INT_TO_FLOAT(params
[3]);
2524 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2525 case GL_LIGHT_MODEL_TWO_SIDE
:
2526 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2527 fparam
[0] = (GLfloat
) params
[0];
2533 /* Error will be caught later in gl_LightModelfv */
2534 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2536 save_LightModelfv(pname
, fparam
);
2540 static void GLAPIENTRY
2541 save_LightModeli(GLenum pname
, GLint param
)
2545 parray
[1] = parray
[2] = parray
[3] = 0;
2546 save_LightModeliv(pname
, parray
);
2550 static void GLAPIENTRY
2551 save_LineStipple(GLint factor
, GLushort pattern
)
2553 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2561 if (ctx
->ExecuteFlag
) {
2562 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2567 static void GLAPIENTRY
2568 save_LineWidth(GLfloat width
)
2570 GET_CURRENT_CONTEXT(ctx
);
2572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2573 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2577 if (ctx
->ExecuteFlag
) {
2578 CALL_LineWidth(ctx
->Exec
, (width
));
2583 static void GLAPIENTRY
2584 save_ListBase(GLuint base
)
2586 GET_CURRENT_CONTEXT(ctx
);
2588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2589 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2593 if (ctx
->ExecuteFlag
) {
2594 CALL_ListBase(ctx
->Exec
, (base
));
2599 static void GLAPIENTRY
2600 save_LoadIdentity(void)
2602 GET_CURRENT_CONTEXT(ctx
);
2603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2604 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2605 if (ctx
->ExecuteFlag
) {
2606 CALL_LoadIdentity(ctx
->Exec
, ());
2611 static void GLAPIENTRY
2612 save_LoadMatrixf(const GLfloat
* m
)
2614 GET_CURRENT_CONTEXT(ctx
);
2616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2617 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2620 for (i
= 0; i
< 16; i
++) {
2624 if (ctx
->ExecuteFlag
) {
2625 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2630 static void GLAPIENTRY
2631 save_LoadMatrixd(const GLdouble
* m
)
2635 for (i
= 0; i
< 16; i
++) {
2636 f
[i
] = (GLfloat
) m
[i
];
2638 save_LoadMatrixf(f
);
2642 static void GLAPIENTRY
2643 save_LoadName(GLuint name
)
2645 GET_CURRENT_CONTEXT(ctx
);
2647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2648 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2652 if (ctx
->ExecuteFlag
) {
2653 CALL_LoadName(ctx
->Exec
, (name
));
2658 static void GLAPIENTRY
2659 save_LogicOp(GLenum opcode
)
2661 GET_CURRENT_CONTEXT(ctx
);
2663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2664 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2668 if (ctx
->ExecuteFlag
) {
2669 CALL_LogicOp(ctx
->Exec
, (opcode
));
2674 static void GLAPIENTRY
2675 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2676 GLint order
, const GLdouble
* points
)
2678 GET_CURRENT_CONTEXT(ctx
);
2680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2681 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2683 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2685 n
[2].f
= (GLfloat
) u1
;
2686 n
[3].f
= (GLfloat
) u2
;
2687 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2689 save_pointer(&n
[6], pnts
);
2691 if (ctx
->ExecuteFlag
) {
2692 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2696 static void GLAPIENTRY
2697 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2698 GLint order
, const GLfloat
* points
)
2700 GET_CURRENT_CONTEXT(ctx
);
2702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2703 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2705 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2709 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2711 save_pointer(&n
[6], pnts
);
2713 if (ctx
->ExecuteFlag
) {
2714 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2719 static void GLAPIENTRY
2720 save_Map2d(GLenum target
,
2721 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2722 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2723 const GLdouble
* points
)
2725 GET_CURRENT_CONTEXT(ctx
);
2727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2728 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2730 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2731 vstride
, vorder
, points
);
2733 n
[2].f
= (GLfloat
) u1
;
2734 n
[3].f
= (GLfloat
) u2
;
2735 n
[4].f
= (GLfloat
) v1
;
2736 n
[5].f
= (GLfloat
) v2
;
2737 /* XXX verify these strides are correct */
2738 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2739 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2742 save_pointer(&n
[10], pnts
);
2744 if (ctx
->ExecuteFlag
) {
2745 CALL_Map2d(ctx
->Exec
, (target
,
2746 u1
, u2
, ustride
, uorder
,
2747 v1
, v2
, vstride
, vorder
, points
));
2752 static void GLAPIENTRY
2753 save_Map2f(GLenum target
,
2754 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2755 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2756 const GLfloat
* points
)
2758 GET_CURRENT_CONTEXT(ctx
);
2760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2761 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2763 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2764 vstride
, vorder
, points
);
2770 /* XXX verify these strides are correct */
2771 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2772 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2775 save_pointer(&n
[10], pnts
);
2777 if (ctx
->ExecuteFlag
) {
2778 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2779 v1
, v2
, vstride
, vorder
, points
));
2784 static void GLAPIENTRY
2785 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2787 GET_CURRENT_CONTEXT(ctx
);
2789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2790 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2796 if (ctx
->ExecuteFlag
) {
2797 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2802 static void GLAPIENTRY
2803 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2805 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2809 static void GLAPIENTRY
2810 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2811 GLint vn
, GLfloat v1
, GLfloat v2
)
2813 GET_CURRENT_CONTEXT(ctx
);
2815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2816 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2825 if (ctx
->ExecuteFlag
) {
2826 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2832 static void GLAPIENTRY
2833 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2834 GLint vn
, GLdouble v1
, GLdouble v2
)
2836 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2837 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2841 static void GLAPIENTRY
2842 save_MatrixMode(GLenum mode
)
2844 GET_CURRENT_CONTEXT(ctx
);
2846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2847 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2851 if (ctx
->ExecuteFlag
) {
2852 CALL_MatrixMode(ctx
->Exec
, (mode
));
2857 static void GLAPIENTRY
2858 save_MultMatrixf(const GLfloat
* m
)
2860 GET_CURRENT_CONTEXT(ctx
);
2862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2863 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2866 for (i
= 0; i
< 16; i
++) {
2870 if (ctx
->ExecuteFlag
) {
2871 CALL_MultMatrixf(ctx
->Exec
, (m
));
2876 static void GLAPIENTRY
2877 save_MultMatrixd(const GLdouble
* m
)
2881 for (i
= 0; i
< 16; i
++) {
2882 f
[i
] = (GLfloat
) m
[i
];
2884 save_MultMatrixf(f
);
2888 static void GLAPIENTRY
2889 save_NewList(GLuint name
, GLenum mode
)
2891 GET_CURRENT_CONTEXT(ctx
);
2892 /* It's an error to call this function while building a display list */
2893 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2900 static void GLAPIENTRY
2901 save_Ortho(GLdouble left
, GLdouble right
,
2902 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2904 GET_CURRENT_CONTEXT(ctx
);
2906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2907 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2909 n
[1].f
= (GLfloat
) left
;
2910 n
[2].f
= (GLfloat
) right
;
2911 n
[3].f
= (GLfloat
) bottom
;
2912 n
[4].f
= (GLfloat
) top
;
2913 n
[5].f
= (GLfloat
) nearval
;
2914 n
[6].f
= (GLfloat
) farval
;
2916 if (ctx
->ExecuteFlag
) {
2917 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2922 static void GLAPIENTRY
2923 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2925 GET_CURRENT_CONTEXT(ctx
);
2927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2928 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
2932 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
2934 if (ctx
->ExecuteFlag
) {
2935 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2940 static void GLAPIENTRY
2941 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2943 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2945 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2946 for (i
= 0; i
< mapsize
; i
++) {
2947 fvalues
[i
] = (GLfloat
) values
[i
];
2951 for (i
= 0; i
< mapsize
; i
++) {
2952 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2955 save_PixelMapfv(map
, mapsize
, fvalues
);
2959 static void GLAPIENTRY
2960 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2962 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2964 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2965 for (i
= 0; i
< mapsize
; i
++) {
2966 fvalues
[i
] = (GLfloat
) values
[i
];
2970 for (i
= 0; i
< mapsize
; i
++) {
2971 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2974 save_PixelMapfv(map
, mapsize
, fvalues
);
2978 static void GLAPIENTRY
2979 save_PixelTransferf(GLenum pname
, GLfloat param
)
2981 GET_CURRENT_CONTEXT(ctx
);
2983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2984 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2989 if (ctx
->ExecuteFlag
) {
2990 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2995 static void GLAPIENTRY
2996 save_PixelTransferi(GLenum pname
, GLint param
)
2998 save_PixelTransferf(pname
, (GLfloat
) param
);
3002 static void GLAPIENTRY
3003 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3005 GET_CURRENT_CONTEXT(ctx
);
3007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3008 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3013 if (ctx
->ExecuteFlag
) {
3014 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3019 static void GLAPIENTRY
3020 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3022 GET_CURRENT_CONTEXT(ctx
);
3024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3025 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3032 if (ctx
->ExecuteFlag
) {
3033 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3038 static void GLAPIENTRY
3039 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3043 parray
[1] = parray
[2] = 0.0F
;
3044 save_PointParameterfvEXT(pname
, parray
);
3047 static void GLAPIENTRY
3048 save_PointParameteriNV(GLenum pname
, GLint param
)
3051 parray
[0] = (GLfloat
) param
;
3052 parray
[1] = parray
[2] = 0.0F
;
3053 save_PointParameterfvEXT(pname
, parray
);
3056 static void GLAPIENTRY
3057 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3060 parray
[0] = (GLfloat
) param
[0];
3061 parray
[1] = parray
[2] = 0.0F
;
3062 save_PointParameterfvEXT(pname
, parray
);
3066 static void GLAPIENTRY
3067 save_PointSize(GLfloat size
)
3069 GET_CURRENT_CONTEXT(ctx
);
3071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3072 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3076 if (ctx
->ExecuteFlag
) {
3077 CALL_PointSize(ctx
->Exec
, (size
));
3082 static void GLAPIENTRY
3083 save_PolygonMode(GLenum face
, GLenum mode
)
3085 GET_CURRENT_CONTEXT(ctx
);
3087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3088 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3093 if (ctx
->ExecuteFlag
) {
3094 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3099 static void GLAPIENTRY
3100 save_PolygonStipple(const GLubyte
* pattern
)
3102 GET_CURRENT_CONTEXT(ctx
);
3105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3107 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3110 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3111 pattern
, &ctx
->Unpack
));
3113 if (ctx
->ExecuteFlag
) {
3114 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3119 static void GLAPIENTRY
3120 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3122 GET_CURRENT_CONTEXT(ctx
);
3124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3125 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3130 if (ctx
->ExecuteFlag
) {
3131 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3136 static void GLAPIENTRY
3137 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3139 GET_CURRENT_CONTEXT(ctx
);
3140 /* XXX mult by DepthMaxF here??? */
3141 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3145 static void GLAPIENTRY
3146 save_PopAttrib(void)
3148 GET_CURRENT_CONTEXT(ctx
);
3149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3150 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3151 if (ctx
->ExecuteFlag
) {
3152 CALL_PopAttrib(ctx
->Exec
, ());
3157 static void GLAPIENTRY
3158 save_PopMatrix(void)
3160 GET_CURRENT_CONTEXT(ctx
);
3161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3162 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3163 if (ctx
->ExecuteFlag
) {
3164 CALL_PopMatrix(ctx
->Exec
, ());
3169 static void GLAPIENTRY
3172 GET_CURRENT_CONTEXT(ctx
);
3173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3174 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3175 if (ctx
->ExecuteFlag
) {
3176 CALL_PopName(ctx
->Exec
, ());
3181 static void GLAPIENTRY
3182 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3183 const GLclampf
* priorities
)
3185 GET_CURRENT_CONTEXT(ctx
);
3187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3189 for (i
= 0; i
< num
; i
++) {
3191 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3193 n
[1].ui
= textures
[i
];
3194 n
[2].f
= priorities
[i
];
3197 if (ctx
->ExecuteFlag
) {
3198 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3203 static void GLAPIENTRY
3204 save_PushAttrib(GLbitfield mask
)
3206 GET_CURRENT_CONTEXT(ctx
);
3208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3209 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3213 if (ctx
->ExecuteFlag
) {
3214 CALL_PushAttrib(ctx
->Exec
, (mask
));
3219 static void GLAPIENTRY
3220 save_PushMatrix(void)
3222 GET_CURRENT_CONTEXT(ctx
);
3223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3224 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3225 if (ctx
->ExecuteFlag
) {
3226 CALL_PushMatrix(ctx
->Exec
, ());
3231 static void GLAPIENTRY
3232 save_PushName(GLuint name
)
3234 GET_CURRENT_CONTEXT(ctx
);
3236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3237 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3241 if (ctx
->ExecuteFlag
) {
3242 CALL_PushName(ctx
->Exec
, (name
));
3247 static void GLAPIENTRY
3248 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3250 GET_CURRENT_CONTEXT(ctx
);
3252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3253 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3265 static void GLAPIENTRY
3266 save_RasterPos2d(GLdouble x
, GLdouble y
)
3268 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3271 static void GLAPIENTRY
3272 save_RasterPos2f(GLfloat x
, GLfloat y
)
3274 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3277 static void GLAPIENTRY
3278 save_RasterPos2i(GLint x
, GLint y
)
3280 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3283 static void GLAPIENTRY
3284 save_RasterPos2s(GLshort x
, GLshort y
)
3286 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3289 static void GLAPIENTRY
3290 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3292 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3295 static void GLAPIENTRY
3296 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3298 save_RasterPos4f(x
, y
, z
, 1.0F
);
3301 static void GLAPIENTRY
3302 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3304 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3307 static void GLAPIENTRY
3308 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3310 save_RasterPos4f(x
, y
, z
, 1.0F
);
3313 static void GLAPIENTRY
3314 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3316 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3319 static void GLAPIENTRY
3320 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3322 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3325 static void GLAPIENTRY
3326 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3328 save_RasterPos4f(x
, y
, z
, w
);
3331 static void GLAPIENTRY
3332 save_RasterPos2dv(const GLdouble
* v
)
3334 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3337 static void GLAPIENTRY
3338 save_RasterPos2fv(const GLfloat
* v
)
3340 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3343 static void GLAPIENTRY
3344 save_RasterPos2iv(const GLint
* v
)
3346 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3349 static void GLAPIENTRY
3350 save_RasterPos2sv(const GLshort
* v
)
3352 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3355 static void GLAPIENTRY
3356 save_RasterPos3dv(const GLdouble
* v
)
3358 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3361 static void GLAPIENTRY
3362 save_RasterPos3fv(const GLfloat
* v
)
3364 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3367 static void GLAPIENTRY
3368 save_RasterPos3iv(const GLint
* v
)
3370 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3373 static void GLAPIENTRY
3374 save_RasterPos3sv(const GLshort
* v
)
3376 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3379 static void GLAPIENTRY
3380 save_RasterPos4dv(const GLdouble
* v
)
3382 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3383 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3386 static void GLAPIENTRY
3387 save_RasterPos4fv(const GLfloat
* v
)
3389 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3392 static void GLAPIENTRY
3393 save_RasterPos4iv(const GLint
* v
)
3395 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3396 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3399 static void GLAPIENTRY
3400 save_RasterPos4sv(const GLshort
* v
)
3402 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3406 static void GLAPIENTRY
3407 save_PassThrough(GLfloat token
)
3409 GET_CURRENT_CONTEXT(ctx
);
3411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3412 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3416 if (ctx
->ExecuteFlag
) {
3417 CALL_PassThrough(ctx
->Exec
, (token
));
3422 static void GLAPIENTRY
3423 save_ReadBuffer(GLenum mode
)
3425 GET_CURRENT_CONTEXT(ctx
);
3427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3428 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3432 if (ctx
->ExecuteFlag
) {
3433 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3438 static void GLAPIENTRY
3439 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3441 GET_CURRENT_CONTEXT(ctx
);
3443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3444 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3451 if (ctx
->ExecuteFlag
) {
3452 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3457 static void GLAPIENTRY
3458 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3460 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3464 static void GLAPIENTRY
3465 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3467 GET_CURRENT_CONTEXT(ctx
);
3469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3470 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3476 if (ctx
->ExecuteFlag
) {
3477 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3482 static void GLAPIENTRY
3483 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3485 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3489 static void GLAPIENTRY
3490 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3492 GET_CURRENT_CONTEXT(ctx
);
3494 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3495 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3502 if (ctx
->ExecuteFlag
) {
3503 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3508 static void GLAPIENTRY
3509 save_ShadeModel(GLenum mode
)
3511 GET_CURRENT_CONTEXT(ctx
);
3513 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3515 if (ctx
->ExecuteFlag
) {
3516 CALL_ShadeModel(ctx
->Exec
, (mode
));
3519 /* Don't compile this call if it's a no-op.
3520 * By avoiding this state change we have a better chance of
3521 * coalescing subsequent drawing commands into one batch.
3523 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3526 SAVE_FLUSH_VERTICES(ctx
);
3528 ctx
->ListState
.Current
.ShadeModel
= mode
;
3530 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3537 static void GLAPIENTRY
3538 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3540 GET_CURRENT_CONTEXT(ctx
);
3542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3543 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3549 if (ctx
->ExecuteFlag
) {
3550 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3555 static void GLAPIENTRY
3556 save_StencilMask(GLuint mask
)
3558 GET_CURRENT_CONTEXT(ctx
);
3560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3561 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3565 if (ctx
->ExecuteFlag
) {
3566 CALL_StencilMask(ctx
->Exec
, (mask
));
3571 static void GLAPIENTRY
3572 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3574 GET_CURRENT_CONTEXT(ctx
);
3576 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3577 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3583 if (ctx
->ExecuteFlag
) {
3584 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3589 static void GLAPIENTRY
3590 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3592 GET_CURRENT_CONTEXT(ctx
);
3594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3595 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3602 if (ctx
->ExecuteFlag
) {
3603 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3608 static void GLAPIENTRY
3609 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3612 GET_CURRENT_CONTEXT(ctx
);
3614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3616 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3624 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3631 if (ctx
->ExecuteFlag
) {
3632 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3633 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3638 static void GLAPIENTRY
3639 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3641 GET_CURRENT_CONTEXT(ctx
);
3643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3644 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3649 if (ctx
->ExecuteFlag
) {
3650 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3655 static void GLAPIENTRY
3656 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3658 GET_CURRENT_CONTEXT(ctx
);
3660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3661 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3668 if (ctx
->ExecuteFlag
) {
3669 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3674 static void GLAPIENTRY
3675 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3677 GET_CURRENT_CONTEXT(ctx
);
3679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3680 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3684 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3692 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3695 if (ctx
->ExecuteFlag
) {
3696 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3701 static void GLAPIENTRY
3702 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3705 parray
[0] = (GLfloat
) param
;
3706 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3707 save_TexEnvfv(target
, pname
, parray
);
3711 static void GLAPIENTRY
3712 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3715 p
[0] = (GLfloat
) param
;
3716 p
[1] = p
[2] = p
[3] = 0.0F
;
3717 save_TexEnvfv(target
, pname
, p
);
3721 static void GLAPIENTRY
3722 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3725 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3726 p
[0] = INT_TO_FLOAT(param
[0]);
3727 p
[1] = INT_TO_FLOAT(param
[1]);
3728 p
[2] = INT_TO_FLOAT(param
[2]);
3729 p
[3] = INT_TO_FLOAT(param
[3]);
3732 p
[0] = (GLfloat
) param
[0];
3733 p
[1] = p
[2] = p
[3] = 0.0F
;
3735 save_TexEnvfv(target
, pname
, p
);
3739 static void GLAPIENTRY
3740 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3742 GET_CURRENT_CONTEXT(ctx
);
3744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3745 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3754 if (ctx
->ExecuteFlag
) {
3755 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3760 static void GLAPIENTRY
3761 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3764 p
[0] = (GLfloat
) params
[0];
3765 p
[1] = (GLfloat
) params
[1];
3766 p
[2] = (GLfloat
) params
[2];
3767 p
[3] = (GLfloat
) params
[3];
3768 save_TexGenfv(coord
, pname
, p
);
3772 static void GLAPIENTRY
3773 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3776 parray
[0] = (GLfloat
) param
;
3777 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3778 save_TexGenfv(coord
, pname
, parray
);
3782 static void GLAPIENTRY
3783 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3786 p
[0] = (GLfloat
) params
[0];
3787 p
[1] = (GLfloat
) params
[1];
3788 p
[2] = (GLfloat
) params
[2];
3789 p
[3] = (GLfloat
) params
[3];
3790 save_TexGenfv(coord
, pname
, p
);
3794 static void GLAPIENTRY
3795 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3799 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3800 save_TexGenfv(coord
, pname
, parray
);
3804 static void GLAPIENTRY
3805 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3809 parray
[1] = parray
[2] = parray
[3] = 0;
3810 save_TexGeniv(coord
, pname
, parray
);
3814 static void GLAPIENTRY
3815 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3817 GET_CURRENT_CONTEXT(ctx
);
3819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3820 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3829 if (ctx
->ExecuteFlag
) {
3830 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3835 static void GLAPIENTRY
3836 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3840 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3841 save_TexParameterfv(target
, pname
, parray
);
3845 static void GLAPIENTRY
3846 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3849 fparam
[0] = (GLfloat
) param
;
3850 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3851 save_TexParameterfv(target
, pname
, fparam
);
3855 static void GLAPIENTRY
3856 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3859 fparam
[0] = (GLfloat
) params
[0];
3860 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3861 save_TexParameterfv(target
, pname
, fparam
);
3865 static void GLAPIENTRY
3866 save_TexImage1D(GLenum target
,
3867 GLint level
, GLint components
,
3868 GLsizei width
, GLint border
,
3869 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3871 GET_CURRENT_CONTEXT(ctx
);
3872 if (target
== GL_PROXY_TEXTURE_1D
) {
3873 /* don't compile, execute immediately */
3874 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3875 border
, format
, type
, pixels
));
3879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3880 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
3884 n
[3].i
= components
;
3885 n
[4].i
= (GLint
) width
;
3890 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3891 pixels
, &ctx
->Unpack
));
3893 if (ctx
->ExecuteFlag
) {
3894 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3895 border
, format
, type
, pixels
));
3901 static void GLAPIENTRY
3902 save_TexImage2D(GLenum target
,
3903 GLint level
, GLint components
,
3904 GLsizei width
, GLsizei height
, GLint border
,
3905 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3907 GET_CURRENT_CONTEXT(ctx
);
3908 if (target
== GL_PROXY_TEXTURE_2D
) {
3909 /* don't compile, execute immediately */
3910 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3911 height
, border
, format
, type
, pixels
));
3915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3916 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
3920 n
[3].i
= components
;
3921 n
[4].i
= (GLint
) width
;
3922 n
[5].i
= (GLint
) height
;
3927 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3928 pixels
, &ctx
->Unpack
));
3930 if (ctx
->ExecuteFlag
) {
3931 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3932 height
, border
, format
, type
, pixels
));
3938 static void GLAPIENTRY
3939 save_TexImage3D(GLenum target
,
3940 GLint level
, GLint internalFormat
,
3941 GLsizei width
, GLsizei height
, GLsizei depth
,
3943 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3945 GET_CURRENT_CONTEXT(ctx
);
3946 if (target
== GL_PROXY_TEXTURE_3D
) {
3947 /* don't compile, execute immediately */
3948 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3949 height
, depth
, border
, format
, type
,
3954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3955 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
3959 n
[3].i
= (GLint
) internalFormat
;
3960 n
[4].i
= (GLint
) width
;
3961 n
[5].i
= (GLint
) height
;
3962 n
[6].i
= (GLint
) depth
;
3966 save_pointer(&n
[10],
3967 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3968 pixels
, &ctx
->Unpack
));
3970 if (ctx
->ExecuteFlag
) {
3971 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3972 height
, depth
, border
, format
, type
,
3979 static void GLAPIENTRY
3980 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3981 GLsizei width
, GLenum format
, GLenum type
,
3982 const GLvoid
* pixels
)
3984 GET_CURRENT_CONTEXT(ctx
);
3987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3989 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
3994 n
[4].i
= (GLint
) width
;
3998 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3999 pixels
, &ctx
->Unpack
));
4001 if (ctx
->ExecuteFlag
) {
4002 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4003 format
, type
, pixels
));
4008 static void GLAPIENTRY
4009 save_TexSubImage2D(GLenum target
, GLint level
,
4010 GLint xoffset
, GLint yoffset
,
4011 GLsizei width
, GLsizei height
,
4012 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4014 GET_CURRENT_CONTEXT(ctx
);
4017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4019 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4025 n
[5].i
= (GLint
) width
;
4026 n
[6].i
= (GLint
) height
;
4030 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4031 pixels
, &ctx
->Unpack
));
4033 if (ctx
->ExecuteFlag
) {
4034 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4035 width
, height
, format
, type
, pixels
));
4040 static void GLAPIENTRY
4041 save_TexSubImage3D(GLenum target
, GLint level
,
4042 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4043 GLsizei width
, GLsizei height
, GLsizei depth
,
4044 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4046 GET_CURRENT_CONTEXT(ctx
);
4049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4051 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4058 n
[6].i
= (GLint
) width
;
4059 n
[7].i
= (GLint
) height
;
4060 n
[8].i
= (GLint
) depth
;
4063 save_pointer(&n
[11],
4064 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4065 pixels
, &ctx
->Unpack
));
4067 if (ctx
->ExecuteFlag
) {
4068 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4069 xoffset
, yoffset
, zoffset
,
4070 width
, height
, depth
, format
, type
,
4076 static void GLAPIENTRY
4077 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4079 GET_CURRENT_CONTEXT(ctx
);
4081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4082 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4088 if (ctx
->ExecuteFlag
) {
4089 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4094 static void GLAPIENTRY
4095 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4097 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4102 static void GLAPIENTRY
4103 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4105 GET_CURRENT_CONTEXT(ctx
);
4107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4108 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4112 n
[3].i
= (GLint
) width
;
4113 n
[4].i
= (GLint
) height
;
4115 if (ctx
->ExecuteFlag
) {
4116 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4121 static void GLAPIENTRY
4122 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4124 GET_CURRENT_CONTEXT(ctx
);
4126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4127 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4134 if (ctx
->ExecuteFlag
) {
4135 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4139 static void GLAPIENTRY
4140 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4142 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4145 static void GLAPIENTRY
4146 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4148 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4151 static void GLAPIENTRY
4152 save_WindowPos2iMESA(GLint x
, GLint y
)
4154 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4157 static void GLAPIENTRY
4158 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4160 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4163 static void GLAPIENTRY
4164 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4166 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4169 static void GLAPIENTRY
4170 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4172 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4175 static void GLAPIENTRY
4176 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4178 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4181 static void GLAPIENTRY
4182 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4184 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4187 static void GLAPIENTRY
4188 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4190 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4193 static void GLAPIENTRY
4194 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4196 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4199 static void GLAPIENTRY
4200 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4202 save_WindowPos4fMESA(x
, y
, z
, w
);
4205 static void GLAPIENTRY
4206 save_WindowPos2dvMESA(const GLdouble
* v
)
4208 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4211 static void GLAPIENTRY
4212 save_WindowPos2fvMESA(const GLfloat
* v
)
4214 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4217 static void GLAPIENTRY
4218 save_WindowPos2ivMESA(const GLint
* v
)
4220 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4223 static void GLAPIENTRY
4224 save_WindowPos2svMESA(const GLshort
* v
)
4226 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4229 static void GLAPIENTRY
4230 save_WindowPos3dvMESA(const GLdouble
* v
)
4232 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4235 static void GLAPIENTRY
4236 save_WindowPos3fvMESA(const GLfloat
* v
)
4238 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4241 static void GLAPIENTRY
4242 save_WindowPos3ivMESA(const GLint
* v
)
4244 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4247 static void GLAPIENTRY
4248 save_WindowPos3svMESA(const GLshort
* v
)
4250 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4253 static void GLAPIENTRY
4254 save_WindowPos4dvMESA(const GLdouble
* v
)
4256 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4257 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4260 static void GLAPIENTRY
4261 save_WindowPos4fvMESA(const GLfloat
* v
)
4263 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4266 static void GLAPIENTRY
4267 save_WindowPos4ivMESA(const GLint
* v
)
4269 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4270 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4273 static void GLAPIENTRY
4274 save_WindowPos4svMESA(const GLshort
* v
)
4276 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4281 /* GL_ARB_multitexture */
4282 static void GLAPIENTRY
4283 save_ActiveTextureARB(GLenum target
)
4285 GET_CURRENT_CONTEXT(ctx
);
4287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4288 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4292 if (ctx
->ExecuteFlag
) {
4293 CALL_ActiveTexture(ctx
->Exec
, (target
));
4298 /* GL_ARB_transpose_matrix */
4300 static void GLAPIENTRY
4301 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4304 _math_transposefd(tm
, m
);
4305 save_LoadMatrixf(tm
);
4309 static void GLAPIENTRY
4310 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4313 _math_transposef(tm
, m
);
4314 save_LoadMatrixf(tm
);
4318 static void GLAPIENTRY
4319 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4322 _math_transposefd(tm
, m
);
4323 save_MultMatrixf(tm
);
4327 static void GLAPIENTRY
4328 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4331 _math_transposef(tm
, m
);
4332 save_MultMatrixf(tm
);
4335 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4337 GET_CURRENT_CONTEXT(ctx
);
4343 image
= malloc(size
);
4345 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4348 memcpy(image
, data
, size
);
4354 /* GL_ARB_texture_compression */
4355 static void GLAPIENTRY
4356 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4357 GLenum internalFormat
, GLsizei width
,
4358 GLint border
, GLsizei imageSize
,
4359 const GLvoid
* data
)
4361 GET_CURRENT_CONTEXT(ctx
);
4362 if (target
== GL_PROXY_TEXTURE_1D
) {
4363 /* don't compile, execute immediately */
4364 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
4365 width
, border
, imageSize
,
4370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4372 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
4373 6 + POINTER_DWORDS
);
4377 n
[3].e
= internalFormat
;
4378 n
[4].i
= (GLint
) width
;
4382 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
4384 if (ctx
->ExecuteFlag
) {
4385 CALL_CompressedTexImage1D(ctx
->Exec
,
4386 (target
, level
, internalFormat
, width
,
4387 border
, imageSize
, data
));
4393 static void GLAPIENTRY
4394 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4395 GLenum internalFormat
, GLsizei width
,
4396 GLsizei height
, GLint border
, GLsizei imageSize
,
4397 const GLvoid
* data
)
4399 GET_CURRENT_CONTEXT(ctx
);
4400 if (target
== GL_PROXY_TEXTURE_2D
) {
4401 /* don't compile, execute immediately */
4402 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
4403 width
, height
, border
,
4408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4410 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
4411 7 + POINTER_DWORDS
);
4415 n
[3].e
= internalFormat
;
4416 n
[4].i
= (GLint
) width
;
4417 n
[5].i
= (GLint
) height
;
4421 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
4423 if (ctx
->ExecuteFlag
) {
4424 CALL_CompressedTexImage2D(ctx
->Exec
,
4425 (target
, level
, internalFormat
, width
,
4426 height
, border
, imageSize
, data
));
4432 static void GLAPIENTRY
4433 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4434 GLenum internalFormat
, GLsizei width
,
4435 GLsizei height
, GLsizei depth
, GLint border
,
4436 GLsizei imageSize
, const GLvoid
* data
)
4438 GET_CURRENT_CONTEXT(ctx
);
4439 if (target
== GL_PROXY_TEXTURE_3D
) {
4440 /* don't compile, execute immediately */
4441 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
4442 width
, height
, depth
, border
,
4447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4449 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
4450 8 + POINTER_DWORDS
);
4454 n
[3].e
= internalFormat
;
4455 n
[4].i
= (GLint
) width
;
4456 n
[5].i
= (GLint
) height
;
4457 n
[6].i
= (GLint
) depth
;
4461 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
4463 if (ctx
->ExecuteFlag
) {
4464 CALL_CompressedTexImage3D(ctx
->Exec
,
4465 (target
, level
, internalFormat
, width
,
4466 height
, depth
, border
, imageSize
,
4473 static void GLAPIENTRY
4474 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4475 GLsizei width
, GLenum format
,
4476 GLsizei imageSize
, const GLvoid
* data
)
4479 GET_CURRENT_CONTEXT(ctx
);
4480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4482 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
4483 6 + POINTER_DWORDS
);
4488 n
[4].i
= (GLint
) width
;
4492 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
4494 if (ctx
->ExecuteFlag
) {
4495 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
4496 width
, format
, imageSize
,
4502 static void GLAPIENTRY
4503 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4504 GLint yoffset
, GLsizei width
, GLsizei height
,
4505 GLenum format
, GLsizei imageSize
,
4506 const GLvoid
* data
)
4509 GET_CURRENT_CONTEXT(ctx
);
4510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4512 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
4513 8 + POINTER_DWORDS
);
4519 n
[5].i
= (GLint
) width
;
4520 n
[6].i
= (GLint
) height
;
4524 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
4526 if (ctx
->ExecuteFlag
) {
4527 CALL_CompressedTexSubImage2D(ctx
->Exec
,
4528 (target
, level
, xoffset
, yoffset
, width
,
4529 height
, format
, imageSize
, data
));
4534 static void GLAPIENTRY
4535 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4536 GLint yoffset
, GLint zoffset
, GLsizei width
,
4537 GLsizei height
, GLsizei depth
, GLenum format
,
4538 GLsizei imageSize
, const GLvoid
* data
)
4541 GET_CURRENT_CONTEXT(ctx
);
4542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4544 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
4545 10 + POINTER_DWORDS
);
4552 n
[6].i
= (GLint
) width
;
4553 n
[7].i
= (GLint
) height
;
4554 n
[8].i
= (GLint
) depth
;
4556 n
[10].i
= imageSize
;
4557 save_pointer(&n
[11],
4558 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
4560 if (ctx
->ExecuteFlag
) {
4561 CALL_CompressedTexSubImage3D(ctx
->Exec
,
4562 (target
, level
, xoffset
, yoffset
,
4563 zoffset
, width
, height
, depth
, format
,
4569 /* GL_ARB_multisample */
4570 static void GLAPIENTRY
4571 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4573 GET_CURRENT_CONTEXT(ctx
);
4575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4576 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4581 if (ctx
->ExecuteFlag
) {
4582 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
4588 * GL_NV_fragment_program
4590 static void GLAPIENTRY
4591 save_BindProgramNV(GLenum target
, GLuint id
)
4593 GET_CURRENT_CONTEXT(ctx
);
4595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4596 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4601 if (ctx
->ExecuteFlag
) {
4602 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
4606 static void GLAPIENTRY
4607 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4608 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4610 GET_CURRENT_CONTEXT(ctx
);
4612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4613 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4622 if (ctx
->ExecuteFlag
) {
4623 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4628 static void GLAPIENTRY
4629 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4630 const GLfloat
*params
)
4632 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4633 params
[2], params
[3]);
4637 static void GLAPIENTRY
4638 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4639 const GLfloat
* params
)
4641 GET_CURRENT_CONTEXT(ctx
);
4643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4647 const GLfloat
* p
= params
;
4649 for (i
= 0 ; i
< count
; i
++) {
4650 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4663 if (ctx
->ExecuteFlag
) {
4664 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4669 static void GLAPIENTRY
4670 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4671 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4673 save_ProgramEnvParameter4fARB(target
, index
,
4675 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4679 static void GLAPIENTRY
4680 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4681 const GLdouble
*params
)
4683 save_ProgramEnvParameter4fARB(target
, index
,
4684 (GLfloat
) params
[0],
4685 (GLfloat
) params
[1],
4686 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4690 static void GLAPIENTRY
4691 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4692 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4694 GET_CURRENT_CONTEXT(ctx
);
4696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4697 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4706 if (ctx
->ExecuteFlag
) {
4707 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4712 static void GLAPIENTRY
4713 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4714 const GLfloat
*params
)
4716 GET_CURRENT_CONTEXT(ctx
);
4718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4719 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4728 if (ctx
->ExecuteFlag
) {
4729 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4734 static void GLAPIENTRY
4735 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4736 const GLfloat
*params
)
4738 GET_CURRENT_CONTEXT(ctx
);
4740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4744 const GLfloat
* p
= params
;
4746 for (i
= 0 ; i
< count
; i
++) {
4747 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4760 if (ctx
->ExecuteFlag
) {
4761 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4766 static void GLAPIENTRY
4767 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4768 GLdouble x
, GLdouble y
,
4769 GLdouble z
, GLdouble w
)
4771 GET_CURRENT_CONTEXT(ctx
);
4773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4774 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4778 n
[3].f
= (GLfloat
) x
;
4779 n
[4].f
= (GLfloat
) y
;
4780 n
[5].f
= (GLfloat
) z
;
4781 n
[6].f
= (GLfloat
) w
;
4783 if (ctx
->ExecuteFlag
) {
4784 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4789 static void GLAPIENTRY
4790 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4791 const GLdouble
*params
)
4793 GET_CURRENT_CONTEXT(ctx
);
4795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4796 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4800 n
[3].f
= (GLfloat
) params
[0];
4801 n
[4].f
= (GLfloat
) params
[1];
4802 n
[5].f
= (GLfloat
) params
[2];
4803 n
[6].f
= (GLfloat
) params
[3];
4805 if (ctx
->ExecuteFlag
) {
4806 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4811 /* GL_EXT_stencil_two_side */
4812 static void GLAPIENTRY
4813 save_ActiveStencilFaceEXT(GLenum face
)
4815 GET_CURRENT_CONTEXT(ctx
);
4817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4818 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4822 if (ctx
->ExecuteFlag
) {
4823 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4828 /* GL_EXT_depth_bounds_test */
4829 static void GLAPIENTRY
4830 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4832 GET_CURRENT_CONTEXT(ctx
);
4834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4835 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4837 n
[1].f
= (GLfloat
) zmin
;
4838 n
[2].f
= (GLfloat
) zmax
;
4840 if (ctx
->ExecuteFlag
) {
4841 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4847 static void GLAPIENTRY
4848 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4849 const GLvoid
* string
)
4851 GET_CURRENT_CONTEXT(ctx
);
4854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4856 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
4858 GLubyte
*programCopy
= malloc(len
);
4860 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4863 memcpy(programCopy
, string
, len
);
4867 save_pointer(&n
[4], programCopy
);
4869 if (ctx
->ExecuteFlag
) {
4870 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4875 static void GLAPIENTRY
4876 save_BeginQueryARB(GLenum target
, GLuint id
)
4878 GET_CURRENT_CONTEXT(ctx
);
4880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4881 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4886 if (ctx
->ExecuteFlag
) {
4887 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
4891 static void GLAPIENTRY
4892 save_EndQueryARB(GLenum target
)
4894 GET_CURRENT_CONTEXT(ctx
);
4896 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4897 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
4901 if (ctx
->ExecuteFlag
) {
4902 CALL_EndQuery(ctx
->Exec
, (target
));
4906 static void GLAPIENTRY
4907 save_QueryCounter(GLuint id
, GLenum target
)
4909 GET_CURRENT_CONTEXT(ctx
);
4911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4912 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
4917 if (ctx
->ExecuteFlag
) {
4918 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
4922 static void GLAPIENTRY
4923 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
4925 GET_CURRENT_CONTEXT(ctx
);
4927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4928 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
4934 if (ctx
->ExecuteFlag
) {
4935 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
4939 static void GLAPIENTRY
4940 save_EndQueryIndexed(GLenum target
, GLuint index
)
4942 GET_CURRENT_CONTEXT(ctx
);
4944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4945 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
4950 if (ctx
->ExecuteFlag
) {
4951 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
4956 static void GLAPIENTRY
4957 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4959 GET_CURRENT_CONTEXT(ctx
);
4961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4962 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4966 if (count
> MAX_DRAW_BUFFERS
)
4967 count
= MAX_DRAW_BUFFERS
;
4968 for (i
= 0; i
< count
; i
++) {
4969 n
[2 + i
].e
= buffers
[i
];
4972 if (ctx
->ExecuteFlag
) {
4973 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
4977 static void GLAPIENTRY
4978 save_BindFragmentShaderATI(GLuint id
)
4980 GET_CURRENT_CONTEXT(ctx
);
4983 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4987 if (ctx
->ExecuteFlag
) {
4988 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4992 static void GLAPIENTRY
4993 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4995 GET_CURRENT_CONTEXT(ctx
);
4998 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5006 if (ctx
->ExecuteFlag
) {
5007 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5011 static void GLAPIENTRY
5012 save_Attr1fNV(GLenum attr
, GLfloat x
)
5014 GET_CURRENT_CONTEXT(ctx
);
5016 SAVE_FLUSH_VERTICES(ctx
);
5017 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5023 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5024 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5025 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5027 if (ctx
->ExecuteFlag
) {
5028 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5032 static void GLAPIENTRY
5033 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5035 GET_CURRENT_CONTEXT(ctx
);
5037 SAVE_FLUSH_VERTICES(ctx
);
5038 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5045 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5046 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5047 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5049 if (ctx
->ExecuteFlag
) {
5050 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5054 static void GLAPIENTRY
5055 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5057 GET_CURRENT_CONTEXT(ctx
);
5059 SAVE_FLUSH_VERTICES(ctx
);
5060 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5068 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5069 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5070 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5072 if (ctx
->ExecuteFlag
) {
5073 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5077 static void GLAPIENTRY
5078 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5080 GET_CURRENT_CONTEXT(ctx
);
5082 SAVE_FLUSH_VERTICES(ctx
);
5083 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5092 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5093 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5094 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5096 if (ctx
->ExecuteFlag
) {
5097 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5102 static void GLAPIENTRY
5103 save_Attr1fARB(GLenum attr
, GLfloat x
)
5105 GET_CURRENT_CONTEXT(ctx
);
5107 SAVE_FLUSH_VERTICES(ctx
);
5108 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5114 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5115 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5116 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5118 if (ctx
->ExecuteFlag
) {
5119 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5123 static void GLAPIENTRY
5124 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5126 GET_CURRENT_CONTEXT(ctx
);
5128 SAVE_FLUSH_VERTICES(ctx
);
5129 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5136 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5137 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5138 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5140 if (ctx
->ExecuteFlag
) {
5141 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5145 static void GLAPIENTRY
5146 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5148 GET_CURRENT_CONTEXT(ctx
);
5150 SAVE_FLUSH_VERTICES(ctx
);
5151 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5159 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5160 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5161 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5163 if (ctx
->ExecuteFlag
) {
5164 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5168 static void GLAPIENTRY
5169 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5171 GET_CURRENT_CONTEXT(ctx
);
5173 SAVE_FLUSH_VERTICES(ctx
);
5174 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5183 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5184 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5185 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5187 if (ctx
->ExecuteFlag
) {
5188 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5193 static void GLAPIENTRY
5194 save_EvalCoord1f(GLfloat x
)
5196 GET_CURRENT_CONTEXT(ctx
);
5198 SAVE_FLUSH_VERTICES(ctx
);
5199 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5203 if (ctx
->ExecuteFlag
) {
5204 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5208 static void GLAPIENTRY
5209 save_EvalCoord1fv(const GLfloat
* v
)
5211 save_EvalCoord1f(v
[0]);
5214 static void GLAPIENTRY
5215 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5217 GET_CURRENT_CONTEXT(ctx
);
5219 SAVE_FLUSH_VERTICES(ctx
);
5220 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5225 if (ctx
->ExecuteFlag
) {
5226 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5230 static void GLAPIENTRY
5231 save_EvalCoord2fv(const GLfloat
* v
)
5233 save_EvalCoord2f(v
[0], v
[1]);
5237 static void GLAPIENTRY
5238 save_EvalPoint1(GLint x
)
5240 GET_CURRENT_CONTEXT(ctx
);
5242 SAVE_FLUSH_VERTICES(ctx
);
5243 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5247 if (ctx
->ExecuteFlag
) {
5248 CALL_EvalPoint1(ctx
->Exec
, (x
));
5252 static void GLAPIENTRY
5253 save_EvalPoint2(GLint x
, GLint y
)
5255 GET_CURRENT_CONTEXT(ctx
);
5257 SAVE_FLUSH_VERTICES(ctx
);
5258 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5263 if (ctx
->ExecuteFlag
) {
5264 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5268 static void GLAPIENTRY
5269 save_Indexf(GLfloat x
)
5271 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5274 static void GLAPIENTRY
5275 save_Indexfv(const GLfloat
* v
)
5277 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5280 static void GLAPIENTRY
5281 save_EdgeFlag(GLboolean x
)
5283 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5288 * Compare 'count' elements of vectors 'a' and 'b'.
5289 * \return GL_TRUE if equal, GL_FALSE if different.
5291 static inline GLboolean
5292 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5294 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5299 * This glMaterial function is used for glMaterial calls that are outside
5300 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5302 static void GLAPIENTRY
5303 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5305 GET_CURRENT_CONTEXT(ctx
);
5313 case GL_FRONT_AND_BACK
:
5316 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5325 case GL_AMBIENT_AND_DIFFUSE
:
5331 case GL_COLOR_INDEXES
:
5335 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5339 if (ctx
->ExecuteFlag
) {
5340 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5343 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5345 /* Try to eliminate redundant statechanges. Because it is legal to
5346 * call glMaterial even inside begin/end calls, don't need to worry
5347 * about ctx->Driver.CurrentSavePrimitive here.
5349 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5350 if (bitmask
& (1 << i
)) {
5351 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5352 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5353 /* no change in material value */
5354 bitmask
&= ~(1 << i
);
5357 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5358 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5363 /* If this call has no effect, return early */
5367 SAVE_FLUSH_VERTICES(ctx
);
5369 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5373 for (i
= 0; i
< args
; i
++)
5374 n
[3 + i
].f
= param
[i
];
5378 static void GLAPIENTRY
5379 save_Begin(GLenum mode
)
5381 GET_CURRENT_CONTEXT(ctx
);
5383 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
5384 /* compile this error into the display list */
5385 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
5387 else if (_mesa_inside_dlist_begin_end(ctx
)) {
5388 /* compile this error into the display list */
5389 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
5394 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5396 /* Give the driver an opportunity to hook in an optimized
5397 * display list compiler.
5399 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5402 SAVE_FLUSH_VERTICES(ctx
);
5403 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5408 if (ctx
->ExecuteFlag
) {
5409 CALL_Begin(ctx
->Exec
, (mode
));
5414 static void GLAPIENTRY
5417 GET_CURRENT_CONTEXT(ctx
);
5418 SAVE_FLUSH_VERTICES(ctx
);
5419 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5420 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5421 if (ctx
->ExecuteFlag
) {
5422 CALL_End(ctx
->Exec
, ());
5426 static void GLAPIENTRY
5427 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5429 GET_CURRENT_CONTEXT(ctx
);
5431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5432 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5439 if (ctx
->ExecuteFlag
) {
5440 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5445 static void GLAPIENTRY
5446 save_Vertex2f(GLfloat x
, GLfloat y
)
5448 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5451 static void GLAPIENTRY
5452 save_Vertex2fv(const GLfloat
* v
)
5454 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5457 static void GLAPIENTRY
5458 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5460 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5463 static void GLAPIENTRY
5464 save_Vertex3fv(const GLfloat
* v
)
5466 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5469 static void GLAPIENTRY
5470 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5472 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5475 static void GLAPIENTRY
5476 save_Vertex4fv(const GLfloat
* v
)
5478 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5481 static void GLAPIENTRY
5482 save_TexCoord1f(GLfloat x
)
5484 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5487 static void GLAPIENTRY
5488 save_TexCoord1fv(const GLfloat
* v
)
5490 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5493 static void GLAPIENTRY
5494 save_TexCoord2f(GLfloat x
, GLfloat y
)
5496 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5499 static void GLAPIENTRY
5500 save_TexCoord2fv(const GLfloat
* v
)
5502 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5505 static void GLAPIENTRY
5506 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5508 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5511 static void GLAPIENTRY
5512 save_TexCoord3fv(const GLfloat
* v
)
5514 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5517 static void GLAPIENTRY
5518 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5520 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5523 static void GLAPIENTRY
5524 save_TexCoord4fv(const GLfloat
* v
)
5526 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5529 static void GLAPIENTRY
5530 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5532 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5535 static void GLAPIENTRY
5536 save_Normal3fv(const GLfloat
* v
)
5538 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5541 static void GLAPIENTRY
5542 save_FogCoordfEXT(GLfloat x
)
5544 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5547 static void GLAPIENTRY
5548 save_FogCoordfvEXT(const GLfloat
* v
)
5550 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5553 static void GLAPIENTRY
5554 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5556 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5559 static void GLAPIENTRY
5560 save_Color3fv(const GLfloat
* v
)
5562 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5565 static void GLAPIENTRY
5566 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5568 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5571 static void GLAPIENTRY
5572 save_Color4fv(const GLfloat
* v
)
5574 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5577 static void GLAPIENTRY
5578 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5580 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5583 static void GLAPIENTRY
5584 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5586 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5590 /* Just call the respective ATTR for texcoord
5592 static void GLAPIENTRY
5593 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5595 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5596 save_Attr1fNV(attr
, x
);
5599 static void GLAPIENTRY
5600 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5602 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5603 save_Attr1fNV(attr
, v
[0]);
5606 static void GLAPIENTRY
5607 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5609 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5610 save_Attr2fNV(attr
, x
, y
);
5613 static void GLAPIENTRY
5614 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5616 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5617 save_Attr2fNV(attr
, v
[0], v
[1]);
5620 static void GLAPIENTRY
5621 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5623 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5624 save_Attr3fNV(attr
, x
, y
, z
);
5627 static void GLAPIENTRY
5628 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5630 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5631 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5634 static void GLAPIENTRY
5635 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5636 GLfloat z
, GLfloat w
)
5638 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5639 save_Attr4fNV(attr
, x
, y
, z
, w
);
5642 static void GLAPIENTRY
5643 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5645 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5646 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5651 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5657 GET_CURRENT_CONTEXT(ctx
);
5658 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5663 static void GLAPIENTRY
5664 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5666 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5667 save_Attr1fARB(index
, x
);
5672 static void GLAPIENTRY
5673 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5675 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5676 save_Attr1fARB(index
, v
[0]);
5681 static void GLAPIENTRY
5682 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5684 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5685 save_Attr2fARB(index
, x
, y
);
5690 static void GLAPIENTRY
5691 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5693 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5694 save_Attr2fARB(index
, v
[0], v
[1]);
5699 static void GLAPIENTRY
5700 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5702 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5703 save_Attr3fARB(index
, x
, y
, z
);
5708 static void GLAPIENTRY
5709 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5711 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5712 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5717 static void GLAPIENTRY
5718 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5721 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5722 save_Attr4fARB(index
, x
, y
, z
, w
);
5727 static void GLAPIENTRY
5728 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5730 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5731 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5736 static void GLAPIENTRY
5737 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5738 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5739 GLbitfield mask
, GLenum filter
)
5741 GET_CURRENT_CONTEXT(ctx
);
5743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5744 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5757 if (ctx
->ExecuteFlag
) {
5758 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5759 dstX0
, dstY0
, dstX1
, dstY1
,
5765 /** GL_EXT_provoking_vertex */
5766 static void GLAPIENTRY
5767 save_ProvokingVertexEXT(GLenum mode
)
5769 GET_CURRENT_CONTEXT(ctx
);
5771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5772 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
5776 if (ctx
->ExecuteFlag
) {
5777 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
5778 _mesa_ProvokingVertex(mode
);
5783 /** GL_EXT_transform_feedback */
5784 static void GLAPIENTRY
5785 save_BeginTransformFeedback(GLenum mode
)
5787 GET_CURRENT_CONTEXT(ctx
);
5789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5790 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
5794 if (ctx
->ExecuteFlag
) {
5795 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
5800 /** GL_EXT_transform_feedback */
5801 static void GLAPIENTRY
5802 save_EndTransformFeedback(void)
5804 GET_CURRENT_CONTEXT(ctx
);
5805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5806 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
5807 if (ctx
->ExecuteFlag
) {
5808 CALL_EndTransformFeedback(ctx
->Exec
, ());
5812 static void GLAPIENTRY
5813 save_BindTransformFeedback(GLenum target
, GLuint name
)
5815 GET_CURRENT_CONTEXT(ctx
);
5817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5818 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
5823 if (ctx
->ExecuteFlag
) {
5824 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
5828 static void GLAPIENTRY
5829 save_PauseTransformFeedback(void)
5831 GET_CURRENT_CONTEXT(ctx
);
5832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5833 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
5834 if (ctx
->ExecuteFlag
) {
5835 CALL_PauseTransformFeedback(ctx
->Exec
, ());
5839 static void GLAPIENTRY
5840 save_ResumeTransformFeedback(void)
5842 GET_CURRENT_CONTEXT(ctx
);
5843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5844 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
5845 if (ctx
->ExecuteFlag
) {
5846 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
5850 static void GLAPIENTRY
5851 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
5853 GET_CURRENT_CONTEXT(ctx
);
5855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5856 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
5861 if (ctx
->ExecuteFlag
) {
5862 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
5866 static void GLAPIENTRY
5867 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
5869 GET_CURRENT_CONTEXT(ctx
);
5871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5872 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
5878 if (ctx
->ExecuteFlag
) {
5879 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
5883 static void GLAPIENTRY
5884 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
5887 GET_CURRENT_CONTEXT(ctx
);
5889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5890 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
5894 n
[3].si
= primcount
;
5896 if (ctx
->ExecuteFlag
) {
5897 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
5901 static void GLAPIENTRY
5902 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
5903 GLuint stream
, GLsizei primcount
)
5905 GET_CURRENT_CONTEXT(ctx
);
5907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5908 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
5913 n
[4].si
= primcount
;
5915 if (ctx
->ExecuteFlag
) {
5916 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
5921 /* aka UseProgram() */
5922 static void GLAPIENTRY
5923 save_UseProgramObjectARB(GLhandleARB program
)
5925 GET_CURRENT_CONTEXT(ctx
);
5927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5928 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
5932 if (ctx
->ExecuteFlag
) {
5933 CALL_UseProgram(ctx
->Exec
, (program
));
5938 static void GLAPIENTRY
5939 save_Uniform1fARB(GLint location
, GLfloat x
)
5941 GET_CURRENT_CONTEXT(ctx
);
5943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5944 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
5949 if (ctx
->ExecuteFlag
) {
5950 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
5955 static void GLAPIENTRY
5956 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
5958 GET_CURRENT_CONTEXT(ctx
);
5960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5961 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
5967 if (ctx
->ExecuteFlag
) {
5968 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
5973 static void GLAPIENTRY
5974 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
5976 GET_CURRENT_CONTEXT(ctx
);
5978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5979 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
5986 if (ctx
->ExecuteFlag
) {
5987 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
5992 static void GLAPIENTRY
5993 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5995 GET_CURRENT_CONTEXT(ctx
);
5997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5998 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6006 if (ctx
->ExecuteFlag
) {
6007 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6012 static void GLAPIENTRY
6013 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6015 GET_CURRENT_CONTEXT(ctx
);
6017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6018 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6022 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6024 if (ctx
->ExecuteFlag
) {
6025 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6029 static void GLAPIENTRY
6030 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6032 GET_CURRENT_CONTEXT(ctx
);
6034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6035 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6039 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6041 if (ctx
->ExecuteFlag
) {
6042 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6046 static void GLAPIENTRY
6047 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6049 GET_CURRENT_CONTEXT(ctx
);
6051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6052 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6056 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6058 if (ctx
->ExecuteFlag
) {
6059 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6063 static void GLAPIENTRY
6064 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6066 GET_CURRENT_CONTEXT(ctx
);
6068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6069 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6073 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6075 if (ctx
->ExecuteFlag
) {
6076 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6081 static void GLAPIENTRY
6082 save_Uniform1iARB(GLint location
, GLint x
)
6084 GET_CURRENT_CONTEXT(ctx
);
6086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6087 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6092 if (ctx
->ExecuteFlag
) {
6093 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
6097 static void GLAPIENTRY
6098 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6100 GET_CURRENT_CONTEXT(ctx
);
6102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6103 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6109 if (ctx
->ExecuteFlag
) {
6110 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
6114 static void GLAPIENTRY
6115 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6117 GET_CURRENT_CONTEXT(ctx
);
6119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6120 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6127 if (ctx
->ExecuteFlag
) {
6128 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
6132 static void GLAPIENTRY
6133 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6135 GET_CURRENT_CONTEXT(ctx
);
6137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6138 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6146 if (ctx
->ExecuteFlag
) {
6147 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
6153 static void GLAPIENTRY
6154 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6156 GET_CURRENT_CONTEXT(ctx
);
6158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6159 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
6163 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
6165 if (ctx
->ExecuteFlag
) {
6166 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
6170 static void GLAPIENTRY
6171 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6173 GET_CURRENT_CONTEXT(ctx
);
6175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6176 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
6180 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
6182 if (ctx
->ExecuteFlag
) {
6183 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
6187 static void GLAPIENTRY
6188 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6190 GET_CURRENT_CONTEXT(ctx
);
6192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6193 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
6197 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
6199 if (ctx
->ExecuteFlag
) {
6200 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
6204 static void GLAPIENTRY
6205 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6207 GET_CURRENT_CONTEXT(ctx
);
6209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6210 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
6214 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6216 if (ctx
->ExecuteFlag
) {
6217 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
6223 static void GLAPIENTRY
6224 save_Uniform1ui(GLint location
, GLuint x
)
6226 GET_CURRENT_CONTEXT(ctx
);
6228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6229 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6234 if (ctx
->ExecuteFlag
) {
6235 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6239 static void GLAPIENTRY
6240 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6242 GET_CURRENT_CONTEXT(ctx
);
6244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6245 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6251 if (ctx
->ExecuteFlag
) {
6252 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6256 static void GLAPIENTRY
6257 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6259 GET_CURRENT_CONTEXT(ctx
);
6261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6262 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6269 if (ctx
->ExecuteFlag
) {
6270 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6274 static void GLAPIENTRY
6275 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6277 GET_CURRENT_CONTEXT(ctx
);
6279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6280 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6288 if (ctx
->ExecuteFlag
) {
6289 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6295 static void GLAPIENTRY
6296 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6298 GET_CURRENT_CONTEXT(ctx
);
6300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6301 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
6305 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
6307 if (ctx
->ExecuteFlag
) {
6308 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6312 static void GLAPIENTRY
6313 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6315 GET_CURRENT_CONTEXT(ctx
);
6317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6318 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
6322 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
6324 if (ctx
->ExecuteFlag
) {
6325 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6329 static void GLAPIENTRY
6330 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6332 GET_CURRENT_CONTEXT(ctx
);
6334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6335 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
6339 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
6341 if (ctx
->ExecuteFlag
) {
6342 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6346 static void GLAPIENTRY
6347 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6349 GET_CURRENT_CONTEXT(ctx
);
6351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6352 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
6356 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
6358 if (ctx
->ExecuteFlag
) {
6359 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6365 static void GLAPIENTRY
6366 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6369 GET_CURRENT_CONTEXT(ctx
);
6371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6372 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
6377 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
6379 if (ctx
->ExecuteFlag
) {
6380 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6384 static void GLAPIENTRY
6385 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6388 GET_CURRENT_CONTEXT(ctx
);
6390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6391 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
6396 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
6398 if (ctx
->ExecuteFlag
) {
6399 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6403 static void GLAPIENTRY
6404 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6407 GET_CURRENT_CONTEXT(ctx
);
6409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6410 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
6415 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
6417 if (ctx
->ExecuteFlag
) {
6418 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6423 static void GLAPIENTRY
6424 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6427 GET_CURRENT_CONTEXT(ctx
);
6429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6430 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
6435 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
6437 if (ctx
->ExecuteFlag
) {
6438 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6442 static void GLAPIENTRY
6443 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6446 GET_CURRENT_CONTEXT(ctx
);
6448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6449 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
6454 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
6456 if (ctx
->ExecuteFlag
) {
6457 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6462 static void GLAPIENTRY
6463 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6466 GET_CURRENT_CONTEXT(ctx
);
6468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6469 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
6474 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
6476 if (ctx
->ExecuteFlag
) {
6477 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6481 static void GLAPIENTRY
6482 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6485 GET_CURRENT_CONTEXT(ctx
);
6487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6488 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
6493 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
6495 if (ctx
->ExecuteFlag
) {
6496 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6501 static void GLAPIENTRY
6502 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6505 GET_CURRENT_CONTEXT(ctx
);
6507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6508 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
6513 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
6515 if (ctx
->ExecuteFlag
) {
6516 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6520 static void GLAPIENTRY
6521 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6524 GET_CURRENT_CONTEXT(ctx
);
6526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6527 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
6532 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
6534 if (ctx
->ExecuteFlag
) {
6535 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6539 static void GLAPIENTRY
6540 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
6542 GET_CURRENT_CONTEXT(ctx
);
6544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6545 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
6551 if (ctx
->ExecuteFlag
) {
6552 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
6556 static void GLAPIENTRY
6557 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
6559 GET_CURRENT_CONTEXT(ctx
);
6561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6562 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
6568 if (ctx
->ExecuteFlag
) {
6569 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
6573 static void GLAPIENTRY
6574 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
6576 GET_CURRENT_CONTEXT(ctx
);
6578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6579 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
6586 if (ctx
->ExecuteFlag
) {
6587 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
6591 static void GLAPIENTRY
6592 save_ProgramUniform3f(GLuint program
, GLint location
,
6593 GLfloat x
, GLfloat y
, GLfloat z
)
6595 GET_CURRENT_CONTEXT(ctx
);
6597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6598 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
6606 if (ctx
->ExecuteFlag
) {
6607 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
6611 static void GLAPIENTRY
6612 save_ProgramUniform4f(GLuint program
, GLint location
,
6613 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6615 GET_CURRENT_CONTEXT(ctx
);
6617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6618 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
6627 if (ctx
->ExecuteFlag
) {
6628 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6632 static void GLAPIENTRY
6633 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
6636 GET_CURRENT_CONTEXT(ctx
);
6638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6639 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
6644 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6646 if (ctx
->ExecuteFlag
) {
6647 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
6651 static void GLAPIENTRY
6652 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
6655 GET_CURRENT_CONTEXT(ctx
);
6657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6658 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
6663 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6665 if (ctx
->ExecuteFlag
) {
6666 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
6670 static void GLAPIENTRY
6671 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
6674 GET_CURRENT_CONTEXT(ctx
);
6676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6677 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
6682 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6684 if (ctx
->ExecuteFlag
) {
6685 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
6689 static void GLAPIENTRY
6690 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
6693 GET_CURRENT_CONTEXT(ctx
);
6695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6696 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
6701 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6703 if (ctx
->ExecuteFlag
) {
6704 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
6708 static void GLAPIENTRY
6709 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
6711 GET_CURRENT_CONTEXT(ctx
);
6713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6714 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
6720 if (ctx
->ExecuteFlag
) {
6721 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
6725 static void GLAPIENTRY
6726 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
6728 GET_CURRENT_CONTEXT(ctx
);
6730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6731 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
6738 if (ctx
->ExecuteFlag
) {
6739 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
6743 static void GLAPIENTRY
6744 save_ProgramUniform3i(GLuint program
, GLint location
,
6745 GLint x
, GLint y
, GLint z
)
6747 GET_CURRENT_CONTEXT(ctx
);
6749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6750 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
6758 if (ctx
->ExecuteFlag
) {
6759 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
6763 static void GLAPIENTRY
6764 save_ProgramUniform4i(GLuint program
, GLint location
,
6765 GLint x
, GLint y
, GLint z
, GLint w
)
6767 GET_CURRENT_CONTEXT(ctx
);
6769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6770 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
6779 if (ctx
->ExecuteFlag
) {
6780 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6784 static void GLAPIENTRY
6785 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
6788 GET_CURRENT_CONTEXT(ctx
);
6790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6791 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
6796 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
6798 if (ctx
->ExecuteFlag
) {
6799 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
6803 static void GLAPIENTRY
6804 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
6807 GET_CURRENT_CONTEXT(ctx
);
6809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6810 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
6815 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
6817 if (ctx
->ExecuteFlag
) {
6818 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
6822 static void GLAPIENTRY
6823 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
6826 GET_CURRENT_CONTEXT(ctx
);
6828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6829 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
6834 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
6836 if (ctx
->ExecuteFlag
) {
6837 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
6841 static void GLAPIENTRY
6842 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
6853 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
6855 if (ctx
->ExecuteFlag
) {
6856 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
6860 static void GLAPIENTRY
6861 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
6863 GET_CURRENT_CONTEXT(ctx
);
6865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6866 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
6872 if (ctx
->ExecuteFlag
) {
6873 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
6877 static void GLAPIENTRY
6878 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
6880 GET_CURRENT_CONTEXT(ctx
);
6882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6883 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
6890 if (ctx
->ExecuteFlag
) {
6891 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
6895 static void GLAPIENTRY
6896 save_ProgramUniform3ui(GLuint program
, GLint location
,
6897 GLuint x
, GLuint y
, GLuint z
)
6899 GET_CURRENT_CONTEXT(ctx
);
6901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6902 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
6910 if (ctx
->ExecuteFlag
) {
6911 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
6915 static void GLAPIENTRY
6916 save_ProgramUniform4ui(GLuint program
, GLint location
,
6917 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6919 GET_CURRENT_CONTEXT(ctx
);
6921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6922 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
6931 if (ctx
->ExecuteFlag
) {
6932 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6936 static void GLAPIENTRY
6937 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
6940 GET_CURRENT_CONTEXT(ctx
);
6942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6943 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
6948 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
6950 if (ctx
->ExecuteFlag
) {
6951 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
6955 static void GLAPIENTRY
6956 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
6959 GET_CURRENT_CONTEXT(ctx
);
6961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6962 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
6967 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
6969 if (ctx
->ExecuteFlag
) {
6970 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
6974 static void GLAPIENTRY
6975 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
6978 GET_CURRENT_CONTEXT(ctx
);
6980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6981 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
6986 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
6988 if (ctx
->ExecuteFlag
) {
6989 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
6993 static void GLAPIENTRY
6994 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
6997 GET_CURRENT_CONTEXT(ctx
);
6999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7000 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
7005 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
7007 if (ctx
->ExecuteFlag
) {
7008 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
7012 static void GLAPIENTRY
7013 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
7014 GLboolean transpose
, const GLfloat
*v
)
7016 GET_CURRENT_CONTEXT(ctx
);
7018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7019 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
7020 4 + POINTER_DWORDS
);
7026 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
7028 if (ctx
->ExecuteFlag
) {
7029 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
7030 (program
, location
, count
, transpose
, v
));
7034 static void GLAPIENTRY
7035 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
7036 GLboolean transpose
, const GLfloat
*v
)
7038 GET_CURRENT_CONTEXT(ctx
);
7040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7041 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
7042 4 + POINTER_DWORDS
);
7048 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
7050 if (ctx
->ExecuteFlag
) {
7051 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
7052 (program
, location
, count
, transpose
, v
));
7056 static void GLAPIENTRY
7057 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
7058 GLboolean transpose
, const GLfloat
*v
)
7060 GET_CURRENT_CONTEXT(ctx
);
7062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7063 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
7064 4 + POINTER_DWORDS
);
7070 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
7072 if (ctx
->ExecuteFlag
) {
7073 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
7074 (program
, location
, count
, transpose
, v
));
7078 static void GLAPIENTRY
7079 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
7080 GLboolean transpose
, const GLfloat
*v
)
7082 GET_CURRENT_CONTEXT(ctx
);
7084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7085 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
7086 4 + POINTER_DWORDS
);
7092 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
7094 if (ctx
->ExecuteFlag
) {
7095 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
7096 (program
, location
, count
, transpose
, v
));
7100 static void GLAPIENTRY
7101 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
7102 GLboolean transpose
, const GLfloat
*v
)
7104 GET_CURRENT_CONTEXT(ctx
);
7106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7107 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
7108 4 + POINTER_DWORDS
);
7114 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
7116 if (ctx
->ExecuteFlag
) {
7117 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
7118 (program
, location
, count
, transpose
, v
));
7122 static void GLAPIENTRY
7123 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
7124 GLboolean transpose
, const GLfloat
*v
)
7126 GET_CURRENT_CONTEXT(ctx
);
7128 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7129 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
7130 4 + POINTER_DWORDS
);
7136 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
7138 if (ctx
->ExecuteFlag
) {
7139 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
7140 (program
, location
, count
, transpose
, v
));
7144 static void GLAPIENTRY
7145 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
7146 GLboolean transpose
, const GLfloat
*v
)
7148 GET_CURRENT_CONTEXT(ctx
);
7150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7151 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
7152 4 + POINTER_DWORDS
);
7158 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
7160 if (ctx
->ExecuteFlag
) {
7161 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
7162 (program
, location
, count
, transpose
, v
));
7166 static void GLAPIENTRY
7167 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
7168 GLboolean transpose
, const GLfloat
*v
)
7170 GET_CURRENT_CONTEXT(ctx
);
7172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7173 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
7174 4 + POINTER_DWORDS
);
7180 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
7182 if (ctx
->ExecuteFlag
) {
7183 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
7184 (program
, location
, count
, transpose
, v
));
7188 static void GLAPIENTRY
7189 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
7190 GLboolean transpose
, const GLfloat
*v
)
7192 GET_CURRENT_CONTEXT(ctx
);
7194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7195 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
7196 4 + POINTER_DWORDS
);
7202 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
7204 if (ctx
->ExecuteFlag
) {
7205 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
7206 (program
, location
, count
, transpose
, v
));
7210 static void GLAPIENTRY
7211 save_ClampColorARB(GLenum target
, GLenum clamp
)
7213 GET_CURRENT_CONTEXT(ctx
);
7215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7216 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7221 if (ctx
->ExecuteFlag
) {
7222 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
7226 /** GL_EXT_texture_integer */
7227 static void GLAPIENTRY
7228 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7230 GET_CURRENT_CONTEXT(ctx
);
7232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7233 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7240 if (ctx
->ExecuteFlag
) {
7241 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7245 /** GL_EXT_texture_integer */
7246 static void GLAPIENTRY
7247 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7249 GET_CURRENT_CONTEXT(ctx
);
7251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7252 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7259 if (ctx
->ExecuteFlag
) {
7260 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7264 /** GL_EXT_texture_integer */
7265 static void GLAPIENTRY
7266 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7268 GET_CURRENT_CONTEXT(ctx
);
7270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7271 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7280 if (ctx
->ExecuteFlag
) {
7281 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
7285 /** GL_EXT_texture_integer */
7286 static void GLAPIENTRY
7287 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7289 GET_CURRENT_CONTEXT(ctx
);
7291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7292 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7296 n
[3].ui
= params
[0];
7297 n
[4].ui
= params
[1];
7298 n
[5].ui
= params
[2];
7299 n
[6].ui
= params
[3];
7301 if (ctx
->ExecuteFlag
) {
7302 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
7306 /* GL_ARB_instanced_arrays */
7307 static void GLAPIENTRY
7308 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7310 GET_CURRENT_CONTEXT(ctx
);
7312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7313 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7318 if (ctx
->ExecuteFlag
) {
7319 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
7324 /* GL_NV_texture_barrier */
7325 static void GLAPIENTRY
7326 save_TextureBarrierNV(void)
7328 GET_CURRENT_CONTEXT(ctx
);
7329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7330 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7331 if (ctx
->ExecuteFlag
) {
7332 CALL_TextureBarrierNV(ctx
->Exec
, ());
7337 /* GL_ARB_sampler_objects */
7338 static void GLAPIENTRY
7339 save_BindSampler(GLuint unit
, GLuint sampler
)
7342 GET_CURRENT_CONTEXT(ctx
);
7343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7344 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7349 if (ctx
->ExecuteFlag
) {
7350 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7354 static void GLAPIENTRY
7355 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7358 GET_CURRENT_CONTEXT(ctx
);
7359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7360 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7365 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7371 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7374 if (ctx
->ExecuteFlag
) {
7375 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7379 static void GLAPIENTRY
7380 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7384 parray
[1] = parray
[2] = parray
[3] = 0;
7385 save_SamplerParameteriv(sampler
, pname
, parray
);
7388 static void GLAPIENTRY
7389 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7392 GET_CURRENT_CONTEXT(ctx
);
7393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7394 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7399 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7405 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7408 if (ctx
->ExecuteFlag
) {
7409 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7413 static void GLAPIENTRY
7414 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7418 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
7419 save_SamplerParameterfv(sampler
, pname
, parray
);
7422 static void GLAPIENTRY
7423 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7426 GET_CURRENT_CONTEXT(ctx
);
7427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7428 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7433 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7439 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7442 if (ctx
->ExecuteFlag
) {
7443 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7447 static void GLAPIENTRY
7448 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7451 GET_CURRENT_CONTEXT(ctx
);
7452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7453 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7457 n
[3].ui
= params
[0];
7458 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7459 n
[4].ui
= params
[1];
7460 n
[5].ui
= params
[2];
7461 n
[6].ui
= params
[3];
7464 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7467 if (ctx
->ExecuteFlag
) {
7468 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7472 /* GL_ARB_geometry_shader4 */
7473 static void GLAPIENTRY
7474 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7477 GET_CURRENT_CONTEXT(ctx
);
7478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7479 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7485 if (ctx
->ExecuteFlag
) {
7486 CALL_ProgramParameteri(ctx
->Exec
, (program
, pname
, value
));
7490 static void GLAPIENTRY
7491 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7492 GLuint texture
, GLint level
)
7495 GET_CURRENT_CONTEXT(ctx
);
7496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7497 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7500 n
[2].e
= attachment
;
7504 if (ctx
->ExecuteFlag
) {
7505 CALL_FramebufferTexture(ctx
->Exec
, (target
, attachment
, texture
, level
));
7509 static void GLAPIENTRY
7510 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7511 GLuint texture
, GLint level
, GLenum face
)
7514 GET_CURRENT_CONTEXT(ctx
);
7515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7516 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7519 n
[2].e
= attachment
;
7524 if (ctx
->ExecuteFlag
) {
7525 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7532 static void GLAPIENTRY
7533 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7536 GET_CURRENT_CONTEXT(ctx
);
7537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7538 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7540 union uint64_pair p
;
7543 n
[2].ui
= p
.uint32
[0];
7544 n
[3].ui
= p
.uint32
[1];
7545 save_pointer(&n
[4], sync
);
7547 if (ctx
->ExecuteFlag
) {
7548 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7553 /** GL_NV_conditional_render */
7554 static void GLAPIENTRY
7555 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7557 GET_CURRENT_CONTEXT(ctx
);
7559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7560 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7565 if (ctx
->ExecuteFlag
) {
7566 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
7570 static void GLAPIENTRY
7571 save_EndConditionalRender(void)
7573 GET_CURRENT_CONTEXT(ctx
);
7574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7575 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7576 if (ctx
->ExecuteFlag
) {
7577 CALL_EndConditionalRender(ctx
->Exec
, ());
7581 static void GLAPIENTRY
7582 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7584 GET_CURRENT_CONTEXT(ctx
);
7586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7587 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7593 if (ctx
->ExecuteFlag
) {
7594 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7600 * Save an error-generating command into display list.
7602 * KW: Will appear in the list before the vertex buffer containing the
7603 * command that provoked the error. I don't see this as a problem.
7606 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7609 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
7612 save_pointer(&n
[2], (void *) s
);
7613 /* note: the data/string here doesn't have to be freed in
7614 * _mesa_delete_list() since the string is never dynamically
7622 * Compile an error into current display list.
7625 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7627 if (ctx
->CompileFlag
)
7628 save_error(ctx
, error
, s
);
7629 if (ctx
->ExecuteFlag
)
7630 _mesa_error(ctx
, error
, "%s", s
);
7635 * Test if ID names a display list.
7638 islist(struct gl_context
*ctx
, GLuint list
)
7640 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
7650 /**********************************************************************/
7651 /* Display list execution */
7652 /**********************************************************************/
7656 * Execute a display list. Note that the ListBase offset must have already
7657 * been added before calling this function. I.e. the list argument is
7658 * the absolute list number, not relative to ListBase.
7659 * \param list - display list number
7662 execute_list(struct gl_context
*ctx
, GLuint list
)
7664 struct gl_display_list
*dlist
;
7668 if (list
== 0 || !islist(ctx
, list
))
7671 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7672 /* raise an error? */
7676 dlist
= _mesa_lookup_list(ctx
, list
);
7680 ctx
->ListState
.CallDepth
++;
7682 if (ctx
->Driver
.BeginCallList
)
7683 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7689 const OpCode opcode
= n
[0].opcode
;
7691 if (is_ext_opcode(opcode
)) {
7692 n
+= ext_opcode_execute(ctx
, n
);
7697 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
7700 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7702 case OPCODE_ALPHA_FUNC
:
7703 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7705 case OPCODE_BIND_TEXTURE
:
7706 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7710 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7711 ctx
->Unpack
= ctx
->DefaultPacking
;
7712 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7713 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7714 get_pointer(&n
[7])));
7715 ctx
->Unpack
= save
; /* restore */
7718 case OPCODE_BLEND_COLOR
:
7719 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7721 case OPCODE_BLEND_EQUATION
:
7722 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7724 case OPCODE_BLEND_EQUATION_SEPARATE
:
7725 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7727 case OPCODE_BLEND_FUNC_SEPARATE
:
7728 CALL_BlendFuncSeparate(ctx
->Exec
,
7729 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7732 case OPCODE_BLEND_FUNC_I
:
7733 /* GL_ARB_draw_buffers_blend */
7734 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7736 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7737 /* GL_ARB_draw_buffers_blend */
7738 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7741 case OPCODE_BLEND_EQUATION_I
:
7742 /* GL_ARB_draw_buffers_blend */
7743 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7745 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7746 /* GL_ARB_draw_buffers_blend */
7747 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7748 (n
[1].ui
, n
[2].e
, n
[3].e
));
7751 case OPCODE_CALL_LIST
:
7752 /* Generated by glCallList(), don't add ListBase */
7753 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7754 execute_list(ctx
, n
[1].ui
);
7757 case OPCODE_CALL_LIST_OFFSET
:
7758 /* Generated by glCallLists() so we must add ListBase */
7760 /* user specified a bad data type at compile time */
7761 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7763 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7764 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7765 execute_list(ctx
, list
);
7769 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7771 case OPCODE_CLEAR_BUFFER_IV
:
7778 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7781 case OPCODE_CLEAR_BUFFER_UIV
:
7788 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7791 case OPCODE_CLEAR_BUFFER_FV
:
7798 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7801 case OPCODE_CLEAR_BUFFER_FI
:
7802 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7804 case OPCODE_CLEAR_COLOR
:
7805 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7807 case OPCODE_CLEAR_ACCUM
:
7808 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7810 case OPCODE_CLEAR_DEPTH
:
7811 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7813 case OPCODE_CLEAR_INDEX
:
7814 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7816 case OPCODE_CLEAR_STENCIL
:
7817 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7819 case OPCODE_CLIP_PLANE
:
7826 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7829 case OPCODE_COLOR_MASK
:
7830 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7832 case OPCODE_COLOR_MASK_INDEXED
:
7833 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7836 case OPCODE_COLOR_MATERIAL
:
7837 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7839 case OPCODE_COPY_PIXELS
:
7840 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7841 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7844 case OPCODE_COPY_TEX_IMAGE1D
:
7845 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7846 n
[5].i
, n
[6].i
, n
[7].i
));
7848 case OPCODE_COPY_TEX_IMAGE2D
:
7849 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7850 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7852 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7853 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7854 n
[4].i
, n
[5].i
, n
[6].i
));
7856 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7857 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7858 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7861 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7862 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7863 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7866 case OPCODE_CULL_FACE
:
7867 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7869 case OPCODE_DEPTH_FUNC
:
7870 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7872 case OPCODE_DEPTH_MASK
:
7873 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7875 case OPCODE_DEPTH_RANGE
:
7876 CALL_DepthRange(ctx
->Exec
,
7877 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7879 case OPCODE_DISABLE
:
7880 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7882 case OPCODE_DISABLE_INDEXED
:
7883 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7885 case OPCODE_DRAW_BUFFER
:
7886 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7888 case OPCODE_DRAW_PIXELS
:
7890 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7891 ctx
->Unpack
= ctx
->DefaultPacking
;
7892 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7893 get_pointer(&n
[5])));
7894 ctx
->Unpack
= save
; /* restore */
7898 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7900 case OPCODE_ENABLE_INDEXED
:
7901 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7903 case OPCODE_EVALMESH1
:
7904 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7906 case OPCODE_EVALMESH2
:
7907 CALL_EvalMesh2(ctx
->Exec
,
7908 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7917 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7920 case OPCODE_FRONT_FACE
:
7921 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7923 case OPCODE_FRUSTUM
:
7924 CALL_Frustum(ctx
->Exec
,
7925 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7928 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7930 case OPCODE_INDEX_MASK
:
7931 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7933 case OPCODE_INIT_NAMES
:
7934 CALL_InitNames(ctx
->Exec
, ());
7943 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7946 case OPCODE_LIGHT_MODEL
:
7953 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7956 case OPCODE_LINE_STIPPLE
:
7957 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7959 case OPCODE_LINE_WIDTH
:
7960 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7962 case OPCODE_LIST_BASE
:
7963 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7965 case OPCODE_LOAD_IDENTITY
:
7966 CALL_LoadIdentity(ctx
->Exec
, ());
7968 case OPCODE_LOAD_MATRIX
:
7969 if (sizeof(Node
) == sizeof(GLfloat
)) {
7970 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7975 for (i
= 0; i
< 16; i
++) {
7978 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7981 case OPCODE_LOAD_NAME
:
7982 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7984 case OPCODE_LOGIC_OP
:
7985 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7989 GLenum target
= n
[1].e
;
7990 GLint ustride
= _mesa_evaluator_components(target
);
7991 GLint uorder
= n
[5].i
;
7992 GLfloat u1
= n
[2].f
;
7993 GLfloat u2
= n
[3].f
;
7994 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7995 (GLfloat
*) get_pointer(&n
[6])));
8000 GLenum target
= n
[1].e
;
8001 GLfloat u1
= n
[2].f
;
8002 GLfloat u2
= n
[3].f
;
8003 GLfloat v1
= n
[4].f
;
8004 GLfloat v2
= n
[5].f
;
8005 GLint ustride
= n
[6].i
;
8006 GLint vstride
= n
[7].i
;
8007 GLint uorder
= n
[8].i
;
8008 GLint vorder
= n
[9].i
;
8009 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8010 v1
, v2
, vstride
, vorder
,
8011 (GLfloat
*) get_pointer(&n
[10])));
8014 case OPCODE_MAPGRID1
:
8015 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8017 case OPCODE_MAPGRID2
:
8018 CALL_MapGrid2f(ctx
->Exec
,
8019 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8021 case OPCODE_MATRIX_MODE
:
8022 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8024 case OPCODE_MULT_MATRIX
:
8025 if (sizeof(Node
) == sizeof(GLfloat
)) {
8026 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8031 for (i
= 0; i
< 16; i
++) {
8034 CALL_MultMatrixf(ctx
->Exec
, (m
));
8038 CALL_Ortho(ctx
->Exec
,
8039 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8041 case OPCODE_PASSTHROUGH
:
8042 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8044 case OPCODE_PIXEL_MAP
:
8045 CALL_PixelMapfv(ctx
->Exec
,
8046 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
8048 case OPCODE_PIXEL_TRANSFER
:
8049 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8051 case OPCODE_PIXEL_ZOOM
:
8052 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8054 case OPCODE_POINT_SIZE
:
8055 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8057 case OPCODE_POINT_PARAMETERS
:
8063 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
8066 case OPCODE_POLYGON_MODE
:
8067 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8069 case OPCODE_POLYGON_STIPPLE
:
8071 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8072 ctx
->Unpack
= ctx
->DefaultPacking
;
8073 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
8074 ctx
->Unpack
= save
; /* restore */
8077 case OPCODE_POLYGON_OFFSET
:
8078 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8080 case OPCODE_POP_ATTRIB
:
8081 CALL_PopAttrib(ctx
->Exec
, ());
8083 case OPCODE_POP_MATRIX
:
8084 CALL_PopMatrix(ctx
->Exec
, ());
8086 case OPCODE_POP_NAME
:
8087 CALL_PopName(ctx
->Exec
, ());
8089 case OPCODE_PRIORITIZE_TEXTURE
:
8090 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8092 case OPCODE_PUSH_ATTRIB
:
8093 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8095 case OPCODE_PUSH_MATRIX
:
8096 CALL_PushMatrix(ctx
->Exec
, ());
8098 case OPCODE_PUSH_NAME
:
8099 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8101 case OPCODE_RASTER_POS
:
8102 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8104 case OPCODE_READ_BUFFER
:
8105 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8108 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8111 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8113 case OPCODE_SCISSOR
:
8114 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8116 case OPCODE_SHADE_MODEL
:
8117 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8119 case OPCODE_PROVOKING_VERTEX
:
8120 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
8122 case OPCODE_STENCIL_FUNC
:
8123 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8125 case OPCODE_STENCIL_MASK
:
8126 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8128 case OPCODE_STENCIL_OP
:
8129 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8131 case OPCODE_STENCIL_FUNC_SEPARATE
:
8132 CALL_StencilFuncSeparate(ctx
->Exec
,
8133 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8135 case OPCODE_STENCIL_MASK_SEPARATE
:
8136 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8138 case OPCODE_STENCIL_OP_SEPARATE
:
8139 CALL_StencilOpSeparate(ctx
->Exec
,
8140 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8149 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8159 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8162 case OPCODE_TEXPARAMETER
:
8169 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8172 case OPCODE_TEX_IMAGE1D
:
8174 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8175 ctx
->Unpack
= ctx
->DefaultPacking
;
8176 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8178 n
[3].i
, /* components */
8180 n
[5].e
, /* border */
8181 n
[6].e
, /* format */
8183 get_pointer(&n
[8])));
8184 ctx
->Unpack
= save
; /* restore */
8187 case OPCODE_TEX_IMAGE2D
:
8189 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8190 ctx
->Unpack
= ctx
->DefaultPacking
;
8191 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8193 n
[3].i
, /* components */
8195 n
[5].i
, /* height */
8196 n
[6].e
, /* border */
8197 n
[7].e
, /* format */
8199 get_pointer(&n
[9])));
8200 ctx
->Unpack
= save
; /* restore */
8203 case OPCODE_TEX_IMAGE3D
:
8205 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8206 ctx
->Unpack
= ctx
->DefaultPacking
;
8207 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8209 n
[3].i
, /* components */
8211 n
[5].i
, /* height */
8213 n
[7].e
, /* border */
8214 n
[8].e
, /* format */
8216 get_pointer(&n
[10])));
8217 ctx
->Unpack
= save
; /* restore */
8220 case OPCODE_TEX_SUB_IMAGE1D
:
8222 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8223 ctx
->Unpack
= ctx
->DefaultPacking
;
8224 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8226 n
[6].e
, get_pointer(&n
[7])));
8227 ctx
->Unpack
= save
; /* restore */
8230 case OPCODE_TEX_SUB_IMAGE2D
:
8232 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8233 ctx
->Unpack
= ctx
->DefaultPacking
;
8234 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8236 n
[6].i
, n
[7].e
, n
[8].e
,
8237 get_pointer(&n
[9])));
8238 ctx
->Unpack
= save
; /* restore */
8241 case OPCODE_TEX_SUB_IMAGE3D
:
8243 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8244 ctx
->Unpack
= ctx
->DefaultPacking
;
8245 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8246 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8247 n
[8].i
, n
[9].e
, n
[10].e
,
8248 get_pointer(&n
[11])));
8249 ctx
->Unpack
= save
; /* restore */
8252 case OPCODE_TRANSLATE
:
8253 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8255 case OPCODE_VIEWPORT
:
8256 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8257 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8259 case OPCODE_WINDOW_POS
:
8260 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8262 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8263 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
8265 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8266 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8267 n
[4].i
, n
[5].i
, n
[6].i
,
8268 get_pointer(&n
[7])));
8270 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8271 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8272 n
[4].i
, n
[5].i
, n
[6].i
,
8273 n
[7].i
, get_pointer(&n
[8])));
8275 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8276 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8277 n
[4].i
, n
[5].i
, n
[6].i
,
8279 get_pointer(&n
[9])));
8281 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8282 CALL_CompressedTexSubImage1D(ctx
->Exec
,
8283 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8285 get_pointer(&n
[7])));
8287 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8288 CALL_CompressedTexSubImage2D(ctx
->Exec
,
8289 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8290 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8291 get_pointer(&n
[9])));
8293 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8294 CALL_CompressedTexSubImage3D(ctx
->Exec
,
8295 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8296 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8298 get_pointer(&n
[11])));
8300 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8301 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8303 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8304 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8306 case OPCODE_BIND_PROGRAM_NV
: /* GL_ARB_vertex_program */
8307 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8309 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8310 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8311 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8314 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8315 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8317 case OPCODE_DEPTH_BOUNDS_EXT
:
8318 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8320 case OPCODE_PROGRAM_STRING_ARB
:
8321 CALL_ProgramStringARB(ctx
->Exec
,
8322 (n
[1].e
, n
[2].e
, n
[3].i
,
8323 get_pointer(&n
[4])));
8325 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8326 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8330 case OPCODE_BEGIN_QUERY_ARB
:
8331 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8333 case OPCODE_END_QUERY_ARB
:
8334 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
8336 case OPCODE_QUERY_COUNTER
:
8337 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8339 case OPCODE_BEGIN_QUERY_INDEXED
:
8340 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8342 case OPCODE_END_QUERY_INDEXED
:
8343 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8345 case OPCODE_DRAW_BUFFERS_ARB
:
8347 GLenum buffers
[MAX_DRAW_BUFFERS
];
8348 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8349 for (i
= 0; i
< count
; i
++)
8350 buffers
[i
] = n
[2 + i
].e
;
8351 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
8354 case OPCODE_BLIT_FRAMEBUFFER
:
8355 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8356 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8359 case OPCODE_USE_PROGRAM
:
8360 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
8362 case OPCODE_UNIFORM_1F
:
8363 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8365 case OPCODE_UNIFORM_2F
:
8366 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8368 case OPCODE_UNIFORM_3F
:
8369 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8371 case OPCODE_UNIFORM_4F
:
8372 CALL_Uniform4f(ctx
->Exec
,
8373 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8375 case OPCODE_UNIFORM_1FV
:
8376 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8378 case OPCODE_UNIFORM_2FV
:
8379 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8381 case OPCODE_UNIFORM_3FV
:
8382 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8384 case OPCODE_UNIFORM_4FV
:
8385 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8387 case OPCODE_UNIFORM_1I
:
8388 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8390 case OPCODE_UNIFORM_2I
:
8391 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8393 case OPCODE_UNIFORM_3I
:
8394 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8396 case OPCODE_UNIFORM_4I
:
8397 CALL_Uniform4i(ctx
->Exec
,
8398 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8400 case OPCODE_UNIFORM_1IV
:
8401 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8403 case OPCODE_UNIFORM_2IV
:
8404 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8406 case OPCODE_UNIFORM_3IV
:
8407 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8409 case OPCODE_UNIFORM_4IV
:
8410 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8412 case OPCODE_UNIFORM_1UI
:
8413 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8415 case OPCODE_UNIFORM_2UI
:
8416 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8418 case OPCODE_UNIFORM_3UI
:
8419 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8421 case OPCODE_UNIFORM_4UI
:
8422 /*CALL_Uniform4uiARB(ctx->Exec,
8423 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8426 case OPCODE_UNIFORM_1UIV
:
8427 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i,
8428 get_pointer(&n[3])));*/
8430 case OPCODE_UNIFORM_2UIV
:
8431 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i,
8432 get_pointer(&n[3])));*/
8434 case OPCODE_UNIFORM_3UIV
:
8435 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i,
8436 get_pointer(&n[3])));*/
8438 case OPCODE_UNIFORM_4UIV
:
8439 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i,
8440 get_pointer(&n[3])));*/
8442 case OPCODE_UNIFORM_MATRIX22
:
8443 CALL_UniformMatrix2fv(ctx
->Exec
,
8444 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8446 case OPCODE_UNIFORM_MATRIX33
:
8447 CALL_UniformMatrix3fv(ctx
->Exec
,
8448 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8450 case OPCODE_UNIFORM_MATRIX44
:
8451 CALL_UniformMatrix4fv(ctx
->Exec
,
8452 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8454 case OPCODE_UNIFORM_MATRIX23
:
8455 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8456 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8458 case OPCODE_UNIFORM_MATRIX32
:
8459 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8460 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8462 case OPCODE_UNIFORM_MATRIX24
:
8463 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8464 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8466 case OPCODE_UNIFORM_MATRIX42
:
8467 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8468 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8470 case OPCODE_UNIFORM_MATRIX34
:
8471 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8472 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8474 case OPCODE_UNIFORM_MATRIX43
:
8475 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8476 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8479 case OPCODE_USE_PROGRAM_STAGES
:
8480 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8482 case OPCODE_PROGRAM_UNIFORM_1F
:
8483 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
8485 case OPCODE_PROGRAM_UNIFORM_2F
:
8486 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
8488 case OPCODE_PROGRAM_UNIFORM_3F
:
8489 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8490 n
[3].f
, n
[4].f
, n
[5].f
));
8492 case OPCODE_PROGRAM_UNIFORM_4F
:
8493 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8494 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8496 case OPCODE_PROGRAM_UNIFORM_1FV
:
8497 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8498 get_pointer(&n
[4])));
8500 case OPCODE_PROGRAM_UNIFORM_2FV
:
8501 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8502 get_pointer(&n
[4])));
8504 case OPCODE_PROGRAM_UNIFORM_3FV
:
8505 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8506 get_pointer(&n
[4])));
8508 case OPCODE_PROGRAM_UNIFORM_4FV
:
8509 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8510 get_pointer(&n
[4])));
8512 case OPCODE_PROGRAM_UNIFORM_1I
:
8513 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
8515 case OPCODE_PROGRAM_UNIFORM_2I
:
8516 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
8518 case OPCODE_PROGRAM_UNIFORM_3I
:
8519 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8520 n
[3].i
, n
[4].i
, n
[5].i
));
8522 case OPCODE_PROGRAM_UNIFORM_4I
:
8523 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8524 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
8526 case OPCODE_PROGRAM_UNIFORM_1IV
:
8527 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8528 get_pointer(&n
[4])));
8530 case OPCODE_PROGRAM_UNIFORM_2IV
:
8531 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8532 get_pointer(&n
[4])));
8534 case OPCODE_PROGRAM_UNIFORM_3IV
:
8535 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8536 get_pointer(&n
[4])));
8538 case OPCODE_PROGRAM_UNIFORM_4IV
:
8539 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8540 get_pointer(&n
[4])));
8542 case OPCODE_PROGRAM_UNIFORM_1UI
:
8543 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
8545 case OPCODE_PROGRAM_UNIFORM_2UI
:
8546 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8549 case OPCODE_PROGRAM_UNIFORM_3UI
:
8550 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8551 n
[3].ui
, n
[4].ui
, n
[5].ui
));
8553 case OPCODE_PROGRAM_UNIFORM_4UI
:
8554 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8556 n
[4].ui
, n
[5].ui
, n
[6].ui
));
8558 case OPCODE_PROGRAM_UNIFORM_1UIV
:
8559 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8560 get_pointer(&n
[4])));
8562 case OPCODE_PROGRAM_UNIFORM_2UIV
:
8563 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8564 get_pointer(&n
[4])));
8566 case OPCODE_PROGRAM_UNIFORM_3UIV
:
8567 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8568 get_pointer(&n
[4])));
8570 case OPCODE_PROGRAM_UNIFORM_4UIV
:
8571 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8572 get_pointer(&n
[4])));
8574 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
8575 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8576 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8577 get_pointer(&n
[5])));
8579 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
8580 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8581 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8582 get_pointer(&n
[5])));
8584 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
8585 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8586 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8587 get_pointer(&n
[5])));
8589 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
8590 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8591 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8592 get_pointer(&n
[5])));
8594 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
8595 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8596 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8597 get_pointer(&n
[5])));
8599 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
8600 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8601 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8602 get_pointer(&n
[5])));
8604 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
8605 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8606 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8607 get_pointer(&n
[5])));
8609 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
8610 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8611 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8612 get_pointer(&n
[5])));
8614 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
8615 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8616 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8617 get_pointer(&n
[5])));
8620 case OPCODE_CLAMP_COLOR
:
8621 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8624 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8625 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8627 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8630 GLuint i
, dst
= n
[1].ui
;
8632 for (i
= 0; i
< 4; i
++)
8633 values
[i
] = n
[1 + i
].f
;
8634 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8637 case OPCODE_ATTR_1F_NV
:
8638 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8640 case OPCODE_ATTR_2F_NV
:
8641 /* Really shouldn't have to do this - the Node structure
8642 * is convenient, but it would be better to store the data
8643 * packed appropriately so that it can be sent directly
8644 * on. With x86_64 becoming common, this will start to
8647 if (sizeof(Node
) == sizeof(GLfloat
))
8648 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8650 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8652 case OPCODE_ATTR_3F_NV
:
8653 if (sizeof(Node
) == sizeof(GLfloat
))
8654 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8656 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8659 case OPCODE_ATTR_4F_NV
:
8660 if (sizeof(Node
) == sizeof(GLfloat
))
8661 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8663 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8666 case OPCODE_ATTR_1F_ARB
:
8667 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8669 case OPCODE_ATTR_2F_ARB
:
8670 /* Really shouldn't have to do this - the Node structure
8671 * is convenient, but it would be better to store the data
8672 * packed appropriately so that it can be sent directly
8673 * on. With x86_64 becoming common, this will start to
8676 if (sizeof(Node
) == sizeof(GLfloat
))
8677 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8679 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8681 case OPCODE_ATTR_3F_ARB
:
8682 if (sizeof(Node
) == sizeof(GLfloat
))
8683 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8685 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8688 case OPCODE_ATTR_4F_ARB
:
8689 if (sizeof(Node
) == sizeof(GLfloat
))
8690 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8692 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8695 case OPCODE_MATERIAL
:
8696 if (sizeof(Node
) == sizeof(GLfloat
))
8697 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8704 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8708 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8711 CALL_End(ctx
->Exec
, ());
8714 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8716 case OPCODE_EVAL_C1
:
8717 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8719 case OPCODE_EVAL_C2
:
8720 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8722 case OPCODE_EVAL_P1
:
8723 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8725 case OPCODE_EVAL_P2
:
8726 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8729 /* GL_EXT_texture_integer */
8730 case OPCODE_CLEARCOLOR_I
:
8731 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8733 case OPCODE_CLEARCOLOR_UI
:
8734 CALL_ClearColorIuiEXT(ctx
->Exec
,
8735 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8737 case OPCODE_TEXPARAMETER_I
:
8744 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8747 case OPCODE_TEXPARAMETER_UI
:
8750 params
[0] = n
[3].ui
;
8751 params
[1] = n
[4].ui
;
8752 params
[2] = n
[5].ui
;
8753 params
[3] = n
[6].ui
;
8754 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8758 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8759 /* GL_ARB_instanced_arrays */
8760 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8763 case OPCODE_TEXTURE_BARRIER_NV
:
8764 CALL_TextureBarrierNV(ctx
->Exec
, ());
8767 /* GL_EXT/ARB_transform_feedback */
8768 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8769 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
8771 case OPCODE_END_TRANSFORM_FEEDBACK
:
8772 CALL_EndTransformFeedback(ctx
->Exec
, ());
8774 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8775 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8777 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8778 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8780 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8781 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8783 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8784 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8786 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8787 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8788 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8790 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8791 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8792 (n
[1].e
, n
[2].ui
, n
[3].si
));
8794 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8795 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8796 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8800 case OPCODE_BIND_SAMPLER
:
8801 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8803 case OPCODE_SAMPLER_PARAMETERIV
:
8810 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8813 case OPCODE_SAMPLER_PARAMETERFV
:
8820 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8823 case OPCODE_SAMPLER_PARAMETERIIV
:
8830 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8833 case OPCODE_SAMPLER_PARAMETERUIV
:
8836 params
[0] = n
[3].ui
;
8837 params
[1] = n
[4].ui
;
8838 params
[2] = n
[5].ui
;
8839 params
[3] = n
[6].ui
;
8840 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8844 /* GL_ARB_geometry_shader4 */
8845 case OPCODE_PROGRAM_PARAMETERI
:
8846 CALL_ProgramParameteri(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8848 case OPCODE_FRAMEBUFFER_TEXTURE
:
8849 CALL_FramebufferTexture(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8852 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8853 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8854 n
[3].ui
, n
[4].i
, n
[5].e
));
8858 case OPCODE_WAIT_SYNC
:
8860 union uint64_pair p
;
8861 p
.uint32
[0] = n
[2].ui
;
8862 p
.uint32
[1] = n
[3].ui
;
8863 CALL_WaitSync(ctx
->Exec
,
8864 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
8868 /* GL_NV_conditional_render */
8869 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8870 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8872 case OPCODE_END_CONDITIONAL_RENDER
:
8873 CALL_EndConditionalRender(ctx
->Exec
, ());
8876 case OPCODE_UNIFORM_BLOCK_BINDING
:
8877 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8880 case OPCODE_CONTINUE
:
8881 n
= (Node
*) get_pointer(&n
[1]);
8883 case OPCODE_END_OF_LIST
:
8889 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8891 _mesa_problem(ctx
, "%s", msg
);
8896 /* increment n to point to next compiled command */
8897 if (opcode
!= OPCODE_CONTINUE
) {
8898 n
+= InstSize
[opcode
];
8903 if (ctx
->Driver
.EndCallList
)
8904 ctx
->Driver
.EndCallList(ctx
);
8906 ctx
->ListState
.CallDepth
--;
8911 /**********************************************************************/
8913 /**********************************************************************/
8916 * Test if a display list number is valid.
8918 GLboolean GLAPIENTRY
8919 _mesa_IsList(GLuint list
)
8921 GET_CURRENT_CONTEXT(ctx
);
8922 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8923 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8924 return islist(ctx
, list
);
8929 * Delete a sequence of consecutive display lists.
8932 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8934 GET_CURRENT_CONTEXT(ctx
);
8936 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8937 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8940 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8943 for (i
= list
; i
< list
+ range
; i
++) {
8944 destroy_list(ctx
, i
);
8950 * Return a display list number, n, such that lists n through n+range-1
8954 _mesa_GenLists(GLsizei range
)
8956 GET_CURRENT_CONTEXT(ctx
);
8958 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8959 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8962 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8970 * Make this an atomic operation
8972 mtx_lock(&ctx
->Shared
->Mutex
);
8974 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8976 /* reserve the list IDs by with empty/dummy lists */
8978 for (i
= 0; i
< range
; i
++) {
8979 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8980 make_list(base
+ i
, 1));
8984 mtx_unlock(&ctx
->Shared
->Mutex
);
8991 * Begin a new display list.
8994 _mesa_NewList(GLuint name
, GLenum mode
)
8996 GET_CURRENT_CONTEXT(ctx
);
8998 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8999 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9001 if (MESA_VERBOSE
& VERBOSE_API
)
9002 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
9003 _mesa_lookup_enum_by_nr(mode
));
9006 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
9010 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
9011 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
9015 if (ctx
->ListState
.CurrentList
) {
9016 /* already compiling a display list */
9017 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
9021 ctx
->CompileFlag
= GL_TRUE
;
9022 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
9024 /* Reset accumulated list state */
9025 invalidate_saved_current_state( ctx
);
9027 /* Allocate new display list */
9028 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
9029 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
9030 ctx
->ListState
.CurrentPos
= 0;
9032 ctx
->Driver
.NewList(ctx
, name
, mode
);
9034 ctx
->CurrentDispatch
= ctx
->Save
;
9035 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9040 * End definition of current display list.
9045 GET_CURRENT_CONTEXT(ctx
);
9046 SAVE_FLUSH_VERTICES(ctx
);
9047 FLUSH_VERTICES(ctx
, 0);
9049 if (MESA_VERBOSE
& VERBOSE_API
)
9050 _mesa_debug(ctx
, "glEndList\n");
9052 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
9053 _mesa_error(ctx
, GL_INVALID_OPERATION
,
9054 "glEndList() called inside glBegin/End");
9057 /* Check that a list is under construction */
9058 if (!ctx
->ListState
.CurrentList
) {
9059 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
9063 /* Call before emitting END_OF_LIST, in case the driver wants to
9064 * emit opcodes itself.
9066 ctx
->Driver
.EndList(ctx
);
9068 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
9072 /* Destroy old list, if any */
9073 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
9075 /* Install the new list */
9076 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
9077 ctx
->ListState
.CurrentList
->Name
,
9078 ctx
->ListState
.CurrentList
);
9081 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
9082 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
9084 ctx
->ListState
.CurrentList
= NULL
;
9085 ctx
->ListState
.CurrentBlock
= NULL
;
9086 ctx
->ListState
.CurrentPos
= 0;
9087 ctx
->ExecuteFlag
= GL_TRUE
;
9088 ctx
->CompileFlag
= GL_FALSE
;
9090 ctx
->CurrentDispatch
= ctx
->Exec
;
9091 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9096 _mesa_CallList(GLuint list
)
9098 GLboolean save_compile_flag
;
9099 GET_CURRENT_CONTEXT(ctx
);
9100 FLUSH_CURRENT(ctx
, 0);
9102 if (MESA_VERBOSE
& VERBOSE_API
)
9103 _mesa_debug(ctx
, "glCallList %d\n", list
);
9106 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
9111 mesa_print_display_list( list
);
9113 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
9114 * execute the display list, and restore the CompileFlag.
9116 save_compile_flag
= ctx
->CompileFlag
;
9117 if (save_compile_flag
) {
9118 ctx
->CompileFlag
= GL_FALSE
;
9121 execute_list(ctx
, list
);
9122 ctx
->CompileFlag
= save_compile_flag
;
9124 /* also restore API function pointers to point to "save" versions */
9125 if (save_compile_flag
) {
9126 ctx
->CurrentDispatch
= ctx
->Save
;
9127 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9133 * Execute glCallLists: call multiple display lists.
9136 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9138 GET_CURRENT_CONTEXT(ctx
);
9140 GLboolean save_compile_flag
;
9142 if (MESA_VERBOSE
& VERBOSE_API
)
9143 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9147 case GL_UNSIGNED_BYTE
:
9149 case GL_UNSIGNED_SHORT
:
9151 case GL_UNSIGNED_INT
:
9159 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9163 /* Save the CompileFlag status, turn it off, execute display list,
9164 * and restore the CompileFlag.
9166 save_compile_flag
= ctx
->CompileFlag
;
9167 ctx
->CompileFlag
= GL_FALSE
;
9169 for (i
= 0; i
< n
; i
++) {
9170 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9171 execute_list(ctx
, list
);
9174 ctx
->CompileFlag
= save_compile_flag
;
9176 /* also restore API function pointers to point to "save" versions */
9177 if (save_compile_flag
) {
9178 ctx
->CurrentDispatch
= ctx
->Save
;
9179 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9185 * Set the offset added to list numbers in glCallLists.
9188 _mesa_ListBase(GLuint base
)
9190 GET_CURRENT_CONTEXT(ctx
);
9191 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9192 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9193 ctx
->List
.ListBase
= base
;
9197 * Setup the given dispatch table to point to Mesa's display list
9198 * building functions.
9200 * This does not include any of the tnl functions - they are
9201 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9205 _mesa_initialize_save_table(const struct gl_context
*ctx
)
9207 struct _glapi_table
*table
= ctx
->Save
;
9208 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
9210 /* Initially populate the dispatch table with the contents of the
9211 * normal-execution dispatch table. This lets us skip populating functions
9212 * that should be called directly instead of compiled into display lists.
9214 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
9216 _mesa_loopback_init_api_table(ctx
, table
);
9219 vbo_initialize_save_dispatch(ctx
, table
);
9222 SET_Accum(table
, save_Accum
);
9223 SET_AlphaFunc(table
, save_AlphaFunc
);
9224 SET_Bitmap(table
, save_Bitmap
);
9225 SET_BlendFunc(table
, save_BlendFunc
);
9226 SET_CallList(table
, save_CallList
);
9227 SET_CallLists(table
, save_CallLists
);
9228 SET_Clear(table
, save_Clear
);
9229 SET_ClearAccum(table
, save_ClearAccum
);
9230 SET_ClearColor(table
, save_ClearColor
);
9231 SET_ClearDepth(table
, save_ClearDepth
);
9232 SET_ClearIndex(table
, save_ClearIndex
);
9233 SET_ClearStencil(table
, save_ClearStencil
);
9234 SET_ClipPlane(table
, save_ClipPlane
);
9235 SET_ColorMask(table
, save_ColorMask
);
9236 SET_ColorMaski(table
, save_ColorMaskIndexed
);
9237 SET_ColorMaterial(table
, save_ColorMaterial
);
9238 SET_CopyPixels(table
, save_CopyPixels
);
9239 SET_CullFace(table
, save_CullFace
);
9240 SET_DepthFunc(table
, save_DepthFunc
);
9241 SET_DepthMask(table
, save_DepthMask
);
9242 SET_DepthRange(table
, save_DepthRange
);
9243 SET_Disable(table
, save_Disable
);
9244 SET_Disablei(table
, save_DisableIndexed
);
9245 SET_DrawBuffer(table
, save_DrawBuffer
);
9246 SET_DrawPixels(table
, save_DrawPixels
);
9247 SET_Enable(table
, save_Enable
);
9248 SET_Enablei(table
, save_EnableIndexed
);
9249 SET_EvalMesh1(table
, save_EvalMesh1
);
9250 SET_EvalMesh2(table
, save_EvalMesh2
);
9251 SET_Fogf(table
, save_Fogf
);
9252 SET_Fogfv(table
, save_Fogfv
);
9253 SET_Fogi(table
, save_Fogi
);
9254 SET_Fogiv(table
, save_Fogiv
);
9255 SET_FrontFace(table
, save_FrontFace
);
9256 SET_Frustum(table
, save_Frustum
);
9257 SET_Hint(table
, save_Hint
);
9258 SET_IndexMask(table
, save_IndexMask
);
9259 SET_InitNames(table
, save_InitNames
);
9260 SET_LightModelf(table
, save_LightModelf
);
9261 SET_LightModelfv(table
, save_LightModelfv
);
9262 SET_LightModeli(table
, save_LightModeli
);
9263 SET_LightModeliv(table
, save_LightModeliv
);
9264 SET_Lightf(table
, save_Lightf
);
9265 SET_Lightfv(table
, save_Lightfv
);
9266 SET_Lighti(table
, save_Lighti
);
9267 SET_Lightiv(table
, save_Lightiv
);
9268 SET_LineStipple(table
, save_LineStipple
);
9269 SET_LineWidth(table
, save_LineWidth
);
9270 SET_ListBase(table
, save_ListBase
);
9271 SET_LoadIdentity(table
, save_LoadIdentity
);
9272 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9273 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9274 SET_LoadName(table
, save_LoadName
);
9275 SET_LogicOp(table
, save_LogicOp
);
9276 SET_Map1d(table
, save_Map1d
);
9277 SET_Map1f(table
, save_Map1f
);
9278 SET_Map2d(table
, save_Map2d
);
9279 SET_Map2f(table
, save_Map2f
);
9280 SET_MapGrid1d(table
, save_MapGrid1d
);
9281 SET_MapGrid1f(table
, save_MapGrid1f
);
9282 SET_MapGrid2d(table
, save_MapGrid2d
);
9283 SET_MapGrid2f(table
, save_MapGrid2f
);
9284 SET_MatrixMode(table
, save_MatrixMode
);
9285 SET_MultMatrixd(table
, save_MultMatrixd
);
9286 SET_MultMatrixf(table
, save_MultMatrixf
);
9287 SET_NewList(table
, save_NewList
);
9288 SET_Ortho(table
, save_Ortho
);
9289 SET_PassThrough(table
, save_PassThrough
);
9290 SET_PixelMapfv(table
, save_PixelMapfv
);
9291 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9292 SET_PixelMapusv(table
, save_PixelMapusv
);
9293 SET_PixelTransferf(table
, save_PixelTransferf
);
9294 SET_PixelTransferi(table
, save_PixelTransferi
);
9295 SET_PixelZoom(table
, save_PixelZoom
);
9296 SET_PointSize(table
, save_PointSize
);
9297 SET_PolygonMode(table
, save_PolygonMode
);
9298 SET_PolygonOffset(table
, save_PolygonOffset
);
9299 SET_PolygonStipple(table
, save_PolygonStipple
);
9300 SET_PopAttrib(table
, save_PopAttrib
);
9301 SET_PopMatrix(table
, save_PopMatrix
);
9302 SET_PopName(table
, save_PopName
);
9303 SET_PushAttrib(table
, save_PushAttrib
);
9304 SET_PushMatrix(table
, save_PushMatrix
);
9305 SET_PushName(table
, save_PushName
);
9306 SET_RasterPos2d(table
, save_RasterPos2d
);
9307 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9308 SET_RasterPos2f(table
, save_RasterPos2f
);
9309 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9310 SET_RasterPos2i(table
, save_RasterPos2i
);
9311 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9312 SET_RasterPos2s(table
, save_RasterPos2s
);
9313 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9314 SET_RasterPos3d(table
, save_RasterPos3d
);
9315 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9316 SET_RasterPos3f(table
, save_RasterPos3f
);
9317 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9318 SET_RasterPos3i(table
, save_RasterPos3i
);
9319 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9320 SET_RasterPos3s(table
, save_RasterPos3s
);
9321 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9322 SET_RasterPos4d(table
, save_RasterPos4d
);
9323 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9324 SET_RasterPos4f(table
, save_RasterPos4f
);
9325 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9326 SET_RasterPos4i(table
, save_RasterPos4i
);
9327 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9328 SET_RasterPos4s(table
, save_RasterPos4s
);
9329 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9330 SET_ReadBuffer(table
, save_ReadBuffer
);
9331 SET_Rectf(table
, save_Rectf
);
9332 SET_Rotated(table
, save_Rotated
);
9333 SET_Rotatef(table
, save_Rotatef
);
9334 SET_Scaled(table
, save_Scaled
);
9335 SET_Scalef(table
, save_Scalef
);
9336 SET_Scissor(table
, save_Scissor
);
9337 SET_ShadeModel(table
, save_ShadeModel
);
9338 SET_StencilFunc(table
, save_StencilFunc
);
9339 SET_StencilMask(table
, save_StencilMask
);
9340 SET_StencilOp(table
, save_StencilOp
);
9341 SET_TexEnvf(table
, save_TexEnvf
);
9342 SET_TexEnvfv(table
, save_TexEnvfv
);
9343 SET_TexEnvi(table
, save_TexEnvi
);
9344 SET_TexEnviv(table
, save_TexEnviv
);
9345 SET_TexGend(table
, save_TexGend
);
9346 SET_TexGendv(table
, save_TexGendv
);
9347 SET_TexGenf(table
, save_TexGenf
);
9348 SET_TexGenfv(table
, save_TexGenfv
);
9349 SET_TexGeni(table
, save_TexGeni
);
9350 SET_TexGeniv(table
, save_TexGeniv
);
9351 SET_TexImage1D(table
, save_TexImage1D
);
9352 SET_TexImage2D(table
, save_TexImage2D
);
9353 SET_TexParameterf(table
, save_TexParameterf
);
9354 SET_TexParameterfv(table
, save_TexParameterfv
);
9355 SET_TexParameteri(table
, save_TexParameteri
);
9356 SET_TexParameteriv(table
, save_TexParameteriv
);
9357 SET_Translated(table
, save_Translated
);
9358 SET_Translatef(table
, save_Translatef
);
9359 SET_Viewport(table
, save_Viewport
);
9362 SET_BindTexture(table
, save_BindTexture
);
9363 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9364 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9365 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9366 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9367 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9368 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9369 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9372 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9373 SET_TexImage3D(table
, save_TexImage3D
);
9374 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9377 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9378 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9379 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9381 /* ATI_separate_stencil */
9382 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9384 /* GL_ARB_imaging */
9385 /* Not all are supported */
9386 SET_BlendColor(table
, save_BlendColor
);
9387 SET_BlendEquation(table
, save_BlendEquation
);
9389 /* 2. GL_EXT_blend_color */
9391 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9394 /* 3. GL_EXT_polygon_offset */
9395 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9397 /* 6. GL_EXT_texture3d */
9399 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9400 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9401 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9404 /* 37. GL_EXT_blend_minmax */
9406 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9409 /* 54. GL_EXT_point_parameters */
9410 SET_PointParameterf(table
, save_PointParameterfEXT
);
9411 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
9413 /* 173. GL_EXT_blend_func_separate */
9414 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
9416 /* 197. GL_MESA_window_pos */
9417 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
9418 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
9419 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
9420 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
9421 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
9422 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
9423 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
9424 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
9425 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
9426 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
9427 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
9428 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
9429 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
9430 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
9431 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
9432 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
9433 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9434 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9435 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9436 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9437 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9438 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9439 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9440 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9442 /* 233. GL_NV_vertex_program */
9443 /* The following commands DO NOT go into display lists:
9444 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9445 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9447 SET_BindProgramARB(table
, save_BindProgramNV
);
9449 /* 245. GL_ATI_fragment_shader */
9450 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9451 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9453 /* 262. GL_NV_point_sprite */
9454 SET_PointParameteri(table
, save_PointParameteriNV
);
9455 SET_PointParameteriv(table
, save_PointParameterivNV
);
9457 /* 268. GL_EXT_stencil_two_side */
9458 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9460 /* ???. GL_EXT_depth_bounds_test */
9461 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9463 /* ARB 1. GL_ARB_multitexture */
9464 SET_ActiveTexture(table
, save_ActiveTextureARB
);
9466 /* ARB 3. GL_ARB_transpose_matrix */
9467 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
9468 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
9469 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
9470 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
9472 /* ARB 5. GL_ARB_multisample */
9473 SET_SampleCoverage(table
, save_SampleCoverageARB
);
9475 /* ARB 12. GL_ARB_texture_compression */
9476 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
9477 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
9478 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
9479 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
9480 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
9481 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
9483 /* ARB 14. GL_ARB_point_parameters */
9484 /* aliased with EXT_point_parameters functions */
9486 /* ARB 25. GL_ARB_window_pos */
9487 /* aliased with MESA_window_pos functions */
9489 /* ARB 26. GL_ARB_vertex_program */
9490 /* ARB 27. GL_ARB_fragment_program */
9491 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9492 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9493 SET_BindProgramARB(table
, save_BindProgramNV
);
9494 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9495 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9496 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9497 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9498 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9499 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9500 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9501 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9503 SET_BeginQuery(table
, save_BeginQueryARB
);
9504 SET_EndQuery(table
, save_EndQueryARB
);
9505 SET_QueryCounter(table
, save_QueryCounter
);
9507 SET_DrawBuffers(table
, save_DrawBuffersARB
);
9509 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
9511 SET_UseProgram(table
, save_UseProgramObjectARB
);
9512 SET_Uniform1f(table
, save_Uniform1fARB
);
9513 SET_Uniform2f(table
, save_Uniform2fARB
);
9514 SET_Uniform3f(table
, save_Uniform3fARB
);
9515 SET_Uniform4f(table
, save_Uniform4fARB
);
9516 SET_Uniform1fv(table
, save_Uniform1fvARB
);
9517 SET_Uniform2fv(table
, save_Uniform2fvARB
);
9518 SET_Uniform3fv(table
, save_Uniform3fvARB
);
9519 SET_Uniform4fv(table
, save_Uniform4fvARB
);
9520 SET_Uniform1i(table
, save_Uniform1iARB
);
9521 SET_Uniform2i(table
, save_Uniform2iARB
);
9522 SET_Uniform3i(table
, save_Uniform3iARB
);
9523 SET_Uniform4i(table
, save_Uniform4iARB
);
9524 SET_Uniform1iv(table
, save_Uniform1ivARB
);
9525 SET_Uniform2iv(table
, save_Uniform2ivARB
);
9526 SET_Uniform3iv(table
, save_Uniform3ivARB
);
9527 SET_Uniform4iv(table
, save_Uniform4ivARB
);
9528 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
9529 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
9530 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
9531 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9532 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9533 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9534 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9535 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9536 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9538 /* 299. GL_EXT_blend_equation_separate */
9539 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
9541 /* GL_EXT_gpu_program_parameters */
9542 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9543 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9545 /* 364. GL_EXT_provoking_vertex */
9546 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
9548 /* GL_EXT_texture_integer */
9549 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
9550 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
9551 SET_TexParameterIiv(table
, save_TexParameterIiv
);
9552 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
9554 /* GL_ARB_color_buffer_float */
9555 SET_ClampColor(table
, save_ClampColorARB
);
9558 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9559 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9560 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9561 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9563 SET_Uniform1ui(table
, save_Uniform1ui
);
9564 SET_Uniform2ui(table
, save_Uniform2ui
);
9565 SET_Uniform3ui(table
, save_Uniform3ui
);
9566 SET_Uniform4ui(table
, save_Uniform4ui
);
9567 SET_Uniform1uiv(table
, save_Uniform1uiv
);
9568 SET_Uniform2uiv(table
, save_Uniform2uiv
);
9569 SET_Uniform3uiv(table
, save_Uniform3uiv
);
9570 SET_Uniform4uiv(table
, save_Uniform4uiv
);
9572 (void) save_Uniform1ui
;
9573 (void) save_Uniform2ui
;
9574 (void) save_Uniform3ui
;
9575 (void) save_Uniform4ui
;
9576 (void) save_Uniform1uiv
;
9577 (void) save_Uniform2uiv
;
9578 (void) save_Uniform3uiv
;
9579 (void) save_Uniform4uiv
;
9583 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
9584 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
9585 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
9586 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
9587 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
9588 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
9589 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
9590 SET_DrawTransformFeedbackInstanced(table
,
9591 save_DrawTransformFeedbackInstanced
);
9592 SET_DrawTransformFeedbackStreamInstanced(table
,
9593 save_DrawTransformFeedbackStreamInstanced
);
9594 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
9595 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
9597 /* GL_ARB_instanced_arrays */
9598 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
9600 /* GL_NV_texture_barrier */
9601 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
9603 SET_BindSampler(table
, save_BindSampler
);
9604 SET_SamplerParameteri(table
, save_SamplerParameteri
);
9605 SET_SamplerParameterf(table
, save_SamplerParameterf
);
9606 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
9607 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
9608 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
9609 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
9611 /* GL_ARB_draw_buffer_blend */
9612 SET_BlendFunciARB(table
, save_BlendFunci
);
9613 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
9614 SET_BlendEquationiARB(table
, save_BlendEquationi
);
9615 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
9617 /* GL_ARB_geometry_shader4 */
9618 SET_ProgramParameteri(table
, save_ProgramParameteri
);
9619 SET_FramebufferTexture(table
, save_FramebufferTexture
);
9620 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
9622 /* GL_NV_conditional_render */
9623 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
9624 SET_EndConditionalRender(table
, save_EndConditionalRender
);
9627 SET_WaitSync(table
, save_WaitSync
);
9629 /* GL_ARB_uniform_buffer_object */
9630 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
9632 /* GL_ARB_draw_instanced */
9633 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
9634 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
9636 /* GL_ARB_draw_elements_base_vertex */
9637 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
9639 /* GL_ARB_base_instance */
9640 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
9641 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
9642 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
9644 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
9645 SET_UseProgramStages(table
, save_UseProgramStages
);
9646 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
9647 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
9648 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
9649 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
9650 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
9651 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
9652 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
9653 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
9654 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
9655 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
9656 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
9657 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
9658 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
9659 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
9660 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
9661 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
9662 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
9663 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
9664 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
9665 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
9666 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
9667 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
9668 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
9669 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
9670 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
9671 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
9672 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
9673 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
9674 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
9675 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
9676 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
9677 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
9678 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
9684 enum_string(GLenum k
)
9686 return _mesa_lookup_enum_by_nr(k
);
9691 * Print the commands in a display list. For debugging only.
9692 * TODO: many commands aren't handled yet.
9694 static void GLAPIENTRY
9695 print_list(struct gl_context
*ctx
, GLuint list
)
9697 struct gl_display_list
*dlist
;
9701 if (!islist(ctx
, list
)) {
9702 printf("%u is not a display list ID\n", list
);
9706 dlist
= _mesa_lookup_list(ctx
, list
);
9712 printf("START-LIST %u, address %p\n", list
, (void *) n
);
9714 done
= n
? GL_FALSE
: GL_TRUE
;
9716 const OpCode opcode
= n
[0].opcode
;
9718 if (is_ext_opcode(opcode
)) {
9719 n
+= ext_opcode_print(ctx
, n
);
9724 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9727 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9728 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9729 get_pointer(&n
[7]));
9731 case OPCODE_CALL_LIST
:
9732 printf("CallList %d\n", (int) n
[1].ui
);
9734 case OPCODE_CALL_LIST_OFFSET
:
9735 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9736 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9738 case OPCODE_DISABLE
:
9739 printf("Disable %s\n", enum_string(n
[1].e
));
9742 printf("Enable %s\n", enum_string(n
[1].e
));
9744 case OPCODE_FRUSTUM
:
9745 printf("Frustum %g %g %g %g %g %g\n",
9746 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9748 case OPCODE_LINE_STIPPLE
:
9749 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9751 case OPCODE_LOAD_IDENTITY
:
9752 printf("LoadIdentity\n");
9754 case OPCODE_LOAD_MATRIX
:
9755 printf("LoadMatrix\n");
9756 printf(" %8f %8f %8f %8f\n",
9757 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9758 printf(" %8f %8f %8f %8f\n",
9759 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9760 printf(" %8f %8f %8f %8f\n",
9761 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9762 printf(" %8f %8f %8f %8f\n",
9763 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9765 case OPCODE_MULT_MATRIX
:
9766 printf("MultMatrix (or Rotate)\n");
9767 printf(" %8f %8f %8f %8f\n",
9768 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9769 printf(" %8f %8f %8f %8f\n",
9770 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9771 printf(" %8f %8f %8f %8f\n",
9772 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9773 printf(" %8f %8f %8f %8f\n",
9774 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9777 printf("Ortho %g %g %g %g %g %g\n",
9778 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9780 case OPCODE_POP_ATTRIB
:
9781 printf("PopAttrib\n");
9783 case OPCODE_POP_MATRIX
:
9784 printf("PopMatrix\n");
9786 case OPCODE_POP_NAME
:
9787 printf("PopName\n");
9789 case OPCODE_PUSH_ATTRIB
:
9790 printf("PushAttrib %x\n", n
[1].bf
);
9792 case OPCODE_PUSH_MATRIX
:
9793 printf("PushMatrix\n");
9795 case OPCODE_PUSH_NAME
:
9796 printf("PushName %d\n", (int) n
[1].ui
);
9798 case OPCODE_RASTER_POS
:
9799 printf("RasterPos %g %g %g %g\n",
9800 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9803 printf("Rotate %g %g %g %g\n",
9804 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9807 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9809 case OPCODE_TRANSLATE
:
9810 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9812 case OPCODE_BIND_TEXTURE
:
9813 printf("BindTexture %s %d\n",
9814 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9816 case OPCODE_SHADE_MODEL
:
9817 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9820 printf("Map1 %s %.3f %.3f %d %d\n",
9821 _mesa_lookup_enum_by_nr(n
[1].ui
),
9822 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9825 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9826 _mesa_lookup_enum_by_nr(n
[1].ui
),
9827 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9828 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9830 case OPCODE_MAPGRID1
:
9831 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9833 case OPCODE_MAPGRID2
:
9834 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9835 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9837 case OPCODE_EVALMESH1
:
9838 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9840 case OPCODE_EVALMESH2
:
9841 printf("EvalMesh2 %d %d %d %d\n",
9842 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9845 case OPCODE_ATTR_1F_NV
:
9846 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9848 case OPCODE_ATTR_2F_NV
:
9849 printf("ATTR_2F_NV attr %d: %f %f\n",
9850 n
[1].i
, n
[2].f
, n
[3].f
);
9852 case OPCODE_ATTR_3F_NV
:
9853 printf("ATTR_3F_NV attr %d: %f %f %f\n",
9854 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9856 case OPCODE_ATTR_4F_NV
:
9857 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9858 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9860 case OPCODE_ATTR_1F_ARB
:
9861 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9863 case OPCODE_ATTR_2F_ARB
:
9864 printf("ATTR_2F_ARB attr %d: %f %f\n",
9865 n
[1].i
, n
[2].f
, n
[3].f
);
9867 case OPCODE_ATTR_3F_ARB
:
9868 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9869 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9871 case OPCODE_ATTR_4F_ARB
:
9872 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9873 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9876 case OPCODE_MATERIAL
:
9877 printf("MATERIAL %x %x: %f %f %f %f\n",
9878 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9881 printf("BEGIN %x\n", n
[1].i
);
9887 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9890 case OPCODE_EVAL_C1
:
9891 printf("EVAL_C1 %f\n", n
[1].f
);
9893 case OPCODE_EVAL_C2
:
9894 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9896 case OPCODE_EVAL_P1
:
9897 printf("EVAL_P1 %d\n", n
[1].i
);
9899 case OPCODE_EVAL_P2
:
9900 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9903 case OPCODE_PROVOKING_VERTEX
:
9904 printf("ProvokingVertex %s\n",
9905 _mesa_lookup_enum_by_nr(n
[1].ui
));
9909 * meta opcodes/commands
9912 printf("Error: %s %s\n", enum_string(n
[1].e
),
9913 (const char *) get_pointer(&n
[2]));
9915 case OPCODE_CONTINUE
:
9916 printf("DISPLAY-LIST-CONTINUE\n");
9917 n
= (Node
*) get_pointer(&n
[1]);
9919 case OPCODE_END_OF_LIST
:
9920 printf("END-LIST %u\n", list
);
9924 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9926 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9927 opcode
, (void *) n
);
9931 printf("command %d, %u operands\n", opcode
,
9935 /* increment n to point to next compiled command */
9936 if (opcode
!= OPCODE_CONTINUE
) {
9937 n
+= InstSize
[opcode
];
9946 * Clients may call this function to help debug display list problems.
9947 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9948 * changed, or break in the future without notice.
9951 mesa_print_display_list(GLuint list
)
9953 GET_CURRENT_CONTEXT(ctx
);
9954 print_list(ctx
, list
);
9958 /**********************************************************************/
9959 /***** Initialization *****/
9960 /**********************************************************************/
9963 save_vtxfmt_init(GLvertexformat
* vfmt
)
9965 vfmt
->ArrayElement
= _ae_ArrayElement
;
9967 vfmt
->Begin
= save_Begin
;
9969 vfmt
->CallList
= save_CallList
;
9970 vfmt
->CallLists
= save_CallLists
;
9972 vfmt
->Color3f
= save_Color3f
;
9973 vfmt
->Color3fv
= save_Color3fv
;
9974 vfmt
->Color4f
= save_Color4f
;
9975 vfmt
->Color4fv
= save_Color4fv
;
9976 vfmt
->EdgeFlag
= save_EdgeFlag
;
9977 vfmt
->End
= save_End
;
9979 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
9980 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
9981 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
9982 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
9983 vfmt
->EvalPoint1
= save_EvalPoint1
;
9984 vfmt
->EvalPoint2
= save_EvalPoint2
;
9986 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9987 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9988 vfmt
->Indexf
= save_Indexf
;
9989 vfmt
->Indexfv
= save_Indexfv
;
9990 vfmt
->Materialfv
= save_Materialfv
;
9991 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9992 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9993 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9994 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9995 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9996 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9997 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9998 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9999 vfmt
->Normal3f
= save_Normal3f
;
10000 vfmt
->Normal3fv
= save_Normal3fv
;
10001 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10002 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10003 vfmt
->TexCoord1f
= save_TexCoord1f
;
10004 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10005 vfmt
->TexCoord2f
= save_TexCoord2f
;
10006 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10007 vfmt
->TexCoord3f
= save_TexCoord3f
;
10008 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10009 vfmt
->TexCoord4f
= save_TexCoord4f
;
10010 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10011 vfmt
->Vertex2f
= save_Vertex2f
;
10012 vfmt
->Vertex2fv
= save_Vertex2fv
;
10013 vfmt
->Vertex3f
= save_Vertex3f
;
10014 vfmt
->Vertex3fv
= save_Vertex3fv
;
10015 vfmt
->Vertex4f
= save_Vertex4f
;
10016 vfmt
->Vertex4fv
= save_Vertex4fv
;
10017 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10018 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10019 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10020 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10021 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10022 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10023 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10024 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10029 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10030 const GLvertexformat
*vfmt
)
10032 SET_CallList(disp
, vfmt
->CallList
);
10033 SET_CallLists(disp
, vfmt
->CallLists
);
10038 * Initialize display list state for given context.
10041 _mesa_init_display_list(struct gl_context
*ctx
)
10043 static GLboolean tableInitialized
= GL_FALSE
;
10045 /* zero-out the instruction size table, just once */
10046 if (!tableInitialized
) {
10047 memset(InstSize
, 0, sizeof(InstSize
));
10048 tableInitialized
= GL_TRUE
;
10051 /* extension info */
10052 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10055 ctx
->ListState
.CallDepth
= 0;
10056 ctx
->ExecuteFlag
= GL_TRUE
;
10057 ctx
->CompileFlag
= GL_FALSE
;
10058 ctx
->ListState
.CurrentBlock
= NULL
;
10059 ctx
->ListState
.CurrentPos
= 0;
10061 /* Display List group */
10062 ctx
->List
.ListBase
= 0;
10064 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10069 _mesa_free_display_list_data(struct gl_context
*ctx
)
10071 free(ctx
->ListExt
);
10072 ctx
->ListExt
= NULL
;