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 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
961 format
, type
, pixels
, unpack
);
962 if (pixels
&& !image
) {
963 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
967 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
968 depth
, format
, type
, INT_MAX
, pixels
)) {
969 const GLubyte
*map
, *src
;
973 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
974 GL_MAP_READ_BIT
, unpack
->BufferObj
,
977 /* unable to map src buffer! */
978 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
982 src
= ADD_POINTERS(map
, pixels
);
983 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
984 format
, type
, src
, unpack
);
986 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
989 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
995 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1000 /** Return copy of memory */
1002 memdup(const void *src
, GLsizei bytes
)
1004 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1006 memcpy(b
, src
, bytes
);
1012 * Allocate space for a display list instruction (opcode + payload space).
1013 * \param opcode the instruction opcode (OPCODE_* value)
1014 * \param bytes instruction payload size (not counting opcode)
1015 * \return pointer to allocated memory (the opcode space)
1018 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
)
1020 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1021 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1024 if (opcode
< OPCODE_EXT_0
) {
1025 if (InstSize
[opcode
] == 0) {
1026 /* save instruction size now */
1027 InstSize
[opcode
] = numNodes
;
1030 /* make sure instruction size agrees */
1031 ASSERT(numNodes
== InstSize
[opcode
]);
1035 if (ctx
->ListState
.CurrentPos
+ numNodes
+ contNodes
> BLOCK_SIZE
) {
1036 /* This block is full. Allocate a new block and chain to it */
1038 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1039 n
[0].opcode
= OPCODE_CONTINUE
;
1040 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1042 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1045 save_pointer(&n
[1], newblock
);
1046 ctx
->ListState
.CurrentBlock
= newblock
;
1047 ctx
->ListState
.CurrentPos
= 0;
1050 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1051 ctx
->ListState
.CurrentPos
+= numNodes
;
1053 n
[0].opcode
= opcode
;
1061 * Allocate space for a display list instruction. Used by callers outside
1062 * this file for things like VBO vertex data.
1064 * \param opcode the instruction opcode (OPCODE_* value)
1065 * \param bytes instruction size in bytes, not counting opcode.
1066 * \return pointer to the usable data area (not including the internal
1070 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1072 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
1074 return n
+ 1; /* return pointer to payload area, after opcode */
1081 * This function allows modules and drivers to get their own opcodes
1082 * for extending display list functionality.
1083 * \param ctx the rendering context
1084 * \param size number of bytes for storing the new display list command
1085 * \param execute function to execute the new display list command
1086 * \param destroy function to destroy the new display list command
1087 * \param print function to print the new display list command
1088 * \return the new opcode number or -1 if error
1091 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1093 void (*execute
) (struct gl_context
*, void *),
1094 void (*destroy
) (struct gl_context
*, void *),
1095 void (*print
) (struct gl_context
*, void *, FILE *))
1097 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1098 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1099 ctx
->ListExt
->Opcode
[i
].Size
=
1100 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1101 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1102 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1103 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1104 return i
+ OPCODE_EXT_0
;
1111 * Allocate space for a display list instruction. The space is basically
1112 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1113 * function parameter, node[2] is the second parameter, etc.
1115 * \param opcode one of OPCODE_x
1116 * \param nparams number of function parameters
1117 * \return pointer to start of instruction space
1119 static inline Node
*
1120 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1122 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
1127 * Called by EndList to try to reduce memory used for the list.
1130 trim_list(struct gl_context
*ctx
)
1132 /* If the list we're ending only has one allocated block of nodes/tokens
1133 * and its size isn't a full block size, realloc the block to use less
1134 * memory. This is important for apps that create many small display
1135 * lists and apps that use glXUseXFont (many lists each containing one
1137 * Note: we currently only trim display lists that allocated one block
1138 * of tokens. That hits the short list case which is what we're mainly
1139 * concerned with. Trimming longer lists would involve traversing the
1140 * linked list of blocks.
1142 struct gl_dlist_state
*list
= &ctx
->ListState
;
1144 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1145 (list
->CurrentPos
< BLOCK_SIZE
)) {
1146 /* There's only one block and it's not full, so realloc */
1147 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1148 list
->CurrentList
->Head
=
1149 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1150 if (!list
->CurrentBlock
) {
1151 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1159 * Display List compilation functions
1161 static void GLAPIENTRY
1162 save_Accum(GLenum op
, GLfloat value
)
1164 GET_CURRENT_CONTEXT(ctx
);
1166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1167 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1172 if (ctx
->ExecuteFlag
) {
1173 CALL_Accum(ctx
->Exec
, (op
, value
));
1178 static void GLAPIENTRY
1179 save_AlphaFunc(GLenum func
, GLclampf ref
)
1181 GET_CURRENT_CONTEXT(ctx
);
1183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1184 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1187 n
[2].f
= (GLfloat
) ref
;
1189 if (ctx
->ExecuteFlag
) {
1190 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1195 static void GLAPIENTRY
1196 save_BindTexture(GLenum target
, GLuint texture
)
1198 GET_CURRENT_CONTEXT(ctx
);
1200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1201 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1206 if (ctx
->ExecuteFlag
) {
1207 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1212 static void GLAPIENTRY
1213 save_Bitmap(GLsizei width
, GLsizei height
,
1214 GLfloat xorig
, GLfloat yorig
,
1215 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1217 GET_CURRENT_CONTEXT(ctx
);
1219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1220 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1222 n
[1].i
= (GLint
) width
;
1223 n
[2].i
= (GLint
) height
;
1229 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1230 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1232 if (ctx
->ExecuteFlag
) {
1233 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1234 xorig
, yorig
, xmove
, ymove
, pixels
));
1239 static void GLAPIENTRY
1240 save_BlendEquation(GLenum mode
)
1242 GET_CURRENT_CONTEXT(ctx
);
1244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1245 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1249 if (ctx
->ExecuteFlag
) {
1250 CALL_BlendEquation(ctx
->Exec
, (mode
));
1255 static void GLAPIENTRY
1256 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1258 GET_CURRENT_CONTEXT(ctx
);
1260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1261 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1266 if (ctx
->ExecuteFlag
) {
1267 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1272 static void GLAPIENTRY
1273 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1274 GLenum sfactorA
, GLenum dfactorA
)
1276 GET_CURRENT_CONTEXT(ctx
);
1278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1279 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1281 n
[1].e
= sfactorRGB
;
1282 n
[2].e
= dfactorRGB
;
1286 if (ctx
->ExecuteFlag
) {
1287 CALL_BlendFuncSeparate(ctx
->Exec
,
1288 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1293 static void GLAPIENTRY
1294 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1296 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1300 static void GLAPIENTRY
1301 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1303 GET_CURRENT_CONTEXT(ctx
);
1305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1306 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1313 if (ctx
->ExecuteFlag
) {
1314 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1318 /* GL_ARB_draw_buffers_blend */
1319 static void GLAPIENTRY
1320 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1321 GLenum sfactorA
, GLenum dfactorA
)
1323 GET_CURRENT_CONTEXT(ctx
);
1325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1326 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1329 n
[2].e
= sfactorRGB
;
1330 n
[3].e
= dfactorRGB
;
1334 if (ctx
->ExecuteFlag
) {
1335 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1336 sfactorA
, dfactorA
));
1340 /* GL_ARB_draw_buffers_blend */
1341 static void GLAPIENTRY
1342 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1344 GET_CURRENT_CONTEXT(ctx
);
1346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1347 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 3);
1353 if (ctx
->ExecuteFlag
) {
1354 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1358 /* GL_ARB_draw_buffers_blend */
1359 static void GLAPIENTRY
1360 save_BlendEquationi(GLuint buf
, GLenum mode
)
1362 GET_CURRENT_CONTEXT(ctx
);
1364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1365 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1370 if (ctx
->ExecuteFlag
) {
1371 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1375 /* GL_ARB_draw_buffers_blend */
1376 static void GLAPIENTRY
1377 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1379 GET_CURRENT_CONTEXT(ctx
);
1381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1382 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1388 if (ctx
->ExecuteFlag
) {
1389 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1394 /* GL_ARB_draw_instanced. */
1395 static void GLAPIENTRY
1396 save_DrawArraysInstancedARB(GLenum mode
,
1401 GET_CURRENT_CONTEXT(ctx
);
1402 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1403 "glDrawArraysInstanced() during display list compile");
1406 static void GLAPIENTRY
1407 save_DrawElementsInstancedARB(GLenum mode
,
1410 const GLvoid
*indices
,
1413 GET_CURRENT_CONTEXT(ctx
);
1414 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1415 "glDrawElementsInstanced() during display list compile");
1418 static void GLAPIENTRY
1419 save_DrawElementsInstancedBaseVertexARB(GLenum mode
,
1422 const GLvoid
*indices
,
1426 GET_CURRENT_CONTEXT(ctx
);
1427 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1428 "glDrawElementsInstancedBaseVertex() during display list compile");
1431 /* GL_ARB_base_instance. */
1432 static void GLAPIENTRY
1433 save_DrawArraysInstancedBaseInstance(GLenum mode
,
1437 GLuint baseinstance
)
1439 GET_CURRENT_CONTEXT(ctx
);
1440 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1441 "glDrawArraysInstancedBaseInstance() during display list compile");
1444 static void APIENTRY
1445 save_DrawElementsInstancedBaseInstance(GLenum mode
,
1448 const void *indices
,
1450 GLuint baseinstance
)
1452 GET_CURRENT_CONTEXT(ctx
);
1453 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1454 "glDrawElementsInstancedBaseInstance() during display list compile");
1457 static void APIENTRY
1458 save_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode
,
1461 const void *indices
,
1464 GLuint baseinstance
)
1466 GET_CURRENT_CONTEXT(ctx
);
1467 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1468 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1473 * While building a display list we cache some OpenGL state.
1474 * Under some circumstances we need to invalidate that state (immediately
1475 * when we start compiling a list, or after glCallList(s)).
1478 invalidate_saved_current_state(struct gl_context
*ctx
)
1482 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1483 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1485 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1486 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1488 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1490 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1494 static void GLAPIENTRY
1495 save_CallList(GLuint list
)
1497 GET_CURRENT_CONTEXT(ctx
);
1499 SAVE_FLUSH_VERTICES(ctx
);
1501 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1506 /* After this, we don't know what state we're in. Invalidate all
1507 * cached information previously gathered:
1509 invalidate_saved_current_state( ctx
);
1511 if (ctx
->ExecuteFlag
) {
1512 _mesa_CallList(list
);
1517 static void GLAPIENTRY
1518 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1520 GET_CURRENT_CONTEXT(ctx
);
1522 GLboolean typeErrorFlag
;
1524 SAVE_FLUSH_VERTICES(ctx
);
1528 case GL_UNSIGNED_BYTE
:
1530 case GL_UNSIGNED_SHORT
:
1532 case GL_UNSIGNED_INT
:
1537 typeErrorFlag
= GL_FALSE
;
1540 typeErrorFlag
= GL_TRUE
;
1543 for (i
= 0; i
< num
; i
++) {
1544 GLint list
= translate_id(i
, type
, lists
);
1545 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1548 n
[2].b
= typeErrorFlag
;
1552 /* After this, we don't know what state we're in. Invalidate all
1553 * cached information previously gathered:
1555 invalidate_saved_current_state( ctx
);
1557 if (ctx
->ExecuteFlag
) {
1558 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1563 static void GLAPIENTRY
1564 save_Clear(GLbitfield mask
)
1566 GET_CURRENT_CONTEXT(ctx
);
1568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1569 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1573 if (ctx
->ExecuteFlag
) {
1574 CALL_Clear(ctx
->Exec
, (mask
));
1579 static void GLAPIENTRY
1580 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1582 GET_CURRENT_CONTEXT(ctx
);
1584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1585 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1588 n
[2].i
= drawbuffer
;
1590 if (buffer
== GL_COLOR
) {
1601 if (ctx
->ExecuteFlag
) {
1602 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1607 static void GLAPIENTRY
1608 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1610 GET_CURRENT_CONTEXT(ctx
);
1612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1613 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1616 n
[2].i
= drawbuffer
;
1618 if (buffer
== GL_COLOR
) {
1629 if (ctx
->ExecuteFlag
) {
1630 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1635 static void GLAPIENTRY
1636 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1638 GET_CURRENT_CONTEXT(ctx
);
1640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1641 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1644 n
[2].i
= drawbuffer
;
1646 if (buffer
== GL_COLOR
) {
1657 if (ctx
->ExecuteFlag
) {
1658 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
1663 static void GLAPIENTRY
1664 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1665 GLfloat depth
, GLint stencil
)
1667 GET_CURRENT_CONTEXT(ctx
);
1669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1670 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1673 n
[2].i
= drawbuffer
;
1677 if (ctx
->ExecuteFlag
) {
1678 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
1683 static void GLAPIENTRY
1684 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1686 GET_CURRENT_CONTEXT(ctx
);
1688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1689 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1696 if (ctx
->ExecuteFlag
) {
1697 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1702 static void GLAPIENTRY
1703 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1705 GET_CURRENT_CONTEXT(ctx
);
1707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1708 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1715 if (ctx
->ExecuteFlag
) {
1716 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1721 static void GLAPIENTRY
1722 save_ClearDepth(GLclampd depth
)
1724 GET_CURRENT_CONTEXT(ctx
);
1726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1727 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1729 n
[1].f
= (GLfloat
) depth
;
1731 if (ctx
->ExecuteFlag
) {
1732 CALL_ClearDepth(ctx
->Exec
, (depth
));
1737 static void GLAPIENTRY
1738 save_ClearIndex(GLfloat c
)
1740 GET_CURRENT_CONTEXT(ctx
);
1742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1743 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1747 if (ctx
->ExecuteFlag
) {
1748 CALL_ClearIndex(ctx
->Exec
, (c
));
1753 static void GLAPIENTRY
1754 save_ClearStencil(GLint s
)
1756 GET_CURRENT_CONTEXT(ctx
);
1758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1759 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1763 if (ctx
->ExecuteFlag
) {
1764 CALL_ClearStencil(ctx
->Exec
, (s
));
1769 static void GLAPIENTRY
1770 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1772 GET_CURRENT_CONTEXT(ctx
);
1774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1775 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1778 n
[2].f
= (GLfloat
) equ
[0];
1779 n
[3].f
= (GLfloat
) equ
[1];
1780 n
[4].f
= (GLfloat
) equ
[2];
1781 n
[5].f
= (GLfloat
) equ
[3];
1783 if (ctx
->ExecuteFlag
) {
1784 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1790 static void GLAPIENTRY
1791 save_ColorMask(GLboolean red
, GLboolean green
,
1792 GLboolean blue
, GLboolean alpha
)
1794 GET_CURRENT_CONTEXT(ctx
);
1796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1797 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1804 if (ctx
->ExecuteFlag
) {
1805 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1810 static void GLAPIENTRY
1811 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1812 GLboolean blue
, GLboolean alpha
)
1814 GET_CURRENT_CONTEXT(ctx
);
1816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1817 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1825 if (ctx
->ExecuteFlag
) {
1826 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
1831 static void GLAPIENTRY
1832 save_ColorMaterial(GLenum face
, GLenum mode
)
1834 GET_CURRENT_CONTEXT(ctx
);
1836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1838 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1843 if (ctx
->ExecuteFlag
) {
1844 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1849 static void GLAPIENTRY
1850 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1852 GET_CURRENT_CONTEXT(ctx
);
1854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1855 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1859 n
[3].i
= (GLint
) width
;
1860 n
[4].i
= (GLint
) height
;
1863 if (ctx
->ExecuteFlag
) {
1864 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1870 static void GLAPIENTRY
1871 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1872 GLint x
, GLint y
, GLsizei width
, GLint border
)
1874 GET_CURRENT_CONTEXT(ctx
);
1876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1877 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1881 n
[3].e
= internalformat
;
1887 if (ctx
->ExecuteFlag
) {
1888 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1889 x
, y
, width
, border
));
1894 static void GLAPIENTRY
1895 save_CopyTexImage2D(GLenum target
, GLint level
,
1896 GLenum internalformat
,
1897 GLint x
, GLint y
, GLsizei width
,
1898 GLsizei height
, GLint border
)
1900 GET_CURRENT_CONTEXT(ctx
);
1902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1903 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1907 n
[3].e
= internalformat
;
1914 if (ctx
->ExecuteFlag
) {
1915 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1916 x
, y
, width
, height
, border
));
1922 static void GLAPIENTRY
1923 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1924 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1926 GET_CURRENT_CONTEXT(ctx
);
1928 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1929 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1938 if (ctx
->ExecuteFlag
) {
1939 CALL_CopyTexSubImage1D(ctx
->Exec
,
1940 (target
, level
, xoffset
, x
, y
, width
));
1945 static void GLAPIENTRY
1946 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1947 GLint xoffset
, GLint yoffset
,
1948 GLint x
, GLint y
, GLsizei width
, GLint height
)
1950 GET_CURRENT_CONTEXT(ctx
);
1952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1953 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1964 if (ctx
->ExecuteFlag
) {
1965 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1966 x
, y
, width
, height
));
1971 static void GLAPIENTRY
1972 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1973 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1974 GLint x
, GLint y
, GLsizei width
, GLint height
)
1976 GET_CURRENT_CONTEXT(ctx
);
1978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1979 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1991 if (ctx
->ExecuteFlag
) {
1992 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1993 xoffset
, yoffset
, zoffset
,
1994 x
, y
, width
, height
));
1999 static void GLAPIENTRY
2000 save_CullFace(GLenum mode
)
2002 GET_CURRENT_CONTEXT(ctx
);
2004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2005 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2009 if (ctx
->ExecuteFlag
) {
2010 CALL_CullFace(ctx
->Exec
, (mode
));
2015 static void GLAPIENTRY
2016 save_DepthFunc(GLenum func
)
2018 GET_CURRENT_CONTEXT(ctx
);
2020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2021 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2025 if (ctx
->ExecuteFlag
) {
2026 CALL_DepthFunc(ctx
->Exec
, (func
));
2031 static void GLAPIENTRY
2032 save_DepthMask(GLboolean mask
)
2034 GET_CURRENT_CONTEXT(ctx
);
2036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2037 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2041 if (ctx
->ExecuteFlag
) {
2042 CALL_DepthMask(ctx
->Exec
, (mask
));
2047 static void GLAPIENTRY
2048 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2050 GET_CURRENT_CONTEXT(ctx
);
2052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2053 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2055 n
[1].f
= (GLfloat
) nearval
;
2056 n
[2].f
= (GLfloat
) farval
;
2058 if (ctx
->ExecuteFlag
) {
2059 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2064 static void GLAPIENTRY
2065 save_Disable(GLenum cap
)
2067 GET_CURRENT_CONTEXT(ctx
);
2069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2070 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2074 if (ctx
->ExecuteFlag
) {
2075 CALL_Disable(ctx
->Exec
, (cap
));
2080 static void GLAPIENTRY
2081 save_DisableIndexed(GLuint index
, GLenum cap
)
2083 GET_CURRENT_CONTEXT(ctx
);
2085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2086 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2091 if (ctx
->ExecuteFlag
) {
2092 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2097 static void GLAPIENTRY
2098 save_DrawBuffer(GLenum mode
)
2100 GET_CURRENT_CONTEXT(ctx
);
2102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2103 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2107 if (ctx
->ExecuteFlag
) {
2108 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2113 static void GLAPIENTRY
2114 save_DrawPixels(GLsizei width
, GLsizei height
,
2115 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2117 GET_CURRENT_CONTEXT(ctx
);
2120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2122 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2129 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2130 pixels
, &ctx
->Unpack
));
2132 if (ctx
->ExecuteFlag
) {
2133 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2139 static void GLAPIENTRY
2140 save_Enable(GLenum cap
)
2142 GET_CURRENT_CONTEXT(ctx
);
2144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2145 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2149 if (ctx
->ExecuteFlag
) {
2150 CALL_Enable(ctx
->Exec
, (cap
));
2156 static void GLAPIENTRY
2157 save_EnableIndexed(GLuint index
, GLenum cap
)
2159 GET_CURRENT_CONTEXT(ctx
);
2161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2162 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2167 if (ctx
->ExecuteFlag
) {
2168 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2174 static void GLAPIENTRY
2175 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2177 GET_CURRENT_CONTEXT(ctx
);
2179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2180 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2186 if (ctx
->ExecuteFlag
) {
2187 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2192 static void GLAPIENTRY
2193 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2195 GET_CURRENT_CONTEXT(ctx
);
2197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2198 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2206 if (ctx
->ExecuteFlag
) {
2207 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2214 static void GLAPIENTRY
2215 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2217 GET_CURRENT_CONTEXT(ctx
);
2219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2220 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2228 if (ctx
->ExecuteFlag
) {
2229 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2234 static void GLAPIENTRY
2235 save_Fogf(GLenum pname
, GLfloat param
)
2239 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2240 save_Fogfv(pname
, parray
);
2244 static void GLAPIENTRY
2245 save_Fogiv(GLenum pname
, const GLint
*params
)
2250 case GL_FOG_DENSITY
:
2254 p
[0] = (GLfloat
) *params
;
2260 p
[0] = INT_TO_FLOAT(params
[0]);
2261 p
[1] = INT_TO_FLOAT(params
[1]);
2262 p
[2] = INT_TO_FLOAT(params
[2]);
2263 p
[3] = INT_TO_FLOAT(params
[3]);
2266 /* Error will be caught later in gl_Fogfv */
2267 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2269 save_Fogfv(pname
, p
);
2273 static void GLAPIENTRY
2274 save_Fogi(GLenum pname
, GLint param
)
2278 parray
[1] = parray
[2] = parray
[3] = 0;
2279 save_Fogiv(pname
, parray
);
2283 static void GLAPIENTRY
2284 save_FrontFace(GLenum mode
)
2286 GET_CURRENT_CONTEXT(ctx
);
2288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2289 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2293 if (ctx
->ExecuteFlag
) {
2294 CALL_FrontFace(ctx
->Exec
, (mode
));
2299 static void GLAPIENTRY
2300 save_Frustum(GLdouble left
, GLdouble right
,
2301 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2303 GET_CURRENT_CONTEXT(ctx
);
2305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2306 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2308 n
[1].f
= (GLfloat
) left
;
2309 n
[2].f
= (GLfloat
) right
;
2310 n
[3].f
= (GLfloat
) bottom
;
2311 n
[4].f
= (GLfloat
) top
;
2312 n
[5].f
= (GLfloat
) nearval
;
2313 n
[6].f
= (GLfloat
) farval
;
2315 if (ctx
->ExecuteFlag
) {
2316 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2321 static void GLAPIENTRY
2322 save_Hint(GLenum target
, GLenum mode
)
2324 GET_CURRENT_CONTEXT(ctx
);
2326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2327 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2332 if (ctx
->ExecuteFlag
) {
2333 CALL_Hint(ctx
->Exec
, (target
, mode
));
2338 static void GLAPIENTRY
2339 save_IndexMask(GLuint mask
)
2341 GET_CURRENT_CONTEXT(ctx
);
2343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2344 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2348 if (ctx
->ExecuteFlag
) {
2349 CALL_IndexMask(ctx
->Exec
, (mask
));
2354 static void GLAPIENTRY
2355 save_InitNames(void)
2357 GET_CURRENT_CONTEXT(ctx
);
2358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2359 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2360 if (ctx
->ExecuteFlag
) {
2361 CALL_InitNames(ctx
->Exec
, ());
2366 static void GLAPIENTRY
2367 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2369 GET_CURRENT_CONTEXT(ctx
);
2371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2372 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2390 case GL_SPOT_DIRECTION
:
2393 case GL_SPOT_EXPONENT
:
2396 case GL_SPOT_CUTOFF
:
2399 case GL_CONSTANT_ATTENUATION
:
2402 case GL_LINEAR_ATTENUATION
:
2405 case GL_QUADRATIC_ATTENUATION
:
2411 for (i
= 0; i
< nParams
; i
++) {
2412 n
[3 + i
].f
= params
[i
];
2415 if (ctx
->ExecuteFlag
) {
2416 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2421 static void GLAPIENTRY
2422 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2426 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2427 save_Lightfv(light
, pname
, parray
);
2431 static void GLAPIENTRY
2432 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2439 fparam
[0] = INT_TO_FLOAT(params
[0]);
2440 fparam
[1] = INT_TO_FLOAT(params
[1]);
2441 fparam
[2] = INT_TO_FLOAT(params
[2]);
2442 fparam
[3] = INT_TO_FLOAT(params
[3]);
2445 fparam
[0] = (GLfloat
) params
[0];
2446 fparam
[1] = (GLfloat
) params
[1];
2447 fparam
[2] = (GLfloat
) params
[2];
2448 fparam
[3] = (GLfloat
) params
[3];
2450 case GL_SPOT_DIRECTION
:
2451 fparam
[0] = (GLfloat
) params
[0];
2452 fparam
[1] = (GLfloat
) params
[1];
2453 fparam
[2] = (GLfloat
) params
[2];
2455 case GL_SPOT_EXPONENT
:
2456 case GL_SPOT_CUTOFF
:
2457 case GL_CONSTANT_ATTENUATION
:
2458 case GL_LINEAR_ATTENUATION
:
2459 case GL_QUADRATIC_ATTENUATION
:
2460 fparam
[0] = (GLfloat
) params
[0];
2463 /* error will be caught later in gl_Lightfv */
2466 save_Lightfv(light
, pname
, fparam
);
2470 static void GLAPIENTRY
2471 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2475 parray
[1] = parray
[2] = parray
[3] = 0;
2476 save_Lightiv(light
, pname
, parray
);
2480 static void GLAPIENTRY
2481 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2483 GET_CURRENT_CONTEXT(ctx
);
2485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2486 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2494 if (ctx
->ExecuteFlag
) {
2495 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2500 static void GLAPIENTRY
2501 save_LightModelf(GLenum pname
, GLfloat param
)
2505 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2506 save_LightModelfv(pname
, parray
);
2510 static void GLAPIENTRY
2511 save_LightModeliv(GLenum pname
, const GLint
*params
)
2515 case GL_LIGHT_MODEL_AMBIENT
:
2516 fparam
[0] = INT_TO_FLOAT(params
[0]);
2517 fparam
[1] = INT_TO_FLOAT(params
[1]);
2518 fparam
[2] = INT_TO_FLOAT(params
[2]);
2519 fparam
[3] = INT_TO_FLOAT(params
[3]);
2521 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2522 case GL_LIGHT_MODEL_TWO_SIDE
:
2523 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2524 fparam
[0] = (GLfloat
) params
[0];
2530 /* Error will be caught later in gl_LightModelfv */
2531 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2533 save_LightModelfv(pname
, fparam
);
2537 static void GLAPIENTRY
2538 save_LightModeli(GLenum pname
, GLint param
)
2542 parray
[1] = parray
[2] = parray
[3] = 0;
2543 save_LightModeliv(pname
, parray
);
2547 static void GLAPIENTRY
2548 save_LineStipple(GLint factor
, GLushort pattern
)
2550 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2558 if (ctx
->ExecuteFlag
) {
2559 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2564 static void GLAPIENTRY
2565 save_LineWidth(GLfloat width
)
2567 GET_CURRENT_CONTEXT(ctx
);
2569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2570 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2574 if (ctx
->ExecuteFlag
) {
2575 CALL_LineWidth(ctx
->Exec
, (width
));
2580 static void GLAPIENTRY
2581 save_ListBase(GLuint base
)
2583 GET_CURRENT_CONTEXT(ctx
);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2586 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_ListBase(ctx
->Exec
, (base
));
2596 static void GLAPIENTRY
2597 save_LoadIdentity(void)
2599 GET_CURRENT_CONTEXT(ctx
);
2600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2601 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2602 if (ctx
->ExecuteFlag
) {
2603 CALL_LoadIdentity(ctx
->Exec
, ());
2608 static void GLAPIENTRY
2609 save_LoadMatrixf(const GLfloat
* m
)
2611 GET_CURRENT_CONTEXT(ctx
);
2613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2614 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2617 for (i
= 0; i
< 16; i
++) {
2621 if (ctx
->ExecuteFlag
) {
2622 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2627 static void GLAPIENTRY
2628 save_LoadMatrixd(const GLdouble
* m
)
2632 for (i
= 0; i
< 16; i
++) {
2633 f
[i
] = (GLfloat
) m
[i
];
2635 save_LoadMatrixf(f
);
2639 static void GLAPIENTRY
2640 save_LoadName(GLuint name
)
2642 GET_CURRENT_CONTEXT(ctx
);
2644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2645 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2649 if (ctx
->ExecuteFlag
) {
2650 CALL_LoadName(ctx
->Exec
, (name
));
2655 static void GLAPIENTRY
2656 save_LogicOp(GLenum opcode
)
2658 GET_CURRENT_CONTEXT(ctx
);
2660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2661 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2665 if (ctx
->ExecuteFlag
) {
2666 CALL_LogicOp(ctx
->Exec
, (opcode
));
2671 static void GLAPIENTRY
2672 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2673 GLint order
, const GLdouble
* points
)
2675 GET_CURRENT_CONTEXT(ctx
);
2677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2678 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2680 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2682 n
[2].f
= (GLfloat
) u1
;
2683 n
[3].f
= (GLfloat
) u2
;
2684 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2686 save_pointer(&n
[6], pnts
);
2688 if (ctx
->ExecuteFlag
) {
2689 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2693 static void GLAPIENTRY
2694 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2695 GLint order
, const GLfloat
* points
)
2697 GET_CURRENT_CONTEXT(ctx
);
2699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2700 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
2702 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2706 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2708 save_pointer(&n
[6], pnts
);
2710 if (ctx
->ExecuteFlag
) {
2711 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2716 static void GLAPIENTRY
2717 save_Map2d(GLenum target
,
2718 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2719 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2720 const GLdouble
* points
)
2722 GET_CURRENT_CONTEXT(ctx
);
2724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2725 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2727 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2728 vstride
, vorder
, points
);
2730 n
[2].f
= (GLfloat
) u1
;
2731 n
[3].f
= (GLfloat
) u2
;
2732 n
[4].f
= (GLfloat
) v1
;
2733 n
[5].f
= (GLfloat
) v2
;
2734 /* XXX verify these strides are correct */
2735 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2736 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2739 save_pointer(&n
[10], pnts
);
2741 if (ctx
->ExecuteFlag
) {
2742 CALL_Map2d(ctx
->Exec
, (target
,
2743 u1
, u2
, ustride
, uorder
,
2744 v1
, v2
, vstride
, vorder
, points
));
2749 static void GLAPIENTRY
2750 save_Map2f(GLenum target
,
2751 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2752 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2753 const GLfloat
* points
)
2755 GET_CURRENT_CONTEXT(ctx
);
2757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2758 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
2760 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2761 vstride
, vorder
, points
);
2767 /* XXX verify these strides are correct */
2768 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2769 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2772 save_pointer(&n
[10], pnts
);
2774 if (ctx
->ExecuteFlag
) {
2775 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2776 v1
, v2
, vstride
, vorder
, points
));
2781 static void GLAPIENTRY
2782 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2784 GET_CURRENT_CONTEXT(ctx
);
2786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2787 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2793 if (ctx
->ExecuteFlag
) {
2794 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2799 static void GLAPIENTRY
2800 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2802 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2806 static void GLAPIENTRY
2807 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2808 GLint vn
, GLfloat v1
, GLfloat v2
)
2810 GET_CURRENT_CONTEXT(ctx
);
2812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2813 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2822 if (ctx
->ExecuteFlag
) {
2823 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2829 static void GLAPIENTRY
2830 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2831 GLint vn
, GLdouble v1
, GLdouble v2
)
2833 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2834 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2838 static void GLAPIENTRY
2839 save_MatrixMode(GLenum mode
)
2841 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2848 if (ctx
->ExecuteFlag
) {
2849 CALL_MatrixMode(ctx
->Exec
, (mode
));
2854 static void GLAPIENTRY
2855 save_MultMatrixf(const GLfloat
* m
)
2857 GET_CURRENT_CONTEXT(ctx
);
2859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2860 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2863 for (i
= 0; i
< 16; i
++) {
2867 if (ctx
->ExecuteFlag
) {
2868 CALL_MultMatrixf(ctx
->Exec
, (m
));
2873 static void GLAPIENTRY
2874 save_MultMatrixd(const GLdouble
* m
)
2878 for (i
= 0; i
< 16; i
++) {
2879 f
[i
] = (GLfloat
) m
[i
];
2881 save_MultMatrixf(f
);
2885 static void GLAPIENTRY
2886 save_NewList(GLuint name
, GLenum mode
)
2888 GET_CURRENT_CONTEXT(ctx
);
2889 /* It's an error to call this function while building a display list */
2890 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2897 static void GLAPIENTRY
2898 save_Ortho(GLdouble left
, GLdouble right
,
2899 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2901 GET_CURRENT_CONTEXT(ctx
);
2903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2904 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2906 n
[1].f
= (GLfloat
) left
;
2907 n
[2].f
= (GLfloat
) right
;
2908 n
[3].f
= (GLfloat
) bottom
;
2909 n
[4].f
= (GLfloat
) top
;
2910 n
[5].f
= (GLfloat
) nearval
;
2911 n
[6].f
= (GLfloat
) farval
;
2913 if (ctx
->ExecuteFlag
) {
2914 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2919 static void GLAPIENTRY
2920 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2922 GET_CURRENT_CONTEXT(ctx
);
2924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2925 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
2929 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
2931 if (ctx
->ExecuteFlag
) {
2932 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2937 static void GLAPIENTRY
2938 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2940 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2942 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2943 for (i
= 0; i
< mapsize
; i
++) {
2944 fvalues
[i
] = (GLfloat
) values
[i
];
2948 for (i
= 0; i
< mapsize
; i
++) {
2949 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2952 save_PixelMapfv(map
, mapsize
, fvalues
);
2956 static void GLAPIENTRY
2957 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2959 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2961 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2962 for (i
= 0; i
< mapsize
; i
++) {
2963 fvalues
[i
] = (GLfloat
) values
[i
];
2967 for (i
= 0; i
< mapsize
; i
++) {
2968 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2971 save_PixelMapfv(map
, mapsize
, fvalues
);
2975 static void GLAPIENTRY
2976 save_PixelTransferf(GLenum pname
, GLfloat param
)
2978 GET_CURRENT_CONTEXT(ctx
);
2980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2981 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2986 if (ctx
->ExecuteFlag
) {
2987 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2992 static void GLAPIENTRY
2993 save_PixelTransferi(GLenum pname
, GLint param
)
2995 save_PixelTransferf(pname
, (GLfloat
) param
);
2999 static void GLAPIENTRY
3000 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3002 GET_CURRENT_CONTEXT(ctx
);
3004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3005 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3010 if (ctx
->ExecuteFlag
) {
3011 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3016 static void GLAPIENTRY
3017 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3019 GET_CURRENT_CONTEXT(ctx
);
3021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3022 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3029 if (ctx
->ExecuteFlag
) {
3030 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3035 static void GLAPIENTRY
3036 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3040 parray
[1] = parray
[2] = 0.0F
;
3041 save_PointParameterfvEXT(pname
, parray
);
3044 static void GLAPIENTRY
3045 save_PointParameteriNV(GLenum pname
, GLint param
)
3048 parray
[0] = (GLfloat
) param
;
3049 parray
[1] = parray
[2] = 0.0F
;
3050 save_PointParameterfvEXT(pname
, parray
);
3053 static void GLAPIENTRY
3054 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3057 parray
[0] = (GLfloat
) param
[0];
3058 parray
[1] = parray
[2] = 0.0F
;
3059 save_PointParameterfvEXT(pname
, parray
);
3063 static void GLAPIENTRY
3064 save_PointSize(GLfloat size
)
3066 GET_CURRENT_CONTEXT(ctx
);
3068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3069 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3073 if (ctx
->ExecuteFlag
) {
3074 CALL_PointSize(ctx
->Exec
, (size
));
3079 static void GLAPIENTRY
3080 save_PolygonMode(GLenum face
, GLenum mode
)
3082 GET_CURRENT_CONTEXT(ctx
);
3084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3085 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3090 if (ctx
->ExecuteFlag
) {
3091 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3096 static void GLAPIENTRY
3097 save_PolygonStipple(const GLubyte
* pattern
)
3099 GET_CURRENT_CONTEXT(ctx
);
3102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3104 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3107 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3108 pattern
, &ctx
->Unpack
));
3110 if (ctx
->ExecuteFlag
) {
3111 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3116 static void GLAPIENTRY
3117 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3119 GET_CURRENT_CONTEXT(ctx
);
3121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3122 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3127 if (ctx
->ExecuteFlag
) {
3128 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3133 static void GLAPIENTRY
3134 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3136 GET_CURRENT_CONTEXT(ctx
);
3137 /* XXX mult by DepthMaxF here??? */
3138 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3142 static void GLAPIENTRY
3143 save_PopAttrib(void)
3145 GET_CURRENT_CONTEXT(ctx
);
3146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3147 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3148 if (ctx
->ExecuteFlag
) {
3149 CALL_PopAttrib(ctx
->Exec
, ());
3154 static void GLAPIENTRY
3155 save_PopMatrix(void)
3157 GET_CURRENT_CONTEXT(ctx
);
3158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3159 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3160 if (ctx
->ExecuteFlag
) {
3161 CALL_PopMatrix(ctx
->Exec
, ());
3166 static void GLAPIENTRY
3169 GET_CURRENT_CONTEXT(ctx
);
3170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3171 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3172 if (ctx
->ExecuteFlag
) {
3173 CALL_PopName(ctx
->Exec
, ());
3178 static void GLAPIENTRY
3179 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3180 const GLclampf
* priorities
)
3182 GET_CURRENT_CONTEXT(ctx
);
3184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3186 for (i
= 0; i
< num
; i
++) {
3188 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3190 n
[1].ui
= textures
[i
];
3191 n
[2].f
= priorities
[i
];
3194 if (ctx
->ExecuteFlag
) {
3195 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3200 static void GLAPIENTRY
3201 save_PushAttrib(GLbitfield mask
)
3203 GET_CURRENT_CONTEXT(ctx
);
3205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3206 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3210 if (ctx
->ExecuteFlag
) {
3211 CALL_PushAttrib(ctx
->Exec
, (mask
));
3216 static void GLAPIENTRY
3217 save_PushMatrix(void)
3219 GET_CURRENT_CONTEXT(ctx
);
3220 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3221 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3222 if (ctx
->ExecuteFlag
) {
3223 CALL_PushMatrix(ctx
->Exec
, ());
3228 static void GLAPIENTRY
3229 save_PushName(GLuint name
)
3231 GET_CURRENT_CONTEXT(ctx
);
3233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3234 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3238 if (ctx
->ExecuteFlag
) {
3239 CALL_PushName(ctx
->Exec
, (name
));
3244 static void GLAPIENTRY
3245 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3247 GET_CURRENT_CONTEXT(ctx
);
3249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3250 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3257 if (ctx
->ExecuteFlag
) {
3258 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3262 static void GLAPIENTRY
3263 save_RasterPos2d(GLdouble x
, GLdouble y
)
3265 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3268 static void GLAPIENTRY
3269 save_RasterPos2f(GLfloat x
, GLfloat y
)
3271 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3274 static void GLAPIENTRY
3275 save_RasterPos2i(GLint x
, GLint y
)
3277 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3280 static void GLAPIENTRY
3281 save_RasterPos2s(GLshort x
, GLshort y
)
3283 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3286 static void GLAPIENTRY
3287 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3289 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3292 static void GLAPIENTRY
3293 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3295 save_RasterPos4f(x
, y
, z
, 1.0F
);
3298 static void GLAPIENTRY
3299 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3301 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3304 static void GLAPIENTRY
3305 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3307 save_RasterPos4f(x
, y
, z
, 1.0F
);
3310 static void GLAPIENTRY
3311 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3313 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3316 static void GLAPIENTRY
3317 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3319 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3322 static void GLAPIENTRY
3323 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3325 save_RasterPos4f(x
, y
, z
, w
);
3328 static void GLAPIENTRY
3329 save_RasterPos2dv(const GLdouble
* v
)
3331 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3334 static void GLAPIENTRY
3335 save_RasterPos2fv(const GLfloat
* v
)
3337 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3340 static void GLAPIENTRY
3341 save_RasterPos2iv(const GLint
* v
)
3343 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3346 static void GLAPIENTRY
3347 save_RasterPos2sv(const GLshort
* v
)
3349 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3352 static void GLAPIENTRY
3353 save_RasterPos3dv(const GLdouble
* v
)
3355 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3358 static void GLAPIENTRY
3359 save_RasterPos3fv(const GLfloat
* v
)
3361 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3364 static void GLAPIENTRY
3365 save_RasterPos3iv(const GLint
* v
)
3367 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3370 static void GLAPIENTRY
3371 save_RasterPos3sv(const GLshort
* v
)
3373 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3376 static void GLAPIENTRY
3377 save_RasterPos4dv(const GLdouble
* v
)
3379 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3380 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3383 static void GLAPIENTRY
3384 save_RasterPos4fv(const GLfloat
* v
)
3386 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3389 static void GLAPIENTRY
3390 save_RasterPos4iv(const GLint
* v
)
3392 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3393 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3396 static void GLAPIENTRY
3397 save_RasterPos4sv(const GLshort
* v
)
3399 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3403 static void GLAPIENTRY
3404 save_PassThrough(GLfloat token
)
3406 GET_CURRENT_CONTEXT(ctx
);
3408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3409 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3413 if (ctx
->ExecuteFlag
) {
3414 CALL_PassThrough(ctx
->Exec
, (token
));
3419 static void GLAPIENTRY
3420 save_ReadBuffer(GLenum mode
)
3422 GET_CURRENT_CONTEXT(ctx
);
3424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3425 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3429 if (ctx
->ExecuteFlag
) {
3430 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3435 static void GLAPIENTRY
3436 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3438 GET_CURRENT_CONTEXT(ctx
);
3440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3441 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3448 if (ctx
->ExecuteFlag
) {
3449 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3454 static void GLAPIENTRY
3455 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3457 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3461 static void GLAPIENTRY
3462 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3464 GET_CURRENT_CONTEXT(ctx
);
3466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3467 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3473 if (ctx
->ExecuteFlag
) {
3474 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3479 static void GLAPIENTRY
3480 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3482 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3486 static void GLAPIENTRY
3487 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3489 GET_CURRENT_CONTEXT(ctx
);
3491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3492 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3499 if (ctx
->ExecuteFlag
) {
3500 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3505 static void GLAPIENTRY
3506 save_ShadeModel(GLenum mode
)
3508 GET_CURRENT_CONTEXT(ctx
);
3510 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3512 if (ctx
->ExecuteFlag
) {
3513 CALL_ShadeModel(ctx
->Exec
, (mode
));
3516 /* Don't compile this call if it's a no-op.
3517 * By avoiding this state change we have a better chance of
3518 * coalescing subsequent drawing commands into one batch.
3520 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3523 SAVE_FLUSH_VERTICES(ctx
);
3525 ctx
->ListState
.Current
.ShadeModel
= mode
;
3527 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3534 static void GLAPIENTRY
3535 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3537 GET_CURRENT_CONTEXT(ctx
);
3539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3540 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3546 if (ctx
->ExecuteFlag
) {
3547 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3552 static void GLAPIENTRY
3553 save_StencilMask(GLuint mask
)
3555 GET_CURRENT_CONTEXT(ctx
);
3557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3558 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3562 if (ctx
->ExecuteFlag
) {
3563 CALL_StencilMask(ctx
->Exec
, (mask
));
3568 static void GLAPIENTRY
3569 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3571 GET_CURRENT_CONTEXT(ctx
);
3573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3574 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3580 if (ctx
->ExecuteFlag
) {
3581 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3586 static void GLAPIENTRY
3587 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3589 GET_CURRENT_CONTEXT(ctx
);
3591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3592 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3599 if (ctx
->ExecuteFlag
) {
3600 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3605 static void GLAPIENTRY
3606 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3609 GET_CURRENT_CONTEXT(ctx
);
3611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3613 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3621 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3628 if (ctx
->ExecuteFlag
) {
3629 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3630 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3635 static void GLAPIENTRY
3636 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3638 GET_CURRENT_CONTEXT(ctx
);
3640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3641 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3646 if (ctx
->ExecuteFlag
) {
3647 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3652 static void GLAPIENTRY
3653 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3655 GET_CURRENT_CONTEXT(ctx
);
3657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3658 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3665 if (ctx
->ExecuteFlag
) {
3666 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3671 static void GLAPIENTRY
3672 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3674 GET_CURRENT_CONTEXT(ctx
);
3676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3677 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3681 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3689 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3692 if (ctx
->ExecuteFlag
) {
3693 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3698 static void GLAPIENTRY
3699 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3702 parray
[0] = (GLfloat
) param
;
3703 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3704 save_TexEnvfv(target
, pname
, parray
);
3708 static void GLAPIENTRY
3709 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3712 p
[0] = (GLfloat
) param
;
3713 p
[1] = p
[2] = p
[3] = 0.0F
;
3714 save_TexEnvfv(target
, pname
, p
);
3718 static void GLAPIENTRY
3719 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3722 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3723 p
[0] = INT_TO_FLOAT(param
[0]);
3724 p
[1] = INT_TO_FLOAT(param
[1]);
3725 p
[2] = INT_TO_FLOAT(param
[2]);
3726 p
[3] = INT_TO_FLOAT(param
[3]);
3729 p
[0] = (GLfloat
) param
[0];
3730 p
[1] = p
[2] = p
[3] = 0.0F
;
3732 save_TexEnvfv(target
, pname
, p
);
3736 static void GLAPIENTRY
3737 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3739 GET_CURRENT_CONTEXT(ctx
);
3741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3742 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3751 if (ctx
->ExecuteFlag
) {
3752 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3757 static void GLAPIENTRY
3758 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3761 p
[0] = (GLfloat
) params
[0];
3762 p
[1] = (GLfloat
) params
[1];
3763 p
[2] = (GLfloat
) params
[2];
3764 p
[3] = (GLfloat
) params
[3];
3765 save_TexGenfv(coord
, pname
, p
);
3769 static void GLAPIENTRY
3770 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3773 parray
[0] = (GLfloat
) param
;
3774 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3775 save_TexGenfv(coord
, pname
, parray
);
3779 static void GLAPIENTRY
3780 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3783 p
[0] = (GLfloat
) params
[0];
3784 p
[1] = (GLfloat
) params
[1];
3785 p
[2] = (GLfloat
) params
[2];
3786 p
[3] = (GLfloat
) params
[3];
3787 save_TexGenfv(coord
, pname
, p
);
3791 static void GLAPIENTRY
3792 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3796 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3797 save_TexGenfv(coord
, pname
, parray
);
3801 static void GLAPIENTRY
3802 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3806 parray
[1] = parray
[2] = parray
[3] = 0;
3807 save_TexGeniv(coord
, pname
, parray
);
3811 static void GLAPIENTRY
3812 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3814 GET_CURRENT_CONTEXT(ctx
);
3816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3817 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3826 if (ctx
->ExecuteFlag
) {
3827 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3832 static void GLAPIENTRY
3833 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3837 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3838 save_TexParameterfv(target
, pname
, parray
);
3842 static void GLAPIENTRY
3843 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3846 fparam
[0] = (GLfloat
) param
;
3847 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3848 save_TexParameterfv(target
, pname
, fparam
);
3852 static void GLAPIENTRY
3853 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3856 fparam
[0] = (GLfloat
) params
[0];
3857 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3858 save_TexParameterfv(target
, pname
, fparam
);
3862 static void GLAPIENTRY
3863 save_TexImage1D(GLenum target
,
3864 GLint level
, GLint components
,
3865 GLsizei width
, GLint border
,
3866 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3868 GET_CURRENT_CONTEXT(ctx
);
3869 if (target
== GL_PROXY_TEXTURE_1D
) {
3870 /* don't compile, execute immediately */
3871 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3872 border
, format
, type
, pixels
));
3876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3877 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
3881 n
[3].i
= components
;
3882 n
[4].i
= (GLint
) width
;
3887 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3888 pixels
, &ctx
->Unpack
));
3890 if (ctx
->ExecuteFlag
) {
3891 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3892 border
, format
, type
, pixels
));
3898 static void GLAPIENTRY
3899 save_TexImage2D(GLenum target
,
3900 GLint level
, GLint components
,
3901 GLsizei width
, GLsizei height
, GLint border
,
3902 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3904 GET_CURRENT_CONTEXT(ctx
);
3905 if (target
== GL_PROXY_TEXTURE_2D
) {
3906 /* don't compile, execute immediately */
3907 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3908 height
, border
, format
, type
, pixels
));
3912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3913 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
3917 n
[3].i
= components
;
3918 n
[4].i
= (GLint
) width
;
3919 n
[5].i
= (GLint
) height
;
3924 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3925 pixels
, &ctx
->Unpack
));
3927 if (ctx
->ExecuteFlag
) {
3928 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3929 height
, border
, format
, type
, pixels
));
3935 static void GLAPIENTRY
3936 save_TexImage3D(GLenum target
,
3937 GLint level
, GLint internalFormat
,
3938 GLsizei width
, GLsizei height
, GLsizei depth
,
3940 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3942 GET_CURRENT_CONTEXT(ctx
);
3943 if (target
== GL_PROXY_TEXTURE_3D
) {
3944 /* don't compile, execute immediately */
3945 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3946 height
, depth
, border
, format
, type
,
3951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3952 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
3956 n
[3].i
= (GLint
) internalFormat
;
3957 n
[4].i
= (GLint
) width
;
3958 n
[5].i
= (GLint
) height
;
3959 n
[6].i
= (GLint
) depth
;
3963 save_pointer(&n
[10],
3964 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3965 pixels
, &ctx
->Unpack
));
3967 if (ctx
->ExecuteFlag
) {
3968 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3969 height
, depth
, border
, format
, type
,
3976 static void GLAPIENTRY
3977 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3978 GLsizei width
, GLenum format
, GLenum type
,
3979 const GLvoid
* pixels
)
3981 GET_CURRENT_CONTEXT(ctx
);
3984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3986 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
3991 n
[4].i
= (GLint
) width
;
3995 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3996 pixels
, &ctx
->Unpack
));
3998 if (ctx
->ExecuteFlag
) {
3999 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4000 format
, type
, pixels
));
4005 static void GLAPIENTRY
4006 save_TexSubImage2D(GLenum target
, GLint level
,
4007 GLint xoffset
, GLint yoffset
,
4008 GLsizei width
, GLsizei height
,
4009 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4011 GET_CURRENT_CONTEXT(ctx
);
4014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4016 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4022 n
[5].i
= (GLint
) width
;
4023 n
[6].i
= (GLint
) height
;
4027 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4028 pixels
, &ctx
->Unpack
));
4030 if (ctx
->ExecuteFlag
) {
4031 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4032 width
, height
, format
, type
, pixels
));
4037 static void GLAPIENTRY
4038 save_TexSubImage3D(GLenum target
, GLint level
,
4039 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4040 GLsizei width
, GLsizei height
, GLsizei depth
,
4041 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4043 GET_CURRENT_CONTEXT(ctx
);
4046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4048 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4055 n
[6].i
= (GLint
) width
;
4056 n
[7].i
= (GLint
) height
;
4057 n
[8].i
= (GLint
) depth
;
4060 save_pointer(&n
[11],
4061 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4062 pixels
, &ctx
->Unpack
));
4064 if (ctx
->ExecuteFlag
) {
4065 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4066 xoffset
, yoffset
, zoffset
,
4067 width
, height
, depth
, format
, type
,
4073 static void GLAPIENTRY
4074 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4076 GET_CURRENT_CONTEXT(ctx
);
4078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4079 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4085 if (ctx
->ExecuteFlag
) {
4086 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4091 static void GLAPIENTRY
4092 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4094 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4099 static void GLAPIENTRY
4100 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4102 GET_CURRENT_CONTEXT(ctx
);
4104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4105 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4109 n
[3].i
= (GLint
) width
;
4110 n
[4].i
= (GLint
) height
;
4112 if (ctx
->ExecuteFlag
) {
4113 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4118 static void GLAPIENTRY
4119 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4121 GET_CURRENT_CONTEXT(ctx
);
4123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4124 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4131 if (ctx
->ExecuteFlag
) {
4132 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4136 static void GLAPIENTRY
4137 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4139 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4142 static void GLAPIENTRY
4143 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4145 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4148 static void GLAPIENTRY
4149 save_WindowPos2iMESA(GLint x
, GLint y
)
4151 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4154 static void GLAPIENTRY
4155 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4157 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4160 static void GLAPIENTRY
4161 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4163 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4166 static void GLAPIENTRY
4167 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4169 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4172 static void GLAPIENTRY
4173 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4175 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4178 static void GLAPIENTRY
4179 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4181 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4184 static void GLAPIENTRY
4185 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4187 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4190 static void GLAPIENTRY
4191 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4193 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4196 static void GLAPIENTRY
4197 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4199 save_WindowPos4fMESA(x
, y
, z
, w
);
4202 static void GLAPIENTRY
4203 save_WindowPos2dvMESA(const GLdouble
* v
)
4205 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4208 static void GLAPIENTRY
4209 save_WindowPos2fvMESA(const GLfloat
* v
)
4211 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4214 static void GLAPIENTRY
4215 save_WindowPos2ivMESA(const GLint
* v
)
4217 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4220 static void GLAPIENTRY
4221 save_WindowPos2svMESA(const GLshort
* v
)
4223 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4226 static void GLAPIENTRY
4227 save_WindowPos3dvMESA(const GLdouble
* v
)
4229 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4232 static void GLAPIENTRY
4233 save_WindowPos3fvMESA(const GLfloat
* v
)
4235 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4238 static void GLAPIENTRY
4239 save_WindowPos3ivMESA(const GLint
* v
)
4241 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4244 static void GLAPIENTRY
4245 save_WindowPos3svMESA(const GLshort
* v
)
4247 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4250 static void GLAPIENTRY
4251 save_WindowPos4dvMESA(const GLdouble
* v
)
4253 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4254 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4257 static void GLAPIENTRY
4258 save_WindowPos4fvMESA(const GLfloat
* v
)
4260 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4263 static void GLAPIENTRY
4264 save_WindowPos4ivMESA(const GLint
* v
)
4266 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4267 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4270 static void GLAPIENTRY
4271 save_WindowPos4svMESA(const GLshort
* v
)
4273 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4278 /* GL_ARB_multitexture */
4279 static void GLAPIENTRY
4280 save_ActiveTextureARB(GLenum target
)
4282 GET_CURRENT_CONTEXT(ctx
);
4284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4285 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4289 if (ctx
->ExecuteFlag
) {
4290 CALL_ActiveTexture(ctx
->Exec
, (target
));
4295 /* GL_ARB_transpose_matrix */
4297 static void GLAPIENTRY
4298 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4301 _math_transposefd(tm
, m
);
4302 save_LoadMatrixf(tm
);
4306 static void GLAPIENTRY
4307 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4310 _math_transposef(tm
, m
);
4311 save_LoadMatrixf(tm
);
4315 static void GLAPIENTRY
4316 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4319 _math_transposefd(tm
, m
);
4320 save_MultMatrixf(tm
);
4324 static void GLAPIENTRY
4325 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4328 _math_transposef(tm
, m
);
4329 save_MultMatrixf(tm
);
4332 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
4334 GET_CURRENT_CONTEXT(ctx
);
4340 image
= malloc(size
);
4342 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
4345 memcpy(image
, data
, size
);
4351 /* GL_ARB_texture_compression */
4352 static void GLAPIENTRY
4353 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4354 GLenum internalFormat
, GLsizei width
,
4355 GLint border
, GLsizei imageSize
,
4356 const GLvoid
* data
)
4358 GET_CURRENT_CONTEXT(ctx
);
4359 if (target
== GL_PROXY_TEXTURE_1D
) {
4360 /* don't compile, execute immediately */
4361 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
4362 width
, border
, imageSize
,
4367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4369 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
4370 6 + POINTER_DWORDS
);
4374 n
[3].e
= internalFormat
;
4375 n
[4].i
= (GLint
) width
;
4379 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
4381 if (ctx
->ExecuteFlag
) {
4382 CALL_CompressedTexImage1D(ctx
->Exec
,
4383 (target
, level
, internalFormat
, width
,
4384 border
, imageSize
, data
));
4390 static void GLAPIENTRY
4391 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4392 GLenum internalFormat
, GLsizei width
,
4393 GLsizei height
, GLint border
, GLsizei imageSize
,
4394 const GLvoid
* data
)
4396 GET_CURRENT_CONTEXT(ctx
);
4397 if (target
== GL_PROXY_TEXTURE_2D
) {
4398 /* don't compile, execute immediately */
4399 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
4400 width
, height
, border
,
4405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4407 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
4408 7 + POINTER_DWORDS
);
4412 n
[3].e
= internalFormat
;
4413 n
[4].i
= (GLint
) width
;
4414 n
[5].i
= (GLint
) height
;
4418 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
4420 if (ctx
->ExecuteFlag
) {
4421 CALL_CompressedTexImage2D(ctx
->Exec
,
4422 (target
, level
, internalFormat
, width
,
4423 height
, border
, imageSize
, data
));
4429 static void GLAPIENTRY
4430 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4431 GLenum internalFormat
, GLsizei width
,
4432 GLsizei height
, GLsizei depth
, GLint border
,
4433 GLsizei imageSize
, const GLvoid
* data
)
4435 GET_CURRENT_CONTEXT(ctx
);
4436 if (target
== GL_PROXY_TEXTURE_3D
) {
4437 /* don't compile, execute immediately */
4438 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
4439 width
, height
, depth
, border
,
4444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4446 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
4447 8 + POINTER_DWORDS
);
4451 n
[3].e
= internalFormat
;
4452 n
[4].i
= (GLint
) width
;
4453 n
[5].i
= (GLint
) height
;
4454 n
[6].i
= (GLint
) depth
;
4458 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
4460 if (ctx
->ExecuteFlag
) {
4461 CALL_CompressedTexImage3D(ctx
->Exec
,
4462 (target
, level
, internalFormat
, width
,
4463 height
, depth
, border
, imageSize
,
4470 static void GLAPIENTRY
4471 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4472 GLsizei width
, GLenum format
,
4473 GLsizei imageSize
, const GLvoid
* data
)
4476 GET_CURRENT_CONTEXT(ctx
);
4477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4479 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
4480 6 + POINTER_DWORDS
);
4485 n
[4].i
= (GLint
) width
;
4489 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
4491 if (ctx
->ExecuteFlag
) {
4492 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
4493 width
, format
, imageSize
,
4499 static void GLAPIENTRY
4500 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4501 GLint yoffset
, GLsizei width
, GLsizei height
,
4502 GLenum format
, GLsizei imageSize
,
4503 const GLvoid
* data
)
4506 GET_CURRENT_CONTEXT(ctx
);
4507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4509 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
4510 8 + POINTER_DWORDS
);
4516 n
[5].i
= (GLint
) width
;
4517 n
[6].i
= (GLint
) height
;
4521 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
4523 if (ctx
->ExecuteFlag
) {
4524 CALL_CompressedTexSubImage2D(ctx
->Exec
,
4525 (target
, level
, xoffset
, yoffset
, width
,
4526 height
, format
, imageSize
, data
));
4531 static void GLAPIENTRY
4532 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4533 GLint yoffset
, GLint zoffset
, GLsizei width
,
4534 GLsizei height
, GLsizei depth
, GLenum format
,
4535 GLsizei imageSize
, const GLvoid
* data
)
4538 GET_CURRENT_CONTEXT(ctx
);
4539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4541 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
4542 10 + POINTER_DWORDS
);
4549 n
[6].i
= (GLint
) width
;
4550 n
[7].i
= (GLint
) height
;
4551 n
[8].i
= (GLint
) depth
;
4553 n
[10].i
= imageSize
;
4554 save_pointer(&n
[11],
4555 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
4557 if (ctx
->ExecuteFlag
) {
4558 CALL_CompressedTexSubImage3D(ctx
->Exec
,
4559 (target
, level
, xoffset
, yoffset
,
4560 zoffset
, width
, height
, depth
, format
,
4566 /* GL_ARB_multisample */
4567 static void GLAPIENTRY
4568 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4570 GET_CURRENT_CONTEXT(ctx
);
4572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4573 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4578 if (ctx
->ExecuteFlag
) {
4579 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
4585 * GL_NV_fragment_program
4587 static void GLAPIENTRY
4588 save_BindProgramNV(GLenum target
, GLuint id
)
4590 GET_CURRENT_CONTEXT(ctx
);
4592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4593 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4598 if (ctx
->ExecuteFlag
) {
4599 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
4603 static void GLAPIENTRY
4604 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4605 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4607 GET_CURRENT_CONTEXT(ctx
);
4609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4610 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4619 if (ctx
->ExecuteFlag
) {
4620 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4625 static void GLAPIENTRY
4626 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4627 const GLfloat
*params
)
4629 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4630 params
[2], params
[3]);
4634 static void GLAPIENTRY
4635 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4636 const GLfloat
* params
)
4638 GET_CURRENT_CONTEXT(ctx
);
4640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4644 const GLfloat
* p
= params
;
4646 for (i
= 0 ; i
< count
; i
++) {
4647 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4660 if (ctx
->ExecuteFlag
) {
4661 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4666 static void GLAPIENTRY
4667 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4668 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4670 save_ProgramEnvParameter4fARB(target
, index
,
4672 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4676 static void GLAPIENTRY
4677 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4678 const GLdouble
*params
)
4680 save_ProgramEnvParameter4fARB(target
, index
,
4681 (GLfloat
) params
[0],
4682 (GLfloat
) params
[1],
4683 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4687 static void GLAPIENTRY
4688 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4689 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4691 GET_CURRENT_CONTEXT(ctx
);
4693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4694 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4703 if (ctx
->ExecuteFlag
) {
4704 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4709 static void GLAPIENTRY
4710 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4711 const GLfloat
*params
)
4713 GET_CURRENT_CONTEXT(ctx
);
4715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4716 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4725 if (ctx
->ExecuteFlag
) {
4726 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4731 static void GLAPIENTRY
4732 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4733 const GLfloat
*params
)
4735 GET_CURRENT_CONTEXT(ctx
);
4737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4741 const GLfloat
* p
= params
;
4743 for (i
= 0 ; i
< count
; i
++) {
4744 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4757 if (ctx
->ExecuteFlag
) {
4758 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4763 static void GLAPIENTRY
4764 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4765 GLdouble x
, GLdouble y
,
4766 GLdouble z
, GLdouble w
)
4768 GET_CURRENT_CONTEXT(ctx
);
4770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4771 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4775 n
[3].f
= (GLfloat
) x
;
4776 n
[4].f
= (GLfloat
) y
;
4777 n
[5].f
= (GLfloat
) z
;
4778 n
[6].f
= (GLfloat
) w
;
4780 if (ctx
->ExecuteFlag
) {
4781 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4786 static void GLAPIENTRY
4787 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4788 const GLdouble
*params
)
4790 GET_CURRENT_CONTEXT(ctx
);
4792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4793 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4797 n
[3].f
= (GLfloat
) params
[0];
4798 n
[4].f
= (GLfloat
) params
[1];
4799 n
[5].f
= (GLfloat
) params
[2];
4800 n
[6].f
= (GLfloat
) params
[3];
4802 if (ctx
->ExecuteFlag
) {
4803 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4808 /* GL_EXT_stencil_two_side */
4809 static void GLAPIENTRY
4810 save_ActiveStencilFaceEXT(GLenum face
)
4812 GET_CURRENT_CONTEXT(ctx
);
4814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4815 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4819 if (ctx
->ExecuteFlag
) {
4820 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4825 /* GL_EXT_depth_bounds_test */
4826 static void GLAPIENTRY
4827 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4832 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4834 n
[1].f
= (GLfloat
) zmin
;
4835 n
[2].f
= (GLfloat
) zmax
;
4837 if (ctx
->ExecuteFlag
) {
4838 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4844 static void GLAPIENTRY
4845 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4846 const GLvoid
* string
)
4848 GET_CURRENT_CONTEXT(ctx
);
4851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4853 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
4855 GLubyte
*programCopy
= malloc(len
);
4857 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4860 memcpy(programCopy
, string
, len
);
4864 save_pointer(&n
[4], programCopy
);
4866 if (ctx
->ExecuteFlag
) {
4867 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4872 static void GLAPIENTRY
4873 save_BeginQueryARB(GLenum target
, GLuint id
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4878 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4883 if (ctx
->ExecuteFlag
) {
4884 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
4888 static void GLAPIENTRY
4889 save_EndQueryARB(GLenum target
)
4891 GET_CURRENT_CONTEXT(ctx
);
4893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4894 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
4898 if (ctx
->ExecuteFlag
) {
4899 CALL_EndQuery(ctx
->Exec
, (target
));
4903 static void GLAPIENTRY
4904 save_QueryCounter(GLuint id
, GLenum target
)
4906 GET_CURRENT_CONTEXT(ctx
);
4908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4909 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
4914 if (ctx
->ExecuteFlag
) {
4915 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
4919 static void GLAPIENTRY
4920 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
4922 GET_CURRENT_CONTEXT(ctx
);
4924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4925 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
4931 if (ctx
->ExecuteFlag
) {
4932 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
4936 static void GLAPIENTRY
4937 save_EndQueryIndexed(GLenum target
, GLuint index
)
4939 GET_CURRENT_CONTEXT(ctx
);
4941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4942 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
4947 if (ctx
->ExecuteFlag
) {
4948 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
4953 static void GLAPIENTRY
4954 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4956 GET_CURRENT_CONTEXT(ctx
);
4958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4959 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4963 if (count
> MAX_DRAW_BUFFERS
)
4964 count
= MAX_DRAW_BUFFERS
;
4965 for (i
= 0; i
< count
; i
++) {
4966 n
[2 + i
].e
= buffers
[i
];
4969 if (ctx
->ExecuteFlag
) {
4970 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
4974 static void GLAPIENTRY
4975 save_BindFragmentShaderATI(GLuint id
)
4977 GET_CURRENT_CONTEXT(ctx
);
4980 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4984 if (ctx
->ExecuteFlag
) {
4985 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4989 static void GLAPIENTRY
4990 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4992 GET_CURRENT_CONTEXT(ctx
);
4995 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5003 if (ctx
->ExecuteFlag
) {
5004 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5008 static void GLAPIENTRY
5009 save_Attr1fNV(GLenum attr
, GLfloat x
)
5011 GET_CURRENT_CONTEXT(ctx
);
5013 SAVE_FLUSH_VERTICES(ctx
);
5014 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5020 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5021 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5022 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5024 if (ctx
->ExecuteFlag
) {
5025 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5029 static void GLAPIENTRY
5030 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5032 GET_CURRENT_CONTEXT(ctx
);
5034 SAVE_FLUSH_VERTICES(ctx
);
5035 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5042 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5043 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5044 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5046 if (ctx
->ExecuteFlag
) {
5047 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5051 static void GLAPIENTRY
5052 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5054 GET_CURRENT_CONTEXT(ctx
);
5056 SAVE_FLUSH_VERTICES(ctx
);
5057 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5065 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5066 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5067 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5069 if (ctx
->ExecuteFlag
) {
5070 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5074 static void GLAPIENTRY
5075 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5077 GET_CURRENT_CONTEXT(ctx
);
5079 SAVE_FLUSH_VERTICES(ctx
);
5080 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5089 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5090 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5091 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5093 if (ctx
->ExecuteFlag
) {
5094 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5099 static void GLAPIENTRY
5100 save_Attr1fARB(GLenum attr
, GLfloat x
)
5102 GET_CURRENT_CONTEXT(ctx
);
5104 SAVE_FLUSH_VERTICES(ctx
);
5105 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5111 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5112 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5113 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5115 if (ctx
->ExecuteFlag
) {
5116 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5120 static void GLAPIENTRY
5121 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5123 GET_CURRENT_CONTEXT(ctx
);
5125 SAVE_FLUSH_VERTICES(ctx
);
5126 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5133 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5134 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5135 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5137 if (ctx
->ExecuteFlag
) {
5138 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5142 static void GLAPIENTRY
5143 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5145 GET_CURRENT_CONTEXT(ctx
);
5147 SAVE_FLUSH_VERTICES(ctx
);
5148 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5156 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5157 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5158 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5160 if (ctx
->ExecuteFlag
) {
5161 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5165 static void GLAPIENTRY
5166 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5168 GET_CURRENT_CONTEXT(ctx
);
5170 SAVE_FLUSH_VERTICES(ctx
);
5171 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5180 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5181 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5182 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5184 if (ctx
->ExecuteFlag
) {
5185 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5190 static void GLAPIENTRY
5191 save_EvalCoord1f(GLfloat x
)
5193 GET_CURRENT_CONTEXT(ctx
);
5195 SAVE_FLUSH_VERTICES(ctx
);
5196 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5200 if (ctx
->ExecuteFlag
) {
5201 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5205 static void GLAPIENTRY
5206 save_EvalCoord1fv(const GLfloat
* v
)
5208 save_EvalCoord1f(v
[0]);
5211 static void GLAPIENTRY
5212 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5214 GET_CURRENT_CONTEXT(ctx
);
5216 SAVE_FLUSH_VERTICES(ctx
);
5217 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5222 if (ctx
->ExecuteFlag
) {
5223 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5227 static void GLAPIENTRY
5228 save_EvalCoord2fv(const GLfloat
* v
)
5230 save_EvalCoord2f(v
[0], v
[1]);
5234 static void GLAPIENTRY
5235 save_EvalPoint1(GLint x
)
5237 GET_CURRENT_CONTEXT(ctx
);
5239 SAVE_FLUSH_VERTICES(ctx
);
5240 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5244 if (ctx
->ExecuteFlag
) {
5245 CALL_EvalPoint1(ctx
->Exec
, (x
));
5249 static void GLAPIENTRY
5250 save_EvalPoint2(GLint x
, GLint y
)
5252 GET_CURRENT_CONTEXT(ctx
);
5254 SAVE_FLUSH_VERTICES(ctx
);
5255 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5260 if (ctx
->ExecuteFlag
) {
5261 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5265 static void GLAPIENTRY
5266 save_Indexf(GLfloat x
)
5268 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5271 static void GLAPIENTRY
5272 save_Indexfv(const GLfloat
* v
)
5274 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5277 static void GLAPIENTRY
5278 save_EdgeFlag(GLboolean x
)
5280 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5285 * Compare 'count' elements of vectors 'a' and 'b'.
5286 * \return GL_TRUE if equal, GL_FALSE if different.
5288 static inline GLboolean
5289 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5291 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5296 * This glMaterial function is used for glMaterial calls that are outside
5297 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5299 static void GLAPIENTRY
5300 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5302 GET_CURRENT_CONTEXT(ctx
);
5310 case GL_FRONT_AND_BACK
:
5313 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
5322 case GL_AMBIENT_AND_DIFFUSE
:
5328 case GL_COLOR_INDEXES
:
5332 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
5336 if (ctx
->ExecuteFlag
) {
5337 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5340 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5342 /* Try to eliminate redundant statechanges. Because it is legal to
5343 * call glMaterial even inside begin/end calls, don't need to worry
5344 * about ctx->Driver.CurrentSavePrimitive here.
5346 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5347 if (bitmask
& (1 << i
)) {
5348 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5349 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5350 /* no change in material value */
5351 bitmask
&= ~(1 << i
);
5354 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5355 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5360 /* If this call has no effect, return early */
5364 SAVE_FLUSH_VERTICES(ctx
);
5366 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5370 for (i
= 0; i
< args
; i
++)
5371 n
[3 + i
].f
= param
[i
];
5375 static void GLAPIENTRY
5376 save_Begin(GLenum mode
)
5378 GET_CURRENT_CONTEXT(ctx
);
5380 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
5381 /* compile this error into the display list */
5382 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
5384 else if (_mesa_inside_dlist_begin_end(ctx
)) {
5385 /* compile this error into the display list */
5386 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
5391 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5393 /* Give the driver an opportunity to hook in an optimized
5394 * display list compiler.
5396 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5399 SAVE_FLUSH_VERTICES(ctx
);
5400 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5405 if (ctx
->ExecuteFlag
) {
5406 CALL_Begin(ctx
->Exec
, (mode
));
5411 static void GLAPIENTRY
5414 GET_CURRENT_CONTEXT(ctx
);
5415 SAVE_FLUSH_VERTICES(ctx
);
5416 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5417 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5418 if (ctx
->ExecuteFlag
) {
5419 CALL_End(ctx
->Exec
, ());
5423 static void GLAPIENTRY
5424 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5426 GET_CURRENT_CONTEXT(ctx
);
5428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5429 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5436 if (ctx
->ExecuteFlag
) {
5437 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5442 static void GLAPIENTRY
5443 save_Vertex2f(GLfloat x
, GLfloat y
)
5445 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5448 static void GLAPIENTRY
5449 save_Vertex2fv(const GLfloat
* v
)
5451 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5454 static void GLAPIENTRY
5455 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5457 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5460 static void GLAPIENTRY
5461 save_Vertex3fv(const GLfloat
* v
)
5463 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5466 static void GLAPIENTRY
5467 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5469 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5472 static void GLAPIENTRY
5473 save_Vertex4fv(const GLfloat
* v
)
5475 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5478 static void GLAPIENTRY
5479 save_TexCoord1f(GLfloat x
)
5481 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5484 static void GLAPIENTRY
5485 save_TexCoord1fv(const GLfloat
* v
)
5487 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5490 static void GLAPIENTRY
5491 save_TexCoord2f(GLfloat x
, GLfloat y
)
5493 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5496 static void GLAPIENTRY
5497 save_TexCoord2fv(const GLfloat
* v
)
5499 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5502 static void GLAPIENTRY
5503 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5505 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5508 static void GLAPIENTRY
5509 save_TexCoord3fv(const GLfloat
* v
)
5511 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5514 static void GLAPIENTRY
5515 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5517 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5520 static void GLAPIENTRY
5521 save_TexCoord4fv(const GLfloat
* v
)
5523 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5526 static void GLAPIENTRY
5527 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5529 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5532 static void GLAPIENTRY
5533 save_Normal3fv(const GLfloat
* v
)
5535 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5538 static void GLAPIENTRY
5539 save_FogCoordfEXT(GLfloat x
)
5541 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5544 static void GLAPIENTRY
5545 save_FogCoordfvEXT(const GLfloat
* v
)
5547 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5550 static void GLAPIENTRY
5551 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5553 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5556 static void GLAPIENTRY
5557 save_Color3fv(const GLfloat
* v
)
5559 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5562 static void GLAPIENTRY
5563 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5565 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5568 static void GLAPIENTRY
5569 save_Color4fv(const GLfloat
* v
)
5571 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5574 static void GLAPIENTRY
5575 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5577 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5580 static void GLAPIENTRY
5581 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5583 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5587 /* Just call the respective ATTR for texcoord
5589 static void GLAPIENTRY
5590 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5592 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5593 save_Attr1fNV(attr
, x
);
5596 static void GLAPIENTRY
5597 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5599 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5600 save_Attr1fNV(attr
, v
[0]);
5603 static void GLAPIENTRY
5604 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5606 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5607 save_Attr2fNV(attr
, x
, y
);
5610 static void GLAPIENTRY
5611 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5613 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5614 save_Attr2fNV(attr
, v
[0], v
[1]);
5617 static void GLAPIENTRY
5618 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5620 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5621 save_Attr3fNV(attr
, x
, y
, z
);
5624 static void GLAPIENTRY
5625 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5627 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5628 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5631 static void GLAPIENTRY
5632 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5633 GLfloat z
, GLfloat w
)
5635 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5636 save_Attr4fNV(attr
, x
, y
, z
, w
);
5639 static void GLAPIENTRY
5640 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5642 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5643 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5648 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5654 GET_CURRENT_CONTEXT(ctx
);
5655 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5660 static void GLAPIENTRY
5661 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5663 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5664 save_Attr1fARB(index
, x
);
5669 static void GLAPIENTRY
5670 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5672 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5673 save_Attr1fARB(index
, v
[0]);
5678 static void GLAPIENTRY
5679 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5681 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5682 save_Attr2fARB(index
, x
, y
);
5687 static void GLAPIENTRY
5688 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5690 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5691 save_Attr2fARB(index
, v
[0], v
[1]);
5696 static void GLAPIENTRY
5697 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5699 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5700 save_Attr3fARB(index
, x
, y
, z
);
5705 static void GLAPIENTRY
5706 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5708 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5709 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5714 static void GLAPIENTRY
5715 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5718 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5719 save_Attr4fARB(index
, x
, y
, z
, w
);
5724 static void GLAPIENTRY
5725 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5727 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5728 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5733 static void GLAPIENTRY
5734 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5735 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5736 GLbitfield mask
, GLenum filter
)
5738 GET_CURRENT_CONTEXT(ctx
);
5740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5741 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5754 if (ctx
->ExecuteFlag
) {
5755 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5756 dstX0
, dstY0
, dstX1
, dstY1
,
5762 /** GL_EXT_provoking_vertex */
5763 static void GLAPIENTRY
5764 save_ProvokingVertexEXT(GLenum mode
)
5766 GET_CURRENT_CONTEXT(ctx
);
5768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5769 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
5773 if (ctx
->ExecuteFlag
) {
5774 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
5775 _mesa_ProvokingVertex(mode
);
5780 /** GL_EXT_transform_feedback */
5781 static void GLAPIENTRY
5782 save_BeginTransformFeedback(GLenum mode
)
5784 GET_CURRENT_CONTEXT(ctx
);
5786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5787 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
5791 if (ctx
->ExecuteFlag
) {
5792 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
5797 /** GL_EXT_transform_feedback */
5798 static void GLAPIENTRY
5799 save_EndTransformFeedback(void)
5801 GET_CURRENT_CONTEXT(ctx
);
5802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5803 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
5804 if (ctx
->ExecuteFlag
) {
5805 CALL_EndTransformFeedback(ctx
->Exec
, ());
5809 static void GLAPIENTRY
5810 save_BindTransformFeedback(GLenum target
, GLuint name
)
5812 GET_CURRENT_CONTEXT(ctx
);
5814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5815 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
5820 if (ctx
->ExecuteFlag
) {
5821 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
5825 static void GLAPIENTRY
5826 save_PauseTransformFeedback(void)
5828 GET_CURRENT_CONTEXT(ctx
);
5829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5830 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
5831 if (ctx
->ExecuteFlag
) {
5832 CALL_PauseTransformFeedback(ctx
->Exec
, ());
5836 static void GLAPIENTRY
5837 save_ResumeTransformFeedback(void)
5839 GET_CURRENT_CONTEXT(ctx
);
5840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5841 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
5842 if (ctx
->ExecuteFlag
) {
5843 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
5847 static void GLAPIENTRY
5848 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
5850 GET_CURRENT_CONTEXT(ctx
);
5852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5853 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
5858 if (ctx
->ExecuteFlag
) {
5859 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
5863 static void GLAPIENTRY
5864 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
5866 GET_CURRENT_CONTEXT(ctx
);
5868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5869 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
5875 if (ctx
->ExecuteFlag
) {
5876 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
5880 static void GLAPIENTRY
5881 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
5884 GET_CURRENT_CONTEXT(ctx
);
5886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5887 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
5891 n
[3].si
= primcount
;
5893 if (ctx
->ExecuteFlag
) {
5894 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
5898 static void GLAPIENTRY
5899 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
5900 GLuint stream
, GLsizei primcount
)
5902 GET_CURRENT_CONTEXT(ctx
);
5904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5905 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
5910 n
[4].si
= primcount
;
5912 if (ctx
->ExecuteFlag
) {
5913 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
5918 /* aka UseProgram() */
5919 static void GLAPIENTRY
5920 save_UseProgramObjectARB(GLhandleARB program
)
5922 GET_CURRENT_CONTEXT(ctx
);
5924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5925 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
5929 if (ctx
->ExecuteFlag
) {
5930 CALL_UseProgram(ctx
->Exec
, (program
));
5935 static void GLAPIENTRY
5936 save_Uniform1fARB(GLint location
, GLfloat x
)
5938 GET_CURRENT_CONTEXT(ctx
);
5940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5941 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
5946 if (ctx
->ExecuteFlag
) {
5947 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
5952 static void GLAPIENTRY
5953 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
5955 GET_CURRENT_CONTEXT(ctx
);
5957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5958 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
5964 if (ctx
->ExecuteFlag
) {
5965 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
5970 static void GLAPIENTRY
5971 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
5973 GET_CURRENT_CONTEXT(ctx
);
5975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5976 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
5983 if (ctx
->ExecuteFlag
) {
5984 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
5989 static void GLAPIENTRY
5990 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5992 GET_CURRENT_CONTEXT(ctx
);
5994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5995 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6003 if (ctx
->ExecuteFlag
) {
6004 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6009 static void GLAPIENTRY
6010 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6012 GET_CURRENT_CONTEXT(ctx
);
6014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6015 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6019 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6021 if (ctx
->ExecuteFlag
) {
6022 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6026 static void GLAPIENTRY
6027 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6029 GET_CURRENT_CONTEXT(ctx
);
6031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6032 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6036 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6038 if (ctx
->ExecuteFlag
) {
6039 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6043 static void GLAPIENTRY
6044 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6046 GET_CURRENT_CONTEXT(ctx
);
6048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6049 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6053 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6055 if (ctx
->ExecuteFlag
) {
6056 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6060 static void GLAPIENTRY
6061 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6063 GET_CURRENT_CONTEXT(ctx
);
6065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6066 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6070 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6072 if (ctx
->ExecuteFlag
) {
6073 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6078 static void GLAPIENTRY
6079 save_Uniform1iARB(GLint location
, GLint x
)
6081 GET_CURRENT_CONTEXT(ctx
);
6083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6084 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6089 if (ctx
->ExecuteFlag
) {
6090 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
6094 static void GLAPIENTRY
6095 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6097 GET_CURRENT_CONTEXT(ctx
);
6099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6100 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6106 if (ctx
->ExecuteFlag
) {
6107 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
6111 static void GLAPIENTRY
6112 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6114 GET_CURRENT_CONTEXT(ctx
);
6116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6117 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6124 if (ctx
->ExecuteFlag
) {
6125 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
6129 static void GLAPIENTRY
6130 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6132 GET_CURRENT_CONTEXT(ctx
);
6134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6135 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6143 if (ctx
->ExecuteFlag
) {
6144 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
6150 static void GLAPIENTRY
6151 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6153 GET_CURRENT_CONTEXT(ctx
);
6155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6156 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
6160 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
6162 if (ctx
->ExecuteFlag
) {
6163 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
6167 static void GLAPIENTRY
6168 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6170 GET_CURRENT_CONTEXT(ctx
);
6172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6173 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
6177 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
6179 if (ctx
->ExecuteFlag
) {
6180 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
6184 static void GLAPIENTRY
6185 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6187 GET_CURRENT_CONTEXT(ctx
);
6189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6190 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
6194 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
6196 if (ctx
->ExecuteFlag
) {
6197 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
6201 static void GLAPIENTRY
6202 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6204 GET_CURRENT_CONTEXT(ctx
);
6206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6207 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
6211 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6213 if (ctx
->ExecuteFlag
) {
6214 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
6220 static void GLAPIENTRY
6221 save_Uniform1ui(GLint location
, GLuint x
)
6223 GET_CURRENT_CONTEXT(ctx
);
6225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6226 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6231 if (ctx
->ExecuteFlag
) {
6232 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6236 static void GLAPIENTRY
6237 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6239 GET_CURRENT_CONTEXT(ctx
);
6241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6242 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6248 if (ctx
->ExecuteFlag
) {
6249 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6253 static void GLAPIENTRY
6254 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6256 GET_CURRENT_CONTEXT(ctx
);
6258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6259 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6266 if (ctx
->ExecuteFlag
) {
6267 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6271 static void GLAPIENTRY
6272 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6274 GET_CURRENT_CONTEXT(ctx
);
6276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6277 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6285 if (ctx
->ExecuteFlag
) {
6286 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6292 static void GLAPIENTRY
6293 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6295 GET_CURRENT_CONTEXT(ctx
);
6297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6298 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
6302 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
6304 if (ctx
->ExecuteFlag
) {
6305 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6309 static void GLAPIENTRY
6310 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6312 GET_CURRENT_CONTEXT(ctx
);
6314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6315 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
6319 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
6321 if (ctx
->ExecuteFlag
) {
6322 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6326 static void GLAPIENTRY
6327 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6329 GET_CURRENT_CONTEXT(ctx
);
6331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6332 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
6336 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
6338 if (ctx
->ExecuteFlag
) {
6339 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6343 static void GLAPIENTRY
6344 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6346 GET_CURRENT_CONTEXT(ctx
);
6348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6349 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
6353 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
6355 if (ctx
->ExecuteFlag
) {
6356 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6362 static void GLAPIENTRY
6363 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6366 GET_CURRENT_CONTEXT(ctx
);
6368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6369 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
6374 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
6376 if (ctx
->ExecuteFlag
) {
6377 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6381 static void GLAPIENTRY
6382 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6385 GET_CURRENT_CONTEXT(ctx
);
6387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6388 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
6393 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
6395 if (ctx
->ExecuteFlag
) {
6396 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6400 static void GLAPIENTRY
6401 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6404 GET_CURRENT_CONTEXT(ctx
);
6406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6407 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
6412 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
6414 if (ctx
->ExecuteFlag
) {
6415 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6420 static void GLAPIENTRY
6421 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6424 GET_CURRENT_CONTEXT(ctx
);
6426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6427 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
6432 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
6434 if (ctx
->ExecuteFlag
) {
6435 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6439 static void GLAPIENTRY
6440 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6443 GET_CURRENT_CONTEXT(ctx
);
6445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6446 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
6451 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
6453 if (ctx
->ExecuteFlag
) {
6454 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6459 static void GLAPIENTRY
6460 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6463 GET_CURRENT_CONTEXT(ctx
);
6465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6466 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
6471 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
6473 if (ctx
->ExecuteFlag
) {
6474 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6478 static void GLAPIENTRY
6479 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6482 GET_CURRENT_CONTEXT(ctx
);
6484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6485 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
6490 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
6492 if (ctx
->ExecuteFlag
) {
6493 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6498 static void GLAPIENTRY
6499 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6502 GET_CURRENT_CONTEXT(ctx
);
6504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6505 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
6510 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
6512 if (ctx
->ExecuteFlag
) {
6513 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6517 static void GLAPIENTRY
6518 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6521 GET_CURRENT_CONTEXT(ctx
);
6523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6524 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
6529 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
6531 if (ctx
->ExecuteFlag
) {
6532 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6536 static void GLAPIENTRY
6537 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
6539 GET_CURRENT_CONTEXT(ctx
);
6541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6542 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
6548 if (ctx
->ExecuteFlag
) {
6549 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
6553 static void GLAPIENTRY
6554 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
6556 GET_CURRENT_CONTEXT(ctx
);
6558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6559 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
6565 if (ctx
->ExecuteFlag
) {
6566 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
6570 static void GLAPIENTRY
6571 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
6573 GET_CURRENT_CONTEXT(ctx
);
6575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6576 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
6583 if (ctx
->ExecuteFlag
) {
6584 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
6588 static void GLAPIENTRY
6589 save_ProgramUniform3f(GLuint program
, GLint location
,
6590 GLfloat x
, GLfloat y
, GLfloat z
)
6592 GET_CURRENT_CONTEXT(ctx
);
6594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6595 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
6603 if (ctx
->ExecuteFlag
) {
6604 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
6608 static void GLAPIENTRY
6609 save_ProgramUniform4f(GLuint program
, GLint location
,
6610 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6612 GET_CURRENT_CONTEXT(ctx
);
6614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6615 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
6624 if (ctx
->ExecuteFlag
) {
6625 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6629 static void GLAPIENTRY
6630 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
6633 GET_CURRENT_CONTEXT(ctx
);
6635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6636 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
6641 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6643 if (ctx
->ExecuteFlag
) {
6644 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
6648 static void GLAPIENTRY
6649 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
6652 GET_CURRENT_CONTEXT(ctx
);
6654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6655 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
6660 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6662 if (ctx
->ExecuteFlag
) {
6663 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
6667 static void GLAPIENTRY
6668 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
6671 GET_CURRENT_CONTEXT(ctx
);
6673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6674 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
6679 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6681 if (ctx
->ExecuteFlag
) {
6682 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
6686 static void GLAPIENTRY
6687 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
6690 GET_CURRENT_CONTEXT(ctx
);
6692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6693 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
6698 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6700 if (ctx
->ExecuteFlag
) {
6701 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
6705 static void GLAPIENTRY
6706 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
6708 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
6717 if (ctx
->ExecuteFlag
) {
6718 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
6722 static void GLAPIENTRY
6723 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
6725 GET_CURRENT_CONTEXT(ctx
);
6727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6728 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
6735 if (ctx
->ExecuteFlag
) {
6736 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
6740 static void GLAPIENTRY
6741 save_ProgramUniform3i(GLuint program
, GLint location
,
6742 GLint x
, GLint y
, GLint z
)
6744 GET_CURRENT_CONTEXT(ctx
);
6746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6747 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
6755 if (ctx
->ExecuteFlag
) {
6756 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
6760 static void GLAPIENTRY
6761 save_ProgramUniform4i(GLuint program
, GLint location
,
6762 GLint x
, GLint y
, GLint z
, GLint w
)
6764 GET_CURRENT_CONTEXT(ctx
);
6766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6767 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
6776 if (ctx
->ExecuteFlag
) {
6777 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6781 static void GLAPIENTRY
6782 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
6785 GET_CURRENT_CONTEXT(ctx
);
6787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6788 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
6793 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
6795 if (ctx
->ExecuteFlag
) {
6796 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
6800 static void GLAPIENTRY
6801 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
6804 GET_CURRENT_CONTEXT(ctx
);
6806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6807 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
6812 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
6814 if (ctx
->ExecuteFlag
) {
6815 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
6819 static void GLAPIENTRY
6820 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
6823 GET_CURRENT_CONTEXT(ctx
);
6825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6826 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
6831 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
6833 if (ctx
->ExecuteFlag
) {
6834 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
6838 static void GLAPIENTRY
6839 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
6842 GET_CURRENT_CONTEXT(ctx
);
6844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6845 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
6850 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
6852 if (ctx
->ExecuteFlag
) {
6853 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
6857 static void GLAPIENTRY
6858 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
6860 GET_CURRENT_CONTEXT(ctx
);
6862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6863 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
6869 if (ctx
->ExecuteFlag
) {
6870 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
6874 static void GLAPIENTRY
6875 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
6877 GET_CURRENT_CONTEXT(ctx
);
6879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6880 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
6887 if (ctx
->ExecuteFlag
) {
6888 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
6892 static void GLAPIENTRY
6893 save_ProgramUniform3ui(GLuint program
, GLint location
,
6894 GLuint x
, GLuint y
, GLuint z
)
6896 GET_CURRENT_CONTEXT(ctx
);
6898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6899 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
6907 if (ctx
->ExecuteFlag
) {
6908 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
6912 static void GLAPIENTRY
6913 save_ProgramUniform4ui(GLuint program
, GLint location
,
6914 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6916 GET_CURRENT_CONTEXT(ctx
);
6918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6919 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
6928 if (ctx
->ExecuteFlag
) {
6929 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
6933 static void GLAPIENTRY
6934 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
6937 GET_CURRENT_CONTEXT(ctx
);
6939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6940 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
6945 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
6947 if (ctx
->ExecuteFlag
) {
6948 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
6952 static void GLAPIENTRY
6953 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
6956 GET_CURRENT_CONTEXT(ctx
);
6958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6959 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
6964 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
6966 if (ctx
->ExecuteFlag
) {
6967 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
6971 static void GLAPIENTRY
6972 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
6975 GET_CURRENT_CONTEXT(ctx
);
6977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6978 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
6983 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
6985 if (ctx
->ExecuteFlag
) {
6986 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
6990 static void GLAPIENTRY
6991 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
6994 GET_CURRENT_CONTEXT(ctx
);
6996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6997 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
7002 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
7004 if (ctx
->ExecuteFlag
) {
7005 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
7009 static void GLAPIENTRY
7010 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
7011 GLboolean transpose
, const GLfloat
*v
)
7013 GET_CURRENT_CONTEXT(ctx
);
7015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7016 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
7017 4 + POINTER_DWORDS
);
7023 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
7025 if (ctx
->ExecuteFlag
) {
7026 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
7027 (program
, location
, count
, transpose
, v
));
7031 static void GLAPIENTRY
7032 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
7033 GLboolean transpose
, const GLfloat
*v
)
7035 GET_CURRENT_CONTEXT(ctx
);
7037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7038 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
7039 4 + POINTER_DWORDS
);
7045 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
7047 if (ctx
->ExecuteFlag
) {
7048 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
7049 (program
, location
, count
, transpose
, v
));
7053 static void GLAPIENTRY
7054 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
7055 GLboolean transpose
, const GLfloat
*v
)
7057 GET_CURRENT_CONTEXT(ctx
);
7059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7060 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
7061 4 + POINTER_DWORDS
);
7067 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
7069 if (ctx
->ExecuteFlag
) {
7070 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
7071 (program
, location
, count
, transpose
, v
));
7075 static void GLAPIENTRY
7076 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
7077 GLboolean transpose
, const GLfloat
*v
)
7079 GET_CURRENT_CONTEXT(ctx
);
7081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7082 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
7083 4 + POINTER_DWORDS
);
7089 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
7091 if (ctx
->ExecuteFlag
) {
7092 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
7093 (program
, location
, count
, transpose
, v
));
7097 static void GLAPIENTRY
7098 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
7099 GLboolean transpose
, const GLfloat
*v
)
7101 GET_CURRENT_CONTEXT(ctx
);
7103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7104 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
7105 4 + POINTER_DWORDS
);
7111 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
7113 if (ctx
->ExecuteFlag
) {
7114 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
7115 (program
, location
, count
, transpose
, v
));
7119 static void GLAPIENTRY
7120 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
7121 GLboolean transpose
, const GLfloat
*v
)
7123 GET_CURRENT_CONTEXT(ctx
);
7125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7126 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
7127 4 + POINTER_DWORDS
);
7133 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
7135 if (ctx
->ExecuteFlag
) {
7136 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
7137 (program
, location
, count
, transpose
, v
));
7141 static void GLAPIENTRY
7142 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
7143 GLboolean transpose
, const GLfloat
*v
)
7145 GET_CURRENT_CONTEXT(ctx
);
7147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7148 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
7149 4 + POINTER_DWORDS
);
7155 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
7157 if (ctx
->ExecuteFlag
) {
7158 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
7159 (program
, location
, count
, transpose
, v
));
7163 static void GLAPIENTRY
7164 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
7165 GLboolean transpose
, const GLfloat
*v
)
7167 GET_CURRENT_CONTEXT(ctx
);
7169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7170 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
7171 4 + POINTER_DWORDS
);
7177 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
7179 if (ctx
->ExecuteFlag
) {
7180 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
7181 (program
, location
, count
, transpose
, v
));
7185 static void GLAPIENTRY
7186 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
7187 GLboolean transpose
, const GLfloat
*v
)
7189 GET_CURRENT_CONTEXT(ctx
);
7191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7192 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
7193 4 + POINTER_DWORDS
);
7199 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
7201 if (ctx
->ExecuteFlag
) {
7202 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
7203 (program
, location
, count
, transpose
, v
));
7207 static void GLAPIENTRY
7208 save_ClipControl(GLenum origin
, GLenum depth
)
7210 GET_CURRENT_CONTEXT(ctx
);
7212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7213 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
7218 if (ctx
->ExecuteFlag
) {
7219 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
7223 static void GLAPIENTRY
7224 save_ClampColorARB(GLenum target
, GLenum clamp
)
7226 GET_CURRENT_CONTEXT(ctx
);
7228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7229 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
7234 if (ctx
->ExecuteFlag
) {
7235 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
7239 /** GL_EXT_texture_integer */
7240 static void GLAPIENTRY
7241 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
7243 GET_CURRENT_CONTEXT(ctx
);
7245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7246 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
7253 if (ctx
->ExecuteFlag
) {
7254 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7258 /** GL_EXT_texture_integer */
7259 static void GLAPIENTRY
7260 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
7262 GET_CURRENT_CONTEXT(ctx
);
7264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7265 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
7272 if (ctx
->ExecuteFlag
) {
7273 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
7277 /** GL_EXT_texture_integer */
7278 static void GLAPIENTRY
7279 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
7281 GET_CURRENT_CONTEXT(ctx
);
7283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7284 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
7293 if (ctx
->ExecuteFlag
) {
7294 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
7298 /** GL_EXT_texture_integer */
7299 static void GLAPIENTRY
7300 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
7302 GET_CURRENT_CONTEXT(ctx
);
7304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7305 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
7309 n
[3].ui
= params
[0];
7310 n
[4].ui
= params
[1];
7311 n
[5].ui
= params
[2];
7312 n
[6].ui
= params
[3];
7314 if (ctx
->ExecuteFlag
) {
7315 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
7319 /* GL_ARB_instanced_arrays */
7320 static void GLAPIENTRY
7321 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
7323 GET_CURRENT_CONTEXT(ctx
);
7325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7326 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
7331 if (ctx
->ExecuteFlag
) {
7332 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
7337 /* GL_NV_texture_barrier */
7338 static void GLAPIENTRY
7339 save_TextureBarrierNV(void)
7341 GET_CURRENT_CONTEXT(ctx
);
7342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7343 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
7344 if (ctx
->ExecuteFlag
) {
7345 CALL_TextureBarrierNV(ctx
->Exec
, ());
7350 /* GL_ARB_sampler_objects */
7351 static void GLAPIENTRY
7352 save_BindSampler(GLuint unit
, GLuint sampler
)
7355 GET_CURRENT_CONTEXT(ctx
);
7356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7357 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
7362 if (ctx
->ExecuteFlag
) {
7363 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
7367 static void GLAPIENTRY
7368 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7371 GET_CURRENT_CONTEXT(ctx
);
7372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7373 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
7378 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7384 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7387 if (ctx
->ExecuteFlag
) {
7388 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
7392 static void GLAPIENTRY
7393 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
7397 parray
[1] = parray
[2] = parray
[3] = 0;
7398 save_SamplerParameteriv(sampler
, pname
, parray
);
7401 static void GLAPIENTRY
7402 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
7405 GET_CURRENT_CONTEXT(ctx
);
7406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7407 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
7412 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7418 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
7421 if (ctx
->ExecuteFlag
) {
7422 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
7426 static void GLAPIENTRY
7427 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
7431 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
7432 save_SamplerParameterfv(sampler
, pname
, parray
);
7435 static void GLAPIENTRY
7436 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
7439 GET_CURRENT_CONTEXT(ctx
);
7440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7441 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
7446 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7452 n
[4].i
= n
[5].i
= n
[6].i
= 0;
7455 if (ctx
->ExecuteFlag
) {
7456 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
7460 static void GLAPIENTRY
7461 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
7464 GET_CURRENT_CONTEXT(ctx
);
7465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7466 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
7470 n
[3].ui
= params
[0];
7471 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
7472 n
[4].ui
= params
[1];
7473 n
[5].ui
= params
[2];
7474 n
[6].ui
= params
[3];
7477 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
7480 if (ctx
->ExecuteFlag
) {
7481 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
7485 /* GL_ARB_geometry_shader4 */
7486 static void GLAPIENTRY
7487 save_ProgramParameteri(GLuint program
, GLenum pname
, GLint value
)
7490 GET_CURRENT_CONTEXT(ctx
);
7491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7492 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_PARAMETERI
, 3);
7498 if (ctx
->ExecuteFlag
) {
7499 CALL_ProgramParameteri(ctx
->Exec
, (program
, pname
, value
));
7503 static void GLAPIENTRY
7504 save_FramebufferTexture(GLenum target
, GLenum attachment
,
7505 GLuint texture
, GLint level
)
7508 GET_CURRENT_CONTEXT(ctx
);
7509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7510 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE
, 4);
7513 n
[2].e
= attachment
;
7517 if (ctx
->ExecuteFlag
) {
7518 CALL_FramebufferTexture(ctx
->Exec
, (target
, attachment
, texture
, level
));
7522 static void GLAPIENTRY
7523 save_FramebufferTextureFace(GLenum target
, GLenum attachment
,
7524 GLuint texture
, GLint level
, GLenum face
)
7527 GET_CURRENT_CONTEXT(ctx
);
7528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7529 n
= alloc_instruction(ctx
, OPCODE_FRAMEBUFFER_TEXTURE_FACE
, 5);
7532 n
[2].e
= attachment
;
7537 if (ctx
->ExecuteFlag
) {
7538 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (target
, attachment
, texture
,
7545 static void GLAPIENTRY
7546 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
7549 GET_CURRENT_CONTEXT(ctx
);
7550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7551 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
7553 union uint64_pair p
;
7556 n
[2].ui
= p
.uint32
[0];
7557 n
[3].ui
= p
.uint32
[1];
7558 save_pointer(&n
[4], sync
);
7560 if (ctx
->ExecuteFlag
) {
7561 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
7566 /** GL_NV_conditional_render */
7567 static void GLAPIENTRY
7568 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
7570 GET_CURRENT_CONTEXT(ctx
);
7572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7573 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
7578 if (ctx
->ExecuteFlag
) {
7579 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
7583 static void GLAPIENTRY
7584 save_EndConditionalRender(void)
7586 GET_CURRENT_CONTEXT(ctx
);
7587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7588 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
7589 if (ctx
->ExecuteFlag
) {
7590 CALL_EndConditionalRender(ctx
->Exec
, ());
7594 static void GLAPIENTRY
7595 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
7597 GET_CURRENT_CONTEXT(ctx
);
7599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7600 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
7606 if (ctx
->ExecuteFlag
) {
7607 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
7613 * Save an error-generating command into display list.
7615 * KW: Will appear in the list before the vertex buffer containing the
7616 * command that provoked the error. I don't see this as a problem.
7619 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7622 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
7625 save_pointer(&n
[2], (void *) s
);
7626 /* note: the data/string here doesn't have to be freed in
7627 * _mesa_delete_list() since the string is never dynamically
7635 * Compile an error into current display list.
7638 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
7640 if (ctx
->CompileFlag
)
7641 save_error(ctx
, error
, s
);
7642 if (ctx
->ExecuteFlag
)
7643 _mesa_error(ctx
, error
, "%s", s
);
7648 * Test if ID names a display list.
7651 islist(struct gl_context
*ctx
, GLuint list
)
7653 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
7663 /**********************************************************************/
7664 /* Display list execution */
7665 /**********************************************************************/
7669 * Execute a display list. Note that the ListBase offset must have already
7670 * been added before calling this function. I.e. the list argument is
7671 * the absolute list number, not relative to ListBase.
7672 * \param list - display list number
7675 execute_list(struct gl_context
*ctx
, GLuint list
)
7677 struct gl_display_list
*dlist
;
7681 if (list
== 0 || !islist(ctx
, list
))
7684 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
7685 /* raise an error? */
7689 dlist
= _mesa_lookup_list(ctx
, list
);
7693 ctx
->ListState
.CallDepth
++;
7695 if (ctx
->Driver
.BeginCallList
)
7696 ctx
->Driver
.BeginCallList(ctx
, dlist
);
7702 const OpCode opcode
= n
[0].opcode
;
7704 if (is_ext_opcode(opcode
)) {
7705 n
+= ext_opcode_execute(ctx
, n
);
7710 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
7713 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7715 case OPCODE_ALPHA_FUNC
:
7716 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7718 case OPCODE_BIND_TEXTURE
:
7719 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7723 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7724 ctx
->Unpack
= ctx
->DefaultPacking
;
7725 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
7726 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
7727 get_pointer(&n
[7])));
7728 ctx
->Unpack
= save
; /* restore */
7731 case OPCODE_BLEND_COLOR
:
7732 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7734 case OPCODE_BLEND_EQUATION
:
7735 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
7737 case OPCODE_BLEND_EQUATION_SEPARATE
:
7738 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7740 case OPCODE_BLEND_FUNC_SEPARATE
:
7741 CALL_BlendFuncSeparate(ctx
->Exec
,
7742 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7745 case OPCODE_BLEND_FUNC_I
:
7746 /* GL_ARB_draw_buffers_blend */
7747 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
7749 case OPCODE_BLEND_FUNC_SEPARATE_I
:
7750 /* GL_ARB_draw_buffers_blend */
7751 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
7754 case OPCODE_BLEND_EQUATION_I
:
7755 /* GL_ARB_draw_buffers_blend */
7756 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7758 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
7759 /* GL_ARB_draw_buffers_blend */
7760 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
7761 (n
[1].ui
, n
[2].e
, n
[3].e
));
7764 case OPCODE_CALL_LIST
:
7765 /* Generated by glCallList(), don't add ListBase */
7766 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7767 execute_list(ctx
, n
[1].ui
);
7770 case OPCODE_CALL_LIST_OFFSET
:
7771 /* Generated by glCallLists() so we must add ListBase */
7773 /* user specified a bad data type at compile time */
7774 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7776 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
7777 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
7778 execute_list(ctx
, list
);
7782 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
7784 case OPCODE_CLEAR_BUFFER_IV
:
7791 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7794 case OPCODE_CLEAR_BUFFER_UIV
:
7801 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7804 case OPCODE_CLEAR_BUFFER_FV
:
7811 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
7814 case OPCODE_CLEAR_BUFFER_FI
:
7815 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
7817 case OPCODE_CLEAR_COLOR
:
7818 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7820 case OPCODE_CLEAR_ACCUM
:
7821 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7823 case OPCODE_CLEAR_DEPTH
:
7824 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
7826 case OPCODE_CLEAR_INDEX
:
7827 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
7829 case OPCODE_CLEAR_STENCIL
:
7830 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
7832 case OPCODE_CLIP_PLANE
:
7839 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
7842 case OPCODE_COLOR_MASK
:
7843 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
7845 case OPCODE_COLOR_MASK_INDEXED
:
7846 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7849 case OPCODE_COLOR_MATERIAL
:
7850 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7852 case OPCODE_COPY_PIXELS
:
7853 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7854 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7857 case OPCODE_COPY_TEX_IMAGE1D
:
7858 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7859 n
[5].i
, n
[6].i
, n
[7].i
));
7861 case OPCODE_COPY_TEX_IMAGE2D
:
7862 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7863 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7865 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7866 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7867 n
[4].i
, n
[5].i
, n
[6].i
));
7869 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7870 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7871 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7874 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7875 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7876 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7879 case OPCODE_CULL_FACE
:
7880 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7882 case OPCODE_DEPTH_FUNC
:
7883 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7885 case OPCODE_DEPTH_MASK
:
7886 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7888 case OPCODE_DEPTH_RANGE
:
7889 CALL_DepthRange(ctx
->Exec
,
7890 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7892 case OPCODE_DISABLE
:
7893 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7895 case OPCODE_DISABLE_INDEXED
:
7896 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7898 case OPCODE_DRAW_BUFFER
:
7899 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7901 case OPCODE_DRAW_PIXELS
:
7903 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7904 ctx
->Unpack
= ctx
->DefaultPacking
;
7905 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7906 get_pointer(&n
[5])));
7907 ctx
->Unpack
= save
; /* restore */
7911 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7913 case OPCODE_ENABLE_INDEXED
:
7914 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7916 case OPCODE_EVALMESH1
:
7917 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7919 case OPCODE_EVALMESH2
:
7920 CALL_EvalMesh2(ctx
->Exec
,
7921 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7930 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7933 case OPCODE_FRONT_FACE
:
7934 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7936 case OPCODE_FRUSTUM
:
7937 CALL_Frustum(ctx
->Exec
,
7938 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7941 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7943 case OPCODE_INDEX_MASK
:
7944 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7946 case OPCODE_INIT_NAMES
:
7947 CALL_InitNames(ctx
->Exec
, ());
7956 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7959 case OPCODE_LIGHT_MODEL
:
7966 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7969 case OPCODE_LINE_STIPPLE
:
7970 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7972 case OPCODE_LINE_WIDTH
:
7973 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7975 case OPCODE_LIST_BASE
:
7976 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7978 case OPCODE_LOAD_IDENTITY
:
7979 CALL_LoadIdentity(ctx
->Exec
, ());
7981 case OPCODE_LOAD_MATRIX
:
7982 if (sizeof(Node
) == sizeof(GLfloat
)) {
7983 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7988 for (i
= 0; i
< 16; i
++) {
7991 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7994 case OPCODE_LOAD_NAME
:
7995 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7997 case OPCODE_LOGIC_OP
:
7998 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
8002 GLenum target
= n
[1].e
;
8003 GLint ustride
= _mesa_evaluator_components(target
);
8004 GLint uorder
= n
[5].i
;
8005 GLfloat u1
= n
[2].f
;
8006 GLfloat u2
= n
[3].f
;
8007 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8008 (GLfloat
*) get_pointer(&n
[6])));
8013 GLenum target
= n
[1].e
;
8014 GLfloat u1
= n
[2].f
;
8015 GLfloat u2
= n
[3].f
;
8016 GLfloat v1
= n
[4].f
;
8017 GLfloat v2
= n
[5].f
;
8018 GLint ustride
= n
[6].i
;
8019 GLint vstride
= n
[7].i
;
8020 GLint uorder
= n
[8].i
;
8021 GLint vorder
= n
[9].i
;
8022 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
8023 v1
, v2
, vstride
, vorder
,
8024 (GLfloat
*) get_pointer(&n
[10])));
8027 case OPCODE_MAPGRID1
:
8028 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8030 case OPCODE_MAPGRID2
:
8031 CALL_MapGrid2f(ctx
->Exec
,
8032 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
8034 case OPCODE_MATRIX_MODE
:
8035 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
8037 case OPCODE_MULT_MATRIX
:
8038 if (sizeof(Node
) == sizeof(GLfloat
)) {
8039 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
8044 for (i
= 0; i
< 16; i
++) {
8047 CALL_MultMatrixf(ctx
->Exec
, (m
));
8051 CALL_Ortho(ctx
->Exec
,
8052 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8054 case OPCODE_PASSTHROUGH
:
8055 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
8057 case OPCODE_PIXEL_MAP
:
8058 CALL_PixelMapfv(ctx
->Exec
,
8059 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
8061 case OPCODE_PIXEL_TRANSFER
:
8062 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8064 case OPCODE_PIXEL_ZOOM
:
8065 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8067 case OPCODE_POINT_SIZE
:
8068 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
8070 case OPCODE_POINT_PARAMETERS
:
8076 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
8079 case OPCODE_POLYGON_MODE
:
8080 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8082 case OPCODE_POLYGON_STIPPLE
:
8084 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8085 ctx
->Unpack
= ctx
->DefaultPacking
;
8086 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
8087 ctx
->Unpack
= save
; /* restore */
8090 case OPCODE_POLYGON_OFFSET
:
8091 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8093 case OPCODE_POP_ATTRIB
:
8094 CALL_PopAttrib(ctx
->Exec
, ());
8096 case OPCODE_POP_MATRIX
:
8097 CALL_PopMatrix(ctx
->Exec
, ());
8099 case OPCODE_POP_NAME
:
8100 CALL_PopName(ctx
->Exec
, ());
8102 case OPCODE_PRIORITIZE_TEXTURE
:
8103 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
8105 case OPCODE_PUSH_ATTRIB
:
8106 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
8108 case OPCODE_PUSH_MATRIX
:
8109 CALL_PushMatrix(ctx
->Exec
, ());
8111 case OPCODE_PUSH_NAME
:
8112 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
8114 case OPCODE_RASTER_POS
:
8115 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8117 case OPCODE_READ_BUFFER
:
8118 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
8121 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8124 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8126 case OPCODE_SCISSOR
:
8127 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8129 case OPCODE_SHADE_MODEL
:
8130 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
8132 case OPCODE_PROVOKING_VERTEX
:
8133 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
8135 case OPCODE_STENCIL_FUNC
:
8136 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
8138 case OPCODE_STENCIL_MASK
:
8139 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
8141 case OPCODE_STENCIL_OP
:
8142 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
8144 case OPCODE_STENCIL_FUNC_SEPARATE
:
8145 CALL_StencilFuncSeparate(ctx
->Exec
,
8146 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
8148 case OPCODE_STENCIL_MASK_SEPARATE
:
8149 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8151 case OPCODE_STENCIL_OP_SEPARATE
:
8152 CALL_StencilOpSeparate(ctx
->Exec
,
8153 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
8162 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8172 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8175 case OPCODE_TEXPARAMETER
:
8182 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8185 case OPCODE_TEX_IMAGE1D
:
8187 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8188 ctx
->Unpack
= ctx
->DefaultPacking
;
8189 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
8191 n
[3].i
, /* components */
8193 n
[5].e
, /* border */
8194 n
[6].e
, /* format */
8196 get_pointer(&n
[8])));
8197 ctx
->Unpack
= save
; /* restore */
8200 case OPCODE_TEX_IMAGE2D
:
8202 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8203 ctx
->Unpack
= ctx
->DefaultPacking
;
8204 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
8206 n
[3].i
, /* components */
8208 n
[5].i
, /* height */
8209 n
[6].e
, /* border */
8210 n
[7].e
, /* format */
8212 get_pointer(&n
[9])));
8213 ctx
->Unpack
= save
; /* restore */
8216 case OPCODE_TEX_IMAGE3D
:
8218 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8219 ctx
->Unpack
= ctx
->DefaultPacking
;
8220 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
8222 n
[3].i
, /* components */
8224 n
[5].i
, /* height */
8226 n
[7].e
, /* border */
8227 n
[8].e
, /* format */
8229 get_pointer(&n
[10])));
8230 ctx
->Unpack
= save
; /* restore */
8233 case OPCODE_TEX_SUB_IMAGE1D
:
8235 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8236 ctx
->Unpack
= ctx
->DefaultPacking
;
8237 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8239 n
[6].e
, get_pointer(&n
[7])));
8240 ctx
->Unpack
= save
; /* restore */
8243 case OPCODE_TEX_SUB_IMAGE2D
:
8245 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8246 ctx
->Unpack
= ctx
->DefaultPacking
;
8247 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8249 n
[6].i
, n
[7].e
, n
[8].e
,
8250 get_pointer(&n
[9])));
8251 ctx
->Unpack
= save
; /* restore */
8254 case OPCODE_TEX_SUB_IMAGE3D
:
8256 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
8257 ctx
->Unpack
= ctx
->DefaultPacking
;
8258 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
8259 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
8260 n
[8].i
, n
[9].e
, n
[10].e
,
8261 get_pointer(&n
[11])));
8262 ctx
->Unpack
= save
; /* restore */
8265 case OPCODE_TRANSLATE
:
8266 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8268 case OPCODE_VIEWPORT
:
8269 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
8270 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
8272 case OPCODE_WINDOW_POS
:
8273 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8275 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
8276 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
8278 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
8279 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8280 n
[4].i
, n
[5].i
, n
[6].i
,
8281 get_pointer(&n
[7])));
8283 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
8284 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8285 n
[4].i
, n
[5].i
, n
[6].i
,
8286 n
[7].i
, get_pointer(&n
[8])));
8288 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
8289 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
8290 n
[4].i
, n
[5].i
, n
[6].i
,
8292 get_pointer(&n
[9])));
8294 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
8295 CALL_CompressedTexSubImage1D(ctx
->Exec
,
8296 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8298 get_pointer(&n
[7])));
8300 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
8301 CALL_CompressedTexSubImage2D(ctx
->Exec
,
8302 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8303 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
8304 get_pointer(&n
[9])));
8306 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
8307 CALL_CompressedTexSubImage3D(ctx
->Exec
,
8308 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
8309 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8311 get_pointer(&n
[11])));
8313 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
8314 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
8316 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
8317 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
8319 case OPCODE_BIND_PROGRAM_NV
: /* GL_ARB_vertex_program */
8320 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8322 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
8323 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
8324 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
8327 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
8328 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
8330 case OPCODE_DEPTH_BOUNDS_EXT
:
8331 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8333 case OPCODE_PROGRAM_STRING_ARB
:
8334 CALL_ProgramStringARB(ctx
->Exec
,
8335 (n
[1].e
, n
[2].e
, n
[3].i
,
8336 get_pointer(&n
[4])));
8338 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
8339 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
8343 case OPCODE_BEGIN_QUERY_ARB
:
8344 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8346 case OPCODE_END_QUERY_ARB
:
8347 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
8349 case OPCODE_QUERY_COUNTER
:
8350 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
8352 case OPCODE_BEGIN_QUERY_INDEXED
:
8353 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
8355 case OPCODE_END_QUERY_INDEXED
:
8356 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8358 case OPCODE_DRAW_BUFFERS_ARB
:
8360 GLenum buffers
[MAX_DRAW_BUFFERS
];
8361 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
8362 for (i
= 0; i
< count
; i
++)
8363 buffers
[i
] = n
[2 + i
].e
;
8364 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
8367 case OPCODE_BLIT_FRAMEBUFFER
:
8368 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
8369 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
8372 case OPCODE_USE_PROGRAM
:
8373 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
8375 case OPCODE_UNIFORM_1F
:
8376 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
8378 case OPCODE_UNIFORM_2F
:
8379 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
8381 case OPCODE_UNIFORM_3F
:
8382 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
8384 case OPCODE_UNIFORM_4F
:
8385 CALL_Uniform4f(ctx
->Exec
,
8386 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
8388 case OPCODE_UNIFORM_1FV
:
8389 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8391 case OPCODE_UNIFORM_2FV
:
8392 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8394 case OPCODE_UNIFORM_3FV
:
8395 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8397 case OPCODE_UNIFORM_4FV
:
8398 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8400 case OPCODE_UNIFORM_1I
:
8401 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8403 case OPCODE_UNIFORM_2I
:
8404 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
8406 case OPCODE_UNIFORM_3I
:
8407 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8409 case OPCODE_UNIFORM_4I
:
8410 CALL_Uniform4i(ctx
->Exec
,
8411 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
8413 case OPCODE_UNIFORM_1IV
:
8414 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8416 case OPCODE_UNIFORM_2IV
:
8417 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8419 case OPCODE_UNIFORM_3IV
:
8420 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8422 case OPCODE_UNIFORM_4IV
:
8423 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
8425 case OPCODE_UNIFORM_1UI
:
8426 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
8428 case OPCODE_UNIFORM_2UI
:
8429 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
8431 case OPCODE_UNIFORM_3UI
:
8432 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
8434 case OPCODE_UNIFORM_4UI
:
8435 /*CALL_Uniform4uiARB(ctx->Exec,
8436 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
8439 case OPCODE_UNIFORM_1UIV
:
8440 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i,
8441 get_pointer(&n[3])));*/
8443 case OPCODE_UNIFORM_2UIV
:
8444 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i,
8445 get_pointer(&n[3])));*/
8447 case OPCODE_UNIFORM_3UIV
:
8448 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i,
8449 get_pointer(&n[3])));*/
8451 case OPCODE_UNIFORM_4UIV
:
8452 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i,
8453 get_pointer(&n[3])));*/
8455 case OPCODE_UNIFORM_MATRIX22
:
8456 CALL_UniformMatrix2fv(ctx
->Exec
,
8457 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8459 case OPCODE_UNIFORM_MATRIX33
:
8460 CALL_UniformMatrix3fv(ctx
->Exec
,
8461 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8463 case OPCODE_UNIFORM_MATRIX44
:
8464 CALL_UniformMatrix4fv(ctx
->Exec
,
8465 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8467 case OPCODE_UNIFORM_MATRIX23
:
8468 CALL_UniformMatrix2x3fv(ctx
->Exec
,
8469 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8471 case OPCODE_UNIFORM_MATRIX32
:
8472 CALL_UniformMatrix3x2fv(ctx
->Exec
,
8473 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8475 case OPCODE_UNIFORM_MATRIX24
:
8476 CALL_UniformMatrix2x4fv(ctx
->Exec
,
8477 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8479 case OPCODE_UNIFORM_MATRIX42
:
8480 CALL_UniformMatrix4x2fv(ctx
->Exec
,
8481 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8483 case OPCODE_UNIFORM_MATRIX34
:
8484 CALL_UniformMatrix3x4fv(ctx
->Exec
,
8485 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8487 case OPCODE_UNIFORM_MATRIX43
:
8488 CALL_UniformMatrix4x3fv(ctx
->Exec
,
8489 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
8492 case OPCODE_USE_PROGRAM_STAGES
:
8493 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8495 case OPCODE_PROGRAM_UNIFORM_1F
:
8496 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
8498 case OPCODE_PROGRAM_UNIFORM_2F
:
8499 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
8501 case OPCODE_PROGRAM_UNIFORM_3F
:
8502 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8503 n
[3].f
, n
[4].f
, n
[5].f
));
8505 case OPCODE_PROGRAM_UNIFORM_4F
:
8506 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8507 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
8509 case OPCODE_PROGRAM_UNIFORM_1FV
:
8510 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8511 get_pointer(&n
[4])));
8513 case OPCODE_PROGRAM_UNIFORM_2FV
:
8514 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8515 get_pointer(&n
[4])));
8517 case OPCODE_PROGRAM_UNIFORM_3FV
:
8518 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8519 get_pointer(&n
[4])));
8521 case OPCODE_PROGRAM_UNIFORM_4FV
:
8522 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8523 get_pointer(&n
[4])));
8525 case OPCODE_PROGRAM_UNIFORM_1I
:
8526 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
8528 case OPCODE_PROGRAM_UNIFORM_2I
:
8529 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
8531 case OPCODE_PROGRAM_UNIFORM_3I
:
8532 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8533 n
[3].i
, n
[4].i
, n
[5].i
));
8535 case OPCODE_PROGRAM_UNIFORM_4I
:
8536 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8537 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
8539 case OPCODE_PROGRAM_UNIFORM_1IV
:
8540 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8541 get_pointer(&n
[4])));
8543 case OPCODE_PROGRAM_UNIFORM_2IV
:
8544 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8545 get_pointer(&n
[4])));
8547 case OPCODE_PROGRAM_UNIFORM_3IV
:
8548 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8549 get_pointer(&n
[4])));
8551 case OPCODE_PROGRAM_UNIFORM_4IV
:
8552 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8553 get_pointer(&n
[4])));
8555 case OPCODE_PROGRAM_UNIFORM_1UI
:
8556 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
8558 case OPCODE_PROGRAM_UNIFORM_2UI
:
8559 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8562 case OPCODE_PROGRAM_UNIFORM_3UI
:
8563 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8564 n
[3].ui
, n
[4].ui
, n
[5].ui
));
8566 case OPCODE_PROGRAM_UNIFORM_4UI
:
8567 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
8569 n
[4].ui
, n
[5].ui
, n
[6].ui
));
8571 case OPCODE_PROGRAM_UNIFORM_1UIV
:
8572 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8573 get_pointer(&n
[4])));
8575 case OPCODE_PROGRAM_UNIFORM_2UIV
:
8576 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8577 get_pointer(&n
[4])));
8579 case OPCODE_PROGRAM_UNIFORM_3UIV
:
8580 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8581 get_pointer(&n
[4])));
8583 case OPCODE_PROGRAM_UNIFORM_4UIV
:
8584 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
8585 get_pointer(&n
[4])));
8587 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
8588 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8589 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8590 get_pointer(&n
[5])));
8592 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
8593 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8594 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8595 get_pointer(&n
[5])));
8597 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
8598 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8599 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8600 get_pointer(&n
[5])));
8602 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
8603 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8604 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8605 get_pointer(&n
[5])));
8607 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
8608 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8609 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8610 get_pointer(&n
[5])));
8612 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
8613 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8614 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8615 get_pointer(&n
[5])));
8617 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
8618 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8619 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8620 get_pointer(&n
[5])));
8622 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
8623 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8624 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8625 get_pointer(&n
[5])));
8627 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
8628 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8629 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
8630 get_pointer(&n
[5])));
8633 case OPCODE_CLIP_CONTROL
:
8634 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8637 case OPCODE_CLAMP_COLOR
:
8638 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
8641 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
8642 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
8644 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
8647 GLuint i
, dst
= n
[1].ui
;
8649 for (i
= 0; i
< 4; i
++)
8650 values
[i
] = n
[1 + i
].f
;
8651 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
8654 case OPCODE_ATTR_1F_NV
:
8655 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8657 case OPCODE_ATTR_2F_NV
:
8658 /* Really shouldn't have to do this - the Node structure
8659 * is convenient, but it would be better to store the data
8660 * packed appropriately so that it can be sent directly
8661 * on. With x86_64 becoming common, this will start to
8664 if (sizeof(Node
) == sizeof(GLfloat
))
8665 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8667 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8669 case OPCODE_ATTR_3F_NV
:
8670 if (sizeof(Node
) == sizeof(GLfloat
))
8671 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8673 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8676 case OPCODE_ATTR_4F_NV
:
8677 if (sizeof(Node
) == sizeof(GLfloat
))
8678 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8680 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8683 case OPCODE_ATTR_1F_ARB
:
8684 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
8686 case OPCODE_ATTR_2F_ARB
:
8687 /* Really shouldn't have to do this - the Node structure
8688 * is convenient, but it would be better to store the data
8689 * packed appropriately so that it can be sent directly
8690 * on. With x86_64 becoming common, this will start to
8693 if (sizeof(Node
) == sizeof(GLfloat
))
8694 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8696 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
8698 case OPCODE_ATTR_3F_ARB
:
8699 if (sizeof(Node
) == sizeof(GLfloat
))
8700 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8702 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8705 case OPCODE_ATTR_4F_ARB
:
8706 if (sizeof(Node
) == sizeof(GLfloat
))
8707 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
8709 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
8712 case OPCODE_MATERIAL
:
8713 if (sizeof(Node
) == sizeof(GLfloat
))
8714 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
8721 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
8725 CALL_Begin(ctx
->Exec
, (n
[1].e
));
8728 CALL_End(ctx
->Exec
, ());
8731 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
8733 case OPCODE_EVAL_C1
:
8734 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
8736 case OPCODE_EVAL_C2
:
8737 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
8739 case OPCODE_EVAL_P1
:
8740 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
8742 case OPCODE_EVAL_P2
:
8743 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
8746 /* GL_EXT_texture_integer */
8747 case OPCODE_CLEARCOLOR_I
:
8748 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
8750 case OPCODE_CLEARCOLOR_UI
:
8751 CALL_ClearColorIuiEXT(ctx
->Exec
,
8752 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
8754 case OPCODE_TEXPARAMETER_I
:
8761 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8764 case OPCODE_TEXPARAMETER_UI
:
8767 params
[0] = n
[3].ui
;
8768 params
[1] = n
[4].ui
;
8769 params
[2] = n
[5].ui
;
8770 params
[3] = n
[6].ui
;
8771 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
8775 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
8776 /* GL_ARB_instanced_arrays */
8777 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8780 case OPCODE_TEXTURE_BARRIER_NV
:
8781 CALL_TextureBarrierNV(ctx
->Exec
, ());
8784 /* GL_EXT/ARB_transform_feedback */
8785 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
8786 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
8788 case OPCODE_END_TRANSFORM_FEEDBACK
:
8789 CALL_EndTransformFeedback(ctx
->Exec
, ());
8791 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
8792 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8794 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
8795 CALL_PauseTransformFeedback(ctx
->Exec
, ());
8797 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
8798 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
8800 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
8801 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
8803 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
8804 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
8805 (n
[1].e
, n
[2].ui
, n
[3].ui
));
8807 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
8808 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
8809 (n
[1].e
, n
[2].ui
, n
[3].si
));
8811 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
8812 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
8813 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
8817 case OPCODE_BIND_SAMPLER
:
8818 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
8820 case OPCODE_SAMPLER_PARAMETERIV
:
8827 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8830 case OPCODE_SAMPLER_PARAMETERFV
:
8837 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8840 case OPCODE_SAMPLER_PARAMETERIIV
:
8847 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8850 case OPCODE_SAMPLER_PARAMETERUIV
:
8853 params
[0] = n
[3].ui
;
8854 params
[1] = n
[4].ui
;
8855 params
[2] = n
[5].ui
;
8856 params
[3] = n
[6].ui
;
8857 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
8861 /* GL_ARB_geometry_shader4 */
8862 case OPCODE_PROGRAM_PARAMETERI
:
8863 CALL_ProgramParameteri(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
));
8865 case OPCODE_FRAMEBUFFER_TEXTURE
:
8866 CALL_FramebufferTexture(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8869 case OPCODE_FRAMEBUFFER_TEXTURE_FACE
:
8870 CALL_FramebufferTextureFaceARB(ctx
->Exec
, (n
[1].e
, n
[2].e
,
8871 n
[3].ui
, n
[4].i
, n
[5].e
));
8875 case OPCODE_WAIT_SYNC
:
8877 union uint64_pair p
;
8878 p
.uint32
[0] = n
[2].ui
;
8879 p
.uint32
[1] = n
[3].ui
;
8880 CALL_WaitSync(ctx
->Exec
,
8881 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
8885 /* GL_NV_conditional_render */
8886 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
8887 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
8889 case OPCODE_END_CONDITIONAL_RENDER
:
8890 CALL_EndConditionalRender(ctx
->Exec
, ());
8893 case OPCODE_UNIFORM_BLOCK_BINDING
:
8894 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
8897 case OPCODE_CONTINUE
:
8898 n
= (Node
*) get_pointer(&n
[1]);
8900 case OPCODE_END_OF_LIST
:
8906 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
8908 _mesa_problem(ctx
, "%s", msg
);
8913 /* increment n to point to next compiled command */
8914 if (opcode
!= OPCODE_CONTINUE
) {
8915 n
+= InstSize
[opcode
];
8920 if (ctx
->Driver
.EndCallList
)
8921 ctx
->Driver
.EndCallList(ctx
);
8923 ctx
->ListState
.CallDepth
--;
8928 /**********************************************************************/
8930 /**********************************************************************/
8933 * Test if a display list number is valid.
8935 GLboolean GLAPIENTRY
8936 _mesa_IsList(GLuint list
)
8938 GET_CURRENT_CONTEXT(ctx
);
8939 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8940 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
8941 return islist(ctx
, list
);
8946 * Delete a sequence of consecutive display lists.
8949 _mesa_DeleteLists(GLuint list
, GLsizei range
)
8951 GET_CURRENT_CONTEXT(ctx
);
8953 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8954 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8957 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
8960 for (i
= list
; i
< list
+ range
; i
++) {
8961 destroy_list(ctx
, i
);
8967 * Return a display list number, n, such that lists n through n+range-1
8971 _mesa_GenLists(GLsizei range
)
8973 GET_CURRENT_CONTEXT(ctx
);
8975 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8976 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
8979 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
8987 * Make this an atomic operation
8989 mtx_lock(&ctx
->Shared
->Mutex
);
8991 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
8993 /* reserve the list IDs by with empty/dummy lists */
8995 for (i
= 0; i
< range
; i
++) {
8996 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8997 make_list(base
+ i
, 1));
9001 mtx_unlock(&ctx
->Shared
->Mutex
);
9008 * Begin a new display list.
9011 _mesa_NewList(GLuint name
, GLenum mode
)
9013 GET_CURRENT_CONTEXT(ctx
);
9015 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
9016 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9018 if (MESA_VERBOSE
& VERBOSE_API
)
9019 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
9020 _mesa_lookup_enum_by_nr(mode
));
9023 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
9027 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
9028 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
9032 if (ctx
->ListState
.CurrentList
) {
9033 /* already compiling a display list */
9034 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
9038 ctx
->CompileFlag
= GL_TRUE
;
9039 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
9041 /* Reset accumulated list state */
9042 invalidate_saved_current_state( ctx
);
9044 /* Allocate new display list */
9045 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
9046 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
9047 ctx
->ListState
.CurrentPos
= 0;
9049 ctx
->Driver
.NewList(ctx
, name
, mode
);
9051 ctx
->CurrentDispatch
= ctx
->Save
;
9052 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9057 * End definition of current display list.
9062 GET_CURRENT_CONTEXT(ctx
);
9063 SAVE_FLUSH_VERTICES(ctx
);
9064 FLUSH_VERTICES(ctx
, 0);
9066 if (MESA_VERBOSE
& VERBOSE_API
)
9067 _mesa_debug(ctx
, "glEndList\n");
9069 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
9070 _mesa_error(ctx
, GL_INVALID_OPERATION
,
9071 "glEndList() called inside glBegin/End");
9074 /* Check that a list is under construction */
9075 if (!ctx
->ListState
.CurrentList
) {
9076 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
9080 /* Call before emitting END_OF_LIST, in case the driver wants to
9081 * emit opcodes itself.
9083 ctx
->Driver
.EndList(ctx
);
9085 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
9089 /* Destroy old list, if any */
9090 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
9092 /* Install the new list */
9093 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
9094 ctx
->ListState
.CurrentList
->Name
,
9095 ctx
->ListState
.CurrentList
);
9098 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
9099 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
9101 ctx
->ListState
.CurrentList
= NULL
;
9102 ctx
->ListState
.CurrentBlock
= NULL
;
9103 ctx
->ListState
.CurrentPos
= 0;
9104 ctx
->ExecuteFlag
= GL_TRUE
;
9105 ctx
->CompileFlag
= GL_FALSE
;
9107 ctx
->CurrentDispatch
= ctx
->Exec
;
9108 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9113 _mesa_CallList(GLuint list
)
9115 GLboolean save_compile_flag
;
9116 GET_CURRENT_CONTEXT(ctx
);
9117 FLUSH_CURRENT(ctx
, 0);
9119 if (MESA_VERBOSE
& VERBOSE_API
)
9120 _mesa_debug(ctx
, "glCallList %d\n", list
);
9123 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
9128 mesa_print_display_list( list
);
9130 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
9131 * execute the display list, and restore the CompileFlag.
9133 save_compile_flag
= ctx
->CompileFlag
;
9134 if (save_compile_flag
) {
9135 ctx
->CompileFlag
= GL_FALSE
;
9138 execute_list(ctx
, list
);
9139 ctx
->CompileFlag
= save_compile_flag
;
9141 /* also restore API function pointers to point to "save" versions */
9142 if (save_compile_flag
) {
9143 ctx
->CurrentDispatch
= ctx
->Save
;
9144 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9150 * Execute glCallLists: call multiple display lists.
9153 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
9155 GET_CURRENT_CONTEXT(ctx
);
9157 GLboolean save_compile_flag
;
9159 if (MESA_VERBOSE
& VERBOSE_API
)
9160 _mesa_debug(ctx
, "glCallLists %d\n", n
);
9164 case GL_UNSIGNED_BYTE
:
9166 case GL_UNSIGNED_SHORT
:
9168 case GL_UNSIGNED_INT
:
9176 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
9180 /* Save the CompileFlag status, turn it off, execute display list,
9181 * and restore the CompileFlag.
9183 save_compile_flag
= ctx
->CompileFlag
;
9184 ctx
->CompileFlag
= GL_FALSE
;
9186 for (i
= 0; i
< n
; i
++) {
9187 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
9188 execute_list(ctx
, list
);
9191 ctx
->CompileFlag
= save_compile_flag
;
9193 /* also restore API function pointers to point to "save" versions */
9194 if (save_compile_flag
) {
9195 ctx
->CurrentDispatch
= ctx
->Save
;
9196 _glapi_set_dispatch(ctx
->CurrentDispatch
);
9202 * Set the offset added to list numbers in glCallLists.
9205 _mesa_ListBase(GLuint base
)
9207 GET_CURRENT_CONTEXT(ctx
);
9208 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
9209 ASSERT_OUTSIDE_BEGIN_END(ctx
);
9210 ctx
->List
.ListBase
= base
;
9214 * Setup the given dispatch table to point to Mesa's display list
9215 * building functions.
9217 * This does not include any of the tnl functions - they are
9218 * initialized from _mesa_init_api_defaults and from the active vtxfmt
9222 _mesa_initialize_save_table(const struct gl_context
*ctx
)
9224 struct _glapi_table
*table
= ctx
->Save
;
9225 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
9227 /* Initially populate the dispatch table with the contents of the
9228 * normal-execution dispatch table. This lets us skip populating functions
9229 * that should be called directly instead of compiled into display lists.
9231 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
9233 _mesa_loopback_init_api_table(ctx
, table
);
9236 vbo_initialize_save_dispatch(ctx
, table
);
9239 SET_Accum(table
, save_Accum
);
9240 SET_AlphaFunc(table
, save_AlphaFunc
);
9241 SET_Bitmap(table
, save_Bitmap
);
9242 SET_BlendFunc(table
, save_BlendFunc
);
9243 SET_CallList(table
, save_CallList
);
9244 SET_CallLists(table
, save_CallLists
);
9245 SET_Clear(table
, save_Clear
);
9246 SET_ClearAccum(table
, save_ClearAccum
);
9247 SET_ClearColor(table
, save_ClearColor
);
9248 SET_ClearDepth(table
, save_ClearDepth
);
9249 SET_ClearIndex(table
, save_ClearIndex
);
9250 SET_ClearStencil(table
, save_ClearStencil
);
9251 SET_ClipPlane(table
, save_ClipPlane
);
9252 SET_ColorMask(table
, save_ColorMask
);
9253 SET_ColorMaski(table
, save_ColorMaskIndexed
);
9254 SET_ColorMaterial(table
, save_ColorMaterial
);
9255 SET_CopyPixels(table
, save_CopyPixels
);
9256 SET_CullFace(table
, save_CullFace
);
9257 SET_DepthFunc(table
, save_DepthFunc
);
9258 SET_DepthMask(table
, save_DepthMask
);
9259 SET_DepthRange(table
, save_DepthRange
);
9260 SET_Disable(table
, save_Disable
);
9261 SET_Disablei(table
, save_DisableIndexed
);
9262 SET_DrawBuffer(table
, save_DrawBuffer
);
9263 SET_DrawPixels(table
, save_DrawPixels
);
9264 SET_Enable(table
, save_Enable
);
9265 SET_Enablei(table
, save_EnableIndexed
);
9266 SET_EvalMesh1(table
, save_EvalMesh1
);
9267 SET_EvalMesh2(table
, save_EvalMesh2
);
9268 SET_Fogf(table
, save_Fogf
);
9269 SET_Fogfv(table
, save_Fogfv
);
9270 SET_Fogi(table
, save_Fogi
);
9271 SET_Fogiv(table
, save_Fogiv
);
9272 SET_FrontFace(table
, save_FrontFace
);
9273 SET_Frustum(table
, save_Frustum
);
9274 SET_Hint(table
, save_Hint
);
9275 SET_IndexMask(table
, save_IndexMask
);
9276 SET_InitNames(table
, save_InitNames
);
9277 SET_LightModelf(table
, save_LightModelf
);
9278 SET_LightModelfv(table
, save_LightModelfv
);
9279 SET_LightModeli(table
, save_LightModeli
);
9280 SET_LightModeliv(table
, save_LightModeliv
);
9281 SET_Lightf(table
, save_Lightf
);
9282 SET_Lightfv(table
, save_Lightfv
);
9283 SET_Lighti(table
, save_Lighti
);
9284 SET_Lightiv(table
, save_Lightiv
);
9285 SET_LineStipple(table
, save_LineStipple
);
9286 SET_LineWidth(table
, save_LineWidth
);
9287 SET_ListBase(table
, save_ListBase
);
9288 SET_LoadIdentity(table
, save_LoadIdentity
);
9289 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9290 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9291 SET_LoadName(table
, save_LoadName
);
9292 SET_LogicOp(table
, save_LogicOp
);
9293 SET_Map1d(table
, save_Map1d
);
9294 SET_Map1f(table
, save_Map1f
);
9295 SET_Map2d(table
, save_Map2d
);
9296 SET_Map2f(table
, save_Map2f
);
9297 SET_MapGrid1d(table
, save_MapGrid1d
);
9298 SET_MapGrid1f(table
, save_MapGrid1f
);
9299 SET_MapGrid2d(table
, save_MapGrid2d
);
9300 SET_MapGrid2f(table
, save_MapGrid2f
);
9301 SET_MatrixMode(table
, save_MatrixMode
);
9302 SET_MultMatrixd(table
, save_MultMatrixd
);
9303 SET_MultMatrixf(table
, save_MultMatrixf
);
9304 SET_NewList(table
, save_NewList
);
9305 SET_Ortho(table
, save_Ortho
);
9306 SET_PassThrough(table
, save_PassThrough
);
9307 SET_PixelMapfv(table
, save_PixelMapfv
);
9308 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9309 SET_PixelMapusv(table
, save_PixelMapusv
);
9310 SET_PixelTransferf(table
, save_PixelTransferf
);
9311 SET_PixelTransferi(table
, save_PixelTransferi
);
9312 SET_PixelZoom(table
, save_PixelZoom
);
9313 SET_PointSize(table
, save_PointSize
);
9314 SET_PolygonMode(table
, save_PolygonMode
);
9315 SET_PolygonOffset(table
, save_PolygonOffset
);
9316 SET_PolygonStipple(table
, save_PolygonStipple
);
9317 SET_PopAttrib(table
, save_PopAttrib
);
9318 SET_PopMatrix(table
, save_PopMatrix
);
9319 SET_PopName(table
, save_PopName
);
9320 SET_PushAttrib(table
, save_PushAttrib
);
9321 SET_PushMatrix(table
, save_PushMatrix
);
9322 SET_PushName(table
, save_PushName
);
9323 SET_RasterPos2d(table
, save_RasterPos2d
);
9324 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9325 SET_RasterPos2f(table
, save_RasterPos2f
);
9326 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9327 SET_RasterPos2i(table
, save_RasterPos2i
);
9328 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9329 SET_RasterPos2s(table
, save_RasterPos2s
);
9330 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9331 SET_RasterPos3d(table
, save_RasterPos3d
);
9332 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9333 SET_RasterPos3f(table
, save_RasterPos3f
);
9334 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9335 SET_RasterPos3i(table
, save_RasterPos3i
);
9336 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9337 SET_RasterPos3s(table
, save_RasterPos3s
);
9338 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9339 SET_RasterPos4d(table
, save_RasterPos4d
);
9340 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9341 SET_RasterPos4f(table
, save_RasterPos4f
);
9342 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9343 SET_RasterPos4i(table
, save_RasterPos4i
);
9344 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9345 SET_RasterPos4s(table
, save_RasterPos4s
);
9346 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9347 SET_ReadBuffer(table
, save_ReadBuffer
);
9348 SET_Rectf(table
, save_Rectf
);
9349 SET_Rotated(table
, save_Rotated
);
9350 SET_Rotatef(table
, save_Rotatef
);
9351 SET_Scaled(table
, save_Scaled
);
9352 SET_Scalef(table
, save_Scalef
);
9353 SET_Scissor(table
, save_Scissor
);
9354 SET_ShadeModel(table
, save_ShadeModel
);
9355 SET_StencilFunc(table
, save_StencilFunc
);
9356 SET_StencilMask(table
, save_StencilMask
);
9357 SET_StencilOp(table
, save_StencilOp
);
9358 SET_TexEnvf(table
, save_TexEnvf
);
9359 SET_TexEnvfv(table
, save_TexEnvfv
);
9360 SET_TexEnvi(table
, save_TexEnvi
);
9361 SET_TexEnviv(table
, save_TexEnviv
);
9362 SET_TexGend(table
, save_TexGend
);
9363 SET_TexGendv(table
, save_TexGendv
);
9364 SET_TexGenf(table
, save_TexGenf
);
9365 SET_TexGenfv(table
, save_TexGenfv
);
9366 SET_TexGeni(table
, save_TexGeni
);
9367 SET_TexGeniv(table
, save_TexGeniv
);
9368 SET_TexImage1D(table
, save_TexImage1D
);
9369 SET_TexImage2D(table
, save_TexImage2D
);
9370 SET_TexParameterf(table
, save_TexParameterf
);
9371 SET_TexParameterfv(table
, save_TexParameterfv
);
9372 SET_TexParameteri(table
, save_TexParameteri
);
9373 SET_TexParameteriv(table
, save_TexParameteriv
);
9374 SET_Translated(table
, save_Translated
);
9375 SET_Translatef(table
, save_Translatef
);
9376 SET_Viewport(table
, save_Viewport
);
9379 SET_BindTexture(table
, save_BindTexture
);
9380 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9381 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9382 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9383 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9384 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9385 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9386 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9389 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9390 SET_TexImage3D(table
, save_TexImage3D
);
9391 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9394 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9395 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9396 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9398 /* ATI_separate_stencil */
9399 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9401 /* GL_ARB_imaging */
9402 /* Not all are supported */
9403 SET_BlendColor(table
, save_BlendColor
);
9404 SET_BlendEquation(table
, save_BlendEquation
);
9406 /* 2. GL_EXT_blend_color */
9408 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9411 /* 3. GL_EXT_polygon_offset */
9412 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9414 /* 6. GL_EXT_texture3d */
9416 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9417 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9418 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9421 /* 37. GL_EXT_blend_minmax */
9423 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9426 /* 54. GL_EXT_point_parameters */
9427 SET_PointParameterf(table
, save_PointParameterfEXT
);
9428 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
9430 /* 173. GL_EXT_blend_func_separate */
9431 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
9433 /* 197. GL_MESA_window_pos */
9434 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
9435 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
9436 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
9437 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
9438 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
9439 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
9440 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
9441 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
9442 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
9443 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
9444 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
9445 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
9446 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
9447 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
9448 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
9449 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
9450 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9451 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9452 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9453 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9454 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9455 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9456 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9457 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9459 /* 233. GL_NV_vertex_program */
9460 /* The following commands DO NOT go into display lists:
9461 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9462 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9464 SET_BindProgramARB(table
, save_BindProgramNV
);
9466 /* 245. GL_ATI_fragment_shader */
9467 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9468 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9470 /* 262. GL_NV_point_sprite */
9471 SET_PointParameteri(table
, save_PointParameteriNV
);
9472 SET_PointParameteriv(table
, save_PointParameterivNV
);
9474 /* 268. GL_EXT_stencil_two_side */
9475 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9477 /* ???. GL_EXT_depth_bounds_test */
9478 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9480 /* ARB 1. GL_ARB_multitexture */
9481 SET_ActiveTexture(table
, save_ActiveTextureARB
);
9483 /* ARB 3. GL_ARB_transpose_matrix */
9484 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
9485 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
9486 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
9487 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
9489 /* ARB 5. GL_ARB_multisample */
9490 SET_SampleCoverage(table
, save_SampleCoverageARB
);
9492 /* ARB 12. GL_ARB_texture_compression */
9493 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
9494 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
9495 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
9496 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
9497 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
9498 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
9500 /* ARB 14. GL_ARB_point_parameters */
9501 /* aliased with EXT_point_parameters functions */
9503 /* ARB 25. GL_ARB_window_pos */
9504 /* aliased with MESA_window_pos functions */
9506 /* ARB 26. GL_ARB_vertex_program */
9507 /* ARB 27. GL_ARB_fragment_program */
9508 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9509 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9510 SET_BindProgramARB(table
, save_BindProgramNV
);
9511 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9512 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9513 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9514 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9515 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9516 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9517 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9518 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9520 SET_BeginQuery(table
, save_BeginQueryARB
);
9521 SET_EndQuery(table
, save_EndQueryARB
);
9522 SET_QueryCounter(table
, save_QueryCounter
);
9524 SET_DrawBuffers(table
, save_DrawBuffersARB
);
9526 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
9528 SET_UseProgram(table
, save_UseProgramObjectARB
);
9529 SET_Uniform1f(table
, save_Uniform1fARB
);
9530 SET_Uniform2f(table
, save_Uniform2fARB
);
9531 SET_Uniform3f(table
, save_Uniform3fARB
);
9532 SET_Uniform4f(table
, save_Uniform4fARB
);
9533 SET_Uniform1fv(table
, save_Uniform1fvARB
);
9534 SET_Uniform2fv(table
, save_Uniform2fvARB
);
9535 SET_Uniform3fv(table
, save_Uniform3fvARB
);
9536 SET_Uniform4fv(table
, save_Uniform4fvARB
);
9537 SET_Uniform1i(table
, save_Uniform1iARB
);
9538 SET_Uniform2i(table
, save_Uniform2iARB
);
9539 SET_Uniform3i(table
, save_Uniform3iARB
);
9540 SET_Uniform4i(table
, save_Uniform4iARB
);
9541 SET_Uniform1iv(table
, save_Uniform1ivARB
);
9542 SET_Uniform2iv(table
, save_Uniform2ivARB
);
9543 SET_Uniform3iv(table
, save_Uniform3ivARB
);
9544 SET_Uniform4iv(table
, save_Uniform4ivARB
);
9545 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
9546 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
9547 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
9548 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9549 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9550 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9551 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9552 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9553 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9555 /* 299. GL_EXT_blend_equation_separate */
9556 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
9558 /* GL_EXT_gpu_program_parameters */
9559 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9560 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9562 /* 364. GL_EXT_provoking_vertex */
9563 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
9565 /* GL_EXT_texture_integer */
9566 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
9567 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
9568 SET_TexParameterIiv(table
, save_TexParameterIiv
);
9569 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
9571 /* GL_ARB_clip_control */
9572 SET_ClipControl(table
, save_ClipControl
);
9574 /* GL_ARB_color_buffer_float */
9575 SET_ClampColor(table
, save_ClampColorARB
);
9578 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9579 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9580 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9581 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9583 SET_Uniform1ui(table
, save_Uniform1ui
);
9584 SET_Uniform2ui(table
, save_Uniform2ui
);
9585 SET_Uniform3ui(table
, save_Uniform3ui
);
9586 SET_Uniform4ui(table
, save_Uniform4ui
);
9587 SET_Uniform1uiv(table
, save_Uniform1uiv
);
9588 SET_Uniform2uiv(table
, save_Uniform2uiv
);
9589 SET_Uniform3uiv(table
, save_Uniform3uiv
);
9590 SET_Uniform4uiv(table
, save_Uniform4uiv
);
9592 (void) save_Uniform1ui
;
9593 (void) save_Uniform2ui
;
9594 (void) save_Uniform3ui
;
9595 (void) save_Uniform4ui
;
9596 (void) save_Uniform1uiv
;
9597 (void) save_Uniform2uiv
;
9598 (void) save_Uniform3uiv
;
9599 (void) save_Uniform4uiv
;
9603 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
9604 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
9605 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
9606 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
9607 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
9608 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
9609 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
9610 SET_DrawTransformFeedbackInstanced(table
,
9611 save_DrawTransformFeedbackInstanced
);
9612 SET_DrawTransformFeedbackStreamInstanced(table
,
9613 save_DrawTransformFeedbackStreamInstanced
);
9614 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
9615 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
9617 /* GL_ARB_instanced_arrays */
9618 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
9620 /* GL_NV_texture_barrier */
9621 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
9623 SET_BindSampler(table
, save_BindSampler
);
9624 SET_SamplerParameteri(table
, save_SamplerParameteri
);
9625 SET_SamplerParameterf(table
, save_SamplerParameterf
);
9626 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
9627 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
9628 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
9629 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
9631 /* GL_ARB_draw_buffer_blend */
9632 SET_BlendFunciARB(table
, save_BlendFunci
);
9633 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
9634 SET_BlendEquationiARB(table
, save_BlendEquationi
);
9635 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
9637 /* GL_ARB_geometry_shader4 */
9638 SET_ProgramParameteri(table
, save_ProgramParameteri
);
9639 SET_FramebufferTexture(table
, save_FramebufferTexture
);
9640 SET_FramebufferTextureFaceARB(table
, save_FramebufferTextureFace
);
9642 /* GL_NV_conditional_render */
9643 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
9644 SET_EndConditionalRender(table
, save_EndConditionalRender
);
9647 SET_WaitSync(table
, save_WaitSync
);
9649 /* GL_ARB_uniform_buffer_object */
9650 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
9652 /* GL_ARB_draw_instanced */
9653 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
9654 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
9656 /* GL_ARB_draw_elements_base_vertex */
9657 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
9659 /* GL_ARB_base_instance */
9660 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
9661 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
9662 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
9664 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
9665 SET_UseProgramStages(table
, save_UseProgramStages
);
9666 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
9667 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
9668 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
9669 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
9670 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
9671 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
9672 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
9673 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
9674 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
9675 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
9676 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
9677 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
9678 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
9679 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
9680 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
9681 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
9682 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
9683 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
9684 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
9685 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
9686 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
9687 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
9688 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
9689 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
9690 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
9691 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
9692 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
9693 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
9694 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
9695 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
9696 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
9697 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
9698 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
9704 enum_string(GLenum k
)
9706 return _mesa_lookup_enum_by_nr(k
);
9711 * Print the commands in a display list. For debugging only.
9712 * TODO: many commands aren't handled yet.
9713 * \param fname filename to write display list to. If null, use stdout.
9715 static void GLAPIENTRY
9716 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
9718 struct gl_display_list
*dlist
;
9724 f
= fopen(fname
, "w");
9729 if (!islist(ctx
, list
)) {
9730 fprintf(f
, "%u is not a display list ID\n", list
);
9734 dlist
= _mesa_lookup_list(ctx
, list
);
9740 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
9742 done
= n
? GL_FALSE
: GL_TRUE
;
9744 const OpCode opcode
= n
[0].opcode
;
9746 if (is_ext_opcode(opcode
)) {
9747 n
+= ext_opcode_print(ctx
, n
, f
);
9752 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9754 case OPCODE_ACTIVE_TEXTURE
:
9755 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
9758 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9759 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9760 get_pointer(&n
[7]));
9762 case OPCODE_CALL_LIST
:
9763 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
9765 case OPCODE_CALL_LIST_OFFSET
:
9766 fprintf(f
, "CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9767 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9769 case OPCODE_DISABLE
:
9770 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
9773 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
9775 case OPCODE_FRUSTUM
:
9776 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
9777 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9779 case OPCODE_LINE_STIPPLE
:
9780 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9782 case OPCODE_LOAD_IDENTITY
:
9783 fprintf(f
, "LoadIdentity\n");
9785 case OPCODE_LOAD_MATRIX
:
9786 fprintf(f
, "LoadMatrix\n");
9787 fprintf(f
, " %8f %8f %8f %8f\n",
9788 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9789 fprintf(f
, " %8f %8f %8f %8f\n",
9790 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9791 fprintf(f
, " %8f %8f %8f %8f\n",
9792 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9793 fprintf(f
, " %8f %8f %8f %8f\n",
9794 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9796 case OPCODE_MULT_MATRIX
:
9797 fprintf(f
, "MultMatrix (or Rotate)\n");
9798 fprintf(f
, " %8f %8f %8f %8f\n",
9799 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9800 fprintf(f
, " %8f %8f %8f %8f\n",
9801 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9802 fprintf(f
, " %8f %8f %8f %8f\n",
9803 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9804 fprintf(f
, " %8f %8f %8f %8f\n",
9805 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9808 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
9809 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9811 case OPCODE_POP_ATTRIB
:
9812 fprintf(f
, "PopAttrib\n");
9814 case OPCODE_POP_MATRIX
:
9815 fprintf(f
, "PopMatrix\n");
9817 case OPCODE_POP_NAME
:
9818 fprintf(f
, "PopName\n");
9820 case OPCODE_PUSH_ATTRIB
:
9821 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
9823 case OPCODE_PUSH_MATRIX
:
9824 fprintf(f
, "PushMatrix\n");
9826 case OPCODE_PUSH_NAME
:
9827 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
9829 case OPCODE_RASTER_POS
:
9830 fprintf(f
, "RasterPos %g %g %g %g\n",
9831 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9834 fprintf(f
, "Rotate %g %g %g %g\n",
9835 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9838 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9840 case OPCODE_TRANSLATE
:
9841 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9843 case OPCODE_BIND_TEXTURE
:
9844 fprintf(f
, "BindTexture %s %d\n",
9845 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9847 case OPCODE_SHADE_MODEL
:
9848 fprintf(f
, "ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9851 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
9852 _mesa_lookup_enum_by_nr(n
[1].ui
),
9853 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9856 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9857 _mesa_lookup_enum_by_nr(n
[1].ui
),
9858 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9859 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9861 case OPCODE_MAPGRID1
:
9862 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9864 case OPCODE_MAPGRID2
:
9865 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9866 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9868 case OPCODE_EVALMESH1
:
9869 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9871 case OPCODE_EVALMESH2
:
9872 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
9873 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9876 case OPCODE_ATTR_1F_NV
:
9877 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9879 case OPCODE_ATTR_2F_NV
:
9880 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
9881 n
[1].i
, n
[2].f
, n
[3].f
);
9883 case OPCODE_ATTR_3F_NV
:
9884 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
9885 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9887 case OPCODE_ATTR_4F_NV
:
9888 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
9889 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9891 case OPCODE_ATTR_1F_ARB
:
9892 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9894 case OPCODE_ATTR_2F_ARB
:
9895 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
9896 n
[1].i
, n
[2].f
, n
[3].f
);
9898 case OPCODE_ATTR_3F_ARB
:
9899 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
9900 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9902 case OPCODE_ATTR_4F_ARB
:
9903 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
9904 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9907 case OPCODE_MATERIAL
:
9908 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
9909 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9912 fprintf(f
, "BEGIN %x\n", n
[1].i
);
9915 fprintf(f
, "END\n");
9918 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9921 case OPCODE_EVAL_C1
:
9922 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
9924 case OPCODE_EVAL_C2
:
9925 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9927 case OPCODE_EVAL_P1
:
9928 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
9930 case OPCODE_EVAL_P2
:
9931 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9934 case OPCODE_PROVOKING_VERTEX
:
9935 fprintf(f
, "ProvokingVertex %s\n",
9936 _mesa_lookup_enum_by_nr(n
[1].ui
));
9940 * meta opcodes/commands
9943 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
9944 (const char *) get_pointer(&n
[2]));
9946 case OPCODE_CONTINUE
:
9947 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
9948 n
= (Node
*) get_pointer(&n
[1]);
9950 case OPCODE_END_OF_LIST
:
9951 fprintf(f
, "END-LIST %u\n", list
);
9955 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9957 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9958 opcode
, (void *) n
);
9962 fprintf(f
, "command %d, %u operands\n", opcode
,
9966 /* increment n to point to next compiled command */
9967 if (opcode
!= OPCODE_CONTINUE
) {
9968 n
+= InstSize
[opcode
];
9981 * Clients may call this function to help debug display list problems.
9982 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9983 * changed, or break in the future without notice.
9986 mesa_print_display_list(GLuint list
)
9988 GET_CURRENT_CONTEXT(ctx
);
9989 print_list(ctx
, list
, NULL
);
9993 /**********************************************************************/
9994 /***** Initialization *****/
9995 /**********************************************************************/
9998 save_vtxfmt_init(GLvertexformat
* vfmt
)
10000 vfmt
->ArrayElement
= _ae_ArrayElement
;
10002 vfmt
->Begin
= save_Begin
;
10004 vfmt
->CallList
= save_CallList
;
10005 vfmt
->CallLists
= save_CallLists
;
10007 vfmt
->Color3f
= save_Color3f
;
10008 vfmt
->Color3fv
= save_Color3fv
;
10009 vfmt
->Color4f
= save_Color4f
;
10010 vfmt
->Color4fv
= save_Color4fv
;
10011 vfmt
->EdgeFlag
= save_EdgeFlag
;
10012 vfmt
->End
= save_End
;
10014 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
10015 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
10016 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
10017 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
10018 vfmt
->EvalPoint1
= save_EvalPoint1
;
10019 vfmt
->EvalPoint2
= save_EvalPoint2
;
10021 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
10022 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
10023 vfmt
->Indexf
= save_Indexf
;
10024 vfmt
->Indexfv
= save_Indexfv
;
10025 vfmt
->Materialfv
= save_Materialfv
;
10026 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
10027 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
10028 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
10029 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
10030 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
10031 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
10032 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
10033 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
10034 vfmt
->Normal3f
= save_Normal3f
;
10035 vfmt
->Normal3fv
= save_Normal3fv
;
10036 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
10037 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
10038 vfmt
->TexCoord1f
= save_TexCoord1f
;
10039 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
10040 vfmt
->TexCoord2f
= save_TexCoord2f
;
10041 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
10042 vfmt
->TexCoord3f
= save_TexCoord3f
;
10043 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
10044 vfmt
->TexCoord4f
= save_TexCoord4f
;
10045 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
10046 vfmt
->Vertex2f
= save_Vertex2f
;
10047 vfmt
->Vertex2fv
= save_Vertex2fv
;
10048 vfmt
->Vertex3f
= save_Vertex3f
;
10049 vfmt
->Vertex3fv
= save_Vertex3fv
;
10050 vfmt
->Vertex4f
= save_Vertex4f
;
10051 vfmt
->Vertex4fv
= save_Vertex4fv
;
10052 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
10053 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
10054 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
10055 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
10056 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
10057 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
10058 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
10059 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
10064 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
10065 const GLvertexformat
*vfmt
)
10067 SET_CallList(disp
, vfmt
->CallList
);
10068 SET_CallLists(disp
, vfmt
->CallLists
);
10073 * Initialize display list state for given context.
10076 _mesa_init_display_list(struct gl_context
*ctx
)
10078 static GLboolean tableInitialized
= GL_FALSE
;
10080 /* zero-out the instruction size table, just once */
10081 if (!tableInitialized
) {
10082 memset(InstSize
, 0, sizeof(InstSize
));
10083 tableInitialized
= GL_TRUE
;
10086 /* extension info */
10087 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
10090 ctx
->ListState
.CallDepth
= 0;
10091 ctx
->ExecuteFlag
= GL_TRUE
;
10092 ctx
->CompileFlag
= GL_FALSE
;
10093 ctx
->ListState
.CurrentBlock
= NULL
;
10094 ctx
->ListState
.CurrentPos
= 0;
10096 /* Display List group */
10097 ctx
->List
.ListBase
= 0;
10099 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
10104 _mesa_free_display_list_data(struct gl_context
*ctx
)
10106 free(ctx
->ListExt
);
10107 ctx
->ListExt
= NULL
;