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
, FILE *f
);
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_clip_control */
404 /* GL_ARB_color_buffer_float */
407 /* GL_EXT_framebuffer_blit */
408 OPCODE_BLIT_FRAMEBUFFER
,
410 /* Vertex attributes -- fallback for when optimized display
411 * list build isn't active.
430 /* GL_EXT_provoking_vertex */
431 OPCODE_PROVOKING_VERTEX
,
433 /* GL_EXT_transform_feedback */
434 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
435 OPCODE_END_TRANSFORM_FEEDBACK
,
436 OPCODE_BIND_TRANSFORM_FEEDBACK
,
437 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
438 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
439 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
441 /* GL_EXT_texture_integer */
443 OPCODE_CLEARCOLOR_UI
,
444 OPCODE_TEXPARAMETER_I
,
445 OPCODE_TEXPARAMETER_UI
,
447 /* GL_ARB_instanced_arrays */
448 OPCODE_VERTEX_ATTRIB_DIVISOR
,
450 /* GL_NV_texture_barrier */
451 OPCODE_TEXTURE_BARRIER_NV
,
453 /* GL_ARB_sampler_object */
455 OPCODE_SAMPLER_PARAMETERIV
,
456 OPCODE_SAMPLER_PARAMETERFV
,
457 OPCODE_SAMPLER_PARAMETERIIV
,
458 OPCODE_SAMPLER_PARAMETERUIV
,
460 /* GL_ARB_geometry_shader4 */
461 OPCODE_PROGRAM_PARAMETERI
,
462 OPCODE_FRAMEBUFFER_TEXTURE
,
463 OPCODE_FRAMEBUFFER_TEXTURE_FACE
,
468 /* GL_NV_conditional_render */
469 OPCODE_BEGIN_CONDITIONAL_RENDER
,
470 OPCODE_END_CONDITIONAL_RENDER
,
472 /* ARB_timer_query */
473 OPCODE_QUERY_COUNTER
,
475 /* ARB_transform_feedback3 */
476 OPCODE_BEGIN_QUERY_INDEXED
,
477 OPCODE_END_QUERY_INDEXED
,
478 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
480 /* ARB_transform_feedback_instanced */
481 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
482 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
484 /* ARB_uniform_buffer_object */
485 OPCODE_UNIFORM_BLOCK_BINDING
,
487 /* The following three are meta instructions */
488 OPCODE_ERROR
, /* raise compiled-in error */
499 * Display list instructions are stored as sequences of "nodes". Nodes
500 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
501 * are linked together with a pointer.
503 * Each instruction in the display list is stored as a sequence of
504 * contiguous nodes in memory.
505 * Each node is the union of a variety of data types.
507 * Note, all of these members should be 4 bytes in size or less for the
508 * sake of compact display lists. We store 8-byte pointers in a pair of
509 * these nodes using the save/get_pointer() functions below.
527 typedef union gl_dlist_node Node
;
530 /** How many 4-byte dwords to store a pointer */
531 #define POINTER_DWORDS (sizeof(void *) / 4)
533 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
534 * space for display lists. The following types and functions are
535 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
540 GLuint dwords
[POINTER_DWORDS
];
545 * Save a 4 or 8-byte pointer at dest (and dest+1).
548 save_pointer(union gl_dlist_node
*dest
, void *src
)
553 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
554 STATIC_ASSERT(sizeof(union gl_dlist_node
) == 4);
558 for (i
= 0; i
< POINTER_DWORDS
; i
++)
559 dest
[i
].ui
= p
.dwords
[i
];
564 * Retrieve a 4 or 8-byte pointer from node (node+1).
567 get_pointer(const union gl_dlist_node
*node
)
572 for (i
= 0; i
< POINTER_DWORDS
; i
++)
573 p
.dwords
[i
] = node
[i
].ui
;
580 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
581 * environment. In 64-bit env, sizeof(Node)==8 anyway.
591 * How many nodes to allocate at a time. Note that bulk vertex data
592 * from glBegin/glVertex/glEnd primitives will typically wind up in
593 * a VBO, and not directly in the display list itself.
595 #define BLOCK_SIZE 256
600 * Number of nodes of storage needed for each instruction.
601 * Sizes for dynamically allocated opcodes are stored in the context struct.
603 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
606 void mesa_print_display_list(GLuint list
);
610 * Allocate a gl_display_list object with an initial block of storage.
611 * \param count how many display list nodes/tokes to allocate
613 static struct gl_display_list
*
614 make_list(GLuint name
, GLuint count
)
616 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
618 dlist
->Head
= malloc(sizeof(Node
) * count
);
619 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
625 * Lookup function to just encapsulate casting.
627 struct gl_display_list
*
628 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
630 return (struct gl_display_list
*)
631 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
635 /** Is the given opcode an extension code? */
636 static inline GLboolean
637 is_ext_opcode(OpCode opcode
)
639 return (opcode
>= OPCODE_EXT_0
);
643 /** Destroy an extended opcode instruction */
645 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
647 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
649 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
650 step
= ctx
->ListExt
->Opcode
[i
].Size
;
655 /** Execute an extended opcode instruction */
657 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
659 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
661 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
662 step
= ctx
->ListExt
->Opcode
[i
].Size
;
667 /** Print an extended opcode instruction */
669 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
671 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
673 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
674 step
= ctx
->ListExt
->Opcode
[i
].Size
;
680 * Delete the named display list, but don't remove from hash table.
681 * \param dlist - display list pointer
684 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
689 n
= block
= dlist
->Head
;
691 done
= block
? GL_FALSE
: GL_TRUE
;
693 const OpCode opcode
= n
[0].opcode
;
695 /* check for extension opcodes first */
696 if (is_ext_opcode(opcode
)) {
697 n
+= ext_opcode_destroy(ctx
, n
);
701 /* for some commands, we need to free malloc'd memory */
703 free(get_pointer(&n
[6]));
704 n
+= InstSize
[n
[0].opcode
];
707 free(get_pointer(&n
[10]));
708 n
+= InstSize
[n
[0].opcode
];
710 case OPCODE_DRAW_PIXELS
:
711 free(get_pointer(&n
[5]));
712 n
+= InstSize
[n
[0].opcode
];
715 free(get_pointer(&n
[7]));
716 n
+= InstSize
[n
[0].opcode
];
718 case OPCODE_POLYGON_STIPPLE
:
719 free(get_pointer(&n
[1]));
720 n
+= InstSize
[n
[0].opcode
];
722 case OPCODE_TEX_IMAGE1D
:
723 free(get_pointer(&n
[8]));
724 n
+= InstSize
[n
[0].opcode
];
726 case OPCODE_TEX_IMAGE2D
:
727 free(get_pointer(&n
[9]));
728 n
+= InstSize
[n
[0].opcode
];
730 case OPCODE_TEX_IMAGE3D
:
731 free(get_pointer(&n
[10]));
732 n
+= InstSize
[n
[0].opcode
];
734 case OPCODE_TEX_SUB_IMAGE1D
:
735 free(get_pointer(&n
[7]));
736 n
+= InstSize
[n
[0].opcode
];
738 case OPCODE_TEX_SUB_IMAGE2D
:
739 free(get_pointer(&n
[9]));
740 n
+= InstSize
[n
[0].opcode
];
742 case OPCODE_TEX_SUB_IMAGE3D
:
743 free(get_pointer(&n
[11]));
744 n
+= InstSize
[n
[0].opcode
];
746 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
747 free(get_pointer(&n
[7]));
748 n
+= InstSize
[n
[0].opcode
];
750 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
751 free(get_pointer(&n
[8]));
752 n
+= InstSize
[n
[0].opcode
];
754 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
755 free(get_pointer(&n
[9]));
756 n
+= InstSize
[n
[0].opcode
];
758 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
759 free(get_pointer(&n
[7]));
760 n
+= InstSize
[n
[0].opcode
];
762 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
763 free(get_pointer(&n
[9]));
764 n
+= InstSize
[n
[0].opcode
];
766 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
767 free(get_pointer(&n
[11]));
768 n
+= InstSize
[n
[0].opcode
];
770 case OPCODE_PROGRAM_STRING_ARB
:
771 free(get_pointer(&n
[4])); /* program string */
772 n
+= InstSize
[n
[0].opcode
];
774 case OPCODE_UNIFORM_1FV
:
775 case OPCODE_UNIFORM_2FV
:
776 case OPCODE_UNIFORM_3FV
:
777 case OPCODE_UNIFORM_4FV
:
778 case OPCODE_UNIFORM_1IV
:
779 case OPCODE_UNIFORM_2IV
:
780 case OPCODE_UNIFORM_3IV
:
781 case OPCODE_UNIFORM_4IV
:
782 case OPCODE_UNIFORM_1UIV
:
783 case OPCODE_UNIFORM_2UIV
:
784 case OPCODE_UNIFORM_3UIV
:
785 case OPCODE_UNIFORM_4UIV
:
786 free(get_pointer(&n
[3]));
787 n
+= InstSize
[n
[0].opcode
];
789 case OPCODE_UNIFORM_MATRIX22
:
790 case OPCODE_UNIFORM_MATRIX33
:
791 case OPCODE_UNIFORM_MATRIX44
:
792 case OPCODE_UNIFORM_MATRIX24
:
793 case OPCODE_UNIFORM_MATRIX42
:
794 case OPCODE_UNIFORM_MATRIX23
:
795 case OPCODE_UNIFORM_MATRIX32
:
796 case OPCODE_UNIFORM_MATRIX34
:
797 case OPCODE_UNIFORM_MATRIX43
:
798 free(get_pointer(&n
[4]));
799 n
+= InstSize
[n
[0].opcode
];
801 case OPCODE_PROGRAM_UNIFORM_1FV
:
802 case OPCODE_PROGRAM_UNIFORM_2FV
:
803 case OPCODE_PROGRAM_UNIFORM_3FV
:
804 case OPCODE_PROGRAM_UNIFORM_4FV
:
805 case OPCODE_PROGRAM_UNIFORM_1IV
:
806 case OPCODE_PROGRAM_UNIFORM_2IV
:
807 case OPCODE_PROGRAM_UNIFORM_3IV
:
808 case OPCODE_PROGRAM_UNIFORM_4IV
:
809 case OPCODE_PROGRAM_UNIFORM_1UIV
:
810 case OPCODE_PROGRAM_UNIFORM_2UIV
:
811 case OPCODE_PROGRAM_UNIFORM_3UIV
:
812 case OPCODE_PROGRAM_UNIFORM_4UIV
:
813 free(get_pointer(&n
[4]));
814 n
+= InstSize
[n
[0].opcode
];
816 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
817 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
818 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
819 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
820 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
821 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
822 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
823 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
824 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
825 free(get_pointer(&n
[5]));
826 n
+= InstSize
[n
[0].opcode
];
828 case OPCODE_PIXEL_MAP
:
829 free(get_pointer(&n
[3]));
830 n
+= InstSize
[n
[0].opcode
];
833 case OPCODE_CONTINUE
:
834 n
= (Node
*) get_pointer(&n
[1]);
838 case OPCODE_END_OF_LIST
:
843 /* Most frequent case */
844 n
+= InstSize
[n
[0].opcode
];
856 * Destroy a display list and remove from hash table.
857 * \param list - display list number
860 destroy_list(struct gl_context
*ctx
, GLuint list
)
862 struct gl_display_list
*dlist
;
867 dlist
= _mesa_lookup_list(ctx
, list
);
871 _mesa_delete_list(ctx
, dlist
);
872 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
877 * Translate the nth element of list from <type> to GLint.
880 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
892 bptr
= (GLbyte
*) list
;
893 return (GLint
) bptr
[n
];
894 case GL_UNSIGNED_BYTE
:
895 ubptr
= (GLubyte
*) list
;
896 return (GLint
) ubptr
[n
];
898 sptr
= (GLshort
*) list
;
899 return (GLint
) sptr
[n
];
900 case GL_UNSIGNED_SHORT
:
901 usptr
= (GLushort
*) list
;
902 return (GLint
) usptr
[n
];
904 iptr
= (GLint
*) list
;
906 case GL_UNSIGNED_INT
:
907 uiptr
= (GLuint
*) list
;
908 return (GLint
) uiptr
[n
];
910 fptr
= (GLfloat
*) list
;
911 return (GLint
) FLOORF(fptr
[n
]);
913 ubptr
= ((GLubyte
*) list
) + 2 * n
;
914 return (GLint
) ubptr
[0] * 256
917 ubptr
= ((GLubyte
*) list
) + 3 * n
;
918 return (GLint
) ubptr
[0] * 65536
919 + (GLint
) ubptr
[1] * 256
922 ubptr
= ((GLubyte
*) list
) + 4 * n
;
923 return (GLint
) ubptr
[0] * 16777216
924 + (GLint
) ubptr
[1] * 65536
925 + (GLint
) ubptr
[2] * 256
934 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
935 * If width < 0 or height < 0 or format or type are invalid we'll just
936 * return NULL. We will not generate an error since OpenGL command
937 * arguments aren't error-checked until the command is actually executed
938 * (not when they're compiled).
939 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
942 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
943 GLsizei width
, GLsizei height
, GLsizei depth
,
944 GLenum format
, GLenum type
, const GLvoid
* pixels
,
945 const struct gl_pixelstore_attrib
*unpack
)
947 if (width
<= 0 || height
<= 0) {
951 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
952 /* bad format and/or type */
956 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
960 if (type
== GL_BITMAP
)
961 image
= _mesa_unpack_bitmap(width
, height
, pixels
, unpack
);
963 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
964 format
, type
, pixels
, unpack
);
965 if (pixels
&& !image
) {
966 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
970 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
971 depth
, format
, type
, INT_MAX
, pixels
)) {
972 const GLubyte
*map
, *src
;
976 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
977 GL_MAP_READ_BIT
, unpack
->BufferObj
,
980 /* unable to map src buffer! */
981 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
985 src
= ADD_POINTERS(map
, pixels
);
986 if (type
== GL_BITMAP
)
987 image
= _mesa_unpack_bitmap(width
, height
, src
, unpack
);
989 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
990 format
, type
, src
, unpack
);
992 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
995 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1001 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1006 /** Return copy of memory */
1008 memdup(const void *src
, GLsizei bytes
)
1010 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1012 memcpy(b
, src
, bytes
);
1018 * Allocate space for a display list instruction (opcode + payload space).
1019 * \param opcode the instruction opcode (OPCODE_* value)
1020 * \param bytes instruction payload size (not counting opcode)
1021 * \return pointer to allocated memory (the opcode space)
1024 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
1026 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1027 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1030 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
1031 if (InstSize
[opcode
] == 0) {
1032 /* save instruction size now */
1033 InstSize
[opcode
] = numNodes
;
1036 /* make sure instruction size agrees */
1037 ASSERT(numNodes
== InstSize
[opcode
]);
1041 if (ctx
->ListState
.CurrentPos
+ numNodes
+ contNodes
> BLOCK_SIZE
) {
1042 /* This block is full. Allocate a new block and chain to it */
1044 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1045 n
[0].opcode
= OPCODE_CONTINUE
;
1046 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1048 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1051 save_pointer(&n
[1], newblock
);
1052 ctx
->ListState
.CurrentBlock
= newblock
;
1053 ctx
->ListState
.CurrentPos
= 0;
1056 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1057 ctx
->ListState
.CurrentPos
+= numNodes
;
1059 n
[0].opcode
= opcode
;
1067 * Allocate space for a display list instruction. Used by callers outside
1068 * this file for things like VBO vertex data.
1070 * \param opcode the instruction opcode (OPCODE_* value)
1071 * \param bytes instruction size in bytes, not counting opcode.
1072 * \return pointer to the usable data area (not including the internal
1076 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1078 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1080 return n
+ 1; /* return pointer to payload area, after opcode */
1087 * This function allows modules and drivers to get their own opcodes
1088 * for extending display list functionality.
1089 * \param ctx the rendering context
1090 * \param size number of bytes for storing the new display list command
1091 * \param execute function to execute the new display list command
1092 * \param destroy function to destroy the new display list command
1093 * \param print function to print the new display list command
1094 * \return the new opcode number or -1 if error
1097 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1099 void (*execute
) (struct gl_context
*, void *),
1100 void (*destroy
) (struct gl_context
*, void *),
1101 void (*print
) (struct gl_context
*, void *, FILE *))
1103 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1104 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1105 ctx
->ListExt
->Opcode
[i
].Size
=
1106 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1107 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1108 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1109 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1110 return i
+ OPCODE_EXT_0
;
1117 * Allocate space for a display list instruction. The space is basically
1118 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1119 * function parameter, node[2] is the second parameter, etc.
1121 * \param opcode one of OPCODE_x
1122 * \param nparams number of function parameters
1123 * \return pointer to start of instruction space
1125 static inline Node
*
1126 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1128 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1133 * Called by EndList to try to reduce memory used for the list.
1136 trim_list(struct gl_context
*ctx
)
1138 /* If the list we're ending only has one allocated block of nodes/tokens
1139 * and its size isn't a full block size, realloc the block to use less
1140 * memory. This is important for apps that create many small display
1141 * lists and apps that use glXUseXFont (many lists each containing one
1143 * Note: we currently only trim display lists that allocated one block
1144 * of tokens. That hits the short list case which is what we're mainly
1145 * concerned with. Trimming longer lists would involve traversing the
1146 * linked list of blocks.
1148 struct gl_dlist_state
*list
= &ctx
->ListState
;
1150 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1151 (list
->CurrentPos
< BLOCK_SIZE
)) {
1152 /* There's only one block and it's not full, so realloc */
1153 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1154 list
->CurrentList
->Head
=
1155 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1156 if (!list
->CurrentBlock
) {
1157 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1165 * Display List compilation functions
1167 static void GLAPIENTRY
1168 save_Accum(GLenum op
, GLfloat value
)
1170 GET_CURRENT_CONTEXT(ctx
);
1172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1173 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1178 if (ctx
->ExecuteFlag
) {
1179 CALL_Accum(ctx
->Exec
, (op
, value
));
1184 static void GLAPIENTRY
1185 save_AlphaFunc(GLenum func
, GLclampf ref
)
1187 GET_CURRENT_CONTEXT(ctx
);
1189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1190 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1193 n
[2].f
= (GLfloat
) ref
;
1195 if (ctx
->ExecuteFlag
) {
1196 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1201 static void GLAPIENTRY
1202 save_BindTexture(GLenum target
, GLuint texture
)
1204 GET_CURRENT_CONTEXT(ctx
);
1206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1207 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1212 if (ctx
->ExecuteFlag
) {
1213 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1218 static void GLAPIENTRY
1219 save_Bitmap(GLsizei width
, GLsizei height
,
1220 GLfloat xorig
, GLfloat yorig
,
1221 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1223 GET_CURRENT_CONTEXT(ctx
);
1225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1226 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1228 n
[1].i
= (GLint
) width
;
1229 n
[2].i
= (GLint
) height
;
1235 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1236 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1238 if (ctx
->ExecuteFlag
) {
1239 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1240 xorig
, yorig
, xmove
, ymove
, pixels
));
1245 static void GLAPIENTRY
1246 save_BlendEquation(GLenum mode
)
1248 GET_CURRENT_CONTEXT(ctx
);
1250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1251 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1255 if (ctx
->ExecuteFlag
) {
1256 CALL_BlendEquation(ctx
->Exec
, (mode
));
1261 static void GLAPIENTRY
1262 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1264 GET_CURRENT_CONTEXT(ctx
);
1266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1267 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1272 if (ctx
->ExecuteFlag
) {
1273 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1278 static void GLAPIENTRY
1279 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1280 GLenum sfactorA
, GLenum dfactorA
)
1282 GET_CURRENT_CONTEXT(ctx
);
1284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1285 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1287 n
[1].e
= sfactorRGB
;
1288 n
[2].e
= dfactorRGB
;
1292 if (ctx
->ExecuteFlag
) {
1293 CALL_BlendFuncSeparate(ctx
->Exec
,
1294 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1299 static void GLAPIENTRY
1300 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1302 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1306 static void GLAPIENTRY
1307 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1309 GET_CURRENT_CONTEXT(ctx
);
1311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1312 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1319 if (ctx
->ExecuteFlag
) {
1320 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1324 /* GL_ARB_draw_buffers_blend */
1325 static void GLAPIENTRY
1326 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1327 GLenum sfactorA
, GLenum dfactorA
)
1329 GET_CURRENT_CONTEXT(ctx
);
1331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1332 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1335 n
[2].e
= sfactorRGB
;
1336 n
[3].e
= dfactorRGB
;
1340 if (ctx
->ExecuteFlag
) {
1341 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1342 sfactorA
, dfactorA
));
1346 /* GL_ARB_draw_buffers_blend */
1347 static void GLAPIENTRY
1348 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1350 GET_CURRENT_CONTEXT(ctx
);
1352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1353 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1359 if (ctx
->ExecuteFlag
) {
1360 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1364 /* GL_ARB_draw_buffers_blend */
1365 static void GLAPIENTRY
1366 save_BlendEquationi(GLuint buf
, GLenum mode
)
1368 GET_CURRENT_CONTEXT(ctx
);
1370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1371 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1376 if (ctx
->ExecuteFlag
) {
1377 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1381 /* GL_ARB_draw_buffers_blend */
1382 static void GLAPIENTRY
1383 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1385 GET_CURRENT_CONTEXT(ctx
);
1387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1388 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1394 if (ctx
->ExecuteFlag
) {
1395 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1400 /* GL_ARB_draw_instanced. */
1401 static void GLAPIENTRY
1402 save_DrawArraysInstancedARB(GLenum mode
,
1407 GET_CURRENT_CONTEXT(ctx
);
1408 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1409 "glDrawArraysInstanced() during display list compile");
1412 static void GLAPIENTRY
1413 save_DrawElementsInstancedARB(GLenum mode
,
1416 const GLvoid
*indices
,
1419 GET_CURRENT_CONTEXT(ctx
);
1420 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1421 "glDrawElementsInstanced() during display list compile");
1424 static void GLAPIENTRY
1425 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1428 const GLvoid
*indices
,
1432 GET_CURRENT_CONTEXT(ctx
);
1433 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1434 "glDrawElementsInstancedBaseVertex() during display list compile");
1437 /* GL_ARB_base_instance. */
1438 static void GLAPIENTRY
1439 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1443 GLuint baseinstance
)
1445 GET_CURRENT_CONTEXT(ctx
);
1446 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1447 "glDrawArraysInstancedBaseInstance() during display list compile");
1450 static void APIENTRY
1451 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1454 const void *indices
,
1456 GLuint baseinstance
)
1458 GET_CURRENT_CONTEXT(ctx
);
1459 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1460 "glDrawElementsInstancedBaseInstance() during display list compile");
1463 static void APIENTRY
1464 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1467 const void *indices
,
1470 GLuint baseinstance
)
1472 GET_CURRENT_CONTEXT(ctx
);
1473 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1474 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1479 * While building a display list we cache some OpenGL state.
1480 * Under some circumstances we need to invalidate that state (immediately
1481 * when we start compiling a list, or after glCallList(s)).
1484 invalidate_saved_current_state(struct gl_context
*ctx
)
1488 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1489 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1491 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1492 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1494 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1496 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1500 static void GLAPIENTRY
1501 save_CallList(GLuint list
)
1503 GET_CURRENT_CONTEXT(ctx
);
1505 SAVE_FLUSH_VERTICES(ctx
);
1507 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1512 /* After this, we don't know what state we're in. Invalidate all
1513 * cached information previously gathered:
1515 invalidate_saved_current_state( ctx
);
1517 if (ctx
->ExecuteFlag
) {
1518 _mesa_CallList(list
);
1523 static void GLAPIENTRY
1524 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1526 GET_CURRENT_CONTEXT(ctx
);
1528 GLboolean typeErrorFlag
;
1530 SAVE_FLUSH_VERTICES(ctx
);
1534 case GL_UNSIGNED_BYTE
:
1536 case GL_UNSIGNED_SHORT
:
1538 case GL_UNSIGNED_INT
:
1543 typeErrorFlag
= GL_FALSE
;
1546 typeErrorFlag
= GL_TRUE
;
1549 for (i
= 0; i
< num
; i
++) {
1550 GLint list
= translate_id(i
, type
, lists
);
1551 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1554 n
[2].b
= typeErrorFlag
;
1558 /* After this, we don't know what state we're in. Invalidate all
1559 * cached information previously gathered:
1561 invalidate_saved_current_state( ctx
);
1563 if (ctx
->ExecuteFlag
) {
1564 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1569 static void GLAPIENTRY
1570 save_Clear(GLbitfield mask
)
1572 GET_CURRENT_CONTEXT(ctx
);
1574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1575 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1579 if (ctx
->ExecuteFlag
) {
1580 CALL_Clear(ctx
->Exec
, (mask
));
1585 static void GLAPIENTRY
1586 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1588 GET_CURRENT_CONTEXT(ctx
);
1590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1591 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1594 n
[2].i
= drawbuffer
;
1596 if (buffer
== GL_COLOR
) {
1607 if (ctx
->ExecuteFlag
) {
1608 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1613 static void GLAPIENTRY
1614 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1616 GET_CURRENT_CONTEXT(ctx
);
1618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1619 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1622 n
[2].i
= drawbuffer
;
1624 if (buffer
== GL_COLOR
) {
1635 if (ctx
->ExecuteFlag
) {
1636 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1641 static void GLAPIENTRY
1642 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1644 GET_CURRENT_CONTEXT(ctx
);
1646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1647 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1650 n
[2].i
= drawbuffer
;
1652 if (buffer
== GL_COLOR
) {
1663 if (ctx
->ExecuteFlag
) {
1664 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1669 static void GLAPIENTRY
1670 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1671 GLfloat depth
, GLint stencil
)
1673 GET_CURRENT_CONTEXT(ctx
);
1675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1676 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1679 n
[2].i
= drawbuffer
;
1683 if (ctx
->ExecuteFlag
) {
1684 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1689 static void GLAPIENTRY
1690 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1692 GET_CURRENT_CONTEXT(ctx
);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1695 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1702 if (ctx
->ExecuteFlag
) {
1703 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1708 static void GLAPIENTRY
1709 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1711 GET_CURRENT_CONTEXT(ctx
);
1713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1714 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1721 if (ctx
->ExecuteFlag
) {
1722 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1727 static void GLAPIENTRY
1728 save_ClearDepth(GLclampd depth
)
1730 GET_CURRENT_CONTEXT(ctx
);
1732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1733 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1735 n
[1].f
= (GLfloat
) depth
;
1737 if (ctx
->ExecuteFlag
) {
1738 CALL_ClearDepth(ctx
->Exec
, (depth
));
1743 static void GLAPIENTRY
1744 save_ClearIndex(GLfloat c
)
1746 GET_CURRENT_CONTEXT(ctx
);
1748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1749 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1753 if (ctx
->ExecuteFlag
) {
1754 CALL_ClearIndex(ctx
->Exec
, (c
));
1759 static void GLAPIENTRY
1760 save_ClearStencil(GLint s
)
1762 GET_CURRENT_CONTEXT(ctx
);
1764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1765 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1769 if (ctx
->ExecuteFlag
) {
1770 CALL_ClearStencil(ctx
->Exec
, (s
));
1775 static void GLAPIENTRY
1776 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1778 GET_CURRENT_CONTEXT(ctx
);
1780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1781 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1784 n
[2].f
= (GLfloat
) equ
[0];
1785 n
[3].f
= (GLfloat
) equ
[1];
1786 n
[4].f
= (GLfloat
) equ
[2];
1787 n
[5].f
= (GLfloat
) equ
[3];
1789 if (ctx
->ExecuteFlag
) {
1790 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1796 static void GLAPIENTRY
1797 save_ColorMask(GLboolean red
, GLboolean green
,
1798 GLboolean blue
, GLboolean alpha
)
1800 GET_CURRENT_CONTEXT(ctx
);
1802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1803 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1810 if (ctx
->ExecuteFlag
) {
1811 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1816 static void GLAPIENTRY
1817 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1818 GLboolean blue
, GLboolean alpha
)
1820 GET_CURRENT_CONTEXT(ctx
);
1822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1823 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1831 if (ctx
->ExecuteFlag
) {
1832 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
1837 static void GLAPIENTRY
1838 save_ColorMaterial(GLenum face
, GLenum mode
)
1840 GET_CURRENT_CONTEXT(ctx
);
1842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1844 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1849 if (ctx
->ExecuteFlag
) {
1850 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1855 static void GLAPIENTRY
1856 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1858 GET_CURRENT_CONTEXT(ctx
);
1860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1861 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1865 n
[3].i
= (GLint
) width
;
1866 n
[4].i
= (GLint
) height
;
1869 if (ctx
->ExecuteFlag
) {
1870 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1876 static void GLAPIENTRY
1877 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1878 GLint x
, GLint y
, GLsizei width
, GLint border
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1887 n
[3].e
= internalformat
;
1893 if (ctx
->ExecuteFlag
) {
1894 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1895 x
, y
, width
, border
));
1900 static void GLAPIENTRY
1901 save_CopyTexImage2D(GLenum target
, GLint level
,
1902 GLenum internalformat
,
1903 GLint x
, GLint y
, GLsizei width
,
1904 GLsizei height
, GLint border
)
1906 GET_CURRENT_CONTEXT(ctx
);
1908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1909 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1913 n
[3].e
= internalformat
;
1920 if (ctx
->ExecuteFlag
) {
1921 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1922 x
, y
, width
, height
, border
));
1928 static void GLAPIENTRY
1929 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1930 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1932 GET_CURRENT_CONTEXT(ctx
);
1934 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1935 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1944 if (ctx
->ExecuteFlag
) {
1945 CALL_CopyTexSubImage1D(ctx
->Exec
,
1946 (target
, level
, xoffset
, x
, y
, width
));
1951 static void GLAPIENTRY
1952 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1953 GLint xoffset
, GLint yoffset
,
1954 GLint x
, GLint y
, GLsizei width
, GLint height
)
1956 GET_CURRENT_CONTEXT(ctx
);
1958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1959 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1970 if (ctx
->ExecuteFlag
) {
1971 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1972 x
, y
, width
, height
));
1977 static void GLAPIENTRY
1978 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1979 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1980 GLint x
, GLint y
, GLsizei width
, GLint height
)
1982 GET_CURRENT_CONTEXT(ctx
);
1984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1985 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1997 if (ctx
->ExecuteFlag
) {
1998 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1999 xoffset
, yoffset
, zoffset
,
2000 x
, y
, width
, height
));
2005 static void GLAPIENTRY
2006 save_CullFace(GLenum mode
)
2008 GET_CURRENT_CONTEXT(ctx
);
2010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2011 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2015 if (ctx
->ExecuteFlag
) {
2016 CALL_CullFace(ctx
->Exec
, (mode
));
2021 static void GLAPIENTRY
2022 save_DepthFunc(GLenum func
)
2024 GET_CURRENT_CONTEXT(ctx
);
2026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2027 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2031 if (ctx
->ExecuteFlag
) {
2032 CALL_DepthFunc(ctx
->Exec
, (func
));
2037 static void GLAPIENTRY
2038 save_DepthMask(GLboolean mask
)
2040 GET_CURRENT_CONTEXT(ctx
);
2042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2043 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2047 if (ctx
->ExecuteFlag
) {
2048 CALL_DepthMask(ctx
->Exec
, (mask
));
2053 static void GLAPIENTRY
2054 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2056 GET_CURRENT_CONTEXT(ctx
);
2058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2059 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2061 n
[1].f
= (GLfloat
) nearval
;
2062 n
[2].f
= (GLfloat
) farval
;
2064 if (ctx
->ExecuteFlag
) {
2065 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2070 static void GLAPIENTRY
2071 save_Disable(GLenum cap
)
2073 GET_CURRENT_CONTEXT(ctx
);
2075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2076 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2080 if (ctx
->ExecuteFlag
) {
2081 CALL_Disable(ctx
->Exec
, (cap
));
2086 static void GLAPIENTRY
2087 save_DisableIndexed(GLuint index
, GLenum cap
)
2089 GET_CURRENT_CONTEXT(ctx
);
2091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2092 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2097 if (ctx
->ExecuteFlag
) {
2098 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2103 static void GLAPIENTRY
2104 save_DrawBuffer(GLenum mode
)
2106 GET_CURRENT_CONTEXT(ctx
);
2108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2109 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2113 if (ctx
->ExecuteFlag
) {
2114 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2119 static void GLAPIENTRY
2120 save_DrawPixels(GLsizei width
, GLsizei height
,
2121 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2123 GET_CURRENT_CONTEXT(ctx
);
2126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2128 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2135 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2136 pixels
, &ctx
->Unpack
));
2138 if (ctx
->ExecuteFlag
) {
2139 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2145 static void GLAPIENTRY
2146 save_Enable(GLenum cap
)
2148 GET_CURRENT_CONTEXT(ctx
);
2150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2151 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2155 if (ctx
->ExecuteFlag
) {
2156 CALL_Enable(ctx
->Exec
, (cap
));
2162 static void GLAPIENTRY
2163 save_EnableIndexed(GLuint index
, GLenum cap
)
2165 GET_CURRENT_CONTEXT(ctx
);
2167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2168 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2173 if (ctx
->ExecuteFlag
) {
2174 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2180 static void GLAPIENTRY
2181 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2183 GET_CURRENT_CONTEXT(ctx
);
2185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2186 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2192 if (ctx
->ExecuteFlag
) {
2193 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2198 static void GLAPIENTRY
2199 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2201 GET_CURRENT_CONTEXT(ctx
);
2203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2204 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2212 if (ctx
->ExecuteFlag
) {
2213 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2220 static void GLAPIENTRY
2221 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2234 if (ctx
->ExecuteFlag
) {
2235 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2240 static void GLAPIENTRY
2241 save_Fogf(GLenum pname
, GLfloat param
)
2245 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2246 save_Fogfv(pname
, parray
);
2250 static void GLAPIENTRY
2251 save_Fogiv(GLenum pname
, const GLint
*params
)
2256 case GL_FOG_DENSITY
:
2260 p
[0] = (GLfloat
) *params
;
2266 p
[0] = INT_TO_FLOAT(params
[0]);
2267 p
[1] = INT_TO_FLOAT(params
[1]);
2268 p
[2] = INT_TO_FLOAT(params
[2]);
2269 p
[3] = INT_TO_FLOAT(params
[3]);
2272 /* Error will be caught later in gl_Fogfv */
2273 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2275 save_Fogfv(pname
, p
);
2279 static void GLAPIENTRY
2280 save_Fogi(GLenum pname
, GLint param
)
2284 parray
[1] = parray
[2] = parray
[3] = 0;
2285 save_Fogiv(pname
, parray
);
2289 static void GLAPIENTRY
2290 save_FrontFace(GLenum mode
)
2292 GET_CURRENT_CONTEXT(ctx
);
2294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2295 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2299 if (ctx
->ExecuteFlag
) {
2300 CALL_FrontFace(ctx
->Exec
, (mode
));
2305 static void GLAPIENTRY
2306 save_Frustum(GLdouble left
, GLdouble right
,
2307 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2309 GET_CURRENT_CONTEXT(ctx
);
2311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2312 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2314 n
[1].f
= (GLfloat
) left
;
2315 n
[2].f
= (GLfloat
) right
;
2316 n
[3].f
= (GLfloat
) bottom
;
2317 n
[4].f
= (GLfloat
) top
;
2318 n
[5].f
= (GLfloat
) nearval
;
2319 n
[6].f
= (GLfloat
) farval
;
2321 if (ctx
->ExecuteFlag
) {
2322 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2327 static void GLAPIENTRY
2328 save_Hint(GLenum target
, GLenum mode
)
2330 GET_CURRENT_CONTEXT(ctx
);
2332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2333 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2338 if (ctx
->ExecuteFlag
) {
2339 CALL_Hint(ctx
->Exec
, (target
, mode
));
2344 static void GLAPIENTRY
2345 save_IndexMask(GLuint mask
)
2347 GET_CURRENT_CONTEXT(ctx
);
2349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2350 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2354 if (ctx
->ExecuteFlag
) {
2355 CALL_IndexMask(ctx
->Exec
, (mask
));
2360 static void GLAPIENTRY
2361 save_InitNames(void)
2363 GET_CURRENT_CONTEXT(ctx
);
2364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2365 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2366 if (ctx
->ExecuteFlag
) {
2367 CALL_InitNames(ctx
->Exec
, ());
2372 static void GLAPIENTRY
2373 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2375 GET_CURRENT_CONTEXT(ctx
);
2377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2378 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2396 case GL_SPOT_DIRECTION
:
2399 case GL_SPOT_EXPONENT
:
2402 case GL_SPOT_CUTOFF
:
2405 case GL_CONSTANT_ATTENUATION
:
2408 case GL_LINEAR_ATTENUATION
:
2411 case GL_QUADRATIC_ATTENUATION
:
2417 for (i
= 0; i
< nParams
; i
++) {
2418 n
[3 + i
].f
= params
[i
];
2421 if (ctx
->ExecuteFlag
) {
2422 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2427 static void GLAPIENTRY
2428 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2432 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2433 save_Lightfv(light
, pname
, parray
);
2437 static void GLAPIENTRY
2438 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2445 fparam
[0] = INT_TO_FLOAT(params
[0]);
2446 fparam
[1] = INT_TO_FLOAT(params
[1]);
2447 fparam
[2] = INT_TO_FLOAT(params
[2]);
2448 fparam
[3] = INT_TO_FLOAT(params
[3]);
2451 fparam
[0] = (GLfloat
) params
[0];
2452 fparam
[1] = (GLfloat
) params
[1];
2453 fparam
[2] = (GLfloat
) params
[2];
2454 fparam
[3] = (GLfloat
) params
[3];
2456 case GL_SPOT_DIRECTION
:
2457 fparam
[0] = (GLfloat
) params
[0];
2458 fparam
[1] = (GLfloat
) params
[1];
2459 fparam
[2] = (GLfloat
) params
[2];
2461 case GL_SPOT_EXPONENT
:
2462 case GL_SPOT_CUTOFF
:
2463 case GL_CONSTANT_ATTENUATION
:
2464 case GL_LINEAR_ATTENUATION
:
2465 case GL_QUADRATIC_ATTENUATION
:
2466 fparam
[0] = (GLfloat
) params
[0];
2469 /* error will be caught later in gl_Lightfv */
2472 save_Lightfv(light
, pname
, fparam
);
2476 static void GLAPIENTRY
2477 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2481 parray
[1] = parray
[2] = parray
[3] = 0;
2482 save_Lightiv(light
, pname
, parray
);
2486 static void GLAPIENTRY
2487 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2489 GET_CURRENT_CONTEXT(ctx
);
2491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2492 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2500 if (ctx
->ExecuteFlag
) {
2501 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2506 static void GLAPIENTRY
2507 save_LightModelf(GLenum pname
, GLfloat param
)
2511 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2512 save_LightModelfv(pname
, parray
);
2516 static void GLAPIENTRY
2517 save_LightModeliv(GLenum pname
, const GLint
*params
)
2521 case GL_LIGHT_MODEL_AMBIENT
:
2522 fparam
[0] = INT_TO_FLOAT(params
[0]);
2523 fparam
[1] = INT_TO_FLOAT(params
[1]);
2524 fparam
[2] = INT_TO_FLOAT(params
[2]);
2525 fparam
[3] = INT_TO_FLOAT(params
[3]);
2527 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2528 case GL_LIGHT_MODEL_TWO_SIDE
:
2529 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2530 fparam
[0] = (GLfloat
) params
[0];
2536 /* Error will be caught later in gl_LightModelfv */
2537 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2539 save_LightModelfv(pname
, fparam
);
2543 static void GLAPIENTRY
2544 save_LightModeli(GLenum pname
, GLint param
)
2548 parray
[1] = parray
[2] = parray
[3] = 0;
2549 save_LightModeliv(pname
, parray
);
2553 static void GLAPIENTRY
2554 save_LineStipple(GLint factor
, GLushort pattern
)
2556 GET_CURRENT_CONTEXT(ctx
);
2558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2559 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2564 if (ctx
->ExecuteFlag
) {
2565 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2570 static void GLAPIENTRY
2571 save_LineWidth(GLfloat width
)
2573 GET_CURRENT_CONTEXT(ctx
);
2575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2576 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2580 if (ctx
->ExecuteFlag
) {
2581 CALL_LineWidth(ctx
->Exec
, (width
));
2586 static void GLAPIENTRY
2587 save_ListBase(GLuint base
)
2589 GET_CURRENT_CONTEXT(ctx
);
2591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2592 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2596 if (ctx
->ExecuteFlag
) {
2597 CALL_ListBase(ctx
->Exec
, (base
));
2602 static void GLAPIENTRY
2603 save_LoadIdentity(void)
2605 GET_CURRENT_CONTEXT(ctx
);
2606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2607 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2608 if (ctx
->ExecuteFlag
) {
2609 CALL_LoadIdentity(ctx
->Exec
, ());
2614 static void GLAPIENTRY
2615 save_LoadMatrixf(const GLfloat
* m
)
2617 GET_CURRENT_CONTEXT(ctx
);
2619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2620 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2623 for (i
= 0; i
< 16; i
++) {
2627 if (ctx
->ExecuteFlag
) {
2628 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2633 static void GLAPIENTRY
2634 save_LoadMatrixd(const GLdouble
* m
)
2638 for (i
= 0; i
< 16; i
++) {
2639 f
[i
] = (GLfloat
) m
[i
];
2641 save_LoadMatrixf(f
);
2645 static void GLAPIENTRY
2646 save_LoadName(GLuint name
)
2648 GET_CURRENT_CONTEXT(ctx
);
2650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2651 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2655 if (ctx
->ExecuteFlag
) {
2656 CALL_LoadName(ctx
->Exec
, (name
));
2661 static void GLAPIENTRY
2662 save_LogicOp(GLenum opcode
)
2664 GET_CURRENT_CONTEXT(ctx
);
2666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2667 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2671 if (ctx
->ExecuteFlag
) {
2672 CALL_LogicOp(ctx
->Exec
, (opcode
));
2677 static void GLAPIENTRY
2678 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2679 GLint order
, const GLdouble
* points
)
2681 GET_CURRENT_CONTEXT(ctx
);
2683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2684 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2686 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2688 n
[2].f
= (GLfloat
) u1
;
2689 n
[3].f
= (GLfloat
) u2
;
2690 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2692 save_pointer(&n
[6], pnts
);
2694 if (ctx
->ExecuteFlag
) {
2695 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2699 static void GLAPIENTRY
2700 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2701 GLint order
, const GLfloat
* points
)
2703 GET_CURRENT_CONTEXT(ctx
);
2705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2706 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2708 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2712 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2714 save_pointer(&n
[6], pnts
);
2716 if (ctx
->ExecuteFlag
) {
2717 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2722 static void GLAPIENTRY
2723 save_Map2d(GLenum target
,
2724 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2725 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2726 const GLdouble
* points
)
2728 GET_CURRENT_CONTEXT(ctx
);
2730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2731 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2733 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2734 vstride
, vorder
, points
);
2736 n
[2].f
= (GLfloat
) u1
;
2737 n
[3].f
= (GLfloat
) u2
;
2738 n
[4].f
= (GLfloat
) v1
;
2739 n
[5].f
= (GLfloat
) v2
;
2740 /* XXX verify these strides are correct */
2741 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2742 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2745 save_pointer(&n
[10], pnts
);
2747 if (ctx
->ExecuteFlag
) {
2748 CALL_Map2d(ctx
->Exec
, (target
,
2749 u1
, u2
, ustride
, uorder
,
2750 v1
, v2
, vstride
, vorder
, points
));
2755 static void GLAPIENTRY
2756 save_Map2f(GLenum target
,
2757 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2758 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2759 const GLfloat
* points
)
2761 GET_CURRENT_CONTEXT(ctx
);
2763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2764 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2766 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2767 vstride
, vorder
, points
);
2773 /* XXX verify these strides are correct */
2774 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2775 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2778 save_pointer(&n
[10], pnts
);
2780 if (ctx
->ExecuteFlag
) {
2781 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2782 v1
, v2
, vstride
, vorder
, points
));
2787 static void GLAPIENTRY
2788 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2790 GET_CURRENT_CONTEXT(ctx
);
2792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2793 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2805 static void GLAPIENTRY
2806 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2808 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2812 static void GLAPIENTRY
2813 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2814 GLint vn
, GLfloat v1
, GLfloat v2
)
2816 GET_CURRENT_CONTEXT(ctx
);
2818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2819 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2828 if (ctx
->ExecuteFlag
) {
2829 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2835 static void GLAPIENTRY
2836 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2837 GLint vn
, GLdouble v1
, GLdouble v2
)
2839 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2840 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2844 static void GLAPIENTRY
2845 save_MatrixMode(GLenum mode
)
2847 GET_CURRENT_CONTEXT(ctx
);
2849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2850 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2854 if (ctx
->ExecuteFlag
) {
2855 CALL_MatrixMode(ctx
->Exec
, (mode
));
2860 static void GLAPIENTRY
2861 save_MultMatrixf(const GLfloat
* m
)
2863 GET_CURRENT_CONTEXT(ctx
);
2865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2866 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2869 for (i
= 0; i
< 16; i
++) {
2873 if (ctx
->ExecuteFlag
) {
2874 CALL_MultMatrixf(ctx
->Exec
, (m
));
2879 static void GLAPIENTRY
2880 save_MultMatrixd(const GLdouble
* m
)
2884 for (i
= 0; i
< 16; i
++) {
2885 f
[i
] = (GLfloat
) m
[i
];
2887 save_MultMatrixf(f
);
2891 static void GLAPIENTRY
2892 save_NewList(GLuint name
, GLenum mode
)
2894 GET_CURRENT_CONTEXT(ctx
);
2895 /* It's an error to call this function while building a display list */
2896 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2903 static void GLAPIENTRY
2904 save_Ortho(GLdouble left
, GLdouble right
,
2905 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2907 GET_CURRENT_CONTEXT(ctx
);
2909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2910 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2912 n
[1].f
= (GLfloat
) left
;
2913 n
[2].f
= (GLfloat
) right
;
2914 n
[3].f
= (GLfloat
) bottom
;
2915 n
[4].f
= (GLfloat
) top
;
2916 n
[5].f
= (GLfloat
) nearval
;
2917 n
[6].f
= (GLfloat
) farval
;
2919 if (ctx
->ExecuteFlag
) {
2920 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2925 static void GLAPIENTRY
2926 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2928 GET_CURRENT_CONTEXT(ctx
);
2930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2931 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
2935 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
2937 if (ctx
->ExecuteFlag
) {
2938 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2943 static void GLAPIENTRY
2944 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2946 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2948 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2949 for (i
= 0; i
< mapsize
; i
++) {
2950 fvalues
[i
] = (GLfloat
) values
[i
];
2954 for (i
= 0; i
< mapsize
; i
++) {
2955 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2958 save_PixelMapfv(map
, mapsize
, fvalues
);
2962 static void GLAPIENTRY
2963 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2965 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2967 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2968 for (i
= 0; i
< mapsize
; i
++) {
2969 fvalues
[i
] = (GLfloat
) values
[i
];
2973 for (i
= 0; i
< mapsize
; i
++) {
2974 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2977 save_PixelMapfv(map
, mapsize
, fvalues
);
2981 static void GLAPIENTRY
2982 save_PixelTransferf(GLenum pname
, GLfloat param
)
2984 GET_CURRENT_CONTEXT(ctx
);
2986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2987 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2992 if (ctx
->ExecuteFlag
) {
2993 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2998 static void GLAPIENTRY
2999 save_PixelTransferi(GLenum pname
, GLint param
)
3001 save_PixelTransferf(pname
, (GLfloat
) param
);
3005 static void GLAPIENTRY
3006 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3008 GET_CURRENT_CONTEXT(ctx
);
3010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3011 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3016 if (ctx
->ExecuteFlag
) {
3017 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3022 static void GLAPIENTRY
3023 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3025 GET_CURRENT_CONTEXT(ctx
);
3027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3028 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3035 if (ctx
->ExecuteFlag
) {
3036 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3041 static void GLAPIENTRY
3042 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3046 parray
[1] = parray
[2] = 0.0F
;
3047 save_PointParameterfvEXT(pname
, parray
);
3050 static void GLAPIENTRY
3051 save_PointParameteriNV(GLenum pname
, GLint param
)
3054 parray
[0] = (GLfloat
) param
;
3055 parray
[1] = parray
[2] = 0.0F
;
3056 save_PointParameterfvEXT(pname
, parray
);
3059 static void GLAPIENTRY
3060 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3063 parray
[0] = (GLfloat
) param
[0];
3064 parray
[1] = parray
[2] = 0.0F
;
3065 save_PointParameterfvEXT(pname
, parray
);
3069 static void GLAPIENTRY
3070 save_PointSize(GLfloat size
)
3072 GET_CURRENT_CONTEXT(ctx
);
3074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3075 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3079 if (ctx
->ExecuteFlag
) {
3080 CALL_PointSize(ctx
->Exec
, (size
));
3085 static void GLAPIENTRY
3086 save_PolygonMode(GLenum face
, GLenum mode
)
3088 GET_CURRENT_CONTEXT(ctx
);
3090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3091 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3096 if (ctx
->ExecuteFlag
) {
3097 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3102 static void GLAPIENTRY
3103 save_PolygonStipple(const GLubyte
* pattern
)
3105 GET_CURRENT_CONTEXT(ctx
);
3108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3110 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3113 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3114 pattern
, &ctx
->Unpack
));
3116 if (ctx
->ExecuteFlag
) {
3117 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3122 static void GLAPIENTRY
3123 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3125 GET_CURRENT_CONTEXT(ctx
);
3127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3128 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3133 if (ctx
->ExecuteFlag
) {
3134 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3139 static void GLAPIENTRY
3140 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3142 GET_CURRENT_CONTEXT(ctx
);
3143 /* XXX mult by DepthMaxF here??? */
3144 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3148 static void GLAPIENTRY
3149 save_PopAttrib(void)
3151 GET_CURRENT_CONTEXT(ctx
);
3152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3153 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3154 if (ctx
->ExecuteFlag
) {
3155 CALL_PopAttrib(ctx
->Exec
, ());
3160 static void GLAPIENTRY
3161 save_PopMatrix(void)
3163 GET_CURRENT_CONTEXT(ctx
);
3164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3165 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3166 if (ctx
->ExecuteFlag
) {
3167 CALL_PopMatrix(ctx
->Exec
, ());
3172 static void GLAPIENTRY
3175 GET_CURRENT_CONTEXT(ctx
);
3176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3177 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3178 if (ctx
->ExecuteFlag
) {
3179 CALL_PopName(ctx
->Exec
, ());
3184 static void GLAPIENTRY
3185 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3186 const GLclampf
* priorities
)
3188 GET_CURRENT_CONTEXT(ctx
);
3190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3192 for (i
= 0; i
< num
; i
++) {
3194 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3196 n
[1].ui
= textures
[i
];
3197 n
[2].f
= priorities
[i
];
3200 if (ctx
->ExecuteFlag
) {
3201 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3206 static void GLAPIENTRY
3207 save_PushAttrib(GLbitfield mask
)
3209 GET_CURRENT_CONTEXT(ctx
);
3211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3212 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3216 if (ctx
->ExecuteFlag
) {
3217 CALL_PushAttrib(ctx
->Exec
, (mask
));
3222 static void GLAPIENTRY
3223 save_PushMatrix(void)
3225 GET_CURRENT_CONTEXT(ctx
);
3226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3227 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3228 if (ctx
->ExecuteFlag
) {
3229 CALL_PushMatrix(ctx
->Exec
, ());
3234 static void GLAPIENTRY
3235 save_PushName(GLuint name
)
3237 GET_CURRENT_CONTEXT(ctx
);
3239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3240 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3244 if (ctx
->ExecuteFlag
) {
3245 CALL_PushName(ctx
->Exec
, (name
));
3250 static void GLAPIENTRY
3251 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3253 GET_CURRENT_CONTEXT(ctx
);
3255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3256 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3263 if (ctx
->ExecuteFlag
) {
3264 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3268 static void GLAPIENTRY
3269 save_RasterPos2d(GLdouble x
, GLdouble y
)
3271 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3274 static void GLAPIENTRY
3275 save_RasterPos2f(GLfloat x
, GLfloat y
)
3277 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3280 static void GLAPIENTRY
3281 save_RasterPos2i(GLint x
, GLint y
)
3283 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3286 static void GLAPIENTRY
3287 save_RasterPos2s(GLshort x
, GLshort y
)
3289 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3292 static void GLAPIENTRY
3293 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3295 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3298 static void GLAPIENTRY
3299 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3301 save_RasterPos4f(x
, y
, z
, 1.0F
);
3304 static void GLAPIENTRY
3305 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3307 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3310 static void GLAPIENTRY
3311 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3313 save_RasterPos4f(x
, y
, z
, 1.0F
);
3316 static void GLAPIENTRY
3317 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3319 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3322 static void GLAPIENTRY
3323 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3325 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3328 static void GLAPIENTRY
3329 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3331 save_RasterPos4f(x
, y
, z
, w
);
3334 static void GLAPIENTRY
3335 save_RasterPos2dv(const GLdouble
* v
)
3337 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3340 static void GLAPIENTRY
3341 save_RasterPos2fv(const GLfloat
* v
)
3343 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3346 static void GLAPIENTRY
3347 save_RasterPos2iv(const GLint
* v
)
3349 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3352 static void GLAPIENTRY
3353 save_RasterPos2sv(const GLshort
* v
)
3355 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3358 static void GLAPIENTRY
3359 save_RasterPos3dv(const GLdouble
* v
)
3361 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3364 static void GLAPIENTRY
3365 save_RasterPos3fv(const GLfloat
* v
)
3367 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3370 static void GLAPIENTRY
3371 save_RasterPos3iv(const GLint
* v
)
3373 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3376 static void GLAPIENTRY
3377 save_RasterPos3sv(const GLshort
* v
)
3379 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3382 static void GLAPIENTRY
3383 save_RasterPos4dv(const GLdouble
* v
)
3385 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3386 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3389 static void GLAPIENTRY
3390 save_RasterPos4fv(const GLfloat
* v
)
3392 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3395 static void GLAPIENTRY
3396 save_RasterPos4iv(const GLint
* v
)
3398 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3399 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3402 static void GLAPIENTRY
3403 save_RasterPos4sv(const GLshort
* v
)
3405 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3409 static void GLAPIENTRY
3410 save_PassThrough(GLfloat token
)
3412 GET_CURRENT_CONTEXT(ctx
);
3414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3415 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3419 if (ctx
->ExecuteFlag
) {
3420 CALL_PassThrough(ctx
->Exec
, (token
));
3425 static void GLAPIENTRY
3426 save_ReadBuffer(GLenum mode
)
3428 GET_CURRENT_CONTEXT(ctx
);
3430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3431 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3435 if (ctx
->ExecuteFlag
) {
3436 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3441 static void GLAPIENTRY
3442 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3444 GET_CURRENT_CONTEXT(ctx
);
3446 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3447 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3454 if (ctx
->ExecuteFlag
) {
3455 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3460 static void GLAPIENTRY
3461 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3463 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3467 static void GLAPIENTRY
3468 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3470 GET_CURRENT_CONTEXT(ctx
);
3472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3473 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3479 if (ctx
->ExecuteFlag
) {
3480 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3485 static void GLAPIENTRY
3486 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3488 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3492 static void GLAPIENTRY
3493 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3495 GET_CURRENT_CONTEXT(ctx
);
3497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3498 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3505 if (ctx
->ExecuteFlag
) {
3506 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3511 static void GLAPIENTRY
3512 save_ShadeModel(GLenum mode
)
3514 GET_CURRENT_CONTEXT(ctx
);
3516 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3518 if (ctx
->ExecuteFlag
) {
3519 CALL_ShadeModel(ctx
->Exec
, (mode
));
3522 /* Don't compile this call if it's a no-op.
3523 * By avoiding this state change we have a better chance of
3524 * coalescing subsequent drawing commands into one batch.
3526 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3529 SAVE_FLUSH_VERTICES(ctx
);
3531 ctx
->ListState
.Current
.ShadeModel
= mode
;
3533 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3540 static void GLAPIENTRY
3541 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3543 GET_CURRENT_CONTEXT(ctx
);
3545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3546 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3552 if (ctx
->ExecuteFlag
) {
3553 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3558 static void GLAPIENTRY
3559 save_StencilMask(GLuint mask
)
3561 GET_CURRENT_CONTEXT(ctx
);
3563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3564 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3568 if (ctx
->ExecuteFlag
) {
3569 CALL_StencilMask(ctx
->Exec
, (mask
));
3574 static void GLAPIENTRY
3575 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3577 GET_CURRENT_CONTEXT(ctx
);
3579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3580 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3586 if (ctx
->ExecuteFlag
) {
3587 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3592 static void GLAPIENTRY
3593 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3595 GET_CURRENT_CONTEXT(ctx
);
3597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3598 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3605 if (ctx
->ExecuteFlag
) {
3606 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3611 static void GLAPIENTRY
3612 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3615 GET_CURRENT_CONTEXT(ctx
);
3617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3619 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3627 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3634 if (ctx
->ExecuteFlag
) {
3635 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3636 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3641 static void GLAPIENTRY
3642 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3644 GET_CURRENT_CONTEXT(ctx
);
3646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3647 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3652 if (ctx
->ExecuteFlag
) {
3653 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3658 static void GLAPIENTRY
3659 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3661 GET_CURRENT_CONTEXT(ctx
);
3663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3664 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3671 if (ctx
->ExecuteFlag
) {
3672 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3677 static void GLAPIENTRY
3678 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3680 GET_CURRENT_CONTEXT(ctx
);
3682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3683 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3687 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3695 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3698 if (ctx
->ExecuteFlag
) {
3699 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3704 static void GLAPIENTRY
3705 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3708 parray
[0] = (GLfloat
) param
;
3709 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3710 save_TexEnvfv(target
, pname
, parray
);
3714 static void GLAPIENTRY
3715 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3718 p
[0] = (GLfloat
) param
;
3719 p
[1] = p
[2] = p
[3] = 0.0F
;
3720 save_TexEnvfv(target
, pname
, p
);
3724 static void GLAPIENTRY
3725 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3728 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3729 p
[0] = INT_TO_FLOAT(param
[0]);
3730 p
[1] = INT_TO_FLOAT(param
[1]);
3731 p
[2] = INT_TO_FLOAT(param
[2]);
3732 p
[3] = INT_TO_FLOAT(param
[3]);
3735 p
[0] = (GLfloat
) param
[0];
3736 p
[1] = p
[2] = p
[3] = 0.0F
;
3738 save_TexEnvfv(target
, pname
, p
);
3742 static void GLAPIENTRY
3743 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3745 GET_CURRENT_CONTEXT(ctx
);
3747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3748 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3757 if (ctx
->ExecuteFlag
) {
3758 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3763 static void GLAPIENTRY
3764 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3767 p
[0] = (GLfloat
) params
[0];
3768 p
[1] = (GLfloat
) params
[1];
3769 p
[2] = (GLfloat
) params
[2];
3770 p
[3] = (GLfloat
) params
[3];
3771 save_TexGenfv(coord
, pname
, p
);
3775 static void GLAPIENTRY
3776 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3779 parray
[0] = (GLfloat
) param
;
3780 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3781 save_TexGenfv(coord
, pname
, parray
);
3785 static void GLAPIENTRY
3786 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3789 p
[0] = (GLfloat
) params
[0];
3790 p
[1] = (GLfloat
) params
[1];
3791 p
[2] = (GLfloat
) params
[2];
3792 p
[3] = (GLfloat
) params
[3];
3793 save_TexGenfv(coord
, pname
, p
);
3797 static void GLAPIENTRY
3798 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3802 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3803 save_TexGenfv(coord
, pname
, parray
);
3807 static void GLAPIENTRY
3808 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3812 parray
[1] = parray
[2] = parray
[3] = 0;
3813 save_TexGeniv(coord
, pname
, parray
);
3817 static void GLAPIENTRY
3818 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3820 GET_CURRENT_CONTEXT(ctx
);
3822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3823 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3832 if (ctx
->ExecuteFlag
) {
3833 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3838 static void GLAPIENTRY
3839 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3843 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3844 save_TexParameterfv(target
, pname
, parray
);
3848 static void GLAPIENTRY
3849 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3852 fparam
[0] = (GLfloat
) param
;
3853 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3854 save_TexParameterfv(target
, pname
, fparam
);
3858 static void GLAPIENTRY
3859 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3862 fparam
[0] = (GLfloat
) params
[0];
3863 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3864 save_TexParameterfv(target
, pname
, fparam
);
3868 static void GLAPIENTRY
3869 save_TexImage1D(GLenum target
,
3870 GLint level
, GLint components
,
3871 GLsizei width
, GLint border
,
3872 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3874 GET_CURRENT_CONTEXT(ctx
);
3875 if (target
== GL_PROXY_TEXTURE_1D
) {
3876 /* don't compile, execute immediately */
3877 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3878 border
, format
, type
, pixels
));
3882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3883 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
3887 n
[3].i
= components
;
3888 n
[4].i
= (GLint
) width
;
3893 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3894 pixels
, &ctx
->Unpack
));
3896 if (ctx
->ExecuteFlag
) {
3897 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3898 border
, format
, type
, pixels
));
3904 static void GLAPIENTRY
3905 save_TexImage2D(GLenum target
,
3906 GLint level
, GLint components
,
3907 GLsizei width
, GLsizei height
, GLint border
,
3908 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3910 GET_CURRENT_CONTEXT(ctx
);
3911 if (target
== GL_PROXY_TEXTURE_2D
) {
3912 /* don't compile, execute immediately */
3913 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3914 height
, border
, format
, type
, pixels
));
3918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3919 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
3923 n
[3].i
= components
;
3924 n
[4].i
= (GLint
) width
;
3925 n
[5].i
= (GLint
) height
;
3930 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3931 pixels
, &ctx
->Unpack
));
3933 if (ctx
->ExecuteFlag
) {
3934 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3935 height
, border
, format
, type
, pixels
));
3941 static void GLAPIENTRY
3942 save_TexImage3D(GLenum target
,
3943 GLint level
, GLint internalFormat
,
3944 GLsizei width
, GLsizei height
, GLsizei depth
,
3946 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3948 GET_CURRENT_CONTEXT(ctx
);
3949 if (target
== GL_PROXY_TEXTURE_3D
) {
3950 /* don't compile, execute immediately */
3951 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3952 height
, depth
, border
, format
, type
,
3957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3958 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
3962 n
[3].i
= (GLint
) internalFormat
;
3963 n
[4].i
= (GLint
) width
;
3964 n
[5].i
= (GLint
) height
;
3965 n
[6].i
= (GLint
) depth
;
3969 save_pointer(&n
[10],
3970 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3971 pixels
, &ctx
->Unpack
));
3973 if (ctx
->ExecuteFlag
) {
3974 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3975 height
, depth
, border
, format
, type
,
3982 static void GLAPIENTRY
3983 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3984 GLsizei width
, GLenum format
, GLenum type
,
3985 const GLvoid
* pixels
)
3987 GET_CURRENT_CONTEXT(ctx
);
3990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3992 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
3997 n
[4].i
= (GLint
) width
;
4001 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4002 pixels
, &ctx
->Unpack
));
4004 if (ctx
->ExecuteFlag
) {
4005 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4006 format
, type
, pixels
));
4011 static void GLAPIENTRY
4012 save_TexSubImage2D(GLenum target
, GLint level
,
4013 GLint xoffset
, GLint yoffset
,
4014 GLsizei width
, GLsizei height
,
4015 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4017 GET_CURRENT_CONTEXT(ctx
);
4020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4022 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4028 n
[5].i
= (GLint
) width
;
4029 n
[6].i
= (GLint
) height
;
4033 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4034 pixels
, &ctx
->Unpack
));
4036 if (ctx
->ExecuteFlag
) {
4037 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4038 width
, height
, format
, type
, pixels
));
4043 static void GLAPIENTRY
4044 save_TexSubImage3D(GLenum target
, GLint level
,
4045 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4046 GLsizei width
, GLsizei height
, GLsizei depth
,
4047 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4049 GET_CURRENT_CONTEXT(ctx
);
4052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4054 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4061 n
[6].i
= (GLint
) width
;
4062 n
[7].i
= (GLint
) height
;
4063 n
[8].i
= (GLint
) depth
;
4066 save_pointer(&n
[11],
4067 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4068 pixels
, &ctx
->Unpack
));
4070 if (ctx
->ExecuteFlag
) {
4071 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4072 xoffset
, yoffset
, zoffset
,
4073 width
, height
, depth
, format
, type
,
4079 static void GLAPIENTRY
4080 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4082 GET_CURRENT_CONTEXT(ctx
);
4084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4085 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4091 if (ctx
->ExecuteFlag
) {
4092 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4097 static void GLAPIENTRY
4098 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4100 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4105 static void GLAPIENTRY
4106 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4108 GET_CURRENT_CONTEXT(ctx
);
4110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4111 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4115 n
[3].i
= (GLint
) width
;
4116 n
[4].i
= (GLint
) height
;
4118 if (ctx
->ExecuteFlag
) {
4119 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4124 static void GLAPIENTRY
4125 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4127 GET_CURRENT_CONTEXT(ctx
);
4129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4130 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4137 if (ctx
->ExecuteFlag
) {
4138 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4142 static void GLAPIENTRY
4143 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4145 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4148 static void GLAPIENTRY
4149 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4151 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4154 static void GLAPIENTRY
4155 save_WindowPos2iMESA(GLint x
, GLint y
)
4157 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4160 static void GLAPIENTRY
4161 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4163 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4166 static void GLAPIENTRY
4167 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4169 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4172 static void GLAPIENTRY
4173 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4175 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4178 static void GLAPIENTRY
4179 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4181 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4184 static void GLAPIENTRY
4185 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4187 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4190 static void GLAPIENTRY
4191 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4193 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4196 static void GLAPIENTRY
4197 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4199 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4202 static void GLAPIENTRY
4203 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4205 save_WindowPos4fMESA(x
, y
, z
, w
);
4208 static void GLAPIENTRY
4209 save_WindowPos2dvMESA(const GLdouble
* v
)
4211 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4214 static void GLAPIENTRY
4215 save_WindowPos2fvMESA(const GLfloat
* v
)
4217 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4220 static void GLAPIENTRY
4221 save_WindowPos2ivMESA(const GLint
* v
)
4223 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4226 static void GLAPIENTRY
4227 save_WindowPos2svMESA(const GLshort
* v
)
4229 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4232 static void GLAPIENTRY
4233 save_WindowPos3dvMESA(const GLdouble
* v
)
4235 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4238 static void GLAPIENTRY
4239 save_WindowPos3fvMESA(const GLfloat
* v
)
4241 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4244 static void GLAPIENTRY
4245 save_WindowPos3ivMESA(const GLint
* v
)
4247 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4250 static void GLAPIENTRY
4251 save_WindowPos3svMESA(const GLshort
* v
)
4253 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4256 static void GLAPIENTRY
4257 save_WindowPos4dvMESA(const GLdouble
* v
)
4259 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4260 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4263 static void GLAPIENTRY
4264 save_WindowPos4fvMESA(const GLfloat
* v
)
4266 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4269 static void GLAPIENTRY
4270 save_WindowPos4ivMESA(const GLint
* v
)
4272 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4273 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4276 static void GLAPIENTRY
4277 save_WindowPos4svMESA(const GLshort
* v
)
4279 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4284 /* GL_ARB_multitexture */
4285 static void GLAPIENTRY
4286 save_ActiveTextureARB(GLenum target
)
4288 GET_CURRENT_CONTEXT(ctx
);
4290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4291 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4295 if (ctx
->ExecuteFlag
) {
4296 CALL_ActiveTexture(ctx
->Exec
, (target
));
4301 /* GL_ARB_transpose_matrix */
4303 static void GLAPIENTRY
4304 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4307 _math_transposefd(tm
, m
);
4308 save_LoadMatrixf(tm
);
4312 static void GLAPIENTRY
4313 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4316 _math_transposef(tm
, m
);
4317 save_LoadMatrixf(tm
);
4321 static void GLAPIENTRY
4322 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4325 _math_transposefd(tm
, m
);
4326 save_MultMatrixf(tm
);
4330 static void GLAPIENTRY
4331 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4334 _math_transposef(tm
, m
);
4335 save_MultMatrixf(tm
);
4338 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4340 GET_CURRENT_CONTEXT(ctx
);
4346 image
= malloc(size
);
4348 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4351 memcpy(image
, data
, size
);
4357 /* GL_ARB_texture_compression */
4358 static void GLAPIENTRY
4359 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4360 GLenum internalFormat
, GLsizei width
,
4361 GLint border
, GLsizei imageSize
,
4362 const GLvoid
* data
)
4364 GET_CURRENT_CONTEXT(ctx
);
4365 if (target
== GL_PROXY_TEXTURE_1D
) {
4366 /* don't compile, execute immediately */
4367 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
4368 width
, border
, imageSize
,
4373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4375 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
4376 6 + POINTER_DWORDS
);
4380 n
[3].e
= internalFormat
;
4381 n
[4].i
= (GLint
) width
;
4385 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
4387 if (ctx
->ExecuteFlag
) {
4388 CALL_CompressedTexImage1D(ctx
->Exec
,
4389 (target
, level
, internalFormat
, width
,
4390 border
, imageSize
, data
));
4396 static void GLAPIENTRY
4397 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4398 GLenum internalFormat
, GLsizei width
,
4399 GLsizei height
, GLint border
, GLsizei imageSize
,
4400 const GLvoid
* data
)
4402 GET_CURRENT_CONTEXT(ctx
);
4403 if (target
== GL_PROXY_TEXTURE_2D
) {
4404 /* don't compile, execute immediately */
4405 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
4406 width
, height
, border
,
4411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4413 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
4414 7 + POINTER_DWORDS
);
4418 n
[3].e
= internalFormat
;
4419 n
[4].i
= (GLint
) width
;
4420 n
[5].i
= (GLint
) height
;
4424 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
4426 if (ctx
->ExecuteFlag
) {
4427 CALL_CompressedTexImage2D(ctx
->Exec
,
4428 (target
, level
, internalFormat
, width
,
4429 height
, border
, imageSize
, data
));
4435 static void GLAPIENTRY
4436 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4437 GLenum internalFormat
, GLsizei width
,
4438 GLsizei height
, GLsizei depth
, GLint border
,
4439 GLsizei imageSize
, const GLvoid
* data
)
4441 GET_CURRENT_CONTEXT(ctx
);
4442 if (target
== GL_PROXY_TEXTURE_3D
) {
4443 /* don't compile, execute immediately */
4444 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
4445 width
, height
, depth
, border
,
4450 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4452 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
4453 8 + POINTER_DWORDS
);
4457 n
[3].e
= internalFormat
;
4458 n
[4].i
= (GLint
) width
;
4459 n
[5].i
= (GLint
) height
;
4460 n
[6].i
= (GLint
) depth
;
4464 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
4466 if (ctx
->ExecuteFlag
) {
4467 CALL_CompressedTexImage3D(ctx
->Exec
,
4468 (target
, level
, internalFormat
, width
,
4469 height
, depth
, border
, imageSize
,
4476 static void GLAPIENTRY
4477 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4478 GLsizei width
, GLenum format
,
4479 GLsizei imageSize
, const GLvoid
* data
)
4482 GET_CURRENT_CONTEXT(ctx
);
4483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4485 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
4486 6 + POINTER_DWORDS
);
4491 n
[4].i
= (GLint
) width
;
4495 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
4497 if (ctx
->ExecuteFlag
) {
4498 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
4499 width
, format
, imageSize
,
4505 static void GLAPIENTRY
4506 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4507 GLint yoffset
, GLsizei width
, GLsizei height
,
4508 GLenum format
, GLsizei imageSize
,
4509 const GLvoid
* data
)
4512 GET_CURRENT_CONTEXT(ctx
);
4513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4515 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
4516 8 + POINTER_DWORDS
);
4522 n
[5].i
= (GLint
) width
;
4523 n
[6].i
= (GLint
) height
;
4527 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
4529 if (ctx
->ExecuteFlag
) {
4530 CALL_CompressedTexSubImage2D(ctx
->Exec
,
4531 (target
, level
, xoffset
, yoffset
, width
,
4532 height
, format
, imageSize
, data
));
4537 static void GLAPIENTRY
4538 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4539 GLint yoffset
, GLint zoffset
, GLsizei width
,
4540 GLsizei height
, GLsizei depth
, GLenum format
,
4541 GLsizei imageSize
, const GLvoid
* data
)
4544 GET_CURRENT_CONTEXT(ctx
);
4545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4547 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
4548 10 + POINTER_DWORDS
);
4555 n
[6].i
= (GLint
) width
;
4556 n
[7].i
= (GLint
) height
;
4557 n
[8].i
= (GLint
) depth
;
4559 n
[10].i
= imageSize
;
4560 save_pointer(&n
[11],
4561 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
4563 if (ctx
->ExecuteFlag
) {
4564 CALL_CompressedTexSubImage3D(ctx
->Exec
,
4565 (target
, level
, xoffset
, yoffset
,
4566 zoffset
, width
, height
, depth
, format
,
4572 /* GL_ARB_multisample */
4573 static void GLAPIENTRY
4574 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4576 GET_CURRENT_CONTEXT(ctx
);
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4579 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4584 if (ctx
->ExecuteFlag
) {
4585 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
4591 * GL_NV_fragment_program
4593 static void GLAPIENTRY
4594 save_BindProgramNV(GLenum target
, GLuint id
)
4596 GET_CURRENT_CONTEXT(ctx
);
4598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4599 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4604 if (ctx
->ExecuteFlag
) {
4605 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
4609 static void GLAPIENTRY
4610 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4611 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4613 GET_CURRENT_CONTEXT(ctx
);
4615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4616 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4625 if (ctx
->ExecuteFlag
) {
4626 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4631 static void GLAPIENTRY
4632 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4633 const GLfloat
*params
)
4635 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4636 params
[2], params
[3]);
4640 static void GLAPIENTRY
4641 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4642 const GLfloat
* params
)
4644 GET_CURRENT_CONTEXT(ctx
);
4646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4650 const GLfloat
* p
= params
;
4652 for (i
= 0 ; i
< count
; i
++) {
4653 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4666 if (ctx
->ExecuteFlag
) {
4667 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4672 static void GLAPIENTRY
4673 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4674 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4676 save_ProgramEnvParameter4fARB(target
, index
,
4678 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4682 static void GLAPIENTRY
4683 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4684 const GLdouble
*params
)
4686 save_ProgramEnvParameter4fARB(target
, index
,
4687 (GLfloat
) params
[0],
4688 (GLfloat
) params
[1],
4689 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4693 static void GLAPIENTRY
4694 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4695 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4697 GET_CURRENT_CONTEXT(ctx
);
4699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4700 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4709 if (ctx
->ExecuteFlag
) {
4710 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4715 static void GLAPIENTRY
4716 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4717 const GLfloat
*params
)
4719 GET_CURRENT_CONTEXT(ctx
);
4721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4722 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4731 if (ctx
->ExecuteFlag
) {
4732 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4737 static void GLAPIENTRY
4738 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4739 const GLfloat
*params
)
4741 GET_CURRENT_CONTEXT(ctx
);
4743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4747 const GLfloat
* p
= params
;
4749 for (i
= 0 ; i
< count
; i
++) {
4750 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4763 if (ctx
->ExecuteFlag
) {
4764 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4769 static void GLAPIENTRY
4770 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4771 GLdouble x
, GLdouble y
,
4772 GLdouble z
, GLdouble w
)
4774 GET_CURRENT_CONTEXT(ctx
);
4776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4777 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4781 n
[3].f
= (GLfloat
) x
;
4782 n
[4].f
= (GLfloat
) y
;
4783 n
[5].f
= (GLfloat
) z
;
4784 n
[6].f
= (GLfloat
) w
;
4786 if (ctx
->ExecuteFlag
) {
4787 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4792 static void GLAPIENTRY
4793 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4794 const GLdouble
*params
)
4796 GET_CURRENT_CONTEXT(ctx
);
4798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4799 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4803 n
[3].f
= (GLfloat
) params
[0];
4804 n
[4].f
= (GLfloat
) params
[1];
4805 n
[5].f
= (GLfloat
) params
[2];
4806 n
[6].f
= (GLfloat
) params
[3];
4808 if (ctx
->ExecuteFlag
) {
4809 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4814 /* GL_EXT_stencil_two_side */
4815 static void GLAPIENTRY
4816 save_ActiveStencilFaceEXT(GLenum face
)
4818 GET_CURRENT_CONTEXT(ctx
);
4820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4821 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4825 if (ctx
->ExecuteFlag
) {
4826 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4831 /* GL_EXT_depth_bounds_test */
4832 static void GLAPIENTRY
4833 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4835 GET_CURRENT_CONTEXT(ctx
);
4837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4838 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4840 n
[1].f
= (GLfloat
) zmin
;
4841 n
[2].f
= (GLfloat
) zmax
;
4843 if (ctx
->ExecuteFlag
) {
4844 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4850 static void GLAPIENTRY
4851 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4852 const GLvoid
* string
)
4854 GET_CURRENT_CONTEXT(ctx
);
4857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4859 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
4861 GLubyte
*programCopy
= malloc(len
);
4863 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4866 memcpy(programCopy
, string
, len
);
4870 save_pointer(&n
[4], programCopy
);
4872 if (ctx
->ExecuteFlag
) {
4873 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4878 static void GLAPIENTRY
4879 save_BeginQueryARB(GLenum target
, GLuint id
)
4881 GET_CURRENT_CONTEXT(ctx
);
4883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4884 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4889 if (ctx
->ExecuteFlag
) {
4890 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
4894 static void GLAPIENTRY
4895 save_EndQueryARB(GLenum target
)
4897 GET_CURRENT_CONTEXT(ctx
);
4899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4900 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
4904 if (ctx
->ExecuteFlag
) {
4905 CALL_EndQuery(ctx
->Exec
, (target
));
4909 static void GLAPIENTRY
4910 save_QueryCounter(GLuint id
, GLenum target
)
4912 GET_CURRENT_CONTEXT(ctx
);
4914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4915 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
4920 if (ctx
->ExecuteFlag
) {
4921 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
4925 static void GLAPIENTRY
4926 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
4928 GET_CURRENT_CONTEXT(ctx
);
4930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4931 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
4937 if (ctx
->ExecuteFlag
) {
4938 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
4942 static void GLAPIENTRY
4943 save_EndQueryIndexed(GLenum target
, GLuint index
)
4945 GET_CURRENT_CONTEXT(ctx
);
4947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4948 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
4953 if (ctx
->ExecuteFlag
) {
4954 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
4959 static void GLAPIENTRY
4960 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4962 GET_CURRENT_CONTEXT(ctx
);
4964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4965 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4969 if (count
> MAX_DRAW_BUFFERS
)
4970 count
= MAX_DRAW_BUFFERS
;
4971 for (i
= 0; i
< count
; i
++) {
4972 n
[2 + i
].e
= buffers
[i
];
4975 if (ctx
->ExecuteFlag
) {
4976 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
4980 static void GLAPIENTRY
4981 save_BindFragmentShaderATI(GLuint id
)
4983 GET_CURRENT_CONTEXT(ctx
);
4986 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4990 if (ctx
->ExecuteFlag
) {
4991 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4995 static void GLAPIENTRY
4996 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4998 GET_CURRENT_CONTEXT(ctx
);
5001 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5009 if (ctx
->ExecuteFlag
) {
5010 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5014 static void GLAPIENTRY
5015 save_Attr1fNV(GLenum attr
, GLfloat x
)
5017 GET_CURRENT_CONTEXT(ctx
);
5019 SAVE_FLUSH_VERTICES(ctx
);
5020 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5026 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5027 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5028 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5030 if (ctx
->ExecuteFlag
) {
5031 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5035 static void GLAPIENTRY
5036 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5038 GET_CURRENT_CONTEXT(ctx
);
5040 SAVE_FLUSH_VERTICES(ctx
);
5041 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5048 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5049 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5050 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5052 if (ctx
->ExecuteFlag
) {
5053 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5057 static void GLAPIENTRY
5058 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5060 GET_CURRENT_CONTEXT(ctx
);
5062 SAVE_FLUSH_VERTICES(ctx
);
5063 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5071 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5072 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5073 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5075 if (ctx
->ExecuteFlag
) {
5076 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5080 static void GLAPIENTRY
5081 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5083 GET_CURRENT_CONTEXT(ctx
);
5085 SAVE_FLUSH_VERTICES(ctx
);
5086 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5095 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5096 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5097 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5099 if (ctx
->ExecuteFlag
) {
5100 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5105 static void GLAPIENTRY
5106 save_Attr1fARB(GLenum attr
, GLfloat x
)
5108 GET_CURRENT_CONTEXT(ctx
);
5110 SAVE_FLUSH_VERTICES(ctx
);
5111 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5117 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5118 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5119 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5121 if (ctx
->ExecuteFlag
) {
5122 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5126 static void GLAPIENTRY
5127 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5129 GET_CURRENT_CONTEXT(ctx
);
5131 SAVE_FLUSH_VERTICES(ctx
);
5132 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5139 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5140 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5141 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5143 if (ctx
->ExecuteFlag
) {
5144 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5148 static void GLAPIENTRY
5149 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5151 GET_CURRENT_CONTEXT(ctx
);
5153 SAVE_FLUSH_VERTICES(ctx
);
5154 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5162 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5163 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5164 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5166 if (ctx
->ExecuteFlag
) {
5167 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5171 static void GLAPIENTRY
5172 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5174 GET_CURRENT_CONTEXT(ctx
);
5176 SAVE_FLUSH_VERTICES(ctx
);
5177 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5186 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5187 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5188 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5190 if (ctx
->ExecuteFlag
) {
5191 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5196 static void GLAPIENTRY
5197 save_EvalCoord1f(GLfloat x
)
5199 GET_CURRENT_CONTEXT(ctx
);
5201 SAVE_FLUSH_VERTICES(ctx
);
5202 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5206 if (ctx
->ExecuteFlag
) {
5207 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5211 static void GLAPIENTRY
5212 save_EvalCoord1fv(const GLfloat
* v
)
5214 save_EvalCoord1f(v
[0]);
5217 static void GLAPIENTRY
5218 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5220 GET_CURRENT_CONTEXT(ctx
);
5222 SAVE_FLUSH_VERTICES(ctx
);
5223 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5228 if (ctx
->ExecuteFlag
) {
5229 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5233 static void GLAPIENTRY
5234 save_EvalCoord2fv(const GLfloat
* v
)
5236 save_EvalCoord2f(v
[0], v
[1]);
5240 static void GLAPIENTRY
5241 save_EvalPoint1(GLint x
)
5243 GET_CURRENT_CONTEXT(ctx
);
5245 SAVE_FLUSH_VERTICES(ctx
);
5246 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5250 if (ctx
->ExecuteFlag
) {
5251 CALL_EvalPoint1(ctx
->Exec
, (x
));
5255 static void GLAPIENTRY
5256 save_EvalPoint2(GLint x
, GLint y
)
5258 GET_CURRENT_CONTEXT(ctx
);
5260 SAVE_FLUSH_VERTICES(ctx
);
5261 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5266 if (ctx
->ExecuteFlag
) {
5267 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5271 static void GLAPIENTRY
5272 save_Indexf(GLfloat x
)
5274 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5277 static void GLAPIENTRY
5278 save_Indexfv(const GLfloat
* v
)
5280 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5283 static void GLAPIENTRY
5284 save_EdgeFlag(GLboolean x
)
5286 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5291 * Compare 'count' elements of vectors 'a' and 'b'.
5292 * \return GL_TRUE if equal, GL_FALSE if different.
5294 static inline GLboolean
5295 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5297 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5302 * This glMaterial function is used for glMaterial calls that are outside
5303 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5305 static void GLAPIENTRY
5306 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5308 GET_CURRENT_CONTEXT(ctx
);
5316 case GL_FRONT_AND_BACK
:
5319 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5328 case GL_AMBIENT_AND_DIFFUSE
:
5334 case GL_COLOR_INDEXES
:
5338 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5342 if (ctx
->ExecuteFlag
) {
5343 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5346 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5348 /* Try to eliminate redundant statechanges. Because it is legal to
5349 * call glMaterial even inside begin/end calls, don't need to worry
5350 * about ctx->Driver.CurrentSavePrimitive here.
5352 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5353 if (bitmask
& (1 << i
)) {
5354 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5355 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5356 /* no change in material value */
5357 bitmask
&= ~(1 << i
);
5360 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5361 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5366 /* If this call has no effect, return early */
5370 SAVE_FLUSH_VERTICES(ctx
);
5372 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5376 for (i
= 0; i
< args
; i
++)
5377 n
[3 + i
].f
= param
[i
];
5381 static void GLAPIENTRY
5382 save_Begin(GLenum mode
)
5384 GET_CURRENT_CONTEXT(ctx
);
5386 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
5387 /* compile this error into the display list */
5388 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
5390 else if (_mesa_inside_dlist_begin_end(ctx
)) {
5391 /* compile this error into the display list */
5392 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
5397 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5399 /* Give the driver an opportunity to hook in an optimized
5400 * display list compiler.
5402 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5405 SAVE_FLUSH_VERTICES(ctx
);
5406 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5411 if (ctx
->ExecuteFlag
) {
5412 CALL_Begin(ctx
->Exec
, (mode
));
5417 static void GLAPIENTRY
5420 GET_CURRENT_CONTEXT(ctx
);
5421 SAVE_FLUSH_VERTICES(ctx
);
5422 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5423 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5424 if (ctx
->ExecuteFlag
) {
5425 CALL_End(ctx
->Exec
, ());
5429 static void GLAPIENTRY
5430 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5432 GET_CURRENT_CONTEXT(ctx
);
5434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5435 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5442 if (ctx
->ExecuteFlag
) {
5443 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5448 static void GLAPIENTRY
5449 save_Vertex2f(GLfloat x
, GLfloat y
)
5451 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5454 static void GLAPIENTRY
5455 save_Vertex2fv(const GLfloat
* v
)
5457 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5460 static void GLAPIENTRY
5461 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5463 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5466 static void GLAPIENTRY
5467 save_Vertex3fv(const GLfloat
* v
)
5469 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5472 static void GLAPIENTRY
5473 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5475 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5478 static void GLAPIENTRY
5479 save_Vertex4fv(const GLfloat
* v
)
5481 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5484 static void GLAPIENTRY
5485 save_TexCoord1f(GLfloat x
)
5487 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5490 static void GLAPIENTRY
5491 save_TexCoord1fv(const GLfloat
* v
)
5493 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5496 static void GLAPIENTRY
5497 save_TexCoord2f(GLfloat x
, GLfloat y
)
5499 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5502 static void GLAPIENTRY
5503 save_TexCoord2fv(const GLfloat
* v
)
5505 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5508 static void GLAPIENTRY
5509 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5511 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5514 static void GLAPIENTRY
5515 save_TexCoord3fv(const GLfloat
* v
)
5517 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5520 static void GLAPIENTRY
5521 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5523 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5526 static void GLAPIENTRY
5527 save_TexCoord4fv(const GLfloat
* v
)
5529 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5532 static void GLAPIENTRY
5533 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5535 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5538 static void GLAPIENTRY
5539 save_Normal3fv(const GLfloat
* v
)
5541 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5544 static void GLAPIENTRY
5545 save_FogCoordfEXT(GLfloat x
)
5547 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5550 static void GLAPIENTRY
5551 save_FogCoordfvEXT(const GLfloat
* v
)
5553 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5556 static void GLAPIENTRY
5557 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5559 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5562 static void GLAPIENTRY
5563 save_Color3fv(const GLfloat
* v
)
5565 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5568 static void GLAPIENTRY
5569 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5571 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5574 static void GLAPIENTRY
5575 save_Color4fv(const GLfloat
* v
)
5577 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5580 static void GLAPIENTRY
5581 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5583 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5586 static void GLAPIENTRY
5587 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5589 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5593 /* Just call the respective ATTR for texcoord
5595 static void GLAPIENTRY
5596 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5598 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5599 save_Attr1fNV(attr
, x
);
5602 static void GLAPIENTRY
5603 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5605 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5606 save_Attr1fNV(attr
, v
[0]);
5609 static void GLAPIENTRY
5610 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5612 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5613 save_Attr2fNV(attr
, x
, y
);
5616 static void GLAPIENTRY
5617 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5619 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5620 save_Attr2fNV(attr
, v
[0], v
[1]);
5623 static void GLAPIENTRY
5624 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5626 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5627 save_Attr3fNV(attr
, x
, y
, z
);
5630 static void GLAPIENTRY
5631 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5633 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5634 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5637 static void GLAPIENTRY
5638 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5639 GLfloat z
, GLfloat w
)
5641 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5642 save_Attr4fNV(attr
, x
, y
, z
, w
);
5645 static void GLAPIENTRY
5646 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5648 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5649 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5654 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5660 GET_CURRENT_CONTEXT(ctx
);
5661 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5666 static void GLAPIENTRY
5667 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5669 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5670 save_Attr1fARB(index
, x
);
5675 static void GLAPIENTRY
5676 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5678 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5679 save_Attr1fARB(index
, v
[0]);
5684 static void GLAPIENTRY
5685 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5687 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5688 save_Attr2fARB(index
, x
, y
);
5693 static void GLAPIENTRY
5694 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5696 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5697 save_Attr2fARB(index
, v
[0], v
[1]);
5702 static void GLAPIENTRY
5703 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5705 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5706 save_Attr3fARB(index
, x
, y
, z
);
5711 static void GLAPIENTRY
5712 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5714 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5715 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5720 static void GLAPIENTRY
5721 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5724 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5725 save_Attr4fARB(index
, x
, y
, z
, w
);
5730 static void GLAPIENTRY
5731 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5733 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5734 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5739 static void GLAPIENTRY
5740 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5741 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5742 GLbitfield mask
, GLenum filter
)
5744 GET_CURRENT_CONTEXT(ctx
);
5746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5747 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5760 if (ctx
->ExecuteFlag
) {
5761 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5762 dstX0
, dstY0
, dstX1
, dstY1
,
5768 /** GL_EXT_provoking_vertex */
5769 static void GLAPIENTRY
5770 save_ProvokingVertexEXT(GLenum mode
)
5772 GET_CURRENT_CONTEXT(ctx
);
5774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5775 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
5779 if (ctx
->ExecuteFlag
) {
5780 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
5781 _mesa_ProvokingVertex(mode
);
5786 /** GL_EXT_transform_feedback */
5787 static void GLAPIENTRY
5788 save_BeginTransformFeedback(GLenum mode
)
5790 GET_CURRENT_CONTEXT(ctx
);
5792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5793 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
5797 if (ctx
->ExecuteFlag
) {
5798 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
5803 /** GL_EXT_transform_feedback */
5804 static void GLAPIENTRY
5805 save_EndTransformFeedback(void)
5807 GET_CURRENT_CONTEXT(ctx
);
5808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5809 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
5810 if (ctx
->ExecuteFlag
) {
5811 CALL_EndTransformFeedback(ctx
->Exec
, ());
5815 static void GLAPIENTRY
5816 save_BindTransformFeedback(GLenum target
, GLuint name
)
5818 GET_CURRENT_CONTEXT(ctx
);
5820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5821 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
5826 if (ctx
->ExecuteFlag
) {
5827 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
5831 static void GLAPIENTRY
5832 save_PauseTransformFeedback(void)
5834 GET_CURRENT_CONTEXT(ctx
);
5835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5836 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
5837 if (ctx
->ExecuteFlag
) {
5838 CALL_PauseTransformFeedback(ctx
->Exec
, ());
5842 static void GLAPIENTRY
5843 save_ResumeTransformFeedback(void)
5845 GET_CURRENT_CONTEXT(ctx
);
5846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5847 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
5848 if (ctx
->ExecuteFlag
) {
5849 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
5853 static void GLAPIENTRY
5854 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
5856 GET_CURRENT_CONTEXT(ctx
);
5858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5859 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
5864 if (ctx
->ExecuteFlag
) {
5865 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
5869 static void GLAPIENTRY
5870 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
5872 GET_CURRENT_CONTEXT(ctx
);
5874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5875 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
5881 if (ctx
->ExecuteFlag
) {
5882 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
5886 static void GLAPIENTRY
5887 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
5890 GET_CURRENT_CONTEXT(ctx
);
5892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5893 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
5897 n
[3].si
= primcount
;
5899 if (ctx
->ExecuteFlag
) {
5900 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
5904 static void GLAPIENTRY
5905 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
5906 GLuint stream
, GLsizei primcount
)
5908 GET_CURRENT_CONTEXT(ctx
);
5910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5911 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
5916 n
[4].si
= primcount
;
5918 if (ctx
->ExecuteFlag
) {
5919 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
5924 /* aka UseProgram() */
5925 static void GLAPIENTRY
5926 save_UseProgramObjectARB(GLhandleARB program
)
5928 GET_CURRENT_CONTEXT(ctx
);
5930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5931 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
5935 if (ctx
->ExecuteFlag
) {
5936 CALL_UseProgram(ctx
->Exec
, (program
));
5941 static void GLAPIENTRY
5942 save_Uniform1fARB(GLint location
, GLfloat x
)
5944 GET_CURRENT_CONTEXT(ctx
);
5946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5947 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
5952 if (ctx
->ExecuteFlag
) {
5953 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
5958 static void GLAPIENTRY
5959 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
5961 GET_CURRENT_CONTEXT(ctx
);
5963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5964 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
5970 if (ctx
->ExecuteFlag
) {
5971 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
5976 static void GLAPIENTRY
5977 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
5979 GET_CURRENT_CONTEXT(ctx
);
5981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5982 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
5989 if (ctx
->ExecuteFlag
) {
5990 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
5995 static void GLAPIENTRY
5996 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5998 GET_CURRENT_CONTEXT(ctx
);
6000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6001 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6009 if (ctx
->ExecuteFlag
) {
6010 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6015 static void GLAPIENTRY
6016 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6018 GET_CURRENT_CONTEXT(ctx
);
6020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6021 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6025 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6027 if (ctx
->ExecuteFlag
) {
6028 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6032 static void GLAPIENTRY
6033 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6035 GET_CURRENT_CONTEXT(ctx
);
6037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6038 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6042 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6044 if (ctx
->ExecuteFlag
) {
6045 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6049 static void GLAPIENTRY
6050 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6052 GET_CURRENT_CONTEXT(ctx
);
6054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6055 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6059 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6061 if (ctx
->ExecuteFlag
) {
6062 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6066 static void GLAPIENTRY
6067 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6069 GET_CURRENT_CONTEXT(ctx
);
6071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6072 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6076 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6078 if (ctx
->ExecuteFlag
) {
6079 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6084 static void GLAPIENTRY
6085 save_Uniform1iARB(GLint location
, GLint x
)
6087 GET_CURRENT_CONTEXT(ctx
);
6089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6090 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6095 if (ctx
->ExecuteFlag
) {
6096 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
6100 static void GLAPIENTRY
6101 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6103 GET_CURRENT_CONTEXT(ctx
);
6105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6106 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6112 if (ctx
->ExecuteFlag
) {
6113 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
6117 static void GLAPIENTRY
6118 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6120 GET_CURRENT_CONTEXT(ctx
);
6122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6123 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6130 if (ctx
->ExecuteFlag
) {
6131 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
6135 static void GLAPIENTRY
6136 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6138 GET_CURRENT_CONTEXT(ctx
);
6140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6141 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6149 if (ctx
->ExecuteFlag
) {
6150 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
6156 static void GLAPIENTRY
6157 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6159 GET_CURRENT_CONTEXT(ctx
);
6161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6162 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
6166 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
6168 if (ctx
->ExecuteFlag
) {
6169 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
6173 static void GLAPIENTRY
6174 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6176 GET_CURRENT_CONTEXT(ctx
);
6178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6179 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
6183 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
6185 if (ctx
->ExecuteFlag
) {
6186 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
6190 static void GLAPIENTRY
6191 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6193 GET_CURRENT_CONTEXT(ctx
);
6195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6196 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
6200 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
6202 if (ctx
->ExecuteFlag
) {
6203 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
6207 static void GLAPIENTRY
6208 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6210 GET_CURRENT_CONTEXT(ctx
);
6212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6213 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
6217 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6219 if (ctx
->ExecuteFlag
) {
6220 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
6226 static void GLAPIENTRY
6227 save_Uniform1ui(GLint location
, GLuint x
)
6229 GET_CURRENT_CONTEXT(ctx
);
6231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6232 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6237 if (ctx
->ExecuteFlag
) {
6238 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6242 static void GLAPIENTRY
6243 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6245 GET_CURRENT_CONTEXT(ctx
);
6247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6248 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6254 if (ctx
->ExecuteFlag
) {
6255 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6259 static void GLAPIENTRY
6260 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6262 GET_CURRENT_CONTEXT(ctx
);
6264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6265 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6272 if (ctx
->ExecuteFlag
) {
6273 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6277 static void GLAPIENTRY
6278 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6280 GET_CURRENT_CONTEXT(ctx
);
6282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6283 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6291 if (ctx
->ExecuteFlag
) {
6292 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6298 static void GLAPIENTRY
6299 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6301 GET_CURRENT_CONTEXT(ctx
);
6303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6304 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
6308 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
6310 if (ctx
->ExecuteFlag
) {
6311 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6315 static void GLAPIENTRY
6316 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6318 GET_CURRENT_CONTEXT(ctx
);
6320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6321 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
6325 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
6327 if (ctx
->ExecuteFlag
) {
6328 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6332 static void GLAPIENTRY
6333 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6335 GET_CURRENT_CONTEXT(ctx
);
6337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6338 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
6342 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
6344 if (ctx
->ExecuteFlag
) {
6345 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6349 static void GLAPIENTRY
6350 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6352 GET_CURRENT_CONTEXT(ctx
);
6354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6355 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
6359 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
6361 if (ctx
->ExecuteFlag
) {
6362 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6368 static void GLAPIENTRY
6369 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6372 GET_CURRENT_CONTEXT(ctx
);
6374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6375 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
6380 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
6382 if (ctx
->ExecuteFlag
) {
6383 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6387 static void GLAPIENTRY
6388 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6391 GET_CURRENT_CONTEXT(ctx
);
6393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6394 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
6399 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
6401 if (ctx
->ExecuteFlag
) {
6402 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6406 static void GLAPIENTRY
6407 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6410 GET_CURRENT_CONTEXT(ctx
);
6412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6413 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
6418 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
6420 if (ctx
->ExecuteFlag
) {
6421 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6426 static void GLAPIENTRY
6427 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6430 GET_CURRENT_CONTEXT(ctx
);
6432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6433 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
6438 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
6440 if (ctx
->ExecuteFlag
) {
6441 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6445 static void GLAPIENTRY
6446 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6449 GET_CURRENT_CONTEXT(ctx
);
6451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6452 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
6457 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
6459 if (ctx
->ExecuteFlag
) {
6460 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6465 static void GLAPIENTRY
6466 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6469 GET_CURRENT_CONTEXT(ctx
);
6471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6472 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
6477 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
6479 if (ctx
->ExecuteFlag
) {
6480 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6484 static void GLAPIENTRY
6485 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6488 GET_CURRENT_CONTEXT(ctx
);
6490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6491 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
6496 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
6498 if (ctx
->ExecuteFlag
) {
6499 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6504 static void GLAPIENTRY
6505 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6508 GET_CURRENT_CONTEXT(ctx
);
6510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6511 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
6516 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
6518 if (ctx
->ExecuteFlag
) {
6519 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6523 static void GLAPIENTRY
6524 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6527 GET_CURRENT_CONTEXT(ctx
);
6529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6530 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
6535 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
6537 if (ctx
->ExecuteFlag
) {
6538 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6542 static void GLAPIENTRY
6543 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
6545 GET_CURRENT_CONTEXT(ctx
);
6547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6548 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
6554 if (ctx
->ExecuteFlag
) {
6555 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
6559 static void GLAPIENTRY
6560 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
6562 GET_CURRENT_CONTEXT(ctx
);
6564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6565 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
6571 if (ctx
->ExecuteFlag
) {
6572 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
6576 static void GLAPIENTRY
6577 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
6579 GET_CURRENT_CONTEXT(ctx
);
6581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6582 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
6589 if (ctx
->ExecuteFlag
) {
6590 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
6594 static void GLAPIENTRY
6595 save_ProgramUniform3f(GLuint program
, GLint location
,
6596 GLfloat x
, GLfloat y
, GLfloat z
)
6598 GET_CURRENT_CONTEXT(ctx
);
6600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6601 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
6609 if (ctx
->ExecuteFlag
) {
6610 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
6614 static void GLAPIENTRY
6615 save_ProgramUniform4f(GLuint program
, GLint location
,
6616 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6618 GET_CURRENT_CONTEXT(ctx
);
6620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6621 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
6630 if (ctx
->ExecuteFlag
) {
6631 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6635 static void GLAPIENTRY
6636 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
6639 GET_CURRENT_CONTEXT(ctx
);
6641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6642 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
6647 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6649 if (ctx
->ExecuteFlag
) {
6650 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
6654 static void GLAPIENTRY
6655 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
6658 GET_CURRENT_CONTEXT(ctx
);
6660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6661 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
6666 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6668 if (ctx
->ExecuteFlag
) {
6669 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
6673 static void GLAPIENTRY
6674 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
6677 GET_CURRENT_CONTEXT(ctx
);
6679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6680 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
6685 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6687 if (ctx
->ExecuteFlag
) {
6688 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
6692 static void GLAPIENTRY
6693 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
6696 GET_CURRENT_CONTEXT(ctx
);
6698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6699 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
6704 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6706 if (ctx
->ExecuteFlag
) {
6707 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
6711 static void GLAPIENTRY
6712 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
6714 GET_CURRENT_CONTEXT(ctx
);
6716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6717 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
6723 if (ctx
->ExecuteFlag
) {
6724 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
6728 static void GLAPIENTRY
6729 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
6731 GET_CURRENT_CONTEXT(ctx
);
6733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6734 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
6741 if (ctx
->ExecuteFlag
) {
6742 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
6746 static void GLAPIENTRY
6747 save_ProgramUniform3i(GLuint program
, GLint location
,
6748 GLint x
, GLint y
, GLint z
)
6750 GET_CURRENT_CONTEXT(ctx
);
6752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6753 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
6761 if (ctx
->ExecuteFlag
) {
6762 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
6766 static void GLAPIENTRY
6767 save_ProgramUniform4i(GLuint program
, GLint location
,
6768 GLint x
, GLint y
, GLint z
, GLint w
)
6770 GET_CURRENT_CONTEXT(ctx
);
6772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6773 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
6782 if (ctx
->ExecuteFlag
) {
6783 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6787 static void GLAPIENTRY
6788 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
6791 GET_CURRENT_CONTEXT(ctx
);
6793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6794 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
6799 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
6801 if (ctx
->ExecuteFlag
) {
6802 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
6806 static void GLAPIENTRY
6807 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
6810 GET_CURRENT_CONTEXT(ctx
);
6812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6813 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
6818 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
6820 if (ctx
->ExecuteFlag
) {
6821 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
6825 static void GLAPIENTRY
6826 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
6829 GET_CURRENT_CONTEXT(ctx
);
6831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6832 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
6837 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
6839 if (ctx
->ExecuteFlag
) {
6840 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
6844 static void GLAPIENTRY
6845 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
6848 GET_CURRENT_CONTEXT(ctx
);
6850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6851 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
6856 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
6858 if (ctx
->ExecuteFlag
) {
6859 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
6863 static void GLAPIENTRY
6864 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
6866 GET_CURRENT_CONTEXT(ctx
);
6868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6869 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
6875 if (ctx
->ExecuteFlag
) {
6876 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
6880 static void GLAPIENTRY
6881 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
6883 GET_CURRENT_CONTEXT(ctx
);
6885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6886 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
6893 if (ctx
->ExecuteFlag
) {
6894 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
6898 static void GLAPIENTRY
6899 save_ProgramUniform3ui(GLuint program
, GLint location
,
6900 GLuint x
, GLuint y
, GLuint z
)
6902 GET_CURRENT_CONTEXT(ctx
);
6904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6905 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
6913 if (ctx
->ExecuteFlag
) {
6914 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
6918 static void GLAPIENTRY
6919 save_ProgramUniform4ui(GLuint program
, GLint location
,
6920 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6922 GET_CURRENT_CONTEXT(ctx
);
6924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6925 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
6934 if (ctx
->ExecuteFlag
) {
6935 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6939 static void GLAPIENTRY
6940 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
6943 GET_CURRENT_CONTEXT(ctx
);
6945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6946 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
6951 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
6953 if (ctx
->ExecuteFlag
) {
6954 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
6958 static void GLAPIENTRY
6959 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
6962 GET_CURRENT_CONTEXT(ctx
);
6964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6965 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
6970 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
6972 if (ctx
->ExecuteFlag
) {
6973 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
6977 static void GLAPIENTRY
6978 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
6981 GET_CURRENT_CONTEXT(ctx
);
6983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6984 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
6989 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
6991 if (ctx
->ExecuteFlag
) {
6992 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
6996 static void GLAPIENTRY
6997 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
7000 GET_CURRENT_CONTEXT(ctx
);
7002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7003 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
7008 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
7010 if (ctx
->ExecuteFlag
) {
7011 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
7015 static void GLAPIENTRY
7016 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
7017 GLboolean transpose
, const GLfloat
*v
)
7019 GET_CURRENT_CONTEXT(ctx
);
7021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7022 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
7023 4 + POINTER_DWORDS
);
7029 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
7031 if (ctx
->ExecuteFlag
) {
7032 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
7033 (program
, location
, count
, transpose
, v
));
7037 static void GLAPIENTRY
7038 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
7039 GLboolean transpose
, const GLfloat
*v
)
7041 GET_CURRENT_CONTEXT(ctx
);
7043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7044 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
7045 4 + POINTER_DWORDS
);
7051 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
7053 if (ctx
->ExecuteFlag
) {
7054 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
7055 (program
, location
, count
, transpose
, v
));
7059 static void GLAPIENTRY
7060 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
7061 GLboolean transpose
, const GLfloat
*v
)
7063 GET_CURRENT_CONTEXT(ctx
);
7065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7066 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
7067 4 + POINTER_DWORDS
);
7073 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
7075 if (ctx
->ExecuteFlag
) {
7076 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
7077 (program
, location
, count
, transpose
, v
));
7081 static void GLAPIENTRY
7082 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
7083 GLboolean transpose
, const GLfloat
*v
)
7085 GET_CURRENT_CONTEXT(ctx
);
7087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7088 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
7089 4 + POINTER_DWORDS
);
7095 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
7097 if (ctx
->ExecuteFlag
) {
7098 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
7099 (program
, location
, count
, transpose
, v
));
7103 static void GLAPIENTRY
7104 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
7105 GLboolean transpose
, const GLfloat
*v
)
7107 GET_CURRENT_CONTEXT(ctx
);
7109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7110 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
7111 4 + POINTER_DWORDS
);
7117 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
7119 if (ctx
->ExecuteFlag
) {
7120 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
7121 (program
, location
, count
, transpose
, v
));
7125 static void GLAPIENTRY
7126 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
7127 GLboolean transpose
, const GLfloat
*v
)
7129 GET_CURRENT_CONTEXT(ctx
);
7131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7132 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
7133 4 + POINTER_DWORDS
);
7139 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
7141 if (ctx
->ExecuteFlag
) {
7142 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
7143 (program
, location
, count
, transpose
, v
));
7147 static void GLAPIENTRY
7148 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
7149 GLboolean transpose
, const GLfloat
*v
)
7151 GET_CURRENT_CONTEXT(ctx
);
7153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7154 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
7155 4 + POINTER_DWORDS
);
7161 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
7163 if (ctx
->ExecuteFlag
) {
7164 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
7165 (program
, location
, count
, transpose
, v
));
7169 static void GLAPIENTRY
7170 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
7171 GLboolean transpose
, const GLfloat
*v
)
7173 GET_CURRENT_CONTEXT(ctx
);
7175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7176 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
7177 4 + POINTER_DWORDS
);
7183 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
7185 if (ctx
->ExecuteFlag
) {
7186 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
7187 (program
, location
, count
, transpose
, v
));
7191 static void GLAPIENTRY
7192 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
7193 GLboolean transpose
, const GLfloat
*v
)
7195 GET_CURRENT_CONTEXT(ctx
);
7197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7198 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
7199 4 + POINTER_DWORDS
);
7205 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
7207 if (ctx
->ExecuteFlag
) {
7208 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
7209 (program
, location
, count
, transpose
, v
));
7213 static void GLAPIENTRY
7214 save_ClipControl(GLenum origin
, GLenum depth
)
7216 GET_CURRENT_CONTEXT(ctx
);
7218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7219 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
7224 if (ctx
->ExecuteFlag
) {
7225 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
7229 static void GLAPIENTRY
7230 save_ClampColorARB(GLenum target
, GLenum clamp
)
7232 GET_CURRENT_CONTEXT(ctx
);
7234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7235 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7240 if (ctx
->ExecuteFlag
) {
7241 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
7245 /** GL_EXT_texture_integer */
7246 static void GLAPIENTRY
7247 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7249 GET_CURRENT_CONTEXT(ctx
);
7251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7252 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7259 if (ctx
->ExecuteFlag
) {
7260 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7264 /** GL_EXT_texture_integer */
7265 static void GLAPIENTRY
7266 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7268 GET_CURRENT_CONTEXT(ctx
);
7270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7271 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7278 if (ctx
->ExecuteFlag
) {
7279 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7283 /** GL_EXT_texture_integer */
7284 static void GLAPIENTRY
7285 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7287 GET_CURRENT_CONTEXT(ctx
);
7289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7290 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7299 if (ctx
->ExecuteFlag
) {
7300 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
7304 /** GL_EXT_texture_integer */
7305 static void GLAPIENTRY
7306 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7308 GET_CURRENT_CONTEXT(ctx
);
7310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7311 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7315 n
[3].ui
= params
[0];
7316 n
[4].ui
= params
[1];
7317 n
[5].ui
= params
[2];
7318 n
[6].ui
= params
[3];
7320 if (ctx
->ExecuteFlag
) {
7321 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
7325 /* GL_ARB_instanced_arrays */
7326 static void GLAPIENTRY
7327 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7329 GET_CURRENT_CONTEXT(ctx
);
7331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7332 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7337 if (ctx
->ExecuteFlag
) {
7338 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
7343 /* GL_NV_texture_barrier */
7344 static void GLAPIENTRY
7345 save_TextureBarrierNV(void)
7347 GET_CURRENT_CONTEXT(ctx
);
7348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7349 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7350 if (ctx
->ExecuteFlag
) {
7351 CALL_TextureBarrierNV(ctx
->Exec
, ());
7356 /* GL_ARB_sampler_objects */
7357 static void GLAPIENTRY
7358 save_BindSampler(GLuint unit
, GLuint sampler
)
7361 GET_CURRENT_CONTEXT(ctx
);
7362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7363 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7368 if (ctx
->ExecuteFlag
) {
7369 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7373 static void GLAPIENTRY
7374 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7377 GET_CURRENT_CONTEXT(ctx
);
7378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7379 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7384 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7390 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7393 if (ctx
->ExecuteFlag
) {
7394 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7398 static void GLAPIENTRY
7399 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7403 parray
[1] = parray
[2] = parray
[3] = 0;
7404 save_SamplerParameteriv(sampler
, pname
, parray
);
7407 static void GLAPIENTRY
7408 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7411 GET_CURRENT_CONTEXT(ctx
);
7412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7413 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7418 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7424 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7427 if (ctx
->ExecuteFlag
) {
7428 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7432 static void GLAPIENTRY
7433 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7437 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
7438 save_SamplerParameterfv(sampler
, pname
, parray
);
7441 static void GLAPIENTRY
7442 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7445 GET_CURRENT_CONTEXT(ctx
);
7446 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7447 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7452 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7458 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7461 if (ctx
->ExecuteFlag
) {
7462 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7466 static void GLAPIENTRY
7467 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7470 GET_CURRENT_CONTEXT(ctx
);
7471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7472 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7476 n
[3].ui
= params
[0];
7477 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7478 n
[4].ui
= params
[1];
7479 n
[5].ui
= params
[2];
7480 n
[6].ui
= params
[3];
7483 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7486 if (ctx
->ExecuteFlag
) {
7487 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7491 /* GL_ARB_geometry_shader4 */
7492 static void GLAPIENTRY
7493 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7496 GET_CURRENT_CONTEXT(ctx
);
7497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7498 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7504 if (ctx
->ExecuteFlag
) {
7505 CALL_ProgramParameteri(ctx
->Exec
, (program
, pname
, value
));
7509 static void GLAPIENTRY
7510 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7511 GLuint texture
, GLint level
)
7514 GET_CURRENT_CONTEXT(ctx
);
7515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7516 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7519 n
[2].e
= attachment
;
7523 if (ctx
->ExecuteFlag
) {
7524 CALL_FramebufferTexture(ctx
->Exec
, (target
, attachment
, texture
, level
));
7528 static void GLAPIENTRY
7529 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7530 GLuint texture
, GLint level
, GLenum face
)
7533 GET_CURRENT_CONTEXT(ctx
);
7534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7535 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7538 n
[2].e
= attachment
;
7543 if (ctx
->ExecuteFlag
) {
7544 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7551 static void GLAPIENTRY
7552 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7555 GET_CURRENT_CONTEXT(ctx
);
7556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7557 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7559 union uint64_pair p
;
7562 n
[2].ui
= p
.uint32
[0];
7563 n
[3].ui
= p
.uint32
[1];
7564 save_pointer(&n
[4], sync
);
7566 if (ctx
->ExecuteFlag
) {
7567 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7572 /** GL_NV_conditional_render */
7573 static void GLAPIENTRY
7574 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7576 GET_CURRENT_CONTEXT(ctx
);
7578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7579 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7584 if (ctx
->ExecuteFlag
) {
7585 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
7589 static void GLAPIENTRY
7590 save_EndConditionalRender(void)
7592 GET_CURRENT_CONTEXT(ctx
);
7593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7594 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7595 if (ctx
->ExecuteFlag
) {
7596 CALL_EndConditionalRender(ctx
->Exec
, ());
7600 static void GLAPIENTRY
7601 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7603 GET_CURRENT_CONTEXT(ctx
);
7605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7606 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7612 if (ctx
->ExecuteFlag
) {
7613 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7619 * Save an error-generating command into display list.
7621 * KW: Will appear in the list before the vertex buffer containing the
7622 * command that provoked the error. I don't see this as a problem.
7625 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7628 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
7631 save_pointer(&n
[2], (void *) s
);
7632 /* note: the data/string here doesn't have to be freed in
7633 * _mesa_delete_list() since the string is never dynamically
7641 * Compile an error into current display list.
7644 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7646 if (ctx
->CompileFlag
)
7647 save_error(ctx
, error
, s
);
7648 if (ctx
->ExecuteFlag
)
7649 _mesa_error(ctx
, error
, "%s", s
);
7654 * Test if ID names a display list.
7657 islist(struct gl_context
*ctx
, GLuint list
)
7659 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
7669 /**********************************************************************/
7670 /* Display list execution */
7671 /**********************************************************************/
7675 * Execute a display list. Note that the ListBase offset must have already
7676 * been added before calling this function. I.e. the list argument is
7677 * the absolute list number, not relative to ListBase.
7678 * \param list - display list number
7681 execute_list(struct gl_context
*ctx
, GLuint list
)
7683 struct gl_display_list
*dlist
;
7687 if (list
== 0 || !islist(ctx
, list
))
7690 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7691 /* raise an error? */
7695 dlist
= _mesa_lookup_list(ctx
, list
);
7699 ctx
->ListState
.CallDepth
++;
7701 if (ctx
->Driver
.BeginCallList
)
7702 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7708 const OpCode opcode
= n
[0].opcode
;
7710 if (is_ext_opcode(opcode
)) {
7711 n
+= ext_opcode_execute(ctx
, n
);
7716 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
7719 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7721 case OPCODE_ALPHA_FUNC
:
7722 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7724 case OPCODE_BIND_TEXTURE
:
7725 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7729 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7730 ctx
->Unpack
= ctx
->DefaultPacking
;
7731 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7732 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7733 get_pointer(&n
[7])));
7734 ctx
->Unpack
= save
; /* restore */
7737 case OPCODE_BLEND_COLOR
:
7738 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7740 case OPCODE_BLEND_EQUATION
:
7741 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7743 case OPCODE_BLEND_EQUATION_SEPARATE
:
7744 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7746 case OPCODE_BLEND_FUNC_SEPARATE
:
7747 CALL_BlendFuncSeparate(ctx
->Exec
,
7748 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7751 case OPCODE_BLEND_FUNC_I
:
7752 /* GL_ARB_draw_buffers_blend */
7753 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7755 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7756 /* GL_ARB_draw_buffers_blend */
7757 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7760 case OPCODE_BLEND_EQUATION_I
:
7761 /* GL_ARB_draw_buffers_blend */
7762 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7764 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7765 /* GL_ARB_draw_buffers_blend */
7766 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7767 (n
[1].ui
, n
[2].e
, n
[3].e
));
7770 case OPCODE_CALL_LIST
:
7771 /* Generated by glCallList(), don't add ListBase */
7772 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7773 execute_list(ctx
, n
[1].ui
);
7776 case OPCODE_CALL_LIST_OFFSET
:
7777 /* Generated by glCallLists() so we must add ListBase */
7779 /* user specified a bad data type at compile time */
7780 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7782 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7783 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7784 execute_list(ctx
, list
);
7788 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7790 case OPCODE_CLEAR_BUFFER_IV
:
7797 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7800 case OPCODE_CLEAR_BUFFER_UIV
:
7807 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7810 case OPCODE_CLEAR_BUFFER_FV
:
7817 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7820 case OPCODE_CLEAR_BUFFER_FI
:
7821 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7823 case OPCODE_CLEAR_COLOR
:
7824 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7826 case OPCODE_CLEAR_ACCUM
:
7827 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7829 case OPCODE_CLEAR_DEPTH
:
7830 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7832 case OPCODE_CLEAR_INDEX
:
7833 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7835 case OPCODE_CLEAR_STENCIL
:
7836 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7838 case OPCODE_CLIP_PLANE
:
7845 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7848 case OPCODE_COLOR_MASK
:
7849 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7851 case OPCODE_COLOR_MASK_INDEXED
:
7852 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7855 case OPCODE_COLOR_MATERIAL
:
7856 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7858 case OPCODE_COPY_PIXELS
:
7859 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7860 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7863 case OPCODE_COPY_TEX_IMAGE1D
:
7864 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7865 n
[5].i
, n
[6].i
, n
[7].i
));
7867 case OPCODE_COPY_TEX_IMAGE2D
:
7868 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7869 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7871 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7872 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7873 n
[4].i
, n
[5].i
, n
[6].i
));
7875 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7876 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7877 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7880 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7881 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7882 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7885 case OPCODE_CULL_FACE
:
7886 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7888 case OPCODE_DEPTH_FUNC
:
7889 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7891 case OPCODE_DEPTH_MASK
:
7892 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7894 case OPCODE_DEPTH_RANGE
:
7895 CALL_DepthRange(ctx
->Exec
,
7896 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7898 case OPCODE_DISABLE
:
7899 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7901 case OPCODE_DISABLE_INDEXED
:
7902 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7904 case OPCODE_DRAW_BUFFER
:
7905 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7907 case OPCODE_DRAW_PIXELS
:
7909 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7910 ctx
->Unpack
= ctx
->DefaultPacking
;
7911 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7912 get_pointer(&n
[5])));
7913 ctx
->Unpack
= save
; /* restore */
7917 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7919 case OPCODE_ENABLE_INDEXED
:
7920 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7922 case OPCODE_EVALMESH1
:
7923 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7925 case OPCODE_EVALMESH2
:
7926 CALL_EvalMesh2(ctx
->Exec
,
7927 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7936 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7939 case OPCODE_FRONT_FACE
:
7940 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7942 case OPCODE_FRUSTUM
:
7943 CALL_Frustum(ctx
->Exec
,
7944 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7947 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7949 case OPCODE_INDEX_MASK
:
7950 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7952 case OPCODE_INIT_NAMES
:
7953 CALL_InitNames(ctx
->Exec
, ());
7962 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7965 case OPCODE_LIGHT_MODEL
:
7972 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7975 case OPCODE_LINE_STIPPLE
:
7976 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7978 case OPCODE_LINE_WIDTH
:
7979 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7981 case OPCODE_LIST_BASE
:
7982 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7984 case OPCODE_LOAD_IDENTITY
:
7985 CALL_LoadIdentity(ctx
->Exec
, ());
7987 case OPCODE_LOAD_MATRIX
:
7988 if (sizeof(Node
) == sizeof(GLfloat
)) {
7989 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7994 for (i
= 0; i
< 16; i
++) {
7997 CALL_LoadMatrixf(ctx
->Exec
, (m
));
8000 case OPCODE_LOAD_NAME
:
8001 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
8003 case OPCODE_LOGIC_OP
:
8004 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
8008 GLenum target
= n
[1].e
;
8009 GLint ustride
= _mesa_evaluator_components(target
);
8010 GLint uorder
= n
[5].i
;
8011 GLfloat u1
= n
[2].f
;
8012 GLfloat u2
= n
[3].f
;
8013 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8014 (GLfloat
*) get_pointer(&n
[6])));
8019 GLenum target
= n
[1].e
;
8020 GLfloat u1
= n
[2].f
;
8021 GLfloat u2
= n
[3].f
;
8022 GLfloat v1
= n
[4].f
;
8023 GLfloat v2
= n
[5].f
;
8024 GLint ustride
= n
[6].i
;
8025 GLint vstride
= n
[7].i
;
8026 GLint uorder
= n
[8].i
;
8027 GLint vorder
= n
[9].i
;
8028 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8029 v1
, v2
, vstride
, vorder
,
8030 (GLfloat
*) get_pointer(&n
[10])));
8033 case OPCODE_MAPGRID1
:
8034 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8036 case OPCODE_MAPGRID2
:
8037 CALL_MapGrid2f(ctx
->Exec
,
8038 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8040 case OPCODE_MATRIX_MODE
:
8041 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8043 case OPCODE_MULT_MATRIX
:
8044 if (sizeof(Node
) == sizeof(GLfloat
)) {
8045 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8050 for (i
= 0; i
< 16; i
++) {
8053 CALL_MultMatrixf(ctx
->Exec
, (m
));
8057 CALL_Ortho(ctx
->Exec
,
8058 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8060 case OPCODE_PASSTHROUGH
:
8061 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8063 case OPCODE_PIXEL_MAP
:
8064 CALL_PixelMapfv(ctx
->Exec
,
8065 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
8067 case OPCODE_PIXEL_TRANSFER
:
8068 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8070 case OPCODE_PIXEL_ZOOM
:
8071 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8073 case OPCODE_POINT_SIZE
:
8074 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8076 case OPCODE_POINT_PARAMETERS
:
8082 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
8085 case OPCODE_POLYGON_MODE
:
8086 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8088 case OPCODE_POLYGON_STIPPLE
:
8090 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8091 ctx
->Unpack
= ctx
->DefaultPacking
;
8092 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
8093 ctx
->Unpack
= save
; /* restore */
8096 case OPCODE_POLYGON_OFFSET
:
8097 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8099 case OPCODE_POP_ATTRIB
:
8100 CALL_PopAttrib(ctx
->Exec
, ());
8102 case OPCODE_POP_MATRIX
:
8103 CALL_PopMatrix(ctx
->Exec
, ());
8105 case OPCODE_POP_NAME
:
8106 CALL_PopName(ctx
->Exec
, ());
8108 case OPCODE_PRIORITIZE_TEXTURE
:
8109 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8111 case OPCODE_PUSH_ATTRIB
:
8112 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8114 case OPCODE_PUSH_MATRIX
:
8115 CALL_PushMatrix(ctx
->Exec
, ());
8117 case OPCODE_PUSH_NAME
:
8118 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8120 case OPCODE_RASTER_POS
:
8121 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8123 case OPCODE_READ_BUFFER
:
8124 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8127 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8130 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8132 case OPCODE_SCISSOR
:
8133 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8135 case OPCODE_SHADE_MODEL
:
8136 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8138 case OPCODE_PROVOKING_VERTEX
:
8139 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
8141 case OPCODE_STENCIL_FUNC
:
8142 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8144 case OPCODE_STENCIL_MASK
:
8145 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8147 case OPCODE_STENCIL_OP
:
8148 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8150 case OPCODE_STENCIL_FUNC_SEPARATE
:
8151 CALL_StencilFuncSeparate(ctx
->Exec
,
8152 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8154 case OPCODE_STENCIL_MASK_SEPARATE
:
8155 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8157 case OPCODE_STENCIL_OP_SEPARATE
:
8158 CALL_StencilOpSeparate(ctx
->Exec
,
8159 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8168 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8178 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8181 case OPCODE_TEXPARAMETER
:
8188 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8191 case OPCODE_TEX_IMAGE1D
:
8193 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8194 ctx
->Unpack
= ctx
->DefaultPacking
;
8195 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8197 n
[3].i
, /* components */
8199 n
[5].e
, /* border */
8200 n
[6].e
, /* format */
8202 get_pointer(&n
[8])));
8203 ctx
->Unpack
= save
; /* restore */
8206 case OPCODE_TEX_IMAGE2D
:
8208 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8209 ctx
->Unpack
= ctx
->DefaultPacking
;
8210 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8212 n
[3].i
, /* components */
8214 n
[5].i
, /* height */
8215 n
[6].e
, /* border */
8216 n
[7].e
, /* format */
8218 get_pointer(&n
[9])));
8219 ctx
->Unpack
= save
; /* restore */
8222 case OPCODE_TEX_IMAGE3D
:
8224 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8225 ctx
->Unpack
= ctx
->DefaultPacking
;
8226 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8228 n
[3].i
, /* components */
8230 n
[5].i
, /* height */
8232 n
[7].e
, /* border */
8233 n
[8].e
, /* format */
8235 get_pointer(&n
[10])));
8236 ctx
->Unpack
= save
; /* restore */
8239 case OPCODE_TEX_SUB_IMAGE1D
:
8241 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8242 ctx
->Unpack
= ctx
->DefaultPacking
;
8243 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8245 n
[6].e
, get_pointer(&n
[7])));
8246 ctx
->Unpack
= save
; /* restore */
8249 case OPCODE_TEX_SUB_IMAGE2D
:
8251 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8252 ctx
->Unpack
= ctx
->DefaultPacking
;
8253 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8255 n
[6].i
, n
[7].e
, n
[8].e
,
8256 get_pointer(&n
[9])));
8257 ctx
->Unpack
= save
; /* restore */
8260 case OPCODE_TEX_SUB_IMAGE3D
:
8262 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8263 ctx
->Unpack
= ctx
->DefaultPacking
;
8264 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8265 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8266 n
[8].i
, n
[9].e
, n
[10].e
,
8267 get_pointer(&n
[11])));
8268 ctx
->Unpack
= save
; /* restore */
8271 case OPCODE_TRANSLATE
:
8272 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8274 case OPCODE_VIEWPORT
:
8275 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8276 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8278 case OPCODE_WINDOW_POS
:
8279 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8281 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8282 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
8284 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8285 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8286 n
[4].i
, n
[5].i
, n
[6].i
,
8287 get_pointer(&n
[7])));
8289 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8290 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8291 n
[4].i
, n
[5].i
, n
[6].i
,
8292 n
[7].i
, get_pointer(&n
[8])));
8294 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8295 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8296 n
[4].i
, n
[5].i
, n
[6].i
,
8298 get_pointer(&n
[9])));
8300 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8301 CALL_CompressedTexSubImage1D(ctx
->Exec
,
8302 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8304 get_pointer(&n
[7])));
8306 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8307 CALL_CompressedTexSubImage2D(ctx
->Exec
,
8308 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8309 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8310 get_pointer(&n
[9])));
8312 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8313 CALL_CompressedTexSubImage3D(ctx
->Exec
,
8314 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8315 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8317 get_pointer(&n
[11])));
8319 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8320 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8322 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8323 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8325 case OPCODE_BIND_PROGRAM_NV
: /* GL_ARB_vertex_program */
8326 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8328 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8329 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8330 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8333 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8334 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8336 case OPCODE_DEPTH_BOUNDS_EXT
:
8337 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8339 case OPCODE_PROGRAM_STRING_ARB
:
8340 CALL_ProgramStringARB(ctx
->Exec
,
8341 (n
[1].e
, n
[2].e
, n
[3].i
,
8342 get_pointer(&n
[4])));
8344 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8345 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8349 case OPCODE_BEGIN_QUERY_ARB
:
8350 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8352 case OPCODE_END_QUERY_ARB
:
8353 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
8355 case OPCODE_QUERY_COUNTER
:
8356 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8358 case OPCODE_BEGIN_QUERY_INDEXED
:
8359 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8361 case OPCODE_END_QUERY_INDEXED
:
8362 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8364 case OPCODE_DRAW_BUFFERS_ARB
:
8366 GLenum buffers
[MAX_DRAW_BUFFERS
];
8367 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8368 for (i
= 0; i
< count
; i
++)
8369 buffers
[i
] = n
[2 + i
].e
;
8370 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
8373 case OPCODE_BLIT_FRAMEBUFFER
:
8374 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8375 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8378 case OPCODE_USE_PROGRAM
:
8379 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
8381 case OPCODE_UNIFORM_1F
:
8382 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8384 case OPCODE_UNIFORM_2F
:
8385 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8387 case OPCODE_UNIFORM_3F
:
8388 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8390 case OPCODE_UNIFORM_4F
:
8391 CALL_Uniform4f(ctx
->Exec
,
8392 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8394 case OPCODE_UNIFORM_1FV
:
8395 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8397 case OPCODE_UNIFORM_2FV
:
8398 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8400 case OPCODE_UNIFORM_3FV
:
8401 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8403 case OPCODE_UNIFORM_4FV
:
8404 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8406 case OPCODE_UNIFORM_1I
:
8407 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8409 case OPCODE_UNIFORM_2I
:
8410 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8412 case OPCODE_UNIFORM_3I
:
8413 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8415 case OPCODE_UNIFORM_4I
:
8416 CALL_Uniform4i(ctx
->Exec
,
8417 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8419 case OPCODE_UNIFORM_1IV
:
8420 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8422 case OPCODE_UNIFORM_2IV
:
8423 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8425 case OPCODE_UNIFORM_3IV
:
8426 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8428 case OPCODE_UNIFORM_4IV
:
8429 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8431 case OPCODE_UNIFORM_1UI
:
8432 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8434 case OPCODE_UNIFORM_2UI
:
8435 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8437 case OPCODE_UNIFORM_3UI
:
8438 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8440 case OPCODE_UNIFORM_4UI
:
8441 /*CALL_Uniform4uiARB(ctx->Exec,
8442 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8445 case OPCODE_UNIFORM_1UIV
:
8446 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i,
8447 get_pointer(&n[3])));*/
8449 case OPCODE_UNIFORM_2UIV
:
8450 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i,
8451 get_pointer(&n[3])));*/
8453 case OPCODE_UNIFORM_3UIV
:
8454 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i,
8455 get_pointer(&n[3])));*/
8457 case OPCODE_UNIFORM_4UIV
:
8458 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i,
8459 get_pointer(&n[3])));*/
8461 case OPCODE_UNIFORM_MATRIX22
:
8462 CALL_UniformMatrix2fv(ctx
->Exec
,
8463 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8465 case OPCODE_UNIFORM_MATRIX33
:
8466 CALL_UniformMatrix3fv(ctx
->Exec
,
8467 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8469 case OPCODE_UNIFORM_MATRIX44
:
8470 CALL_UniformMatrix4fv(ctx
->Exec
,
8471 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8473 case OPCODE_UNIFORM_MATRIX23
:
8474 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8475 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8477 case OPCODE_UNIFORM_MATRIX32
:
8478 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8479 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8481 case OPCODE_UNIFORM_MATRIX24
:
8482 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8483 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8485 case OPCODE_UNIFORM_MATRIX42
:
8486 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8487 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8489 case OPCODE_UNIFORM_MATRIX34
:
8490 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8491 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8493 case OPCODE_UNIFORM_MATRIX43
:
8494 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8495 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8498 case OPCODE_USE_PROGRAM_STAGES
:
8499 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8501 case OPCODE_PROGRAM_UNIFORM_1F
:
8502 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
8504 case OPCODE_PROGRAM_UNIFORM_2F
:
8505 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
8507 case OPCODE_PROGRAM_UNIFORM_3F
:
8508 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8509 n
[3].f
, n
[4].f
, n
[5].f
));
8511 case OPCODE_PROGRAM_UNIFORM_4F
:
8512 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8513 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8515 case OPCODE_PROGRAM_UNIFORM_1FV
:
8516 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8517 get_pointer(&n
[4])));
8519 case OPCODE_PROGRAM_UNIFORM_2FV
:
8520 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8521 get_pointer(&n
[4])));
8523 case OPCODE_PROGRAM_UNIFORM_3FV
:
8524 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8525 get_pointer(&n
[4])));
8527 case OPCODE_PROGRAM_UNIFORM_4FV
:
8528 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8529 get_pointer(&n
[4])));
8531 case OPCODE_PROGRAM_UNIFORM_1I
:
8532 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
8534 case OPCODE_PROGRAM_UNIFORM_2I
:
8535 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
8537 case OPCODE_PROGRAM_UNIFORM_3I
:
8538 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8539 n
[3].i
, n
[4].i
, n
[5].i
));
8541 case OPCODE_PROGRAM_UNIFORM_4I
:
8542 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8543 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
8545 case OPCODE_PROGRAM_UNIFORM_1IV
:
8546 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8547 get_pointer(&n
[4])));
8549 case OPCODE_PROGRAM_UNIFORM_2IV
:
8550 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8551 get_pointer(&n
[4])));
8553 case OPCODE_PROGRAM_UNIFORM_3IV
:
8554 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8555 get_pointer(&n
[4])));
8557 case OPCODE_PROGRAM_UNIFORM_4IV
:
8558 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8559 get_pointer(&n
[4])));
8561 case OPCODE_PROGRAM_UNIFORM_1UI
:
8562 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
8564 case OPCODE_PROGRAM_UNIFORM_2UI
:
8565 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8568 case OPCODE_PROGRAM_UNIFORM_3UI
:
8569 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8570 n
[3].ui
, n
[4].ui
, n
[5].ui
));
8572 case OPCODE_PROGRAM_UNIFORM_4UI
:
8573 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8575 n
[4].ui
, n
[5].ui
, n
[6].ui
));
8577 case OPCODE_PROGRAM_UNIFORM_1UIV
:
8578 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8579 get_pointer(&n
[4])));
8581 case OPCODE_PROGRAM_UNIFORM_2UIV
:
8582 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8583 get_pointer(&n
[4])));
8585 case OPCODE_PROGRAM_UNIFORM_3UIV
:
8586 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8587 get_pointer(&n
[4])));
8589 case OPCODE_PROGRAM_UNIFORM_4UIV
:
8590 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8591 get_pointer(&n
[4])));
8593 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
8594 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8595 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8596 get_pointer(&n
[5])));
8598 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
8599 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8600 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8601 get_pointer(&n
[5])));
8603 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
8604 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8605 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8606 get_pointer(&n
[5])));
8608 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
8609 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8610 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8611 get_pointer(&n
[5])));
8613 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
8614 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8615 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8616 get_pointer(&n
[5])));
8618 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
8619 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8620 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8621 get_pointer(&n
[5])));
8623 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
8624 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8625 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8626 get_pointer(&n
[5])));
8628 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
8629 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8630 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8631 get_pointer(&n
[5])));
8633 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
8634 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8635 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8636 get_pointer(&n
[5])));
8639 case OPCODE_CLIP_CONTROL
:
8640 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8643 case OPCODE_CLAMP_COLOR
:
8644 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8647 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8648 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8650 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8653 GLuint i
, dst
= n
[1].ui
;
8655 for (i
= 0; i
< 4; i
++)
8656 values
[i
] = n
[1 + i
].f
;
8657 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8660 case OPCODE_ATTR_1F_NV
:
8661 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8663 case OPCODE_ATTR_2F_NV
:
8664 /* Really shouldn't have to do this - the Node structure
8665 * is convenient, but it would be better to store the data
8666 * packed appropriately so that it can be sent directly
8667 * on. With x86_64 becoming common, this will start to
8670 if (sizeof(Node
) == sizeof(GLfloat
))
8671 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8673 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8675 case OPCODE_ATTR_3F_NV
:
8676 if (sizeof(Node
) == sizeof(GLfloat
))
8677 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8679 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8682 case OPCODE_ATTR_4F_NV
:
8683 if (sizeof(Node
) == sizeof(GLfloat
))
8684 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8686 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8689 case OPCODE_ATTR_1F_ARB
:
8690 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8692 case OPCODE_ATTR_2F_ARB
:
8693 /* Really shouldn't have to do this - the Node structure
8694 * is convenient, but it would be better to store the data
8695 * packed appropriately so that it can be sent directly
8696 * on. With x86_64 becoming common, this will start to
8699 if (sizeof(Node
) == sizeof(GLfloat
))
8700 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8702 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8704 case OPCODE_ATTR_3F_ARB
:
8705 if (sizeof(Node
) == sizeof(GLfloat
))
8706 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8708 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8711 case OPCODE_ATTR_4F_ARB
:
8712 if (sizeof(Node
) == sizeof(GLfloat
))
8713 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8715 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8718 case OPCODE_MATERIAL
:
8719 if (sizeof(Node
) == sizeof(GLfloat
))
8720 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8727 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8731 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8734 CALL_End(ctx
->Exec
, ());
8737 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8739 case OPCODE_EVAL_C1
:
8740 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8742 case OPCODE_EVAL_C2
:
8743 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8745 case OPCODE_EVAL_P1
:
8746 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8748 case OPCODE_EVAL_P2
:
8749 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8752 /* GL_EXT_texture_integer */
8753 case OPCODE_CLEARCOLOR_I
:
8754 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8756 case OPCODE_CLEARCOLOR_UI
:
8757 CALL_ClearColorIuiEXT(ctx
->Exec
,
8758 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8760 case OPCODE_TEXPARAMETER_I
:
8767 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8770 case OPCODE_TEXPARAMETER_UI
:
8773 params
[0] = n
[3].ui
;
8774 params
[1] = n
[4].ui
;
8775 params
[2] = n
[5].ui
;
8776 params
[3] = n
[6].ui
;
8777 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8781 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8782 /* GL_ARB_instanced_arrays */
8783 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8786 case OPCODE_TEXTURE_BARRIER_NV
:
8787 CALL_TextureBarrierNV(ctx
->Exec
, ());
8790 /* GL_EXT/ARB_transform_feedback */
8791 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8792 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
8794 case OPCODE_END_TRANSFORM_FEEDBACK
:
8795 CALL_EndTransformFeedback(ctx
->Exec
, ());
8797 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8798 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8800 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8801 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8803 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8804 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8806 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8807 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8809 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8810 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8811 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8813 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8814 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8815 (n
[1].e
, n
[2].ui
, n
[3].si
));
8817 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8818 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8819 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8823 case OPCODE_BIND_SAMPLER
:
8824 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8826 case OPCODE_SAMPLER_PARAMETERIV
:
8833 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8836 case OPCODE_SAMPLER_PARAMETERFV
:
8843 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8846 case OPCODE_SAMPLER_PARAMETERIIV
:
8853 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8856 case OPCODE_SAMPLER_PARAMETERUIV
:
8859 params
[0] = n
[3].ui
;
8860 params
[1] = n
[4].ui
;
8861 params
[2] = n
[5].ui
;
8862 params
[3] = n
[6].ui
;
8863 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8867 /* GL_ARB_geometry_shader4 */
8868 case OPCODE_PROGRAM_PARAMETERI
:
8869 CALL_ProgramParameteri(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8871 case OPCODE_FRAMEBUFFER_TEXTURE
:
8872 CALL_FramebufferTexture(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8875 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8876 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8877 n
[3].ui
, n
[4].i
, n
[5].e
));
8881 case OPCODE_WAIT_SYNC
:
8883 union uint64_pair p
;
8884 p
.uint32
[0] = n
[2].ui
;
8885 p
.uint32
[1] = n
[3].ui
;
8886 CALL_WaitSync(ctx
->Exec
,
8887 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
8891 /* GL_NV_conditional_render */
8892 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8893 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8895 case OPCODE_END_CONDITIONAL_RENDER
:
8896 CALL_EndConditionalRender(ctx
->Exec
, ());
8899 case OPCODE_UNIFORM_BLOCK_BINDING
:
8900 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8903 case OPCODE_CONTINUE
:
8904 n
= (Node
*) get_pointer(&n
[1]);
8906 case OPCODE_END_OF_LIST
:
8912 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8914 _mesa_problem(ctx
, "%s", msg
);
8919 /* increment n to point to next compiled command */
8920 if (opcode
!= OPCODE_CONTINUE
) {
8921 n
+= InstSize
[opcode
];
8926 if (ctx
->Driver
.EndCallList
)
8927 ctx
->Driver
.EndCallList(ctx
);
8929 ctx
->ListState
.CallDepth
--;
8934 /**********************************************************************/
8936 /**********************************************************************/
8939 * Test if a display list number is valid.
8941 GLboolean GLAPIENTRY
8942 _mesa_IsList(GLuint list
)
8944 GET_CURRENT_CONTEXT(ctx
);
8945 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8946 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8947 return islist(ctx
, list
);
8952 * Delete a sequence of consecutive display lists.
8955 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8957 GET_CURRENT_CONTEXT(ctx
);
8959 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8960 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8963 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8966 for (i
= list
; i
< list
+ range
; i
++) {
8967 destroy_list(ctx
, i
);
8973 * Return a display list number, n, such that lists n through n+range-1
8977 _mesa_GenLists(GLsizei range
)
8979 GET_CURRENT_CONTEXT(ctx
);
8981 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8982 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8985 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8993 * Make this an atomic operation
8995 mtx_lock(&ctx
->Shared
->Mutex
);
8997 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8999 /* reserve the list IDs by with empty/dummy lists */
9001 for (i
= 0; i
< range
; i
++) {
9002 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
9003 make_list(base
+ i
, 1));
9007 mtx_unlock(&ctx
->Shared
->Mutex
);
9014 * Begin a new display list.
9017 _mesa_NewList(GLuint name
, GLenum mode
)
9019 GET_CURRENT_CONTEXT(ctx
);
9021 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
9022 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9024 if (MESA_VERBOSE
& VERBOSE_API
)
9025 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
9026 _mesa_lookup_enum_by_nr(mode
));
9029 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
9033 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
9034 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
9038 if (ctx
->ListState
.CurrentList
) {
9039 /* already compiling a display list */
9040 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
9044 ctx
->CompileFlag
= GL_TRUE
;
9045 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
9047 /* Reset accumulated list state */
9048 invalidate_saved_current_state( ctx
);
9050 /* Allocate new display list */
9051 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
9052 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
9053 ctx
->ListState
.CurrentPos
= 0;
9055 ctx
->Driver
.NewList(ctx
, name
, mode
);
9057 ctx
->CurrentDispatch
= ctx
->Save
;
9058 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9063 * End definition of current display list.
9068 GET_CURRENT_CONTEXT(ctx
);
9069 SAVE_FLUSH_VERTICES(ctx
);
9070 FLUSH_VERTICES(ctx
, 0);
9072 if (MESA_VERBOSE
& VERBOSE_API
)
9073 _mesa_debug(ctx
, "glEndList\n");
9075 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
9076 _mesa_error(ctx
, GL_INVALID_OPERATION
,
9077 "glEndList() called inside glBegin/End");
9080 /* Check that a list is under construction */
9081 if (!ctx
->ListState
.CurrentList
) {
9082 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
9086 /* Call before emitting END_OF_LIST, in case the driver wants to
9087 * emit opcodes itself.
9089 ctx
->Driver
.EndList(ctx
);
9091 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
9095 /* Destroy old list, if any */
9096 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
9098 /* Install the new list */
9099 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
9100 ctx
->ListState
.CurrentList
->Name
,
9101 ctx
->ListState
.CurrentList
);
9104 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
9105 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
9107 ctx
->ListState
.CurrentList
= NULL
;
9108 ctx
->ListState
.CurrentBlock
= NULL
;
9109 ctx
->ListState
.CurrentPos
= 0;
9110 ctx
->ExecuteFlag
= GL_TRUE
;
9111 ctx
->CompileFlag
= GL_FALSE
;
9113 ctx
->CurrentDispatch
= ctx
->Exec
;
9114 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9119 _mesa_CallList(GLuint list
)
9121 GLboolean save_compile_flag
;
9122 GET_CURRENT_CONTEXT(ctx
);
9123 FLUSH_CURRENT(ctx
, 0);
9125 if (MESA_VERBOSE
& VERBOSE_API
)
9126 _mesa_debug(ctx
, "glCallList %d\n", list
);
9129 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
9134 mesa_print_display_list( list
);
9136 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
9137 * execute the display list, and restore the CompileFlag.
9139 save_compile_flag
= ctx
->CompileFlag
;
9140 if (save_compile_flag
) {
9141 ctx
->CompileFlag
= GL_FALSE
;
9144 execute_list(ctx
, list
);
9145 ctx
->CompileFlag
= save_compile_flag
;
9147 /* also restore API function pointers to point to "save" versions */
9148 if (save_compile_flag
) {
9149 ctx
->CurrentDispatch
= ctx
->Save
;
9150 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9156 * Execute glCallLists: call multiple display lists.
9159 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9161 GET_CURRENT_CONTEXT(ctx
);
9163 GLboolean save_compile_flag
;
9165 if (MESA_VERBOSE
& VERBOSE_API
)
9166 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9170 case GL_UNSIGNED_BYTE
:
9172 case GL_UNSIGNED_SHORT
:
9174 case GL_UNSIGNED_INT
:
9182 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9186 /* Save the CompileFlag status, turn it off, execute display list,
9187 * and restore the CompileFlag.
9189 save_compile_flag
= ctx
->CompileFlag
;
9190 ctx
->CompileFlag
= GL_FALSE
;
9192 for (i
= 0; i
< n
; i
++) {
9193 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9194 execute_list(ctx
, list
);
9197 ctx
->CompileFlag
= save_compile_flag
;
9199 /* also restore API function pointers to point to "save" versions */
9200 if (save_compile_flag
) {
9201 ctx
->CurrentDispatch
= ctx
->Save
;
9202 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9208 * Set the offset added to list numbers in glCallLists.
9211 _mesa_ListBase(GLuint base
)
9213 GET_CURRENT_CONTEXT(ctx
);
9214 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9215 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9216 ctx
->List
.ListBase
= base
;
9220 * Setup the given dispatch table to point to Mesa's display list
9221 * building functions.
9223 * This does not include any of the tnl functions - they are
9224 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9228 _mesa_initialize_save_table(const struct gl_context
*ctx
)
9230 struct _glapi_table
*table
= ctx
->Save
;
9231 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
9233 /* Initially populate the dispatch table with the contents of the
9234 * normal-execution dispatch table. This lets us skip populating functions
9235 * that should be called directly instead of compiled into display lists.
9237 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
9239 _mesa_loopback_init_api_table(ctx
, table
);
9242 vbo_initialize_save_dispatch(ctx
, table
);
9245 SET_Accum(table
, save_Accum
);
9246 SET_AlphaFunc(table
, save_AlphaFunc
);
9247 SET_Bitmap(table
, save_Bitmap
);
9248 SET_BlendFunc(table
, save_BlendFunc
);
9249 SET_CallList(table
, save_CallList
);
9250 SET_CallLists(table
, save_CallLists
);
9251 SET_Clear(table
, save_Clear
);
9252 SET_ClearAccum(table
, save_ClearAccum
);
9253 SET_ClearColor(table
, save_ClearColor
);
9254 SET_ClearDepth(table
, save_ClearDepth
);
9255 SET_ClearIndex(table
, save_ClearIndex
);
9256 SET_ClearStencil(table
, save_ClearStencil
);
9257 SET_ClipPlane(table
, save_ClipPlane
);
9258 SET_ColorMask(table
, save_ColorMask
);
9259 SET_ColorMaski(table
, save_ColorMaskIndexed
);
9260 SET_ColorMaterial(table
, save_ColorMaterial
);
9261 SET_CopyPixels(table
, save_CopyPixels
);
9262 SET_CullFace(table
, save_CullFace
);
9263 SET_DepthFunc(table
, save_DepthFunc
);
9264 SET_DepthMask(table
, save_DepthMask
);
9265 SET_DepthRange(table
, save_DepthRange
);
9266 SET_Disable(table
, save_Disable
);
9267 SET_Disablei(table
, save_DisableIndexed
);
9268 SET_DrawBuffer(table
, save_DrawBuffer
);
9269 SET_DrawPixels(table
, save_DrawPixels
);
9270 SET_Enable(table
, save_Enable
);
9271 SET_Enablei(table
, save_EnableIndexed
);
9272 SET_EvalMesh1(table
, save_EvalMesh1
);
9273 SET_EvalMesh2(table
, save_EvalMesh2
);
9274 SET_Fogf(table
, save_Fogf
);
9275 SET_Fogfv(table
, save_Fogfv
);
9276 SET_Fogi(table
, save_Fogi
);
9277 SET_Fogiv(table
, save_Fogiv
);
9278 SET_FrontFace(table
, save_FrontFace
);
9279 SET_Frustum(table
, save_Frustum
);
9280 SET_Hint(table
, save_Hint
);
9281 SET_IndexMask(table
, save_IndexMask
);
9282 SET_InitNames(table
, save_InitNames
);
9283 SET_LightModelf(table
, save_LightModelf
);
9284 SET_LightModelfv(table
, save_LightModelfv
);
9285 SET_LightModeli(table
, save_LightModeli
);
9286 SET_LightModeliv(table
, save_LightModeliv
);
9287 SET_Lightf(table
, save_Lightf
);
9288 SET_Lightfv(table
, save_Lightfv
);
9289 SET_Lighti(table
, save_Lighti
);
9290 SET_Lightiv(table
, save_Lightiv
);
9291 SET_LineStipple(table
, save_LineStipple
);
9292 SET_LineWidth(table
, save_LineWidth
);
9293 SET_ListBase(table
, save_ListBase
);
9294 SET_LoadIdentity(table
, save_LoadIdentity
);
9295 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9296 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9297 SET_LoadName(table
, save_LoadName
);
9298 SET_LogicOp(table
, save_LogicOp
);
9299 SET_Map1d(table
, save_Map1d
);
9300 SET_Map1f(table
, save_Map1f
);
9301 SET_Map2d(table
, save_Map2d
);
9302 SET_Map2f(table
, save_Map2f
);
9303 SET_MapGrid1d(table
, save_MapGrid1d
);
9304 SET_MapGrid1f(table
, save_MapGrid1f
);
9305 SET_MapGrid2d(table
, save_MapGrid2d
);
9306 SET_MapGrid2f(table
, save_MapGrid2f
);
9307 SET_MatrixMode(table
, save_MatrixMode
);
9308 SET_MultMatrixd(table
, save_MultMatrixd
);
9309 SET_MultMatrixf(table
, save_MultMatrixf
);
9310 SET_NewList(table
, save_NewList
);
9311 SET_Ortho(table
, save_Ortho
);
9312 SET_PassThrough(table
, save_PassThrough
);
9313 SET_PixelMapfv(table
, save_PixelMapfv
);
9314 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9315 SET_PixelMapusv(table
, save_PixelMapusv
);
9316 SET_PixelTransferf(table
, save_PixelTransferf
);
9317 SET_PixelTransferi(table
, save_PixelTransferi
);
9318 SET_PixelZoom(table
, save_PixelZoom
);
9319 SET_PointSize(table
, save_PointSize
);
9320 SET_PolygonMode(table
, save_PolygonMode
);
9321 SET_PolygonOffset(table
, save_PolygonOffset
);
9322 SET_PolygonStipple(table
, save_PolygonStipple
);
9323 SET_PopAttrib(table
, save_PopAttrib
);
9324 SET_PopMatrix(table
, save_PopMatrix
);
9325 SET_PopName(table
, save_PopName
);
9326 SET_PushAttrib(table
, save_PushAttrib
);
9327 SET_PushMatrix(table
, save_PushMatrix
);
9328 SET_PushName(table
, save_PushName
);
9329 SET_RasterPos2d(table
, save_RasterPos2d
);
9330 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9331 SET_RasterPos2f(table
, save_RasterPos2f
);
9332 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9333 SET_RasterPos2i(table
, save_RasterPos2i
);
9334 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9335 SET_RasterPos2s(table
, save_RasterPos2s
);
9336 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9337 SET_RasterPos3d(table
, save_RasterPos3d
);
9338 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9339 SET_RasterPos3f(table
, save_RasterPos3f
);
9340 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9341 SET_RasterPos3i(table
, save_RasterPos3i
);
9342 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9343 SET_RasterPos3s(table
, save_RasterPos3s
);
9344 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9345 SET_RasterPos4d(table
, save_RasterPos4d
);
9346 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9347 SET_RasterPos4f(table
, save_RasterPos4f
);
9348 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9349 SET_RasterPos4i(table
, save_RasterPos4i
);
9350 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9351 SET_RasterPos4s(table
, save_RasterPos4s
);
9352 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9353 SET_ReadBuffer(table
, save_ReadBuffer
);
9354 SET_Rectf(table
, save_Rectf
);
9355 SET_Rotated(table
, save_Rotated
);
9356 SET_Rotatef(table
, save_Rotatef
);
9357 SET_Scaled(table
, save_Scaled
);
9358 SET_Scalef(table
, save_Scalef
);
9359 SET_Scissor(table
, save_Scissor
);
9360 SET_ShadeModel(table
, save_ShadeModel
);
9361 SET_StencilFunc(table
, save_StencilFunc
);
9362 SET_StencilMask(table
, save_StencilMask
);
9363 SET_StencilOp(table
, save_StencilOp
);
9364 SET_TexEnvf(table
, save_TexEnvf
);
9365 SET_TexEnvfv(table
, save_TexEnvfv
);
9366 SET_TexEnvi(table
, save_TexEnvi
);
9367 SET_TexEnviv(table
, save_TexEnviv
);
9368 SET_TexGend(table
, save_TexGend
);
9369 SET_TexGendv(table
, save_TexGendv
);
9370 SET_TexGenf(table
, save_TexGenf
);
9371 SET_TexGenfv(table
, save_TexGenfv
);
9372 SET_TexGeni(table
, save_TexGeni
);
9373 SET_TexGeniv(table
, save_TexGeniv
);
9374 SET_TexImage1D(table
, save_TexImage1D
);
9375 SET_TexImage2D(table
, save_TexImage2D
);
9376 SET_TexParameterf(table
, save_TexParameterf
);
9377 SET_TexParameterfv(table
, save_TexParameterfv
);
9378 SET_TexParameteri(table
, save_TexParameteri
);
9379 SET_TexParameteriv(table
, save_TexParameteriv
);
9380 SET_Translated(table
, save_Translated
);
9381 SET_Translatef(table
, save_Translatef
);
9382 SET_Viewport(table
, save_Viewport
);
9385 SET_BindTexture(table
, save_BindTexture
);
9386 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9387 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9388 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9389 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9390 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9391 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9392 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9395 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9396 SET_TexImage3D(table
, save_TexImage3D
);
9397 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9400 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9401 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9402 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9404 /* ATI_separate_stencil */
9405 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9407 /* GL_ARB_imaging */
9408 /* Not all are supported */
9409 SET_BlendColor(table
, save_BlendColor
);
9410 SET_BlendEquation(table
, save_BlendEquation
);
9412 /* 2. GL_EXT_blend_color */
9414 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9417 /* 3. GL_EXT_polygon_offset */
9418 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9420 /* 6. GL_EXT_texture3d */
9422 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9423 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9424 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9427 /* 37. GL_EXT_blend_minmax */
9429 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9432 /* 54. GL_EXT_point_parameters */
9433 SET_PointParameterf(table
, save_PointParameterfEXT
);
9434 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
9436 /* 173. GL_EXT_blend_func_separate */
9437 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
9439 /* 197. GL_MESA_window_pos */
9440 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
9441 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
9442 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
9443 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
9444 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
9445 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
9446 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
9447 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
9448 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
9449 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
9450 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
9451 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
9452 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
9453 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
9454 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
9455 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
9456 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9457 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9458 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9459 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9460 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9461 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9462 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9463 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9465 /* 233. GL_NV_vertex_program */
9466 /* The following commands DO NOT go into display lists:
9467 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9468 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9470 SET_BindProgramARB(table
, save_BindProgramNV
);
9472 /* 245. GL_ATI_fragment_shader */
9473 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9474 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9476 /* 262. GL_NV_point_sprite */
9477 SET_PointParameteri(table
, save_PointParameteriNV
);
9478 SET_PointParameteriv(table
, save_PointParameterivNV
);
9480 /* 268. GL_EXT_stencil_two_side */
9481 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9483 /* ???. GL_EXT_depth_bounds_test */
9484 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9486 /* ARB 1. GL_ARB_multitexture */
9487 SET_ActiveTexture(table
, save_ActiveTextureARB
);
9489 /* ARB 3. GL_ARB_transpose_matrix */
9490 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
9491 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
9492 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
9493 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
9495 /* ARB 5. GL_ARB_multisample */
9496 SET_SampleCoverage(table
, save_SampleCoverageARB
);
9498 /* ARB 12. GL_ARB_texture_compression */
9499 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
9500 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
9501 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
9502 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
9503 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
9504 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
9506 /* ARB 14. GL_ARB_point_parameters */
9507 /* aliased with EXT_point_parameters functions */
9509 /* ARB 25. GL_ARB_window_pos */
9510 /* aliased with MESA_window_pos functions */
9512 /* ARB 26. GL_ARB_vertex_program */
9513 /* ARB 27. GL_ARB_fragment_program */
9514 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9515 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9516 SET_BindProgramARB(table
, save_BindProgramNV
);
9517 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9518 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9519 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9520 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9521 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9522 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9523 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9524 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9526 SET_BeginQuery(table
, save_BeginQueryARB
);
9527 SET_EndQuery(table
, save_EndQueryARB
);
9528 SET_QueryCounter(table
, save_QueryCounter
);
9530 SET_DrawBuffers(table
, save_DrawBuffersARB
);
9532 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
9534 SET_UseProgram(table
, save_UseProgramObjectARB
);
9535 SET_Uniform1f(table
, save_Uniform1fARB
);
9536 SET_Uniform2f(table
, save_Uniform2fARB
);
9537 SET_Uniform3f(table
, save_Uniform3fARB
);
9538 SET_Uniform4f(table
, save_Uniform4fARB
);
9539 SET_Uniform1fv(table
, save_Uniform1fvARB
);
9540 SET_Uniform2fv(table
, save_Uniform2fvARB
);
9541 SET_Uniform3fv(table
, save_Uniform3fvARB
);
9542 SET_Uniform4fv(table
, save_Uniform4fvARB
);
9543 SET_Uniform1i(table
, save_Uniform1iARB
);
9544 SET_Uniform2i(table
, save_Uniform2iARB
);
9545 SET_Uniform3i(table
, save_Uniform3iARB
);
9546 SET_Uniform4i(table
, save_Uniform4iARB
);
9547 SET_Uniform1iv(table
, save_Uniform1ivARB
);
9548 SET_Uniform2iv(table
, save_Uniform2ivARB
);
9549 SET_Uniform3iv(table
, save_Uniform3ivARB
);
9550 SET_Uniform4iv(table
, save_Uniform4ivARB
);
9551 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
9552 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
9553 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
9554 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9555 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9556 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9557 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9558 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9559 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9561 /* 299. GL_EXT_blend_equation_separate */
9562 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
9564 /* GL_EXT_gpu_program_parameters */
9565 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9566 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9568 /* 364. GL_EXT_provoking_vertex */
9569 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
9571 /* GL_EXT_texture_integer */
9572 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
9573 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
9574 SET_TexParameterIiv(table
, save_TexParameterIiv
);
9575 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
9577 /* GL_ARB_clip_control */
9578 SET_ClipControl(table
, save_ClipControl
);
9580 /* GL_ARB_color_buffer_float */
9581 SET_ClampColor(table
, save_ClampColorARB
);
9584 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9585 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9586 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9587 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9589 SET_Uniform1ui(table
, save_Uniform1ui
);
9590 SET_Uniform2ui(table
, save_Uniform2ui
);
9591 SET_Uniform3ui(table
, save_Uniform3ui
);
9592 SET_Uniform4ui(table
, save_Uniform4ui
);
9593 SET_Uniform1uiv(table
, save_Uniform1uiv
);
9594 SET_Uniform2uiv(table
, save_Uniform2uiv
);
9595 SET_Uniform3uiv(table
, save_Uniform3uiv
);
9596 SET_Uniform4uiv(table
, save_Uniform4uiv
);
9598 (void) save_Uniform1ui
;
9599 (void) save_Uniform2ui
;
9600 (void) save_Uniform3ui
;
9601 (void) save_Uniform4ui
;
9602 (void) save_Uniform1uiv
;
9603 (void) save_Uniform2uiv
;
9604 (void) save_Uniform3uiv
;
9605 (void) save_Uniform4uiv
;
9609 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
9610 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
9611 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
9612 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
9613 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
9614 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
9615 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
9616 SET_DrawTransformFeedbackInstanced(table
,
9617 save_DrawTransformFeedbackInstanced
);
9618 SET_DrawTransformFeedbackStreamInstanced(table
,
9619 save_DrawTransformFeedbackStreamInstanced
);
9620 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
9621 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
9623 /* GL_ARB_instanced_arrays */
9624 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
9626 /* GL_NV_texture_barrier */
9627 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
9629 SET_BindSampler(table
, save_BindSampler
);
9630 SET_SamplerParameteri(table
, save_SamplerParameteri
);
9631 SET_SamplerParameterf(table
, save_SamplerParameterf
);
9632 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
9633 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
9634 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
9635 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
9637 /* GL_ARB_draw_buffer_blend */
9638 SET_BlendFunciARB(table
, save_BlendFunci
);
9639 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
9640 SET_BlendEquationiARB(table
, save_BlendEquationi
);
9641 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
9643 /* GL_ARB_geometry_shader4 */
9644 SET_ProgramParameteri(table
, save_ProgramParameteri
);
9645 SET_FramebufferTexture(table
, save_FramebufferTexture
);
9646 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
9648 /* GL_NV_conditional_render */
9649 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
9650 SET_EndConditionalRender(table
, save_EndConditionalRender
);
9653 SET_WaitSync(table
, save_WaitSync
);
9655 /* GL_ARB_uniform_buffer_object */
9656 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
9658 /* GL_ARB_draw_instanced */
9659 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
9660 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
9662 /* GL_ARB_draw_elements_base_vertex */
9663 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
9665 /* GL_ARB_base_instance */
9666 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
9667 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
9668 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
9670 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
9671 SET_UseProgramStages(table
, save_UseProgramStages
);
9672 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
9673 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
9674 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
9675 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
9676 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
9677 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
9678 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
9679 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
9680 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
9681 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
9682 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
9683 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
9684 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
9685 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
9686 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
9687 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
9688 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
9689 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
9690 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
9691 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
9692 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
9693 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
9694 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
9695 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
9696 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
9697 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
9698 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
9699 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
9700 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
9701 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
9702 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
9703 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
9704 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
9710 enum_string(GLenum k
)
9712 return _mesa_lookup_enum_by_nr(k
);
9717 * Print the commands in a display list. For debugging only.
9718 * TODO: many commands aren't handled yet.
9719 * \param fname filename to write display list to. If null, use stdout.
9721 static void GLAPIENTRY
9722 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
9724 struct gl_display_list
*dlist
;
9730 f
= fopen(fname
, "w");
9735 if (!islist(ctx
, list
)) {
9736 fprintf(f
, "%u is not a display list ID\n", list
);
9740 dlist
= _mesa_lookup_list(ctx
, list
);
9746 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
9748 done
= n
? GL_FALSE
: GL_TRUE
;
9750 const OpCode opcode
= n
[0].opcode
;
9752 if (is_ext_opcode(opcode
)) {
9753 n
+= ext_opcode_print(ctx
, n
, f
);
9758 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9760 case OPCODE_ACTIVE_TEXTURE
:
9761 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
9764 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9765 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9766 get_pointer(&n
[7]));
9768 case OPCODE_CALL_LIST
:
9769 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
9771 case OPCODE_CALL_LIST_OFFSET
:
9772 fprintf(f
, "CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9773 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9775 case OPCODE_DISABLE
:
9776 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
9779 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
9781 case OPCODE_FRUSTUM
:
9782 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
9783 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9785 case OPCODE_LINE_STIPPLE
:
9786 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9788 case OPCODE_LOAD_IDENTITY
:
9789 fprintf(f
, "LoadIdentity\n");
9791 case OPCODE_LOAD_MATRIX
:
9792 fprintf(f
, "LoadMatrix\n");
9793 fprintf(f
, " %8f %8f %8f %8f\n",
9794 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9795 fprintf(f
, " %8f %8f %8f %8f\n",
9796 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9797 fprintf(f
, " %8f %8f %8f %8f\n",
9798 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9799 fprintf(f
, " %8f %8f %8f %8f\n",
9800 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9802 case OPCODE_MULT_MATRIX
:
9803 fprintf(f
, "MultMatrix (or Rotate)\n");
9804 fprintf(f
, " %8f %8f %8f %8f\n",
9805 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9806 fprintf(f
, " %8f %8f %8f %8f\n",
9807 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9808 fprintf(f
, " %8f %8f %8f %8f\n",
9809 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9810 fprintf(f
, " %8f %8f %8f %8f\n",
9811 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9814 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
9815 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9817 case OPCODE_POP_ATTRIB
:
9818 fprintf(f
, "PopAttrib\n");
9820 case OPCODE_POP_MATRIX
:
9821 fprintf(f
, "PopMatrix\n");
9823 case OPCODE_POP_NAME
:
9824 fprintf(f
, "PopName\n");
9826 case OPCODE_PUSH_ATTRIB
:
9827 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
9829 case OPCODE_PUSH_MATRIX
:
9830 fprintf(f
, "PushMatrix\n");
9832 case OPCODE_PUSH_NAME
:
9833 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
9835 case OPCODE_RASTER_POS
:
9836 fprintf(f
, "RasterPos %g %g %g %g\n",
9837 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9840 fprintf(f
, "Rotate %g %g %g %g\n",
9841 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9844 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9846 case OPCODE_TRANSLATE
:
9847 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9849 case OPCODE_BIND_TEXTURE
:
9850 fprintf(f
, "BindTexture %s %d\n",
9851 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9853 case OPCODE_SHADE_MODEL
:
9854 fprintf(f
, "ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9857 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
9858 _mesa_lookup_enum_by_nr(n
[1].ui
),
9859 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9862 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9863 _mesa_lookup_enum_by_nr(n
[1].ui
),
9864 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9865 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9867 case OPCODE_MAPGRID1
:
9868 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9870 case OPCODE_MAPGRID2
:
9871 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9872 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9874 case OPCODE_EVALMESH1
:
9875 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9877 case OPCODE_EVALMESH2
:
9878 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
9879 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9882 case OPCODE_ATTR_1F_NV
:
9883 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9885 case OPCODE_ATTR_2F_NV
:
9886 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
9887 n
[1].i
, n
[2].f
, n
[3].f
);
9889 case OPCODE_ATTR_3F_NV
:
9890 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
9891 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9893 case OPCODE_ATTR_4F_NV
:
9894 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
9895 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9897 case OPCODE_ATTR_1F_ARB
:
9898 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9900 case OPCODE_ATTR_2F_ARB
:
9901 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
9902 n
[1].i
, n
[2].f
, n
[3].f
);
9904 case OPCODE_ATTR_3F_ARB
:
9905 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
9906 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9908 case OPCODE_ATTR_4F_ARB
:
9909 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
9910 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9913 case OPCODE_MATERIAL
:
9914 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
9915 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9918 fprintf(f
, "BEGIN %x\n", n
[1].i
);
9921 fprintf(f
, "END\n");
9924 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9927 case OPCODE_EVAL_C1
:
9928 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
9930 case OPCODE_EVAL_C2
:
9931 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9933 case OPCODE_EVAL_P1
:
9934 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
9936 case OPCODE_EVAL_P2
:
9937 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9940 case OPCODE_PROVOKING_VERTEX
:
9941 fprintf(f
, "ProvokingVertex %s\n",
9942 _mesa_lookup_enum_by_nr(n
[1].ui
));
9946 * meta opcodes/commands
9949 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
9950 (const char *) get_pointer(&n
[2]));
9952 case OPCODE_CONTINUE
:
9953 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
9954 n
= (Node
*) get_pointer(&n
[1]);
9956 case OPCODE_END_OF_LIST
:
9957 fprintf(f
, "END-LIST %u\n", list
);
9961 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9963 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9964 opcode
, (void *) n
);
9968 fprintf(f
, "command %d, %u operands\n", opcode
,
9972 /* increment n to point to next compiled command */
9973 if (opcode
!= OPCODE_CONTINUE
) {
9974 n
+= InstSize
[opcode
];
9987 * Clients may call this function to help debug display list problems.
9988 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9989 * changed, or break in the future without notice.
9992 mesa_print_display_list(GLuint list
)
9994 GET_CURRENT_CONTEXT(ctx
);
9995 print_list(ctx
, list
, NULL
);
9999 /**********************************************************************/
10000 /***** Initialization *****/
10001 /**********************************************************************/
10004 save_vtxfmt_init(GLvertexformat
* vfmt
)
10006 vfmt
->ArrayElement
= _ae_ArrayElement
;
10008 vfmt
->Begin
= save_Begin
;
10010 vfmt
->CallList
= save_CallList
;
10011 vfmt
->CallLists
= save_CallLists
;
10013 vfmt
->Color3f
= save_Color3f
;
10014 vfmt
->Color3fv
= save_Color3fv
;
10015 vfmt
->Color4f
= save_Color4f
;
10016 vfmt
->Color4fv
= save_Color4fv
;
10017 vfmt
->EdgeFlag
= save_EdgeFlag
;
10018 vfmt
->End
= save_End
;
10020 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
10021 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
10022 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
10023 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
10024 vfmt
->EvalPoint1
= save_EvalPoint1
;
10025 vfmt
->EvalPoint2
= save_EvalPoint2
;
10027 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10028 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10029 vfmt
->Indexf
= save_Indexf
;
10030 vfmt
->Indexfv
= save_Indexfv
;
10031 vfmt
->Materialfv
= save_Materialfv
;
10032 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10033 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10034 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10035 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10036 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10037 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10038 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10039 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10040 vfmt
->Normal3f
= save_Normal3f
;
10041 vfmt
->Normal3fv
= save_Normal3fv
;
10042 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10043 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10044 vfmt
->TexCoord1f
= save_TexCoord1f
;
10045 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10046 vfmt
->TexCoord2f
= save_TexCoord2f
;
10047 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10048 vfmt
->TexCoord3f
= save_TexCoord3f
;
10049 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10050 vfmt
->TexCoord4f
= save_TexCoord4f
;
10051 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10052 vfmt
->Vertex2f
= save_Vertex2f
;
10053 vfmt
->Vertex2fv
= save_Vertex2fv
;
10054 vfmt
->Vertex3f
= save_Vertex3f
;
10055 vfmt
->Vertex3fv
= save_Vertex3fv
;
10056 vfmt
->Vertex4f
= save_Vertex4f
;
10057 vfmt
->Vertex4fv
= save_Vertex4fv
;
10058 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10059 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10060 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10061 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10062 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10063 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10064 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10065 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10070 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10071 const GLvertexformat
*vfmt
)
10073 SET_CallList(disp
, vfmt
->CallList
);
10074 SET_CallLists(disp
, vfmt
->CallLists
);
10079 * Initialize display list state for given context.
10082 _mesa_init_display_list(struct gl_context
*ctx
)
10084 static GLboolean tableInitialized
= GL_FALSE
;
10086 /* zero-out the instruction size table, just once */
10087 if (!tableInitialized
) {
10088 memset(InstSize
, 0, sizeof(InstSize
));
10089 tableInitialized
= GL_TRUE
;
10092 /* extension info */
10093 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10096 ctx
->ListState
.CallDepth
= 0;
10097 ctx
->ExecuteFlag
= GL_TRUE
;
10098 ctx
->CompileFlag
= GL_FALSE
;
10099 ctx
->ListState
.CurrentBlock
= NULL
;
10100 ctx
->ListState
.CurrentPos
= 0;
10102 /* Display List group */
10103 ctx
->List
.ListBase
= 0;
10105 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10110 _mesa_free_display_list_data(struct gl_context
*ctx
)
10112 free(ctx
->ListExt
);
10113 ctx
->ListExt
= NULL
;