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.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
572 /* The following three are meta instructions */
573 OPCODE_ERROR
, /* raise compiled-in error */
575 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
585 * Display list instructions are stored as sequences of "nodes". Nodes
586 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
587 * are linked together with a pointer.
589 * Each instruction in the display list is stored as a sequence of
590 * contiguous nodes in memory.
591 * Each node is the union of a variety of data types.
593 * Note, all of these members should be 4 bytes in size or less for the
594 * sake of compact display lists. We store 8-byte pointers in a pair of
595 * these nodes using the save/get_pointer() functions below.
613 typedef union gl_dlist_node Node
;
616 /** How many 4-byte dwords to store a pointer */
617 #define POINTER_DWORDS (sizeof(void *) / 4)
619 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
620 * space for display lists. The following types and functions are
621 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
626 GLuint dwords
[POINTER_DWORDS
];
631 * Save a 4 or 8-byte pointer at dest (and dest+1).
634 save_pointer(Node
*dest
, void *src
)
639 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
640 STATIC_ASSERT(sizeof(Node
) == 4);
644 for (i
= 0; i
< POINTER_DWORDS
; i
++)
645 dest
[i
].ui
= p
.dwords
[i
];
650 * Retrieve a 4 or 8-byte pointer from node (node+1).
653 get_pointer(const Node
*node
)
658 for (i
= 0; i
< POINTER_DWORDS
; i
++)
659 p
.dwords
[i
] = node
[i
].ui
;
666 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
683 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
685 union float64_pair tmp; \
687 n[idx].ui = tmp.uint32[0]; \
688 n[idx+1].ui = tmp.uint32[1]; \
693 * How many nodes to allocate at a time. Note that bulk vertex data
694 * from glBegin/glVertex/glEnd primitives will typically wind up in
695 * a VBO, and not directly in the display list itself.
697 #define BLOCK_SIZE 256
702 * Number of nodes of storage needed for each instruction.
703 * Sizes for dynamically allocated opcodes are stored in the context struct.
705 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
708 void mesa_print_display_list(GLuint list
);
712 * Does the given display list only contain a single glBitmap call?
715 is_bitmap_list(const struct gl_display_list
*dlist
)
717 const Node
*n
= dlist
->Head
;
718 if (n
[0].opcode
== OPCODE_BITMAP
) {
719 n
+= InstSize
[OPCODE_BITMAP
];
720 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
728 * Is the given display list an empty list?
731 is_empty_list(const struct gl_display_list
*dlist
)
733 const Node
*n
= dlist
->Head
;
734 return n
[0].opcode
== OPCODE_END_OF_LIST
;
739 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
742 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
745 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
752 * Lookup a gl_bitmap_atlas by listBase ID.
754 static struct gl_bitmap_atlas
*
755 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
757 struct gl_bitmap_atlas
*atlas
;
759 assert(listBase
> 0);
760 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
766 * Create new bitmap atlas and insert into hash table.
768 static struct gl_bitmap_atlas
*
769 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
771 struct gl_bitmap_atlas
*atlas
;
773 assert(listBase
> 0);
774 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
776 atlas
= calloc(1, sizeof(*atlas
));
778 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
786 * Try to build a bitmap atlas. This involves examining a sequence of
787 * display lists which contain glBitmap commands and putting the bitmap
788 * images into a texture map (the atlas).
789 * If we succeed, gl_bitmap_atlas::complete will be set to true.
790 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
793 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
796 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
801 assert(!atlas
->complete
);
802 assert(atlas
->numBitmaps
> 0);
804 /* We use a rectangle texture (non-normalized coords) for the atlas */
805 assert(ctx
->Extensions
.NV_texture_rectangle
);
806 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
808 atlas
->texWidth
= 1024;
809 atlas
->texHeight
= 0; /* determined below */
811 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
812 if (!atlas
->glyphs
) {
814 atlas
->incomplete
= true;
818 /* Loop over the display lists. They should all contain a single glBitmap
819 * call. If not, bail out. Also, compute the position and sizes of each
820 * bitmap in the atlas to determine the texture atlas size.
822 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
823 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
825 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
826 unsigned bitmap_width
, bitmap_height
;
827 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
829 if (!list
|| is_empty_list(list
)) {
831 atlas
->numBitmaps
= i
;
835 if (!is_bitmap_list(list
)) {
836 /* This list does not contain exactly one glBitmap command. Give up. */
837 atlas
->incomplete
= true;
841 /* get bitmap info from the display list command */
843 assert(n
[0].opcode
== OPCODE_BITMAP
);
844 bitmap_width
= n
[1].i
;
845 bitmap_height
= n
[2].i
;
846 bitmap_xorig
= n
[3].f
;
847 bitmap_yorig
= n
[4].f
;
848 bitmap_xmove
= n
[5].f
;
849 bitmap_ymove
= n
[6].f
;
851 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
852 /* advance to the next row of the texture */
858 /* save the bitmap's position in the atlas */
862 g
->h
= bitmap_height
;
863 g
->xorig
= bitmap_xorig
;
864 g
->yorig
= bitmap_yorig
;
865 g
->xmove
= bitmap_xmove
;
866 g
->ymove
= bitmap_ymove
;
868 xpos
+= bitmap_width
;
870 /* keep track of tallest bitmap in the row */
871 row_height
= MAX2(row_height
, bitmap_height
);
874 /* Now we know the texture height */
875 atlas
->texHeight
= ypos
+ row_height
;
877 if (atlas
->texHeight
== 0) {
878 /* no glyphs found, give up */
881 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
882 /* too large, give up */
886 /* Create atlas texture (texture ID is irrelevant) */
887 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
888 if (!atlas
->texObj
) {
892 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
893 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
894 atlas
->texObj
->MaxLevel
= 0;
895 atlas
->texObj
->Immutable
= GL_TRUE
;
897 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
898 GL_TEXTURE_RECTANGLE
, 0);
899 if (!atlas
->texImage
) {
903 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
904 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
905 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
907 /* alloc image storage */
908 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
912 /* map teximage, load with bitmap glyphs */
913 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
914 0, 0, atlas
->texWidth
, atlas
->texHeight
,
915 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
920 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
921 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
923 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
924 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
925 const Node
*n
= list
->Head
;
927 assert(n
[0].opcode
== OPCODE_BITMAP
||
928 n
[0].opcode
== OPCODE_END_OF_LIST
);
930 if (n
[0].opcode
== OPCODE_BITMAP
) {
931 unsigned bitmap_width
= n
[1].i
;
932 unsigned bitmap_height
= n
[2].i
;
933 unsigned xpos
= atlas
->glyphs
[i
].x
;
934 unsigned ypos
= atlas
->glyphs
[i
].y
;
935 const void *bitmap_image
= get_pointer(&n
[7]);
937 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
938 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
940 /* put the bitmap image into the texture image */
941 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
942 &ctx
->DefaultPacking
, bitmap_image
,
943 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
948 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
950 atlas
->complete
= true;
955 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
958 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
961 atlas
->glyphs
= NULL
;
962 atlas
->incomplete
= true;
967 * Allocate a gl_display_list object with an initial block of storage.
968 * \param count how many display list nodes/tokens to allocate
970 static struct gl_display_list
*
971 make_list(GLuint name
, GLuint count
)
973 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
975 dlist
->Head
= malloc(sizeof(Node
) * count
);
976 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
977 /* All InstSize[] entries must be non-zero */
978 InstSize
[OPCODE_END_OF_LIST
] = 1;
984 * Lookup function to just encapsulate casting.
986 struct gl_display_list
*
987 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
989 return (struct gl_display_list
*)
990 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
994 /** Is the given opcode an extension code? */
995 static inline GLboolean
996 is_ext_opcode(OpCode opcode
)
998 return (opcode
>= OPCODE_EXT_0
);
1002 /** Destroy an extended opcode instruction */
1004 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1006 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1008 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1009 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1014 /** Execute an extended opcode instruction */
1016 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1018 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1020 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1021 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1026 /** Print an extended opcode instruction */
1028 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1030 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1032 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1033 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1039 * Delete the named display list, but don't remove from hash table.
1040 * \param dlist - display list pointer
1043 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1048 n
= block
= dlist
->Head
;
1050 done
= block
? GL_FALSE
: GL_TRUE
;
1052 const OpCode opcode
= n
[0].opcode
;
1054 /* check for extension opcodes first */
1055 if (is_ext_opcode(opcode
)) {
1056 n
+= ext_opcode_destroy(ctx
, n
);
1060 /* for some commands, we need to free malloc'd memory */
1062 free(get_pointer(&n
[6]));
1065 free(get_pointer(&n
[10]));
1067 case OPCODE_CALL_LISTS
:
1068 free(get_pointer(&n
[3]));
1070 case OPCODE_DRAW_PIXELS
:
1071 free(get_pointer(&n
[5]));
1074 free(get_pointer(&n
[7]));
1076 case OPCODE_POLYGON_STIPPLE
:
1077 free(get_pointer(&n
[1]));
1079 case OPCODE_TEX_IMAGE1D
:
1080 free(get_pointer(&n
[8]));
1082 case OPCODE_TEX_IMAGE2D
:
1083 free(get_pointer(&n
[9]));
1085 case OPCODE_TEX_IMAGE3D
:
1086 free(get_pointer(&n
[10]));
1088 case OPCODE_TEX_SUB_IMAGE1D
:
1089 free(get_pointer(&n
[7]));
1091 case OPCODE_TEX_SUB_IMAGE2D
:
1092 free(get_pointer(&n
[9]));
1094 case OPCODE_TEX_SUB_IMAGE3D
:
1095 free(get_pointer(&n
[11]));
1097 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1098 free(get_pointer(&n
[7]));
1100 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1101 free(get_pointer(&n
[8]));
1103 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1104 free(get_pointer(&n
[9]));
1106 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1107 free(get_pointer(&n
[7]));
1109 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1110 free(get_pointer(&n
[9]));
1112 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1113 free(get_pointer(&n
[11]));
1115 case OPCODE_PROGRAM_STRING_ARB
:
1116 free(get_pointer(&n
[4])); /* program string */
1118 case OPCODE_UNIFORM_1FV
:
1119 case OPCODE_UNIFORM_2FV
:
1120 case OPCODE_UNIFORM_3FV
:
1121 case OPCODE_UNIFORM_4FV
:
1122 case OPCODE_UNIFORM_1DV
:
1123 case OPCODE_UNIFORM_2DV
:
1124 case OPCODE_UNIFORM_3DV
:
1125 case OPCODE_UNIFORM_4DV
:
1126 case OPCODE_UNIFORM_1IV
:
1127 case OPCODE_UNIFORM_2IV
:
1128 case OPCODE_UNIFORM_3IV
:
1129 case OPCODE_UNIFORM_4IV
:
1130 case OPCODE_UNIFORM_1UIV
:
1131 case OPCODE_UNIFORM_2UIV
:
1132 case OPCODE_UNIFORM_3UIV
:
1133 case OPCODE_UNIFORM_4UIV
:
1134 free(get_pointer(&n
[3]));
1136 case OPCODE_UNIFORM_MATRIX22
:
1137 case OPCODE_UNIFORM_MATRIX33
:
1138 case OPCODE_UNIFORM_MATRIX44
:
1139 case OPCODE_UNIFORM_MATRIX24
:
1140 case OPCODE_UNIFORM_MATRIX42
:
1141 case OPCODE_UNIFORM_MATRIX23
:
1142 case OPCODE_UNIFORM_MATRIX32
:
1143 case OPCODE_UNIFORM_MATRIX34
:
1144 case OPCODE_UNIFORM_MATRIX43
:
1145 case OPCODE_UNIFORM_MATRIX22D
:
1146 case OPCODE_UNIFORM_MATRIX33D
:
1147 case OPCODE_UNIFORM_MATRIX44D
:
1148 case OPCODE_UNIFORM_MATRIX24D
:
1149 case OPCODE_UNIFORM_MATRIX42D
:
1150 case OPCODE_UNIFORM_MATRIX23D
:
1151 case OPCODE_UNIFORM_MATRIX32D
:
1152 case OPCODE_UNIFORM_MATRIX34D
:
1153 case OPCODE_UNIFORM_MATRIX43D
:
1154 free(get_pointer(&n
[4]));
1156 case OPCODE_PROGRAM_UNIFORM_1FV
:
1157 case OPCODE_PROGRAM_UNIFORM_2FV
:
1158 case OPCODE_PROGRAM_UNIFORM_3FV
:
1159 case OPCODE_PROGRAM_UNIFORM_4FV
:
1160 case OPCODE_PROGRAM_UNIFORM_1DV
:
1161 case OPCODE_PROGRAM_UNIFORM_2DV
:
1162 case OPCODE_PROGRAM_UNIFORM_3DV
:
1163 case OPCODE_PROGRAM_UNIFORM_4DV
:
1164 case OPCODE_PROGRAM_UNIFORM_1IV
:
1165 case OPCODE_PROGRAM_UNIFORM_2IV
:
1166 case OPCODE_PROGRAM_UNIFORM_3IV
:
1167 case OPCODE_PROGRAM_UNIFORM_4IV
:
1168 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1169 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1170 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1171 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1172 free(get_pointer(&n
[4]));
1174 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1175 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1176 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1177 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1178 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1179 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1180 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1181 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1182 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1183 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1184 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1185 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1186 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1187 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1188 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1189 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1190 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1191 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1192 free(get_pointer(&n
[5]));
1194 case OPCODE_PIXEL_MAP
:
1195 free(get_pointer(&n
[3]));
1197 case OPCODE_VIEWPORT_ARRAY_V
:
1198 case OPCODE_SCISSOR_ARRAY_V
:
1199 case OPCODE_DEPTH_ARRAY_V
:
1200 case OPCODE_UNIFORM_SUBROUTINES
:
1201 case OPCODE_WINDOW_RECTANGLES
:
1202 free(get_pointer(&n
[3]));
1204 case OPCODE_CONTINUE
:
1205 n
= (Node
*) get_pointer(&n
[1]);
1209 case OPCODE_END_OF_LIST
:
1214 /* just increment 'n' pointer, below */
1218 if (opcode
!= OPCODE_CONTINUE
) {
1219 assert(InstSize
[opcode
] > 0);
1220 n
+= InstSize
[opcode
];
1231 * Called by _mesa_HashWalk() to check if a display list which is being
1232 * deleted belongs to a bitmap texture atlas.
1235 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1237 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1238 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1240 /* See if the list_id falls in the range contained in this texture atlas */
1241 if (atlas
->complete
&&
1242 list_id
>= atlas_id
&&
1243 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1244 /* Mark the atlas as incomplete so it doesn't get used. But don't
1245 * delete it yet since we don't want to try to recreate it in the next
1248 atlas
->complete
= false;
1249 atlas
->incomplete
= true;
1255 * Destroy a display list and remove from hash table.
1256 * \param list - display list number
1259 destroy_list(struct gl_context
*ctx
, GLuint list
)
1261 struct gl_display_list
*dlist
;
1266 dlist
= _mesa_lookup_list(ctx
, list
);
1270 if (is_bitmap_list(dlist
)) {
1271 /* If we're destroying a simple glBitmap display list, there's a
1272 * chance that we're destroying a bitmap image that's in a texture
1273 * atlas. Examine all atlases to see if that's the case. There's
1274 * usually few (if any) atlases so this isn't expensive.
1276 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1277 check_atlas_for_deleted_list
, &list
);
1280 _mesa_delete_list(ctx
, dlist
);
1281 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1286 * Translate the nth element of list from <type> to GLint.
1289 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1301 bptr
= (GLbyte
*) list
;
1302 return (GLint
) bptr
[n
];
1303 case GL_UNSIGNED_BYTE
:
1304 ubptr
= (GLubyte
*) list
;
1305 return (GLint
) ubptr
[n
];
1307 sptr
= (GLshort
*) list
;
1308 return (GLint
) sptr
[n
];
1309 case GL_UNSIGNED_SHORT
:
1310 usptr
= (GLushort
*) list
;
1311 return (GLint
) usptr
[n
];
1313 iptr
= (GLint
*) list
;
1315 case GL_UNSIGNED_INT
:
1316 uiptr
= (GLuint
*) list
;
1317 return (GLint
) uiptr
[n
];
1319 fptr
= (GLfloat
*) list
;
1320 return (GLint
) floorf(fptr
[n
]);
1322 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1323 return (GLint
) ubptr
[0] * 256
1326 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1327 return (GLint
) ubptr
[0] * 65536
1328 + (GLint
) ubptr
[1] * 256
1331 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1332 return (GLint
) ubptr
[0] * 16777216
1333 + (GLint
) ubptr
[1] * 65536
1334 + (GLint
) ubptr
[2] * 256
1343 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1344 * If width < 0 or height < 0 or format or type are invalid we'll just
1345 * return NULL. We will not generate an error since OpenGL command
1346 * arguments aren't error-checked until the command is actually executed
1347 * (not when they're compiled).
1348 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1351 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1352 GLsizei width
, GLsizei height
, GLsizei depth
,
1353 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1354 const struct gl_pixelstore_attrib
*unpack
)
1356 if (width
<= 0 || height
<= 0) {
1360 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1361 /* bad format and/or type */
1365 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1369 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1370 format
, type
, pixels
, unpack
);
1371 if (pixels
&& !image
) {
1372 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1376 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1377 depth
, format
, type
, INT_MAX
, pixels
)) {
1378 const GLubyte
*map
, *src
;
1382 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1383 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1386 /* unable to map src buffer! */
1387 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1391 src
= ADD_POINTERS(map
, pixels
);
1392 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1393 format
, type
, src
, unpack
);
1395 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1398 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1404 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1409 /** Return copy of memory */
1411 memdup(const void *src
, GLsizei bytes
)
1413 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1415 memcpy(b
, src
, bytes
);
1421 * Allocate space for a display list instruction (opcode + payload space).
1422 * \param opcode the instruction opcode (OPCODE_* value)
1423 * \param bytes instruction payload size (not counting opcode)
1424 * \param align8 does the payload need to be 8-byte aligned?
1425 * This is only relevant in 64-bit environments.
1426 * \return pointer to allocated memory (the payload will be at pointer+1)
1429 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1431 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1432 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1436 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1438 if (opcode
< OPCODE_EXT_0
) {
1439 if (InstSize
[opcode
] == 0) {
1440 /* save instruction size now */
1441 InstSize
[opcode
] = numNodes
;
1444 /* make sure instruction size agrees */
1445 assert(numNodes
== InstSize
[opcode
]);
1449 if (sizeof(void *) > sizeof(Node
) && align8
1450 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1451 /* The opcode would get placed at node[0] and the payload would start
1452 * at node[1]. But the payload needs to be at an even offset (8-byte
1461 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1463 /* This block is full. Allocate a new block and chain to it */
1465 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1466 n
[0].opcode
= OPCODE_CONTINUE
;
1467 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1469 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1473 /* a fresh block should be 8-byte aligned on 64-bit systems */
1474 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1476 save_pointer(&n
[1], newblock
);
1477 ctx
->ListState
.CurrentBlock
= newblock
;
1478 ctx
->ListState
.CurrentPos
= 0;
1480 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1481 * we have to insert a NOP so that the payload of the real opcode lands
1482 * on an even location:
1483 * node[0] = OPCODE_NOP
1484 * node[1] = OPCODE_x;
1485 * node[2] = start of payload
1487 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1490 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1492 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1493 n
[0].opcode
= OPCODE_NOP
;
1495 /* The "real" opcode will now be at an odd location and the payload
1496 * will be at an even location.
1499 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1501 n
[0].opcode
= opcode
;
1509 * Allocate space for a display list instruction. Used by callers outside
1510 * this file for things like VBO vertex data.
1512 * \param opcode the instruction opcode (OPCODE_* value)
1513 * \param bytes instruction size in bytes, not counting opcode.
1514 * \return pointer to the usable data area (not including the internal
1518 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1520 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1522 return n
+ 1; /* return pointer to payload area, after opcode */
1529 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1530 * aligned in 64-bit environments, 4-byte aligned otherwise.
1533 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1535 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1537 return n
+ 1; /* return pointer to payload area, after opcode */
1544 * This function allows modules and drivers to get their own opcodes
1545 * for extending display list functionality.
1546 * \param ctx the rendering context
1547 * \param size number of bytes for storing the new display list command
1548 * \param execute function to execute the new display list command
1549 * \param destroy function to destroy the new display list command
1550 * \param print function to print the new display list command
1551 * \return the new opcode number or -1 if error
1554 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1556 void (*execute
) (struct gl_context
*, void *),
1557 void (*destroy
) (struct gl_context
*, void *),
1558 void (*print
) (struct gl_context
*, void *, FILE *))
1560 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1561 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1562 ctx
->ListExt
->Opcode
[i
].Size
=
1563 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1564 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1565 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1566 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1567 return i
+ OPCODE_EXT_0
;
1574 * Allocate space for a display list instruction. The space is basically
1575 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1576 * function parameter, node[2] is the second parameter, etc.
1578 * \param opcode one of OPCODE_x
1579 * \param nparams number of function parameters
1580 * \return pointer to start of instruction space
1582 static inline Node
*
1583 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1585 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1590 * Called by EndList to try to reduce memory used for the list.
1593 trim_list(struct gl_context
*ctx
)
1595 /* If the list we're ending only has one allocated block of nodes/tokens
1596 * and its size isn't a full block size, realloc the block to use less
1597 * memory. This is important for apps that create many small display
1598 * lists and apps that use glXUseXFont (many lists each containing one
1600 * Note: we currently only trim display lists that allocated one block
1601 * of tokens. That hits the short list case which is what we're mainly
1602 * concerned with. Trimming longer lists would involve traversing the
1603 * linked list of blocks.
1605 struct gl_dlist_state
*list
= &ctx
->ListState
;
1607 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1608 (list
->CurrentPos
< BLOCK_SIZE
)) {
1609 /* There's only one block and it's not full, so realloc */
1610 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1611 list
->CurrentList
->Head
=
1612 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1613 if (!list
->CurrentBlock
) {
1614 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1622 * Display List compilation functions
1624 static void GLAPIENTRY
1625 save_Accum(GLenum op
, GLfloat value
)
1627 GET_CURRENT_CONTEXT(ctx
);
1629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1635 if (ctx
->ExecuteFlag
) {
1636 CALL_Accum(ctx
->Exec
, (op
, value
));
1641 static void GLAPIENTRY
1642 save_AlphaFunc(GLenum func
, GLclampf ref
)
1644 GET_CURRENT_CONTEXT(ctx
);
1646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1647 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1650 n
[2].f
= (GLfloat
) ref
;
1652 if (ctx
->ExecuteFlag
) {
1653 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1658 static void GLAPIENTRY
1659 save_BindTexture(GLenum target
, GLuint texture
)
1661 GET_CURRENT_CONTEXT(ctx
);
1663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1664 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1669 if (ctx
->ExecuteFlag
) {
1670 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1675 static void GLAPIENTRY
1676 save_Bitmap(GLsizei width
, GLsizei height
,
1677 GLfloat xorig
, GLfloat yorig
,
1678 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1680 GET_CURRENT_CONTEXT(ctx
);
1682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1683 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1685 n
[1].i
= (GLint
) width
;
1686 n
[2].i
= (GLint
) height
;
1692 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1693 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1695 if (ctx
->ExecuteFlag
) {
1696 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1697 xorig
, yorig
, xmove
, ymove
, pixels
));
1702 static void GLAPIENTRY
1703 save_BlendEquation(GLenum mode
)
1705 GET_CURRENT_CONTEXT(ctx
);
1707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1708 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1712 if (ctx
->ExecuteFlag
) {
1713 CALL_BlendEquation(ctx
->Exec
, (mode
));
1718 static void GLAPIENTRY
1719 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1721 GET_CURRENT_CONTEXT(ctx
);
1723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1724 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1729 if (ctx
->ExecuteFlag
) {
1730 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1735 static void GLAPIENTRY
1736 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1737 GLenum sfactorA
, GLenum dfactorA
)
1739 GET_CURRENT_CONTEXT(ctx
);
1741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1742 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1744 n
[1].e
= sfactorRGB
;
1745 n
[2].e
= dfactorRGB
;
1749 if (ctx
->ExecuteFlag
) {
1750 CALL_BlendFuncSeparate(ctx
->Exec
,
1751 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1756 static void GLAPIENTRY
1757 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1759 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1763 static void GLAPIENTRY
1764 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1766 GET_CURRENT_CONTEXT(ctx
);
1768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1769 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1776 if (ctx
->ExecuteFlag
) {
1777 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1781 /* GL_ARB_draw_buffers_blend */
1782 static void GLAPIENTRY
1783 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1784 GLenum sfactorA
, GLenum dfactorA
)
1786 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1792 n
[2].e
= sfactorRGB
;
1793 n
[3].e
= dfactorRGB
;
1797 if (ctx
->ExecuteFlag
) {
1798 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1799 sfactorA
, dfactorA
));
1803 /* GL_ARB_draw_buffers_blend */
1804 static void GLAPIENTRY
1805 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1807 GET_CURRENT_CONTEXT(ctx
);
1809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1810 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1816 if (ctx
->ExecuteFlag
) {
1817 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1821 /* GL_ARB_draw_buffers_blend */
1822 static void GLAPIENTRY
1823 save_BlendEquationi(GLuint buf
, GLenum mode
)
1825 GET_CURRENT_CONTEXT(ctx
);
1827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1828 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1833 if (ctx
->ExecuteFlag
) {
1834 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1838 /* GL_ARB_draw_buffers_blend */
1839 static void GLAPIENTRY
1840 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1842 GET_CURRENT_CONTEXT(ctx
);
1844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1845 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1851 if (ctx
->ExecuteFlag
) {
1852 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1857 /* GL_ARB_draw_instanced. */
1858 static void GLAPIENTRY
1859 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1861 UNUSED GLsizei count
,
1862 UNUSED GLsizei primcount
)
1864 GET_CURRENT_CONTEXT(ctx
);
1865 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1866 "glDrawArraysInstanced() during display list compile");
1869 static void GLAPIENTRY
1870 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1871 UNUSED GLsizei count
,
1873 UNUSED
const GLvoid
*indices
,
1874 UNUSED GLsizei primcount
)
1876 GET_CURRENT_CONTEXT(ctx
);
1877 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1878 "glDrawElementsInstanced() during display list compile");
1881 static void GLAPIENTRY
1882 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1883 UNUSED GLsizei count
,
1885 UNUSED
const GLvoid
*indices
,
1886 UNUSED GLsizei primcount
,
1887 UNUSED GLint basevertex
)
1889 GET_CURRENT_CONTEXT(ctx
);
1890 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1891 "glDrawElementsInstancedBaseVertex() during display list compile");
1894 /* GL_ARB_base_instance. */
1895 static void GLAPIENTRY
1896 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1898 UNUSED GLsizei count
,
1899 UNUSED GLsizei primcount
,
1900 UNUSED GLuint baseinstance
)
1902 GET_CURRENT_CONTEXT(ctx
);
1903 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1904 "glDrawArraysInstancedBaseInstance() during display list compile");
1907 static void APIENTRY
1908 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1909 UNUSED GLsizei count
,
1911 UNUSED
const void *indices
,
1912 UNUSED GLsizei primcount
,
1913 UNUSED GLuint baseinstance
)
1915 GET_CURRENT_CONTEXT(ctx
);
1916 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1917 "glDrawElementsInstancedBaseInstance() during display list compile");
1920 static void APIENTRY
1921 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1922 UNUSED GLsizei count
,
1924 UNUSED
const void *indices
,
1925 UNUSED GLsizei primcount
,
1926 UNUSED GLint basevertex
,
1927 UNUSED GLuint baseinstance
)
1929 GET_CURRENT_CONTEXT(ctx
);
1930 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1931 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1934 static void APIENTRY
1935 save_DrawArraysIndirect(UNUSED GLenum mode
,
1936 UNUSED
const void *indirect
)
1938 GET_CURRENT_CONTEXT(ctx
);
1939 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1940 "glDrawArraysIndirect() during display list compile");
1943 static void APIENTRY
1944 save_DrawElementsIndirect(UNUSED GLenum mode
,
1946 UNUSED
const void *indirect
)
1948 GET_CURRENT_CONTEXT(ctx
);
1949 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1950 "glDrawElementsIndirect() during display list compile");
1953 static void APIENTRY
1954 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1955 UNUSED
const void *indirect
,
1956 UNUSED GLsizei primcount
,
1957 UNUSED GLsizei stride
)
1959 GET_CURRENT_CONTEXT(ctx
);
1960 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1961 "glMultiDrawArraysIndirect() during display list compile");
1964 static void APIENTRY
1965 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
1967 UNUSED
const void *indirect
,
1968 UNUSED GLsizei primcount
,
1969 UNUSED GLsizei stride
)
1971 GET_CURRENT_CONTEXT(ctx
);
1972 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1973 "glMultiDrawElementsIndirect() during display list compile");
1977 * While building a display list we cache some OpenGL state.
1978 * Under some circumstances we need to invalidate that state (immediately
1979 * when we start compiling a list, or after glCallList(s)).
1982 invalidate_saved_current_state(struct gl_context
*ctx
)
1986 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1987 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1989 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1990 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1992 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1994 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1998 static void GLAPIENTRY
1999 save_CallList(GLuint list
)
2001 GET_CURRENT_CONTEXT(ctx
);
2003 SAVE_FLUSH_VERTICES(ctx
);
2005 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2010 /* After this, we don't know what state we're in. Invalidate all
2011 * cached information previously gathered:
2013 invalidate_saved_current_state( ctx
);
2015 if (ctx
->ExecuteFlag
) {
2016 _mesa_CallList(list
);
2021 static void GLAPIENTRY
2022 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2024 GET_CURRENT_CONTEXT(ctx
);
2029 SAVE_FLUSH_VERTICES(ctx
);
2033 case GL_UNSIGNED_BYTE
:
2037 case GL_UNSIGNED_SHORT
:
2045 case GL_UNSIGNED_INT
:
2054 if (num
> 0 && type_size
> 0) {
2055 /* create a copy of the array of list IDs to save in the display list */
2056 lists_copy
= memdup(lists
, num
* type_size
);
2061 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2065 save_pointer(&n
[3], lists_copy
);
2068 /* After this, we don't know what state we're in. Invalidate all
2069 * cached information previously gathered:
2071 invalidate_saved_current_state( ctx
);
2073 if (ctx
->ExecuteFlag
) {
2074 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2079 static void GLAPIENTRY
2080 save_Clear(GLbitfield mask
)
2082 GET_CURRENT_CONTEXT(ctx
);
2084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2085 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2089 if (ctx
->ExecuteFlag
) {
2090 CALL_Clear(ctx
->Exec
, (mask
));
2095 static void GLAPIENTRY
2096 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2098 GET_CURRENT_CONTEXT(ctx
);
2100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2101 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2104 n
[2].i
= drawbuffer
;
2106 if (buffer
== GL_COLOR
) {
2117 if (ctx
->ExecuteFlag
) {
2118 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2123 static void GLAPIENTRY
2124 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2126 GET_CURRENT_CONTEXT(ctx
);
2128 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2129 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2132 n
[2].i
= drawbuffer
;
2134 if (buffer
== GL_COLOR
) {
2145 if (ctx
->ExecuteFlag
) {
2146 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2151 static void GLAPIENTRY
2152 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2154 GET_CURRENT_CONTEXT(ctx
);
2156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2157 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2160 n
[2].i
= drawbuffer
;
2162 if (buffer
== GL_COLOR
) {
2173 if (ctx
->ExecuteFlag
) {
2174 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2179 static void GLAPIENTRY
2180 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2181 GLfloat depth
, GLint stencil
)
2183 GET_CURRENT_CONTEXT(ctx
);
2185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2186 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2189 n
[2].i
= drawbuffer
;
2193 if (ctx
->ExecuteFlag
) {
2194 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2199 static void GLAPIENTRY
2200 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2202 GET_CURRENT_CONTEXT(ctx
);
2204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2205 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2212 if (ctx
->ExecuteFlag
) {
2213 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2218 static void GLAPIENTRY
2219 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2221 GET_CURRENT_CONTEXT(ctx
);
2223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2224 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2231 if (ctx
->ExecuteFlag
) {
2232 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2237 static void GLAPIENTRY
2238 save_ClearDepth(GLclampd depth
)
2240 GET_CURRENT_CONTEXT(ctx
);
2242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2243 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2245 n
[1].f
= (GLfloat
) depth
;
2247 if (ctx
->ExecuteFlag
) {
2248 CALL_ClearDepth(ctx
->Exec
, (depth
));
2253 static void GLAPIENTRY
2254 save_ClearIndex(GLfloat c
)
2256 GET_CURRENT_CONTEXT(ctx
);
2258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2259 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2263 if (ctx
->ExecuteFlag
) {
2264 CALL_ClearIndex(ctx
->Exec
, (c
));
2269 static void GLAPIENTRY
2270 save_ClearStencil(GLint s
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2279 if (ctx
->ExecuteFlag
) {
2280 CALL_ClearStencil(ctx
->Exec
, (s
));
2285 static void GLAPIENTRY
2286 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2288 GET_CURRENT_CONTEXT(ctx
);
2290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2291 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2294 n
[2].f
= (GLfloat
) equ
[0];
2295 n
[3].f
= (GLfloat
) equ
[1];
2296 n
[4].f
= (GLfloat
) equ
[2];
2297 n
[5].f
= (GLfloat
) equ
[3];
2299 if (ctx
->ExecuteFlag
) {
2300 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2306 static void GLAPIENTRY
2307 save_ColorMask(GLboolean red
, GLboolean green
,
2308 GLboolean blue
, GLboolean alpha
)
2310 GET_CURRENT_CONTEXT(ctx
);
2312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2313 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2320 if (ctx
->ExecuteFlag
) {
2321 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2326 static void GLAPIENTRY
2327 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2328 GLboolean blue
, GLboolean alpha
)
2330 GET_CURRENT_CONTEXT(ctx
);
2332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2333 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2341 if (ctx
->ExecuteFlag
) {
2342 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2347 static void GLAPIENTRY
2348 save_ColorMaterial(GLenum face
, GLenum mode
)
2350 GET_CURRENT_CONTEXT(ctx
);
2352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2354 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2359 if (ctx
->ExecuteFlag
) {
2360 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2365 static void GLAPIENTRY
2366 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2368 GET_CURRENT_CONTEXT(ctx
);
2370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2371 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2375 n
[3].i
= (GLint
) width
;
2376 n
[4].i
= (GLint
) height
;
2379 if (ctx
->ExecuteFlag
) {
2380 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2386 static void GLAPIENTRY
2387 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2388 GLint x
, GLint y
, GLsizei width
, GLint border
)
2390 GET_CURRENT_CONTEXT(ctx
);
2392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2393 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2397 n
[3].e
= internalformat
;
2403 if (ctx
->ExecuteFlag
) {
2404 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2405 x
, y
, width
, border
));
2410 static void GLAPIENTRY
2411 save_CopyTexImage2D(GLenum target
, GLint level
,
2412 GLenum internalformat
,
2413 GLint x
, GLint y
, GLsizei width
,
2414 GLsizei height
, GLint border
)
2416 GET_CURRENT_CONTEXT(ctx
);
2418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2419 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2423 n
[3].e
= internalformat
;
2430 if (ctx
->ExecuteFlag
) {
2431 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2432 x
, y
, width
, height
, border
));
2438 static void GLAPIENTRY
2439 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2440 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2442 GET_CURRENT_CONTEXT(ctx
);
2444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2445 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2454 if (ctx
->ExecuteFlag
) {
2455 CALL_CopyTexSubImage1D(ctx
->Exec
,
2456 (target
, level
, xoffset
, x
, y
, width
));
2461 static void GLAPIENTRY
2462 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2463 GLint xoffset
, GLint yoffset
,
2464 GLint x
, GLint y
, GLsizei width
, GLint height
)
2466 GET_CURRENT_CONTEXT(ctx
);
2468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2469 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2480 if (ctx
->ExecuteFlag
) {
2481 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2482 x
, y
, width
, height
));
2487 static void GLAPIENTRY
2488 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2489 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2490 GLint x
, GLint y
, GLsizei width
, GLint height
)
2492 GET_CURRENT_CONTEXT(ctx
);
2494 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2495 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2507 if (ctx
->ExecuteFlag
) {
2508 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2509 xoffset
, yoffset
, zoffset
,
2510 x
, y
, width
, height
));
2515 static void GLAPIENTRY
2516 save_CullFace(GLenum mode
)
2518 GET_CURRENT_CONTEXT(ctx
);
2520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2521 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2525 if (ctx
->ExecuteFlag
) {
2526 CALL_CullFace(ctx
->Exec
, (mode
));
2531 static void GLAPIENTRY
2532 save_DepthFunc(GLenum func
)
2534 GET_CURRENT_CONTEXT(ctx
);
2536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2537 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2541 if (ctx
->ExecuteFlag
) {
2542 CALL_DepthFunc(ctx
->Exec
, (func
));
2547 static void GLAPIENTRY
2548 save_DepthMask(GLboolean mask
)
2550 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2557 if (ctx
->ExecuteFlag
) {
2558 CALL_DepthMask(ctx
->Exec
, (mask
));
2563 static void GLAPIENTRY
2564 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2566 GET_CURRENT_CONTEXT(ctx
);
2568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2569 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2571 n
[1].f
= (GLfloat
) nearval
;
2572 n
[2].f
= (GLfloat
) farval
;
2574 if (ctx
->ExecuteFlag
) {
2575 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2580 static void GLAPIENTRY
2581 save_Disable(GLenum cap
)
2583 GET_CURRENT_CONTEXT(ctx
);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2586 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_Disable(ctx
->Exec
, (cap
));
2596 static void GLAPIENTRY
2597 save_DisableIndexed(GLuint index
, GLenum cap
)
2599 GET_CURRENT_CONTEXT(ctx
);
2601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2602 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2607 if (ctx
->ExecuteFlag
) {
2608 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2613 static void GLAPIENTRY
2614 save_DrawBuffer(GLenum mode
)
2616 GET_CURRENT_CONTEXT(ctx
);
2618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2619 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2623 if (ctx
->ExecuteFlag
) {
2624 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2629 static void GLAPIENTRY
2630 save_DrawPixels(GLsizei width
, GLsizei height
,
2631 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2633 GET_CURRENT_CONTEXT(ctx
);
2636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2638 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2645 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2646 pixels
, &ctx
->Unpack
));
2648 if (ctx
->ExecuteFlag
) {
2649 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2655 static void GLAPIENTRY
2656 save_Enable(GLenum cap
)
2658 GET_CURRENT_CONTEXT(ctx
);
2660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2661 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2665 if (ctx
->ExecuteFlag
) {
2666 CALL_Enable(ctx
->Exec
, (cap
));
2672 static void GLAPIENTRY
2673 save_EnableIndexed(GLuint index
, GLenum cap
)
2675 GET_CURRENT_CONTEXT(ctx
);
2677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2678 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2683 if (ctx
->ExecuteFlag
) {
2684 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2690 static void GLAPIENTRY
2691 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2693 GET_CURRENT_CONTEXT(ctx
);
2695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2696 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2702 if (ctx
->ExecuteFlag
) {
2703 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2708 static void GLAPIENTRY
2709 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2711 GET_CURRENT_CONTEXT(ctx
);
2713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2714 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2722 if (ctx
->ExecuteFlag
) {
2723 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2730 static void GLAPIENTRY
2731 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2733 GET_CURRENT_CONTEXT(ctx
);
2735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2736 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2744 if (ctx
->ExecuteFlag
) {
2745 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2750 static void GLAPIENTRY
2751 save_Fogf(GLenum pname
, GLfloat param
)
2755 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2756 save_Fogfv(pname
, parray
);
2760 static void GLAPIENTRY
2761 save_Fogiv(GLenum pname
, const GLint
*params
)
2766 case GL_FOG_DENSITY
:
2770 case GL_FOG_COORDINATE_SOURCE
:
2771 p
[0] = (GLfloat
) *params
;
2777 p
[0] = INT_TO_FLOAT(params
[0]);
2778 p
[1] = INT_TO_FLOAT(params
[1]);
2779 p
[2] = INT_TO_FLOAT(params
[2]);
2780 p
[3] = INT_TO_FLOAT(params
[3]);
2783 /* Error will be caught later in gl_Fogfv */
2784 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2786 save_Fogfv(pname
, p
);
2790 static void GLAPIENTRY
2791 save_Fogi(GLenum pname
, GLint param
)
2795 parray
[1] = parray
[2] = parray
[3] = 0;
2796 save_Fogiv(pname
, parray
);
2800 static void GLAPIENTRY
2801 save_FrontFace(GLenum mode
)
2803 GET_CURRENT_CONTEXT(ctx
);
2805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2806 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2810 if (ctx
->ExecuteFlag
) {
2811 CALL_FrontFace(ctx
->Exec
, (mode
));
2816 static void GLAPIENTRY
2817 save_Frustum(GLdouble left
, GLdouble right
,
2818 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2820 GET_CURRENT_CONTEXT(ctx
);
2822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2823 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2825 n
[1].f
= (GLfloat
) left
;
2826 n
[2].f
= (GLfloat
) right
;
2827 n
[3].f
= (GLfloat
) bottom
;
2828 n
[4].f
= (GLfloat
) top
;
2829 n
[5].f
= (GLfloat
) nearval
;
2830 n
[6].f
= (GLfloat
) farval
;
2832 if (ctx
->ExecuteFlag
) {
2833 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2838 static void GLAPIENTRY
2839 save_Hint(GLenum target
, GLenum mode
)
2841 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2849 if (ctx
->ExecuteFlag
) {
2850 CALL_Hint(ctx
->Exec
, (target
, mode
));
2855 static void GLAPIENTRY
2856 save_IndexMask(GLuint mask
)
2858 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2865 if (ctx
->ExecuteFlag
) {
2866 CALL_IndexMask(ctx
->Exec
, (mask
));
2871 static void GLAPIENTRY
2872 save_InitNames(void)
2874 GET_CURRENT_CONTEXT(ctx
);
2875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2876 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2877 if (ctx
->ExecuteFlag
) {
2878 CALL_InitNames(ctx
->Exec
, ());
2883 static void GLAPIENTRY
2884 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2886 GET_CURRENT_CONTEXT(ctx
);
2888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2889 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2907 case GL_SPOT_DIRECTION
:
2910 case GL_SPOT_EXPONENT
:
2913 case GL_SPOT_CUTOFF
:
2916 case GL_CONSTANT_ATTENUATION
:
2919 case GL_LINEAR_ATTENUATION
:
2922 case GL_QUADRATIC_ATTENUATION
:
2928 for (i
= 0; i
< nParams
; i
++) {
2929 n
[3 + i
].f
= params
[i
];
2932 if (ctx
->ExecuteFlag
) {
2933 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2938 static void GLAPIENTRY
2939 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2943 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2944 save_Lightfv(light
, pname
, parray
);
2948 static void GLAPIENTRY
2949 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2956 fparam
[0] = INT_TO_FLOAT(params
[0]);
2957 fparam
[1] = INT_TO_FLOAT(params
[1]);
2958 fparam
[2] = INT_TO_FLOAT(params
[2]);
2959 fparam
[3] = INT_TO_FLOAT(params
[3]);
2962 fparam
[0] = (GLfloat
) params
[0];
2963 fparam
[1] = (GLfloat
) params
[1];
2964 fparam
[2] = (GLfloat
) params
[2];
2965 fparam
[3] = (GLfloat
) params
[3];
2967 case GL_SPOT_DIRECTION
:
2968 fparam
[0] = (GLfloat
) params
[0];
2969 fparam
[1] = (GLfloat
) params
[1];
2970 fparam
[2] = (GLfloat
) params
[2];
2972 case GL_SPOT_EXPONENT
:
2973 case GL_SPOT_CUTOFF
:
2974 case GL_CONSTANT_ATTENUATION
:
2975 case GL_LINEAR_ATTENUATION
:
2976 case GL_QUADRATIC_ATTENUATION
:
2977 fparam
[0] = (GLfloat
) params
[0];
2980 /* error will be caught later in gl_Lightfv */
2983 save_Lightfv(light
, pname
, fparam
);
2987 static void GLAPIENTRY
2988 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2992 parray
[1] = parray
[2] = parray
[3] = 0;
2993 save_Lightiv(light
, pname
, parray
);
2997 static void GLAPIENTRY
2998 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3000 GET_CURRENT_CONTEXT(ctx
);
3002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3003 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3011 if (ctx
->ExecuteFlag
) {
3012 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3017 static void GLAPIENTRY
3018 save_LightModelf(GLenum pname
, GLfloat param
)
3022 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3023 save_LightModelfv(pname
, parray
);
3027 static void GLAPIENTRY
3028 save_LightModeliv(GLenum pname
, const GLint
*params
)
3032 case GL_LIGHT_MODEL_AMBIENT
:
3033 fparam
[0] = INT_TO_FLOAT(params
[0]);
3034 fparam
[1] = INT_TO_FLOAT(params
[1]);
3035 fparam
[2] = INT_TO_FLOAT(params
[2]);
3036 fparam
[3] = INT_TO_FLOAT(params
[3]);
3038 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3039 case GL_LIGHT_MODEL_TWO_SIDE
:
3040 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3041 fparam
[0] = (GLfloat
) params
[0];
3047 /* Error will be caught later in gl_LightModelfv */
3048 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3050 save_LightModelfv(pname
, fparam
);
3054 static void GLAPIENTRY
3055 save_LightModeli(GLenum pname
, GLint param
)
3059 parray
[1] = parray
[2] = parray
[3] = 0;
3060 save_LightModeliv(pname
, parray
);
3064 static void GLAPIENTRY
3065 save_LineStipple(GLint factor
, GLushort pattern
)
3067 GET_CURRENT_CONTEXT(ctx
);
3069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3070 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3075 if (ctx
->ExecuteFlag
) {
3076 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3081 static void GLAPIENTRY
3082 save_LineWidth(GLfloat width
)
3084 GET_CURRENT_CONTEXT(ctx
);
3086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3087 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3091 if (ctx
->ExecuteFlag
) {
3092 CALL_LineWidth(ctx
->Exec
, (width
));
3097 static void GLAPIENTRY
3098 save_ListBase(GLuint base
)
3100 GET_CURRENT_CONTEXT(ctx
);
3102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3103 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3107 if (ctx
->ExecuteFlag
) {
3108 CALL_ListBase(ctx
->Exec
, (base
));
3113 static void GLAPIENTRY
3114 save_LoadIdentity(void)
3116 GET_CURRENT_CONTEXT(ctx
);
3117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3118 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3119 if (ctx
->ExecuteFlag
) {
3120 CALL_LoadIdentity(ctx
->Exec
, ());
3125 static void GLAPIENTRY
3126 save_LoadMatrixf(const GLfloat
* m
)
3128 GET_CURRENT_CONTEXT(ctx
);
3130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3131 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3134 for (i
= 0; i
< 16; i
++) {
3138 if (ctx
->ExecuteFlag
) {
3139 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3144 static void GLAPIENTRY
3145 save_LoadMatrixd(const GLdouble
* m
)
3149 for (i
= 0; i
< 16; i
++) {
3150 f
[i
] = (GLfloat
) m
[i
];
3152 save_LoadMatrixf(f
);
3156 static void GLAPIENTRY
3157 save_LoadName(GLuint name
)
3159 GET_CURRENT_CONTEXT(ctx
);
3161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3162 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3166 if (ctx
->ExecuteFlag
) {
3167 CALL_LoadName(ctx
->Exec
, (name
));
3172 static void GLAPIENTRY
3173 save_LogicOp(GLenum opcode
)
3175 GET_CURRENT_CONTEXT(ctx
);
3177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3178 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3182 if (ctx
->ExecuteFlag
) {
3183 CALL_LogicOp(ctx
->Exec
, (opcode
));
3188 static void GLAPIENTRY
3189 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3190 GLint order
, const GLdouble
* points
)
3192 GET_CURRENT_CONTEXT(ctx
);
3194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3195 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3197 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3199 n
[2].f
= (GLfloat
) u1
;
3200 n
[3].f
= (GLfloat
) u2
;
3201 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3203 save_pointer(&n
[6], pnts
);
3205 if (ctx
->ExecuteFlag
) {
3206 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3210 static void GLAPIENTRY
3211 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3212 GLint order
, const GLfloat
* points
)
3214 GET_CURRENT_CONTEXT(ctx
);
3216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3217 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3219 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3223 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3225 save_pointer(&n
[6], pnts
);
3227 if (ctx
->ExecuteFlag
) {
3228 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3233 static void GLAPIENTRY
3234 save_Map2d(GLenum target
,
3235 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3236 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3237 const GLdouble
* points
)
3239 GET_CURRENT_CONTEXT(ctx
);
3241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3242 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3244 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3245 vstride
, vorder
, points
);
3247 n
[2].f
= (GLfloat
) u1
;
3248 n
[3].f
= (GLfloat
) u2
;
3249 n
[4].f
= (GLfloat
) v1
;
3250 n
[5].f
= (GLfloat
) v2
;
3251 /* XXX verify these strides are correct */
3252 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3253 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3256 save_pointer(&n
[10], pnts
);
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_Map2d(ctx
->Exec
, (target
,
3260 u1
, u2
, ustride
, uorder
,
3261 v1
, v2
, vstride
, vorder
, points
));
3266 static void GLAPIENTRY
3267 save_Map2f(GLenum target
,
3268 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3269 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3270 const GLfloat
* points
)
3272 GET_CURRENT_CONTEXT(ctx
);
3274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3275 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3277 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3278 vstride
, vorder
, points
);
3284 /* XXX verify these strides are correct */
3285 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3286 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3289 save_pointer(&n
[10], pnts
);
3291 if (ctx
->ExecuteFlag
) {
3292 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3293 v1
, v2
, vstride
, vorder
, points
));
3298 static void GLAPIENTRY
3299 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3301 GET_CURRENT_CONTEXT(ctx
);
3303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3304 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3310 if (ctx
->ExecuteFlag
) {
3311 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3316 static void GLAPIENTRY
3317 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3319 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3323 static void GLAPIENTRY
3324 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3325 GLint vn
, GLfloat v1
, GLfloat v2
)
3327 GET_CURRENT_CONTEXT(ctx
);
3329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3330 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3339 if (ctx
->ExecuteFlag
) {
3340 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3346 static void GLAPIENTRY
3347 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3348 GLint vn
, GLdouble v1
, GLdouble v2
)
3350 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3351 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3355 static void GLAPIENTRY
3356 save_MatrixMode(GLenum mode
)
3358 GET_CURRENT_CONTEXT(ctx
);
3360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3361 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3365 if (ctx
->ExecuteFlag
) {
3366 CALL_MatrixMode(ctx
->Exec
, (mode
));
3371 static void GLAPIENTRY
3372 save_MultMatrixf(const GLfloat
* m
)
3374 GET_CURRENT_CONTEXT(ctx
);
3376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3377 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3380 for (i
= 0; i
< 16; i
++) {
3384 if (ctx
->ExecuteFlag
) {
3385 CALL_MultMatrixf(ctx
->Exec
, (m
));
3390 static void GLAPIENTRY
3391 save_MultMatrixd(const GLdouble
* m
)
3395 for (i
= 0; i
< 16; i
++) {
3396 f
[i
] = (GLfloat
) m
[i
];
3398 save_MultMatrixf(f
);
3402 static void GLAPIENTRY
3403 save_NewList(GLuint name
, GLenum mode
)
3405 GET_CURRENT_CONTEXT(ctx
);
3406 /* It's an error to call this function while building a display list */
3407 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3414 static void GLAPIENTRY
3415 save_Ortho(GLdouble left
, GLdouble right
,
3416 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3418 GET_CURRENT_CONTEXT(ctx
);
3420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3421 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3423 n
[1].f
= (GLfloat
) left
;
3424 n
[2].f
= (GLfloat
) right
;
3425 n
[3].f
= (GLfloat
) bottom
;
3426 n
[4].f
= (GLfloat
) top
;
3427 n
[5].f
= (GLfloat
) nearval
;
3428 n
[6].f
= (GLfloat
) farval
;
3430 if (ctx
->ExecuteFlag
) {
3431 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3436 static void GLAPIENTRY
3437 save_PatchParameteri(GLenum pname
, const GLint value
)
3439 GET_CURRENT_CONTEXT(ctx
);
3441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3442 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3447 if (ctx
->ExecuteFlag
) {
3448 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3453 static void GLAPIENTRY
3454 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3456 GET_CURRENT_CONTEXT(ctx
);
3458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3460 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3461 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3463 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3464 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3468 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3478 if (ctx
->ExecuteFlag
) {
3479 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3484 static void GLAPIENTRY
3485 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3487 GET_CURRENT_CONTEXT(ctx
);
3489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3490 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3494 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3496 if (ctx
->ExecuteFlag
) {
3497 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3502 static void GLAPIENTRY
3503 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3505 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3507 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3508 for (i
= 0; i
< mapsize
; i
++) {
3509 fvalues
[i
] = (GLfloat
) values
[i
];
3513 for (i
= 0; i
< mapsize
; i
++) {
3514 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3517 save_PixelMapfv(map
, mapsize
, fvalues
);
3521 static void GLAPIENTRY
3522 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3524 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3526 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3527 for (i
= 0; i
< mapsize
; i
++) {
3528 fvalues
[i
] = (GLfloat
) values
[i
];
3532 for (i
= 0; i
< mapsize
; i
++) {
3533 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3536 save_PixelMapfv(map
, mapsize
, fvalues
);
3540 static void GLAPIENTRY
3541 save_PixelTransferf(GLenum pname
, GLfloat param
)
3543 GET_CURRENT_CONTEXT(ctx
);
3545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3546 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3551 if (ctx
->ExecuteFlag
) {
3552 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3557 static void GLAPIENTRY
3558 save_PixelTransferi(GLenum pname
, GLint param
)
3560 save_PixelTransferf(pname
, (GLfloat
) param
);
3564 static void GLAPIENTRY
3565 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3567 GET_CURRENT_CONTEXT(ctx
);
3569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3570 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3575 if (ctx
->ExecuteFlag
) {
3576 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3581 static void GLAPIENTRY
3582 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3584 GET_CURRENT_CONTEXT(ctx
);
3586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3587 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3594 if (ctx
->ExecuteFlag
) {
3595 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3600 static void GLAPIENTRY
3601 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3605 parray
[1] = parray
[2] = 0.0F
;
3606 save_PointParameterfvEXT(pname
, parray
);
3609 static void GLAPIENTRY
3610 save_PointParameteriNV(GLenum pname
, GLint param
)
3613 parray
[0] = (GLfloat
) param
;
3614 parray
[1] = parray
[2] = 0.0F
;
3615 save_PointParameterfvEXT(pname
, parray
);
3618 static void GLAPIENTRY
3619 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3622 parray
[0] = (GLfloat
) param
[0];
3623 parray
[1] = parray
[2] = 0.0F
;
3624 save_PointParameterfvEXT(pname
, parray
);
3628 static void GLAPIENTRY
3629 save_PointSize(GLfloat size
)
3631 GET_CURRENT_CONTEXT(ctx
);
3633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3634 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3638 if (ctx
->ExecuteFlag
) {
3639 CALL_PointSize(ctx
->Exec
, (size
));
3644 static void GLAPIENTRY
3645 save_PolygonMode(GLenum face
, GLenum mode
)
3647 GET_CURRENT_CONTEXT(ctx
);
3649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3650 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3655 if (ctx
->ExecuteFlag
) {
3656 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3661 static void GLAPIENTRY
3662 save_PolygonStipple(const GLubyte
* pattern
)
3664 GET_CURRENT_CONTEXT(ctx
);
3667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3669 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3672 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3673 pattern
, &ctx
->Unpack
));
3675 if (ctx
->ExecuteFlag
) {
3676 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3681 static void GLAPIENTRY
3682 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3684 GET_CURRENT_CONTEXT(ctx
);
3686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3687 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3692 if (ctx
->ExecuteFlag
) {
3693 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3698 static void GLAPIENTRY
3699 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3701 GET_CURRENT_CONTEXT(ctx
);
3703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3704 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3710 if (ctx
->ExecuteFlag
) {
3711 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3715 static void GLAPIENTRY
3716 save_PopAttrib(void)
3718 GET_CURRENT_CONTEXT(ctx
);
3719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3720 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3721 if (ctx
->ExecuteFlag
) {
3722 CALL_PopAttrib(ctx
->Exec
, ());
3727 static void GLAPIENTRY
3728 save_PopMatrix(void)
3730 GET_CURRENT_CONTEXT(ctx
);
3731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3732 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3733 if (ctx
->ExecuteFlag
) {
3734 CALL_PopMatrix(ctx
->Exec
, ());
3739 static void GLAPIENTRY
3742 GET_CURRENT_CONTEXT(ctx
);
3743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3744 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3745 if (ctx
->ExecuteFlag
) {
3746 CALL_PopName(ctx
->Exec
, ());
3751 static void GLAPIENTRY
3752 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3753 const GLclampf
* priorities
)
3755 GET_CURRENT_CONTEXT(ctx
);
3757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3759 for (i
= 0; i
< num
; i
++) {
3761 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3763 n
[1].ui
= textures
[i
];
3764 n
[2].f
= priorities
[i
];
3767 if (ctx
->ExecuteFlag
) {
3768 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3773 static void GLAPIENTRY
3774 save_PushAttrib(GLbitfield mask
)
3776 GET_CURRENT_CONTEXT(ctx
);
3778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3779 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3783 if (ctx
->ExecuteFlag
) {
3784 CALL_PushAttrib(ctx
->Exec
, (mask
));
3789 static void GLAPIENTRY
3790 save_PushMatrix(void)
3792 GET_CURRENT_CONTEXT(ctx
);
3793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3794 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3795 if (ctx
->ExecuteFlag
) {
3796 CALL_PushMatrix(ctx
->Exec
, ());
3801 static void GLAPIENTRY
3802 save_PushName(GLuint name
)
3804 GET_CURRENT_CONTEXT(ctx
);
3806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3807 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3811 if (ctx
->ExecuteFlag
) {
3812 CALL_PushName(ctx
->Exec
, (name
));
3817 static void GLAPIENTRY
3818 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3820 GET_CURRENT_CONTEXT(ctx
);
3822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3823 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3830 if (ctx
->ExecuteFlag
) {
3831 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3835 static void GLAPIENTRY
3836 save_RasterPos2d(GLdouble x
, GLdouble y
)
3838 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3841 static void GLAPIENTRY
3842 save_RasterPos2f(GLfloat x
, GLfloat y
)
3844 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3847 static void GLAPIENTRY
3848 save_RasterPos2i(GLint x
, GLint y
)
3850 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3853 static void GLAPIENTRY
3854 save_RasterPos2s(GLshort x
, GLshort y
)
3856 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3859 static void GLAPIENTRY
3860 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3862 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3865 static void GLAPIENTRY
3866 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3868 save_RasterPos4f(x
, y
, z
, 1.0F
);
3871 static void GLAPIENTRY
3872 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3874 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3877 static void GLAPIENTRY
3878 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3880 save_RasterPos4f(x
, y
, z
, 1.0F
);
3883 static void GLAPIENTRY
3884 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3886 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3889 static void GLAPIENTRY
3890 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3892 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3895 static void GLAPIENTRY
3896 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3898 save_RasterPos4f(x
, y
, z
, w
);
3901 static void GLAPIENTRY
3902 save_RasterPos2dv(const GLdouble
* v
)
3904 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3907 static void GLAPIENTRY
3908 save_RasterPos2fv(const GLfloat
* v
)
3910 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3913 static void GLAPIENTRY
3914 save_RasterPos2iv(const GLint
* v
)
3916 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3919 static void GLAPIENTRY
3920 save_RasterPos2sv(const GLshort
* v
)
3922 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3925 static void GLAPIENTRY
3926 save_RasterPos3dv(const GLdouble
* v
)
3928 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3931 static void GLAPIENTRY
3932 save_RasterPos3fv(const GLfloat
* v
)
3934 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3937 static void GLAPIENTRY
3938 save_RasterPos3iv(const GLint
* v
)
3940 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3943 static void GLAPIENTRY
3944 save_RasterPos3sv(const GLshort
* v
)
3946 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3949 static void GLAPIENTRY
3950 save_RasterPos4dv(const GLdouble
* v
)
3952 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3953 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3956 static void GLAPIENTRY
3957 save_RasterPos4fv(const GLfloat
* v
)
3959 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3962 static void GLAPIENTRY
3963 save_RasterPos4iv(const GLint
* v
)
3965 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3966 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3969 static void GLAPIENTRY
3970 save_RasterPos4sv(const GLshort
* v
)
3972 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3976 static void GLAPIENTRY
3977 save_PassThrough(GLfloat token
)
3979 GET_CURRENT_CONTEXT(ctx
);
3981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3982 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3986 if (ctx
->ExecuteFlag
) {
3987 CALL_PassThrough(ctx
->Exec
, (token
));
3992 static void GLAPIENTRY
3993 save_ReadBuffer(GLenum mode
)
3995 GET_CURRENT_CONTEXT(ctx
);
3997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3998 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4002 if (ctx
->ExecuteFlag
) {
4003 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4008 static void GLAPIENTRY
4009 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4011 GET_CURRENT_CONTEXT(ctx
);
4013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4014 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4021 if (ctx
->ExecuteFlag
) {
4022 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4027 static void GLAPIENTRY
4028 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4030 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4034 static void GLAPIENTRY
4035 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4037 GET_CURRENT_CONTEXT(ctx
);
4039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4040 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4046 if (ctx
->ExecuteFlag
) {
4047 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4052 static void GLAPIENTRY
4053 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4055 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4059 static void GLAPIENTRY
4060 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4062 GET_CURRENT_CONTEXT(ctx
);
4064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4065 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4072 if (ctx
->ExecuteFlag
) {
4073 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4078 static void GLAPIENTRY
4079 save_ShadeModel(GLenum mode
)
4081 GET_CURRENT_CONTEXT(ctx
);
4083 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4085 if (ctx
->ExecuteFlag
) {
4086 CALL_ShadeModel(ctx
->Exec
, (mode
));
4089 /* Don't compile this call if it's a no-op.
4090 * By avoiding this state change we have a better chance of
4091 * coalescing subsequent drawing commands into one batch.
4093 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4096 SAVE_FLUSH_VERTICES(ctx
);
4098 ctx
->ListState
.Current
.ShadeModel
= mode
;
4100 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4107 static void GLAPIENTRY
4108 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4110 GET_CURRENT_CONTEXT(ctx
);
4112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4113 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4119 if (ctx
->ExecuteFlag
) {
4120 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4125 static void GLAPIENTRY
4126 save_StencilMask(GLuint mask
)
4128 GET_CURRENT_CONTEXT(ctx
);
4130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4131 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4135 if (ctx
->ExecuteFlag
) {
4136 CALL_StencilMask(ctx
->Exec
, (mask
));
4141 static void GLAPIENTRY
4142 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4144 GET_CURRENT_CONTEXT(ctx
);
4146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4147 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4153 if (ctx
->ExecuteFlag
) {
4154 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4159 static void GLAPIENTRY
4160 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4162 GET_CURRENT_CONTEXT(ctx
);
4164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4165 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4172 if (ctx
->ExecuteFlag
) {
4173 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4178 static void GLAPIENTRY
4179 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4182 GET_CURRENT_CONTEXT(ctx
);
4184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4186 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4194 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4201 if (ctx
->ExecuteFlag
) {
4202 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4203 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4208 static void GLAPIENTRY
4209 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4211 GET_CURRENT_CONTEXT(ctx
);
4213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4214 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4219 if (ctx
->ExecuteFlag
) {
4220 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4225 static void GLAPIENTRY
4226 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4228 GET_CURRENT_CONTEXT(ctx
);
4230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4231 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4238 if (ctx
->ExecuteFlag
) {
4239 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4244 static void GLAPIENTRY
4245 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4247 GET_CURRENT_CONTEXT(ctx
);
4249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4250 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4254 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4262 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4265 if (ctx
->ExecuteFlag
) {
4266 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4271 static void GLAPIENTRY
4272 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4275 parray
[0] = (GLfloat
) param
;
4276 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4277 save_TexEnvfv(target
, pname
, parray
);
4281 static void GLAPIENTRY
4282 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4285 p
[0] = (GLfloat
) param
;
4286 p
[1] = p
[2] = p
[3] = 0.0F
;
4287 save_TexEnvfv(target
, pname
, p
);
4291 static void GLAPIENTRY
4292 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4295 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4296 p
[0] = INT_TO_FLOAT(param
[0]);
4297 p
[1] = INT_TO_FLOAT(param
[1]);
4298 p
[2] = INT_TO_FLOAT(param
[2]);
4299 p
[3] = INT_TO_FLOAT(param
[3]);
4302 p
[0] = (GLfloat
) param
[0];
4303 p
[1] = p
[2] = p
[3] = 0.0F
;
4305 save_TexEnvfv(target
, pname
, p
);
4309 static void GLAPIENTRY
4310 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4312 GET_CURRENT_CONTEXT(ctx
);
4314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4315 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4324 if (ctx
->ExecuteFlag
) {
4325 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4330 static void GLAPIENTRY
4331 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4334 p
[0] = (GLfloat
) params
[0];
4335 p
[1] = (GLfloat
) params
[1];
4336 p
[2] = (GLfloat
) params
[2];
4337 p
[3] = (GLfloat
) params
[3];
4338 save_TexGenfv(coord
, pname
, p
);
4342 static void GLAPIENTRY
4343 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4346 parray
[0] = (GLfloat
) param
;
4347 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4348 save_TexGenfv(coord
, pname
, parray
);
4352 static void GLAPIENTRY
4353 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4356 p
[0] = (GLfloat
) params
[0];
4357 p
[1] = (GLfloat
) params
[1];
4358 p
[2] = (GLfloat
) params
[2];
4359 p
[3] = (GLfloat
) params
[3];
4360 save_TexGenfv(coord
, pname
, p
);
4364 static void GLAPIENTRY
4365 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4369 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4370 save_TexGenfv(coord
, pname
, parray
);
4374 static void GLAPIENTRY
4375 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4379 parray
[1] = parray
[2] = parray
[3] = 0;
4380 save_TexGeniv(coord
, pname
, parray
);
4384 static void GLAPIENTRY
4385 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4387 GET_CURRENT_CONTEXT(ctx
);
4389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4390 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4399 if (ctx
->ExecuteFlag
) {
4400 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4405 static void GLAPIENTRY
4406 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4410 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4411 save_TexParameterfv(target
, pname
, parray
);
4415 static void GLAPIENTRY
4416 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4419 fparam
[0] = (GLfloat
) param
;
4420 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4421 save_TexParameterfv(target
, pname
, fparam
);
4425 static void GLAPIENTRY
4426 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4429 fparam
[0] = (GLfloat
) params
[0];
4430 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4431 save_TexParameterfv(target
, pname
, fparam
);
4435 static void GLAPIENTRY
4436 save_TexImage1D(GLenum target
,
4437 GLint level
, GLint components
,
4438 GLsizei width
, GLint border
,
4439 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4441 GET_CURRENT_CONTEXT(ctx
);
4442 if (target
== GL_PROXY_TEXTURE_1D
) {
4443 /* don't compile, execute immediately */
4444 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4445 border
, format
, type
, pixels
));
4449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4450 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4454 n
[3].i
= components
;
4455 n
[4].i
= (GLint
) width
;
4460 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4461 pixels
, &ctx
->Unpack
));
4463 if (ctx
->ExecuteFlag
) {
4464 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4465 border
, format
, type
, pixels
));
4471 static void GLAPIENTRY
4472 save_TexImage2D(GLenum target
,
4473 GLint level
, GLint components
,
4474 GLsizei width
, GLsizei height
, GLint border
,
4475 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4477 GET_CURRENT_CONTEXT(ctx
);
4478 if (target
== GL_PROXY_TEXTURE_2D
) {
4479 /* don't compile, execute immediately */
4480 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4481 height
, border
, format
, type
, pixels
));
4485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4486 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4490 n
[3].i
= components
;
4491 n
[4].i
= (GLint
) width
;
4492 n
[5].i
= (GLint
) height
;
4497 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4498 pixels
, &ctx
->Unpack
));
4500 if (ctx
->ExecuteFlag
) {
4501 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4502 height
, border
, format
, type
, pixels
));
4508 static void GLAPIENTRY
4509 save_TexImage3D(GLenum target
,
4510 GLint level
, GLint internalFormat
,
4511 GLsizei width
, GLsizei height
, GLsizei depth
,
4513 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4515 GET_CURRENT_CONTEXT(ctx
);
4516 if (target
== GL_PROXY_TEXTURE_3D
) {
4517 /* don't compile, execute immediately */
4518 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4519 height
, depth
, border
, format
, type
,
4524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4525 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4529 n
[3].i
= (GLint
) internalFormat
;
4530 n
[4].i
= (GLint
) width
;
4531 n
[5].i
= (GLint
) height
;
4532 n
[6].i
= (GLint
) depth
;
4536 save_pointer(&n
[10],
4537 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4538 pixels
, &ctx
->Unpack
));
4540 if (ctx
->ExecuteFlag
) {
4541 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4542 height
, depth
, border
, format
, type
,
4549 static void GLAPIENTRY
4550 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4551 GLsizei width
, GLenum format
, GLenum type
,
4552 const GLvoid
* pixels
)
4554 GET_CURRENT_CONTEXT(ctx
);
4557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4559 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4564 n
[4].i
= (GLint
) width
;
4568 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4569 pixels
, &ctx
->Unpack
));
4571 if (ctx
->ExecuteFlag
) {
4572 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4573 format
, type
, pixels
));
4578 static void GLAPIENTRY
4579 save_TexSubImage2D(GLenum target
, GLint level
,
4580 GLint xoffset
, GLint yoffset
,
4581 GLsizei width
, GLsizei height
,
4582 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4584 GET_CURRENT_CONTEXT(ctx
);
4587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4589 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4595 n
[5].i
= (GLint
) width
;
4596 n
[6].i
= (GLint
) height
;
4600 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4601 pixels
, &ctx
->Unpack
));
4603 if (ctx
->ExecuteFlag
) {
4604 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4605 width
, height
, format
, type
, pixels
));
4610 static void GLAPIENTRY
4611 save_TexSubImage3D(GLenum target
, GLint level
,
4612 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4613 GLsizei width
, GLsizei height
, GLsizei depth
,
4614 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4616 GET_CURRENT_CONTEXT(ctx
);
4619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4621 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4628 n
[6].i
= (GLint
) width
;
4629 n
[7].i
= (GLint
) height
;
4630 n
[8].i
= (GLint
) depth
;
4633 save_pointer(&n
[11],
4634 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4635 pixels
, &ctx
->Unpack
));
4637 if (ctx
->ExecuteFlag
) {
4638 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4639 xoffset
, yoffset
, zoffset
,
4640 width
, height
, depth
, format
, type
,
4646 static void GLAPIENTRY
4647 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4649 GET_CURRENT_CONTEXT(ctx
);
4651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4652 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4658 if (ctx
->ExecuteFlag
) {
4659 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4664 static void GLAPIENTRY
4665 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4667 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4672 static void GLAPIENTRY
4673 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4675 GET_CURRENT_CONTEXT(ctx
);
4677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4678 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4682 n
[3].i
= (GLint
) width
;
4683 n
[4].i
= (GLint
) height
;
4685 if (ctx
->ExecuteFlag
) {
4686 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4690 static void GLAPIENTRY
4691 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4694 GET_CURRENT_CONTEXT(ctx
);
4696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4697 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4705 if (ctx
->ExecuteFlag
) {
4706 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4710 static void GLAPIENTRY
4711 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4713 GET_CURRENT_CONTEXT(ctx
);
4715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4716 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4724 if (ctx
->ExecuteFlag
) {
4725 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4729 static void GLAPIENTRY
4730 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4732 GET_CURRENT_CONTEXT(ctx
);
4734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4735 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4739 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4741 if (ctx
->ExecuteFlag
) {
4742 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4746 static void GLAPIENTRY
4747 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4750 GET_CURRENT_CONTEXT(ctx
);
4752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4753 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4761 if (ctx
->ExecuteFlag
) {
4762 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4766 static void GLAPIENTRY
4767 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4769 GET_CURRENT_CONTEXT(ctx
);
4771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4772 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4780 if (ctx
->ExecuteFlag
) {
4781 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4785 static void GLAPIENTRY
4786 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4788 GET_CURRENT_CONTEXT(ctx
);
4790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4791 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4795 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4797 if (ctx
->ExecuteFlag
) {
4798 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4802 static void GLAPIENTRY
4803 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4805 GET_CURRENT_CONTEXT(ctx
);
4807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4808 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4811 /* Mesa stores these as floats internally so we deliberately convert
4812 * them to a float here.
4817 if (ctx
->ExecuteFlag
) {
4818 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4822 static void GLAPIENTRY
4823 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4825 GET_CURRENT_CONTEXT(ctx
);
4827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4828 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4832 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4834 if (ctx
->ExecuteFlag
) {
4835 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4839 static void GLAPIENTRY
4840 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4842 GET_CURRENT_CONTEXT(ctx
);
4844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4845 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4852 if (ctx
->ExecuteFlag
) {
4853 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4857 static void GLAPIENTRY
4858 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4860 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4863 static void GLAPIENTRY
4864 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4866 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4869 static void GLAPIENTRY
4870 save_WindowPos2iMESA(GLint x
, GLint y
)
4872 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4875 static void GLAPIENTRY
4876 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4878 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4881 static void GLAPIENTRY
4882 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4884 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4887 static void GLAPIENTRY
4888 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4890 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4893 static void GLAPIENTRY
4894 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4896 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4899 static void GLAPIENTRY
4900 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4902 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4905 static void GLAPIENTRY
4906 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4908 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4911 static void GLAPIENTRY
4912 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4914 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4917 static void GLAPIENTRY
4918 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4920 save_WindowPos4fMESA(x
, y
, z
, w
);
4923 static void GLAPIENTRY
4924 save_WindowPos2dvMESA(const GLdouble
* v
)
4926 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4929 static void GLAPIENTRY
4930 save_WindowPos2fvMESA(const GLfloat
* v
)
4932 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4935 static void GLAPIENTRY
4936 save_WindowPos2ivMESA(const GLint
* v
)
4938 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4941 static void GLAPIENTRY
4942 save_WindowPos2svMESA(const GLshort
* v
)
4944 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4947 static void GLAPIENTRY
4948 save_WindowPos3dvMESA(const GLdouble
* v
)
4950 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4953 static void GLAPIENTRY
4954 save_WindowPos3fvMESA(const GLfloat
* v
)
4956 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4959 static void GLAPIENTRY
4960 save_WindowPos3ivMESA(const GLint
* v
)
4962 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4965 static void GLAPIENTRY
4966 save_WindowPos3svMESA(const GLshort
* v
)
4968 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4971 static void GLAPIENTRY
4972 save_WindowPos4dvMESA(const GLdouble
* v
)
4974 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4975 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4978 static void GLAPIENTRY
4979 save_WindowPos4fvMESA(const GLfloat
* v
)
4981 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4984 static void GLAPIENTRY
4985 save_WindowPos4ivMESA(const GLint
* v
)
4987 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4988 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4991 static void GLAPIENTRY
4992 save_WindowPos4svMESA(const GLshort
* v
)
4994 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4999 /* GL_ARB_multitexture */
5000 static void GLAPIENTRY
5001 save_ActiveTextureARB(GLenum target
)
5003 GET_CURRENT_CONTEXT(ctx
);
5005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5006 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5010 if (ctx
->ExecuteFlag
) {
5011 CALL_ActiveTexture(ctx
->Exec
, (target
));
5016 /* GL_ARB_transpose_matrix */
5018 static void GLAPIENTRY
5019 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5022 _math_transposefd(tm
, m
);
5023 save_LoadMatrixf(tm
);
5027 static void GLAPIENTRY
5028 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5031 _math_transposef(tm
, m
);
5032 save_LoadMatrixf(tm
);
5036 static void GLAPIENTRY
5037 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5040 _math_transposefd(tm
, m
);
5041 save_MultMatrixf(tm
);
5045 static void GLAPIENTRY
5046 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5049 _math_transposef(tm
, m
);
5050 save_MultMatrixf(tm
);
5053 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5055 GET_CURRENT_CONTEXT(ctx
);
5061 image
= malloc(size
);
5063 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5066 memcpy(image
, data
, size
);
5072 /* GL_ARB_texture_compression */
5073 static void GLAPIENTRY
5074 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5075 GLenum internalFormat
, GLsizei width
,
5076 GLint border
, GLsizei imageSize
,
5077 const GLvoid
* data
)
5079 GET_CURRENT_CONTEXT(ctx
);
5080 if (target
== GL_PROXY_TEXTURE_1D
) {
5081 /* don't compile, execute immediately */
5082 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5083 width
, border
, imageSize
,
5088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5090 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5091 6 + POINTER_DWORDS
);
5095 n
[3].e
= internalFormat
;
5096 n
[4].i
= (GLint
) width
;
5100 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5102 if (ctx
->ExecuteFlag
) {
5103 CALL_CompressedTexImage1D(ctx
->Exec
,
5104 (target
, level
, internalFormat
, width
,
5105 border
, imageSize
, data
));
5111 static void GLAPIENTRY
5112 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5113 GLenum internalFormat
, GLsizei width
,
5114 GLsizei height
, GLint border
, GLsizei imageSize
,
5115 const GLvoid
* data
)
5117 GET_CURRENT_CONTEXT(ctx
);
5118 if (target
== GL_PROXY_TEXTURE_2D
) {
5119 /* don't compile, execute immediately */
5120 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5121 width
, height
, border
,
5126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5128 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5129 7 + POINTER_DWORDS
);
5133 n
[3].e
= internalFormat
;
5134 n
[4].i
= (GLint
) width
;
5135 n
[5].i
= (GLint
) height
;
5139 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5141 if (ctx
->ExecuteFlag
) {
5142 CALL_CompressedTexImage2D(ctx
->Exec
,
5143 (target
, level
, internalFormat
, width
,
5144 height
, border
, imageSize
, data
));
5150 static void GLAPIENTRY
5151 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5152 GLenum internalFormat
, GLsizei width
,
5153 GLsizei height
, GLsizei depth
, GLint border
,
5154 GLsizei imageSize
, const GLvoid
* data
)
5156 GET_CURRENT_CONTEXT(ctx
);
5157 if (target
== GL_PROXY_TEXTURE_3D
) {
5158 /* don't compile, execute immediately */
5159 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5160 width
, height
, depth
, border
,
5165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5167 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5168 8 + POINTER_DWORDS
);
5172 n
[3].e
= internalFormat
;
5173 n
[4].i
= (GLint
) width
;
5174 n
[5].i
= (GLint
) height
;
5175 n
[6].i
= (GLint
) depth
;
5179 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5181 if (ctx
->ExecuteFlag
) {
5182 CALL_CompressedTexImage3D(ctx
->Exec
,
5183 (target
, level
, internalFormat
, width
,
5184 height
, depth
, border
, imageSize
,
5191 static void GLAPIENTRY
5192 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5193 GLsizei width
, GLenum format
,
5194 GLsizei imageSize
, const GLvoid
* data
)
5197 GET_CURRENT_CONTEXT(ctx
);
5198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5200 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5201 6 + POINTER_DWORDS
);
5206 n
[4].i
= (GLint
) width
;
5210 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5212 if (ctx
->ExecuteFlag
) {
5213 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5214 width
, format
, imageSize
,
5220 static void GLAPIENTRY
5221 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5222 GLint yoffset
, GLsizei width
, GLsizei height
,
5223 GLenum format
, GLsizei imageSize
,
5224 const GLvoid
* data
)
5227 GET_CURRENT_CONTEXT(ctx
);
5228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5230 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5231 8 + POINTER_DWORDS
);
5237 n
[5].i
= (GLint
) width
;
5238 n
[6].i
= (GLint
) height
;
5242 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5244 if (ctx
->ExecuteFlag
) {
5245 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5246 (target
, level
, xoffset
, yoffset
, width
,
5247 height
, format
, imageSize
, data
));
5252 static void GLAPIENTRY
5253 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5254 GLint yoffset
, GLint zoffset
, GLsizei width
,
5255 GLsizei height
, GLsizei depth
, GLenum format
,
5256 GLsizei imageSize
, const GLvoid
* data
)
5259 GET_CURRENT_CONTEXT(ctx
);
5260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5262 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5263 10 + POINTER_DWORDS
);
5270 n
[6].i
= (GLint
) width
;
5271 n
[7].i
= (GLint
) height
;
5272 n
[8].i
= (GLint
) depth
;
5274 n
[10].i
= imageSize
;
5275 save_pointer(&n
[11],
5276 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5278 if (ctx
->ExecuteFlag
) {
5279 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5280 (target
, level
, xoffset
, yoffset
,
5281 zoffset
, width
, height
, depth
, format
,
5287 /* GL_ARB_multisample */
5288 static void GLAPIENTRY
5289 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5291 GET_CURRENT_CONTEXT(ctx
);
5293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5294 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5299 if (ctx
->ExecuteFlag
) {
5300 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5306 * GL_ARB_vertex_program
5308 static void GLAPIENTRY
5309 save_BindProgramARB(GLenum target
, GLuint id
)
5311 GET_CURRENT_CONTEXT(ctx
);
5313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5314 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5319 if (ctx
->ExecuteFlag
) {
5320 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5324 static void GLAPIENTRY
5325 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5326 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5328 GET_CURRENT_CONTEXT(ctx
);
5330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5331 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5340 if (ctx
->ExecuteFlag
) {
5341 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5346 static void GLAPIENTRY
5347 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5348 const GLfloat
*params
)
5350 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5351 params
[2], params
[3]);
5355 static void GLAPIENTRY
5356 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5357 const GLfloat
* params
)
5359 GET_CURRENT_CONTEXT(ctx
);
5361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5365 const GLfloat
* p
= params
;
5367 for (i
= 0 ; i
< count
; i
++) {
5368 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5381 if (ctx
->ExecuteFlag
) {
5382 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5387 static void GLAPIENTRY
5388 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5389 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5391 save_ProgramEnvParameter4fARB(target
, index
,
5393 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5397 static void GLAPIENTRY
5398 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5399 const GLdouble
*params
)
5401 save_ProgramEnvParameter4fARB(target
, index
,
5402 (GLfloat
) params
[0],
5403 (GLfloat
) params
[1],
5404 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5408 static void GLAPIENTRY
5409 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5410 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5412 GET_CURRENT_CONTEXT(ctx
);
5414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5415 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5424 if (ctx
->ExecuteFlag
) {
5425 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5430 static void GLAPIENTRY
5431 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5432 const GLfloat
*params
)
5434 GET_CURRENT_CONTEXT(ctx
);
5436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5437 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5446 if (ctx
->ExecuteFlag
) {
5447 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5452 static void GLAPIENTRY
5453 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5454 const GLfloat
*params
)
5456 GET_CURRENT_CONTEXT(ctx
);
5458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5462 const GLfloat
* p
= params
;
5464 for (i
= 0 ; i
< count
; i
++) {
5465 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5478 if (ctx
->ExecuteFlag
) {
5479 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5484 static void GLAPIENTRY
5485 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5486 GLdouble x
, GLdouble y
,
5487 GLdouble z
, GLdouble w
)
5489 GET_CURRENT_CONTEXT(ctx
);
5491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5492 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5496 n
[3].f
= (GLfloat
) x
;
5497 n
[4].f
= (GLfloat
) y
;
5498 n
[5].f
= (GLfloat
) z
;
5499 n
[6].f
= (GLfloat
) w
;
5501 if (ctx
->ExecuteFlag
) {
5502 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5507 static void GLAPIENTRY
5508 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5509 const GLdouble
*params
)
5511 GET_CURRENT_CONTEXT(ctx
);
5513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5514 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5518 n
[3].f
= (GLfloat
) params
[0];
5519 n
[4].f
= (GLfloat
) params
[1];
5520 n
[5].f
= (GLfloat
) params
[2];
5521 n
[6].f
= (GLfloat
) params
[3];
5523 if (ctx
->ExecuteFlag
) {
5524 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5529 /* GL_EXT_stencil_two_side */
5530 static void GLAPIENTRY
5531 save_ActiveStencilFaceEXT(GLenum face
)
5533 GET_CURRENT_CONTEXT(ctx
);
5535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5536 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5540 if (ctx
->ExecuteFlag
) {
5541 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5546 /* GL_EXT_depth_bounds_test */
5547 static void GLAPIENTRY
5548 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5550 GET_CURRENT_CONTEXT(ctx
);
5552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5553 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5555 n
[1].f
= (GLfloat
) zmin
;
5556 n
[2].f
= (GLfloat
) zmax
;
5558 if (ctx
->ExecuteFlag
) {
5559 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5565 static void GLAPIENTRY
5566 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5567 const GLvoid
* string
)
5569 GET_CURRENT_CONTEXT(ctx
);
5572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5574 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5576 GLubyte
*programCopy
= malloc(len
);
5578 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5581 memcpy(programCopy
, string
, len
);
5585 save_pointer(&n
[4], programCopy
);
5587 if (ctx
->ExecuteFlag
) {
5588 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5593 static void GLAPIENTRY
5594 save_BeginQueryARB(GLenum target
, GLuint id
)
5596 GET_CURRENT_CONTEXT(ctx
);
5598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5599 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5604 if (ctx
->ExecuteFlag
) {
5605 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5609 static void GLAPIENTRY
5610 save_EndQueryARB(GLenum target
)
5612 GET_CURRENT_CONTEXT(ctx
);
5614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5615 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5619 if (ctx
->ExecuteFlag
) {
5620 CALL_EndQuery(ctx
->Exec
, (target
));
5624 static void GLAPIENTRY
5625 save_QueryCounter(GLuint id
, GLenum target
)
5627 GET_CURRENT_CONTEXT(ctx
);
5629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5630 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5635 if (ctx
->ExecuteFlag
) {
5636 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5640 static void GLAPIENTRY
5641 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5643 GET_CURRENT_CONTEXT(ctx
);
5645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5646 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5652 if (ctx
->ExecuteFlag
) {
5653 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5657 static void GLAPIENTRY
5658 save_EndQueryIndexed(GLenum target
, GLuint index
)
5660 GET_CURRENT_CONTEXT(ctx
);
5662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5663 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5668 if (ctx
->ExecuteFlag
) {
5669 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5674 static void GLAPIENTRY
5675 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5677 GET_CURRENT_CONTEXT(ctx
);
5679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5680 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5684 if (count
> MAX_DRAW_BUFFERS
)
5685 count
= MAX_DRAW_BUFFERS
;
5686 for (i
= 0; i
< count
; i
++) {
5687 n
[2 + i
].e
= buffers
[i
];
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5695 static void GLAPIENTRY
5696 save_BindFragmentShaderATI(GLuint id
)
5698 GET_CURRENT_CONTEXT(ctx
);
5701 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5705 if (ctx
->ExecuteFlag
) {
5706 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5710 static void GLAPIENTRY
5711 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5713 GET_CURRENT_CONTEXT(ctx
);
5716 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5724 if (ctx
->ExecuteFlag
) {
5725 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5729 static void GLAPIENTRY
5730 save_Attr1fNV(GLenum attr
, GLfloat x
)
5732 GET_CURRENT_CONTEXT(ctx
);
5734 SAVE_FLUSH_VERTICES(ctx
);
5735 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5741 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5742 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5743 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5745 if (ctx
->ExecuteFlag
) {
5746 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5750 static void GLAPIENTRY
5751 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5753 GET_CURRENT_CONTEXT(ctx
);
5755 SAVE_FLUSH_VERTICES(ctx
);
5756 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5763 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5764 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5765 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5767 if (ctx
->ExecuteFlag
) {
5768 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5772 static void GLAPIENTRY
5773 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5775 GET_CURRENT_CONTEXT(ctx
);
5777 SAVE_FLUSH_VERTICES(ctx
);
5778 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5786 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5787 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5788 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5790 if (ctx
->ExecuteFlag
) {
5791 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5795 static void GLAPIENTRY
5796 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5798 GET_CURRENT_CONTEXT(ctx
);
5800 SAVE_FLUSH_VERTICES(ctx
);
5801 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5810 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5811 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5812 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5814 if (ctx
->ExecuteFlag
) {
5815 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5820 static void GLAPIENTRY
5821 save_Attr1fARB(GLenum attr
, GLfloat x
)
5823 GET_CURRENT_CONTEXT(ctx
);
5825 SAVE_FLUSH_VERTICES(ctx
);
5826 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5832 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5833 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5834 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5836 if (ctx
->ExecuteFlag
) {
5837 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5841 static void GLAPIENTRY
5842 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5844 GET_CURRENT_CONTEXT(ctx
);
5846 SAVE_FLUSH_VERTICES(ctx
);
5847 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5854 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5855 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5856 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5858 if (ctx
->ExecuteFlag
) {
5859 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5863 static void GLAPIENTRY
5864 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5866 GET_CURRENT_CONTEXT(ctx
);
5868 SAVE_FLUSH_VERTICES(ctx
);
5869 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5877 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5878 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5879 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5881 if (ctx
->ExecuteFlag
) {
5882 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5886 static void GLAPIENTRY
5887 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5889 GET_CURRENT_CONTEXT(ctx
);
5891 SAVE_FLUSH_VERTICES(ctx
);
5892 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5901 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5902 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5903 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5905 if (ctx
->ExecuteFlag
) {
5906 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5911 static void GLAPIENTRY
5912 save_EvalCoord1f(GLfloat x
)
5914 GET_CURRENT_CONTEXT(ctx
);
5916 SAVE_FLUSH_VERTICES(ctx
);
5917 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5921 if (ctx
->ExecuteFlag
) {
5922 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5926 static void GLAPIENTRY
5927 save_EvalCoord1fv(const GLfloat
* v
)
5929 save_EvalCoord1f(v
[0]);
5932 static void GLAPIENTRY
5933 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5935 GET_CURRENT_CONTEXT(ctx
);
5937 SAVE_FLUSH_VERTICES(ctx
);
5938 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5943 if (ctx
->ExecuteFlag
) {
5944 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5948 static void GLAPIENTRY
5949 save_EvalCoord2fv(const GLfloat
* v
)
5951 save_EvalCoord2f(v
[0], v
[1]);
5955 static void GLAPIENTRY
5956 save_EvalPoint1(GLint x
)
5958 GET_CURRENT_CONTEXT(ctx
);
5960 SAVE_FLUSH_VERTICES(ctx
);
5961 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5965 if (ctx
->ExecuteFlag
) {
5966 CALL_EvalPoint1(ctx
->Exec
, (x
));
5970 static void GLAPIENTRY
5971 save_EvalPoint2(GLint x
, GLint y
)
5973 GET_CURRENT_CONTEXT(ctx
);
5975 SAVE_FLUSH_VERTICES(ctx
);
5976 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5981 if (ctx
->ExecuteFlag
) {
5982 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5986 static void GLAPIENTRY
5987 save_Indexf(GLfloat x
)
5989 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5992 static void GLAPIENTRY
5993 save_Indexfv(const GLfloat
* v
)
5995 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5998 static void GLAPIENTRY
5999 save_EdgeFlag(GLboolean x
)
6001 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6006 * Compare 'count' elements of vectors 'a' and 'b'.
6007 * \return GL_TRUE if equal, GL_FALSE if different.
6009 static inline GLboolean
6010 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6012 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6017 * This glMaterial function is used for glMaterial calls that are outside
6018 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6020 static void GLAPIENTRY
6021 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6023 GET_CURRENT_CONTEXT(ctx
);
6031 case GL_FRONT_AND_BACK
:
6034 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6043 case GL_AMBIENT_AND_DIFFUSE
:
6049 case GL_COLOR_INDEXES
:
6053 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6057 if (ctx
->ExecuteFlag
) {
6058 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6061 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6063 /* Try to eliminate redundant statechanges. Because it is legal to
6064 * call glMaterial even inside begin/end calls, don't need to worry
6065 * about ctx->Driver.CurrentSavePrimitive here.
6067 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6068 if (bitmask
& (1 << i
)) {
6069 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6070 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6071 /* no change in material value */
6072 bitmask
&= ~(1 << i
);
6075 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6076 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6081 /* If this call has no effect, return early */
6085 SAVE_FLUSH_VERTICES(ctx
);
6087 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6091 for (i
= 0; i
< args
; i
++)
6092 n
[3 + i
].f
= param
[i
];
6096 static void GLAPIENTRY
6097 save_Begin(GLenum mode
)
6099 GET_CURRENT_CONTEXT(ctx
);
6101 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6102 /* compile this error into the display list */
6103 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6105 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6106 /* compile this error into the display list */
6107 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6110 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6112 vbo_save_NotifyBegin(ctx
, mode
, false);
6116 static void GLAPIENTRY
6119 GET_CURRENT_CONTEXT(ctx
);
6120 SAVE_FLUSH_VERTICES(ctx
);
6121 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6122 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6123 if (ctx
->ExecuteFlag
) {
6124 CALL_End(ctx
->Exec
, ());
6128 static void GLAPIENTRY
6129 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6131 GET_CURRENT_CONTEXT(ctx
);
6133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6134 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6141 if (ctx
->ExecuteFlag
) {
6142 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6147 static void GLAPIENTRY
6148 save_Vertex2f(GLfloat x
, GLfloat y
)
6150 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6153 static void GLAPIENTRY
6154 save_Vertex2fv(const GLfloat
* v
)
6156 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6159 static void GLAPIENTRY
6160 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6162 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6165 static void GLAPIENTRY
6166 save_Vertex3fv(const GLfloat
* v
)
6168 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6171 static void GLAPIENTRY
6172 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6174 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6177 static void GLAPIENTRY
6178 save_Vertex4fv(const GLfloat
* v
)
6180 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6183 static void GLAPIENTRY
6184 save_TexCoord1f(GLfloat x
)
6186 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6189 static void GLAPIENTRY
6190 save_TexCoord1fv(const GLfloat
* v
)
6192 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6195 static void GLAPIENTRY
6196 save_TexCoord2f(GLfloat x
, GLfloat y
)
6198 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6201 static void GLAPIENTRY
6202 save_TexCoord2fv(const GLfloat
* v
)
6204 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6207 static void GLAPIENTRY
6208 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6210 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6213 static void GLAPIENTRY
6214 save_TexCoord3fv(const GLfloat
* v
)
6216 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6219 static void GLAPIENTRY
6220 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6222 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6225 static void GLAPIENTRY
6226 save_TexCoord4fv(const GLfloat
* v
)
6228 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6231 static void GLAPIENTRY
6232 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6234 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6237 static void GLAPIENTRY
6238 save_Normal3fv(const GLfloat
* v
)
6240 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6243 static void GLAPIENTRY
6244 save_FogCoordfEXT(GLfloat x
)
6246 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6249 static void GLAPIENTRY
6250 save_FogCoordfvEXT(const GLfloat
* v
)
6252 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6255 static void GLAPIENTRY
6256 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6258 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6261 static void GLAPIENTRY
6262 save_Color3fv(const GLfloat
* v
)
6264 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6267 static void GLAPIENTRY
6268 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6270 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6273 static void GLAPIENTRY
6274 save_Color4fv(const GLfloat
* v
)
6276 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6279 static void GLAPIENTRY
6280 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6282 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6285 static void GLAPIENTRY
6286 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6288 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6292 /* Just call the respective ATTR for texcoord
6294 static void GLAPIENTRY
6295 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6297 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6298 save_Attr1fNV(attr
, x
);
6301 static void GLAPIENTRY
6302 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6304 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6305 save_Attr1fNV(attr
, v
[0]);
6308 static void GLAPIENTRY
6309 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6311 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6312 save_Attr2fNV(attr
, x
, y
);
6315 static void GLAPIENTRY
6316 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6318 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6319 save_Attr2fNV(attr
, v
[0], v
[1]);
6322 static void GLAPIENTRY
6323 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6325 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6326 save_Attr3fNV(attr
, x
, y
, z
);
6329 static void GLAPIENTRY
6330 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6332 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6333 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6336 static void GLAPIENTRY
6337 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6338 GLfloat z
, GLfloat w
)
6340 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6341 save_Attr4fNV(attr
, x
, y
, z
, w
);
6344 static void GLAPIENTRY
6345 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6347 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6348 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6353 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6359 GET_CURRENT_CONTEXT(ctx
);
6360 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6365 static void GLAPIENTRY
6366 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6368 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6369 save_Attr1fARB(index
, x
);
6374 static void GLAPIENTRY
6375 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6377 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6378 save_Attr1fARB(index
, v
[0]);
6383 static void GLAPIENTRY
6384 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6386 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6387 save_Attr2fARB(index
, x
, y
);
6392 static void GLAPIENTRY
6393 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6395 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6396 save_Attr2fARB(index
, v
[0], v
[1]);
6401 static void GLAPIENTRY
6402 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6404 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6405 save_Attr3fARB(index
, x
, y
, z
);
6410 static void GLAPIENTRY
6411 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6413 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6414 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6419 static void GLAPIENTRY
6420 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6423 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6424 save_Attr4fARB(index
, x
, y
, z
, w
);
6429 static void GLAPIENTRY
6430 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6432 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6433 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6438 static void GLAPIENTRY
6439 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6441 GET_CURRENT_CONTEXT(ctx
);
6443 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6445 SAVE_FLUSH_VERTICES(ctx
);
6446 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6449 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6452 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6453 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6455 if (ctx
->ExecuteFlag
) {
6456 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6463 static void GLAPIENTRY
6464 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6466 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6467 save_VertexAttribL1d(index
, v
[0]);
6472 static void GLAPIENTRY
6473 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6475 GET_CURRENT_CONTEXT(ctx
);
6477 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6479 SAVE_FLUSH_VERTICES(ctx
);
6480 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6483 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6484 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6487 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6488 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6489 2 * sizeof(GLdouble
));
6491 if (ctx
->ExecuteFlag
) {
6492 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6499 static void GLAPIENTRY
6500 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6502 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6503 save_VertexAttribL2d(index
, v
[0], v
[1]);
6508 static void GLAPIENTRY
6509 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6511 GET_CURRENT_CONTEXT(ctx
);
6513 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6515 SAVE_FLUSH_VERTICES(ctx
);
6516 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6519 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6520 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6521 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6524 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6525 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6526 3 * sizeof(GLdouble
));
6528 if (ctx
->ExecuteFlag
) {
6529 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6536 static void GLAPIENTRY
6537 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6539 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6540 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6545 static void GLAPIENTRY
6546 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6549 GET_CURRENT_CONTEXT(ctx
);
6551 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6553 SAVE_FLUSH_VERTICES(ctx
);
6554 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6557 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6558 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6559 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6560 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6563 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6564 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6565 4 * sizeof(GLdouble
));
6567 if (ctx
->ExecuteFlag
) {
6568 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6575 static void GLAPIENTRY
6576 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6578 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6579 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6584 static void GLAPIENTRY
6585 save_PrimitiveRestartNV(void)
6587 /* Note: this is used when outside a glBegin/End pair in a display list */
6588 GET_CURRENT_CONTEXT(ctx
);
6589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6590 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6591 if (ctx
->ExecuteFlag
) {
6592 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6597 static void GLAPIENTRY
6598 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6599 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6600 GLbitfield mask
, GLenum filter
)
6602 GET_CURRENT_CONTEXT(ctx
);
6604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6605 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6618 if (ctx
->ExecuteFlag
) {
6619 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6620 dstX0
, dstY0
, dstX1
, dstY1
,
6626 /** GL_EXT_provoking_vertex */
6627 static void GLAPIENTRY
6628 save_ProvokingVertexEXT(GLenum mode
)
6630 GET_CURRENT_CONTEXT(ctx
);
6632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6633 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6637 if (ctx
->ExecuteFlag
) {
6638 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6639 _mesa_ProvokingVertex(mode
);
6644 /** GL_EXT_transform_feedback */
6645 static void GLAPIENTRY
6646 save_BeginTransformFeedback(GLenum mode
)
6648 GET_CURRENT_CONTEXT(ctx
);
6650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6651 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6655 if (ctx
->ExecuteFlag
) {
6656 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6661 /** GL_EXT_transform_feedback */
6662 static void GLAPIENTRY
6663 save_EndTransformFeedback(void)
6665 GET_CURRENT_CONTEXT(ctx
);
6666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6667 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6668 if (ctx
->ExecuteFlag
) {
6669 CALL_EndTransformFeedback(ctx
->Exec
, ());
6673 static void GLAPIENTRY
6674 save_BindTransformFeedback(GLenum target
, GLuint name
)
6676 GET_CURRENT_CONTEXT(ctx
);
6678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6679 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6684 if (ctx
->ExecuteFlag
) {
6685 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6689 static void GLAPIENTRY
6690 save_PauseTransformFeedback(void)
6692 GET_CURRENT_CONTEXT(ctx
);
6693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6694 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6695 if (ctx
->ExecuteFlag
) {
6696 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6700 static void GLAPIENTRY
6701 save_ResumeTransformFeedback(void)
6703 GET_CURRENT_CONTEXT(ctx
);
6704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6705 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6706 if (ctx
->ExecuteFlag
) {
6707 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6711 static void GLAPIENTRY
6712 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6714 GET_CURRENT_CONTEXT(ctx
);
6716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6717 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6722 if (ctx
->ExecuteFlag
) {
6723 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6727 static void GLAPIENTRY
6728 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6730 GET_CURRENT_CONTEXT(ctx
);
6732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6733 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6739 if (ctx
->ExecuteFlag
) {
6740 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6744 static void GLAPIENTRY
6745 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6748 GET_CURRENT_CONTEXT(ctx
);
6750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6751 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6755 n
[3].si
= primcount
;
6757 if (ctx
->ExecuteFlag
) {
6758 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6762 static void GLAPIENTRY
6763 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6764 GLuint stream
, GLsizei primcount
)
6766 GET_CURRENT_CONTEXT(ctx
);
6768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6769 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6774 n
[4].si
= primcount
;
6776 if (ctx
->ExecuteFlag
) {
6777 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6782 static void GLAPIENTRY
6783 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6784 GLuint num_groups_z
)
6786 GET_CURRENT_CONTEXT(ctx
);
6788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6789 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6791 n
[1].ui
= num_groups_x
;
6792 n
[2].ui
= num_groups_y
;
6793 n
[3].ui
= num_groups_z
;
6795 if (ctx
->ExecuteFlag
) {
6796 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6801 static void GLAPIENTRY
6802 save_DispatchComputeIndirect(GLintptr indirect
)
6804 GET_CURRENT_CONTEXT(ctx
);
6805 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6806 "glDispatchComputeIndirect() during display list compile");
6809 static void GLAPIENTRY
6810 save_UseProgram(GLuint program
)
6812 GET_CURRENT_CONTEXT(ctx
);
6814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6815 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6819 if (ctx
->ExecuteFlag
) {
6820 CALL_UseProgram(ctx
->Exec
, (program
));
6825 static void GLAPIENTRY
6826 save_Uniform1fARB(GLint location
, GLfloat x
)
6828 GET_CURRENT_CONTEXT(ctx
);
6830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6831 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6836 if (ctx
->ExecuteFlag
) {
6837 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6842 static void GLAPIENTRY
6843 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6854 if (ctx
->ExecuteFlag
) {
6855 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6860 static void GLAPIENTRY
6861 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6863 GET_CURRENT_CONTEXT(ctx
);
6865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6866 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6873 if (ctx
->ExecuteFlag
) {
6874 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6879 static void GLAPIENTRY
6880 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6882 GET_CURRENT_CONTEXT(ctx
);
6884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6885 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6893 if (ctx
->ExecuteFlag
) {
6894 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6899 static void GLAPIENTRY
6900 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6902 GET_CURRENT_CONTEXT(ctx
);
6904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6905 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6909 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6911 if (ctx
->ExecuteFlag
) {
6912 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6916 static void GLAPIENTRY
6917 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6919 GET_CURRENT_CONTEXT(ctx
);
6921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6922 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6926 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6928 if (ctx
->ExecuteFlag
) {
6929 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6933 static void GLAPIENTRY
6934 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6936 GET_CURRENT_CONTEXT(ctx
);
6938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6939 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6943 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6945 if (ctx
->ExecuteFlag
) {
6946 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6950 static void GLAPIENTRY
6951 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6953 GET_CURRENT_CONTEXT(ctx
);
6955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6956 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6960 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6962 if (ctx
->ExecuteFlag
) {
6963 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6968 static void GLAPIENTRY
6969 save_Uniform1d(GLint location
, GLdouble x
)
6971 GET_CURRENT_CONTEXT(ctx
);
6973 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6974 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
6977 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6979 if (ctx
->ExecuteFlag
) {
6980 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
6985 static void GLAPIENTRY
6986 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
6988 GET_CURRENT_CONTEXT(ctx
);
6990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6991 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
6994 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6995 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6997 if (ctx
->ExecuteFlag
) {
6998 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7003 static void GLAPIENTRY
7004 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7006 GET_CURRENT_CONTEXT(ctx
);
7008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7009 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7012 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7013 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7014 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7016 if (ctx
->ExecuteFlag
) {
7017 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7022 static void GLAPIENTRY
7023 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7025 GET_CURRENT_CONTEXT(ctx
);
7027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7028 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7031 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7032 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7033 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7034 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7036 if (ctx
->ExecuteFlag
) {
7037 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7042 static void GLAPIENTRY
7043 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7045 GET_CURRENT_CONTEXT(ctx
);
7047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7048 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7052 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7054 if (ctx
->ExecuteFlag
) {
7055 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7060 static void GLAPIENTRY
7061 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7063 GET_CURRENT_CONTEXT(ctx
);
7065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7066 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7070 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7072 if (ctx
->ExecuteFlag
) {
7073 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7078 static void GLAPIENTRY
7079 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7081 GET_CURRENT_CONTEXT(ctx
);
7083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7084 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7088 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7090 if (ctx
->ExecuteFlag
) {
7091 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7096 static void GLAPIENTRY
7097 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7099 GET_CURRENT_CONTEXT(ctx
);
7101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7102 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7106 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7108 if (ctx
->ExecuteFlag
) {
7109 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7114 static void GLAPIENTRY
7115 save_Uniform1iARB(GLint location
, GLint x
)
7117 GET_CURRENT_CONTEXT(ctx
);
7119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7120 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7125 if (ctx
->ExecuteFlag
) {
7126 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7130 static void GLAPIENTRY
7131 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7133 GET_CURRENT_CONTEXT(ctx
);
7135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7136 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7142 if (ctx
->ExecuteFlag
) {
7143 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7147 static void GLAPIENTRY
7148 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7150 GET_CURRENT_CONTEXT(ctx
);
7152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7153 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7160 if (ctx
->ExecuteFlag
) {
7161 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7165 static void GLAPIENTRY
7166 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7168 GET_CURRENT_CONTEXT(ctx
);
7170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7171 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7179 if (ctx
->ExecuteFlag
) {
7180 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7186 static void GLAPIENTRY
7187 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7189 GET_CURRENT_CONTEXT(ctx
);
7191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7192 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7196 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7198 if (ctx
->ExecuteFlag
) {
7199 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7203 static void GLAPIENTRY
7204 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7206 GET_CURRENT_CONTEXT(ctx
);
7208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7209 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7213 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7215 if (ctx
->ExecuteFlag
) {
7216 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7220 static void GLAPIENTRY
7221 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7223 GET_CURRENT_CONTEXT(ctx
);
7225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7226 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7230 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7232 if (ctx
->ExecuteFlag
) {
7233 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7237 static void GLAPIENTRY
7238 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7240 GET_CURRENT_CONTEXT(ctx
);
7242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7243 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7247 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7249 if (ctx
->ExecuteFlag
) {
7250 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7256 static void GLAPIENTRY
7257 save_Uniform1ui(GLint location
, GLuint x
)
7259 GET_CURRENT_CONTEXT(ctx
);
7261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7262 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7267 if (ctx
->ExecuteFlag
) {
7268 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7272 static void GLAPIENTRY
7273 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7275 GET_CURRENT_CONTEXT(ctx
);
7277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7278 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7284 if (ctx
->ExecuteFlag
) {
7285 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7289 static void GLAPIENTRY
7290 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7292 GET_CURRENT_CONTEXT(ctx
);
7294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7295 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7302 if (ctx
->ExecuteFlag
) {
7303 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7307 static void GLAPIENTRY
7308 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7310 GET_CURRENT_CONTEXT(ctx
);
7312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7313 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7321 if (ctx
->ExecuteFlag
) {
7322 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7328 static void GLAPIENTRY
7329 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7331 GET_CURRENT_CONTEXT(ctx
);
7333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7334 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7338 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7340 if (ctx
->ExecuteFlag
) {
7341 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7345 static void GLAPIENTRY
7346 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7348 GET_CURRENT_CONTEXT(ctx
);
7350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7351 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7355 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7357 if (ctx
->ExecuteFlag
) {
7358 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7362 static void GLAPIENTRY
7363 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7365 GET_CURRENT_CONTEXT(ctx
);
7367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7368 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7372 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7374 if (ctx
->ExecuteFlag
) {
7375 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7379 static void GLAPIENTRY
7380 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7382 GET_CURRENT_CONTEXT(ctx
);
7384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7385 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7389 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7391 if (ctx
->ExecuteFlag
) {
7392 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7398 static void GLAPIENTRY
7399 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7402 GET_CURRENT_CONTEXT(ctx
);
7404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7405 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7410 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7412 if (ctx
->ExecuteFlag
) {
7413 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7417 static void GLAPIENTRY
7418 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7421 GET_CURRENT_CONTEXT(ctx
);
7423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7424 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7429 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7431 if (ctx
->ExecuteFlag
) {
7432 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7436 static void GLAPIENTRY
7437 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7440 GET_CURRENT_CONTEXT(ctx
);
7442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7443 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7448 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7450 if (ctx
->ExecuteFlag
) {
7451 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7456 static void GLAPIENTRY
7457 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7460 GET_CURRENT_CONTEXT(ctx
);
7462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7463 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7468 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7470 if (ctx
->ExecuteFlag
) {
7471 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7475 static void GLAPIENTRY
7476 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7479 GET_CURRENT_CONTEXT(ctx
);
7481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7482 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7487 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7489 if (ctx
->ExecuteFlag
) {
7490 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7495 static void GLAPIENTRY
7496 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7499 GET_CURRENT_CONTEXT(ctx
);
7501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7502 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7507 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7509 if (ctx
->ExecuteFlag
) {
7510 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7514 static void GLAPIENTRY
7515 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7518 GET_CURRENT_CONTEXT(ctx
);
7520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7521 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7526 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7528 if (ctx
->ExecuteFlag
) {
7529 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7534 static void GLAPIENTRY
7535 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7538 GET_CURRENT_CONTEXT(ctx
);
7540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7541 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7546 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7548 if (ctx
->ExecuteFlag
) {
7549 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7553 static void GLAPIENTRY
7554 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7557 GET_CURRENT_CONTEXT(ctx
);
7559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7560 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7565 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7567 if (ctx
->ExecuteFlag
) {
7568 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7573 static void GLAPIENTRY
7574 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7577 GET_CURRENT_CONTEXT(ctx
);
7579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7580 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7585 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7587 if (ctx
->ExecuteFlag
) {
7588 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7592 static void GLAPIENTRY
7593 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7596 GET_CURRENT_CONTEXT(ctx
);
7598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7599 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7604 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7606 if (ctx
->ExecuteFlag
) {
7607 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7611 static void GLAPIENTRY
7612 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7615 GET_CURRENT_CONTEXT(ctx
);
7617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7618 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7623 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7625 if (ctx
->ExecuteFlag
) {
7626 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7631 static void GLAPIENTRY
7632 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7635 GET_CURRENT_CONTEXT(ctx
);
7637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7638 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7643 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7645 if (ctx
->ExecuteFlag
) {
7646 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7651 static void GLAPIENTRY
7652 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7655 GET_CURRENT_CONTEXT(ctx
);
7657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7658 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7663 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7665 if (ctx
->ExecuteFlag
) {
7666 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7671 static void GLAPIENTRY
7672 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7675 GET_CURRENT_CONTEXT(ctx
);
7677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7678 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7683 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7685 if (ctx
->ExecuteFlag
) {
7686 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7690 static void GLAPIENTRY
7691 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7694 GET_CURRENT_CONTEXT(ctx
);
7696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7697 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7702 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7704 if (ctx
->ExecuteFlag
) {
7705 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7710 static void GLAPIENTRY
7711 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7714 GET_CURRENT_CONTEXT(ctx
);
7716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7717 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7722 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7724 if (ctx
->ExecuteFlag
) {
7725 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7730 static void GLAPIENTRY
7731 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7734 GET_CURRENT_CONTEXT(ctx
);
7736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7737 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7742 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7744 if (ctx
->ExecuteFlag
) {
7745 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7750 static void GLAPIENTRY
7751 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7753 GET_CURRENT_CONTEXT(ctx
);
7755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7756 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7762 if (ctx
->ExecuteFlag
) {
7763 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7767 static void GLAPIENTRY
7768 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7770 GET_CURRENT_CONTEXT(ctx
);
7772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7773 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7779 if (ctx
->ExecuteFlag
) {
7780 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7784 static void GLAPIENTRY
7785 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7787 GET_CURRENT_CONTEXT(ctx
);
7789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7790 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7797 if (ctx
->ExecuteFlag
) {
7798 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7802 static void GLAPIENTRY
7803 save_ProgramUniform3f(GLuint program
, GLint location
,
7804 GLfloat x
, GLfloat y
, GLfloat z
)
7806 GET_CURRENT_CONTEXT(ctx
);
7808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7809 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7817 if (ctx
->ExecuteFlag
) {
7818 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7822 static void GLAPIENTRY
7823 save_ProgramUniform4f(GLuint program
, GLint location
,
7824 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7826 GET_CURRENT_CONTEXT(ctx
);
7828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7829 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7838 if (ctx
->ExecuteFlag
) {
7839 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7843 static void GLAPIENTRY
7844 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7847 GET_CURRENT_CONTEXT(ctx
);
7849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7850 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7855 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7857 if (ctx
->ExecuteFlag
) {
7858 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7862 static void GLAPIENTRY
7863 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7866 GET_CURRENT_CONTEXT(ctx
);
7868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7869 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7874 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7876 if (ctx
->ExecuteFlag
) {
7877 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7881 static void GLAPIENTRY
7882 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7885 GET_CURRENT_CONTEXT(ctx
);
7887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7888 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7893 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7895 if (ctx
->ExecuteFlag
) {
7896 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7900 static void GLAPIENTRY
7901 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7904 GET_CURRENT_CONTEXT(ctx
);
7906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7907 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7912 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7914 if (ctx
->ExecuteFlag
) {
7915 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7919 static void GLAPIENTRY
7920 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7922 GET_CURRENT_CONTEXT(ctx
);
7924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7925 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7929 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7931 if (ctx
->ExecuteFlag
) {
7932 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7936 static void GLAPIENTRY
7937 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7939 GET_CURRENT_CONTEXT(ctx
);
7941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7942 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7946 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7947 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7949 if (ctx
->ExecuteFlag
) {
7950 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7954 static void GLAPIENTRY
7955 save_ProgramUniform3d(GLuint program
, GLint location
,
7956 GLdouble x
, GLdouble y
, GLdouble z
)
7958 GET_CURRENT_CONTEXT(ctx
);
7960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7961 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
7965 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7966 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7967 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7969 if (ctx
->ExecuteFlag
) {
7970 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
7974 static void GLAPIENTRY
7975 save_ProgramUniform4d(GLuint program
, GLint location
,
7976 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7978 GET_CURRENT_CONTEXT(ctx
);
7980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7981 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
7985 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7986 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7987 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7988 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
7990 if (ctx
->ExecuteFlag
) {
7991 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7995 static void GLAPIENTRY
7996 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
7999 GET_CURRENT_CONTEXT(ctx
);
8001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8002 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8007 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8009 if (ctx
->ExecuteFlag
) {
8010 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8014 static void GLAPIENTRY
8015 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8018 GET_CURRENT_CONTEXT(ctx
);
8020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8021 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8026 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8028 if (ctx
->ExecuteFlag
) {
8029 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8033 static void GLAPIENTRY
8034 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8037 GET_CURRENT_CONTEXT(ctx
);
8039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8040 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8045 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8047 if (ctx
->ExecuteFlag
) {
8048 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8052 static void GLAPIENTRY
8053 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8056 GET_CURRENT_CONTEXT(ctx
);
8058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8059 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8064 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8066 if (ctx
->ExecuteFlag
) {
8067 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8071 static void GLAPIENTRY
8072 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8074 GET_CURRENT_CONTEXT(ctx
);
8076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8077 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8083 if (ctx
->ExecuteFlag
) {
8084 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8088 static void GLAPIENTRY
8089 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8091 GET_CURRENT_CONTEXT(ctx
);
8093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8094 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8101 if (ctx
->ExecuteFlag
) {
8102 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8106 static void GLAPIENTRY
8107 save_ProgramUniform3i(GLuint program
, GLint location
,
8108 GLint x
, GLint y
, GLint z
)
8110 GET_CURRENT_CONTEXT(ctx
);
8112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8113 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8121 if (ctx
->ExecuteFlag
) {
8122 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8126 static void GLAPIENTRY
8127 save_ProgramUniform4i(GLuint program
, GLint location
,
8128 GLint x
, GLint y
, GLint z
, GLint w
)
8130 GET_CURRENT_CONTEXT(ctx
);
8132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8133 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8142 if (ctx
->ExecuteFlag
) {
8143 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8147 static void GLAPIENTRY
8148 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8151 GET_CURRENT_CONTEXT(ctx
);
8153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8154 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8159 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8161 if (ctx
->ExecuteFlag
) {
8162 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8166 static void GLAPIENTRY
8167 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8170 GET_CURRENT_CONTEXT(ctx
);
8172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8173 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8178 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8180 if (ctx
->ExecuteFlag
) {
8181 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8185 static void GLAPIENTRY
8186 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8189 GET_CURRENT_CONTEXT(ctx
);
8191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8192 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8197 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8199 if (ctx
->ExecuteFlag
) {
8200 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8204 static void GLAPIENTRY
8205 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8208 GET_CURRENT_CONTEXT(ctx
);
8210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8211 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8216 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8218 if (ctx
->ExecuteFlag
) {
8219 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8223 static void GLAPIENTRY
8224 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8226 GET_CURRENT_CONTEXT(ctx
);
8228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8229 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8235 if (ctx
->ExecuteFlag
) {
8236 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8240 static void GLAPIENTRY
8241 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8243 GET_CURRENT_CONTEXT(ctx
);
8245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8246 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8253 if (ctx
->ExecuteFlag
) {
8254 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8258 static void GLAPIENTRY
8259 save_ProgramUniform3ui(GLuint program
, GLint location
,
8260 GLuint x
, GLuint y
, GLuint z
)
8262 GET_CURRENT_CONTEXT(ctx
);
8264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8265 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8273 if (ctx
->ExecuteFlag
) {
8274 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8278 static void GLAPIENTRY
8279 save_ProgramUniform4ui(GLuint program
, GLint location
,
8280 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8282 GET_CURRENT_CONTEXT(ctx
);
8284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8285 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8294 if (ctx
->ExecuteFlag
) {
8295 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8299 static void GLAPIENTRY
8300 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8303 GET_CURRENT_CONTEXT(ctx
);
8305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8306 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8311 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8313 if (ctx
->ExecuteFlag
) {
8314 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8318 static void GLAPIENTRY
8319 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8322 GET_CURRENT_CONTEXT(ctx
);
8324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8325 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8330 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8332 if (ctx
->ExecuteFlag
) {
8333 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8337 static void GLAPIENTRY
8338 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8341 GET_CURRENT_CONTEXT(ctx
);
8343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8344 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8349 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8351 if (ctx
->ExecuteFlag
) {
8352 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8356 static void GLAPIENTRY
8357 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8360 GET_CURRENT_CONTEXT(ctx
);
8362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8363 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8368 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8370 if (ctx
->ExecuteFlag
) {
8371 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8375 static void GLAPIENTRY
8376 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8377 GLboolean transpose
, const GLfloat
*v
)
8379 GET_CURRENT_CONTEXT(ctx
);
8381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8382 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8383 4 + POINTER_DWORDS
);
8389 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8391 if (ctx
->ExecuteFlag
) {
8392 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8393 (program
, location
, count
, transpose
, v
));
8397 static void GLAPIENTRY
8398 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8399 GLboolean transpose
, const GLfloat
*v
)
8401 GET_CURRENT_CONTEXT(ctx
);
8403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8404 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8405 4 + POINTER_DWORDS
);
8411 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8413 if (ctx
->ExecuteFlag
) {
8414 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8415 (program
, location
, count
, transpose
, v
));
8419 static void GLAPIENTRY
8420 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8421 GLboolean transpose
, const GLfloat
*v
)
8423 GET_CURRENT_CONTEXT(ctx
);
8425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8426 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8427 4 + POINTER_DWORDS
);
8433 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8435 if (ctx
->ExecuteFlag
) {
8436 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8437 (program
, location
, count
, transpose
, v
));
8441 static void GLAPIENTRY
8442 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8443 GLboolean transpose
, const GLfloat
*v
)
8445 GET_CURRENT_CONTEXT(ctx
);
8447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8448 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8449 4 + POINTER_DWORDS
);
8455 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8457 if (ctx
->ExecuteFlag
) {
8458 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8459 (program
, location
, count
, transpose
, v
));
8463 static void GLAPIENTRY
8464 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8465 GLboolean transpose
, const GLfloat
*v
)
8467 GET_CURRENT_CONTEXT(ctx
);
8469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8470 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8471 4 + POINTER_DWORDS
);
8477 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8479 if (ctx
->ExecuteFlag
) {
8480 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8481 (program
, location
, count
, transpose
, v
));
8485 static void GLAPIENTRY
8486 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8487 GLboolean transpose
, const GLfloat
*v
)
8489 GET_CURRENT_CONTEXT(ctx
);
8491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8492 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8493 4 + POINTER_DWORDS
);
8499 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8501 if (ctx
->ExecuteFlag
) {
8502 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8503 (program
, location
, count
, transpose
, v
));
8507 static void GLAPIENTRY
8508 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8509 GLboolean transpose
, const GLfloat
*v
)
8511 GET_CURRENT_CONTEXT(ctx
);
8513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8514 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8515 4 + POINTER_DWORDS
);
8521 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8523 if (ctx
->ExecuteFlag
) {
8524 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8525 (program
, location
, count
, transpose
, v
));
8529 static void GLAPIENTRY
8530 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8531 GLboolean transpose
, const GLfloat
*v
)
8533 GET_CURRENT_CONTEXT(ctx
);
8535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8536 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8537 4 + POINTER_DWORDS
);
8543 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8545 if (ctx
->ExecuteFlag
) {
8546 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8547 (program
, location
, count
, transpose
, v
));
8551 static void GLAPIENTRY
8552 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8553 GLboolean transpose
, const GLfloat
*v
)
8555 GET_CURRENT_CONTEXT(ctx
);
8557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8558 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8559 4 + POINTER_DWORDS
);
8565 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8567 if (ctx
->ExecuteFlag
) {
8568 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8569 (program
, location
, count
, transpose
, v
));
8573 static void GLAPIENTRY
8574 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8575 GLboolean transpose
, const GLdouble
*v
)
8577 GET_CURRENT_CONTEXT(ctx
);
8579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8580 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8581 4 + POINTER_DWORDS
);
8587 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8589 if (ctx
->ExecuteFlag
) {
8590 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8591 (program
, location
, count
, transpose
, v
));
8595 static void GLAPIENTRY
8596 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8597 GLboolean transpose
, const GLdouble
*v
)
8599 GET_CURRENT_CONTEXT(ctx
);
8601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8602 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8603 4 + POINTER_DWORDS
);
8609 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8611 if (ctx
->ExecuteFlag
) {
8612 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8613 (program
, location
, count
, transpose
, v
));
8617 static void GLAPIENTRY
8618 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8619 GLboolean transpose
, const GLdouble
*v
)
8621 GET_CURRENT_CONTEXT(ctx
);
8623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8624 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8625 4 + POINTER_DWORDS
);
8631 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8633 if (ctx
->ExecuteFlag
) {
8634 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8635 (program
, location
, count
, transpose
, v
));
8639 static void GLAPIENTRY
8640 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8641 GLboolean transpose
, const GLdouble
*v
)
8643 GET_CURRENT_CONTEXT(ctx
);
8645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8646 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8647 4 + POINTER_DWORDS
);
8653 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8655 if (ctx
->ExecuteFlag
) {
8656 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8657 (program
, location
, count
, transpose
, v
));
8661 static void GLAPIENTRY
8662 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8663 GLboolean transpose
, const GLdouble
*v
)
8665 GET_CURRENT_CONTEXT(ctx
);
8667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8668 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8669 4 + POINTER_DWORDS
);
8675 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8677 if (ctx
->ExecuteFlag
) {
8678 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8679 (program
, location
, count
, transpose
, v
));
8683 static void GLAPIENTRY
8684 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8685 GLboolean transpose
, const GLdouble
*v
)
8687 GET_CURRENT_CONTEXT(ctx
);
8689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8690 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8691 4 + POINTER_DWORDS
);
8697 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8699 if (ctx
->ExecuteFlag
) {
8700 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8701 (program
, location
, count
, transpose
, v
));
8705 static void GLAPIENTRY
8706 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8707 GLboolean transpose
, const GLdouble
*v
)
8709 GET_CURRENT_CONTEXT(ctx
);
8711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8712 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8713 4 + POINTER_DWORDS
);
8719 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8721 if (ctx
->ExecuteFlag
) {
8722 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8723 (program
, location
, count
, transpose
, v
));
8727 static void GLAPIENTRY
8728 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8729 GLboolean transpose
, const GLdouble
*v
)
8731 GET_CURRENT_CONTEXT(ctx
);
8733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8734 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8735 4 + POINTER_DWORDS
);
8741 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8743 if (ctx
->ExecuteFlag
) {
8744 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8745 (program
, location
, count
, transpose
, v
));
8749 static void GLAPIENTRY
8750 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8751 GLboolean transpose
, const GLdouble
*v
)
8753 GET_CURRENT_CONTEXT(ctx
);
8755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8756 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8757 4 + POINTER_DWORDS
);
8763 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8765 if (ctx
->ExecuteFlag
) {
8766 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8767 (program
, location
, count
, transpose
, v
));
8771 static void GLAPIENTRY
8772 save_ClipControl(GLenum origin
, GLenum depth
)
8774 GET_CURRENT_CONTEXT(ctx
);
8776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8777 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8782 if (ctx
->ExecuteFlag
) {
8783 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8787 static void GLAPIENTRY
8788 save_ClampColorARB(GLenum target
, GLenum clamp
)
8790 GET_CURRENT_CONTEXT(ctx
);
8792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8793 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8798 if (ctx
->ExecuteFlag
) {
8799 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8803 /** GL_EXT_texture_integer */
8804 static void GLAPIENTRY
8805 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8807 GET_CURRENT_CONTEXT(ctx
);
8809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8810 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8817 if (ctx
->ExecuteFlag
) {
8818 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8822 /** GL_EXT_texture_integer */
8823 static void GLAPIENTRY
8824 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8826 GET_CURRENT_CONTEXT(ctx
);
8828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8829 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8836 if (ctx
->ExecuteFlag
) {
8837 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8841 /** GL_EXT_texture_integer */
8842 static void GLAPIENTRY
8843 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8845 GET_CURRENT_CONTEXT(ctx
);
8847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8848 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8857 if (ctx
->ExecuteFlag
) {
8858 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8862 /** GL_EXT_texture_integer */
8863 static void GLAPIENTRY
8864 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8866 GET_CURRENT_CONTEXT(ctx
);
8868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8869 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8873 n
[3].ui
= params
[0];
8874 n
[4].ui
= params
[1];
8875 n
[5].ui
= params
[2];
8876 n
[6].ui
= params
[3];
8878 if (ctx
->ExecuteFlag
) {
8879 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8883 /* GL_ARB_instanced_arrays */
8884 static void GLAPIENTRY
8885 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8887 GET_CURRENT_CONTEXT(ctx
);
8889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8890 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8895 if (ctx
->ExecuteFlag
) {
8896 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8901 /* GL_NV_texture_barrier */
8902 static void GLAPIENTRY
8903 save_TextureBarrierNV(void)
8905 GET_CURRENT_CONTEXT(ctx
);
8906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8907 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8908 if (ctx
->ExecuteFlag
) {
8909 CALL_TextureBarrierNV(ctx
->Exec
, ());
8914 /* GL_ARB_sampler_objects */
8915 static void GLAPIENTRY
8916 save_BindSampler(GLuint unit
, GLuint sampler
)
8919 GET_CURRENT_CONTEXT(ctx
);
8920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8921 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8926 if (ctx
->ExecuteFlag
) {
8927 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8931 static void GLAPIENTRY
8932 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8935 GET_CURRENT_CONTEXT(ctx
);
8936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8937 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8942 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8948 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8951 if (ctx
->ExecuteFlag
) {
8952 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8956 static void GLAPIENTRY
8957 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8961 parray
[1] = parray
[2] = parray
[3] = 0;
8962 save_SamplerParameteriv(sampler
, pname
, parray
);
8965 static void GLAPIENTRY
8966 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
8969 GET_CURRENT_CONTEXT(ctx
);
8970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8971 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
8976 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8982 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
8985 if (ctx
->ExecuteFlag
) {
8986 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
8990 static void GLAPIENTRY
8991 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
8995 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
8996 save_SamplerParameterfv(sampler
, pname
, parray
);
8999 static void GLAPIENTRY
9000 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9003 GET_CURRENT_CONTEXT(ctx
);
9004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9005 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9010 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9016 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9019 if (ctx
->ExecuteFlag
) {
9020 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9024 static void GLAPIENTRY
9025 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9028 GET_CURRENT_CONTEXT(ctx
);
9029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9030 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9034 n
[3].ui
= params
[0];
9035 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9036 n
[4].ui
= params
[1];
9037 n
[5].ui
= params
[2];
9038 n
[6].ui
= params
[3];
9041 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9044 if (ctx
->ExecuteFlag
) {
9045 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9049 static void GLAPIENTRY
9050 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9053 GET_CURRENT_CONTEXT(ctx
);
9054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9055 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9057 union uint64_pair p
;
9060 n
[2].ui
= p
.uint32
[0];
9061 n
[3].ui
= p
.uint32
[1];
9062 save_pointer(&n
[4], sync
);
9064 if (ctx
->ExecuteFlag
) {
9065 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9070 /** GL_NV_conditional_render */
9071 static void GLAPIENTRY
9072 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9074 GET_CURRENT_CONTEXT(ctx
);
9076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9077 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9082 if (ctx
->ExecuteFlag
) {
9083 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9087 static void GLAPIENTRY
9088 save_EndConditionalRender(void)
9090 GET_CURRENT_CONTEXT(ctx
);
9091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9092 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9093 if (ctx
->ExecuteFlag
) {
9094 CALL_EndConditionalRender(ctx
->Exec
, ());
9098 static void GLAPIENTRY
9099 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9101 GET_CURRENT_CONTEXT(ctx
);
9103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9104 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9110 if (ctx
->ExecuteFlag
) {
9111 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9115 static void GLAPIENTRY
9116 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9117 const GLuint
*indices
)
9119 GET_CURRENT_CONTEXT(ctx
);
9121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9122 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9124 GLint
*indices_copy
= NULL
;
9127 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9128 n
[1].e
= shadertype
;
9130 save_pointer(&n
[3], indices_copy
);
9132 if (ctx
->ExecuteFlag
) {
9133 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9137 /** GL_EXT_window_rectangles */
9138 static void GLAPIENTRY
9139 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9141 GET_CURRENT_CONTEXT(ctx
);
9143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9144 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9146 GLint
*box_copy
= NULL
;
9149 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9152 save_pointer(&n
[3], box_copy
);
9154 if (ctx
->ExecuteFlag
) {
9155 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9160 /** GL_NV_conservative_raster */
9161 static void GLAPIENTRY
9162 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9164 GET_CURRENT_CONTEXT(ctx
);
9166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9167 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9172 if (ctx
->ExecuteFlag
) {
9173 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9177 /** GL_NV_conservative_raster_dilate */
9178 static void GLAPIENTRY
9179 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9181 GET_CURRENT_CONTEXT(ctx
);
9183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9184 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9189 if (ctx
->ExecuteFlag
) {
9190 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9194 /** GL_NV_conservative_raster_pre_snap_triangles */
9195 static void GLAPIENTRY
9196 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9198 GET_CURRENT_CONTEXT(ctx
);
9200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9201 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9206 if (ctx
->ExecuteFlag
) {
9207 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9211 /** GL_EXT_direct_state_access */
9213 static void GLAPIENTRY
9214 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9216 GET_CURRENT_CONTEXT(ctx
);
9218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9219 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9221 n
[1].e
= matrixMode
;
9222 for (unsigned i
= 0; i
< 16; i
++) {
9226 if (ctx
->ExecuteFlag
) {
9227 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9231 static void GLAPIENTRY
9232 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9235 for (unsigned i
= 0; i
< 16; i
++) {
9236 f
[i
] = (GLfloat
) m
[i
];
9238 save_MatrixLoadfEXT(matrixMode
, f
);
9241 static void GLAPIENTRY
9242 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9244 GET_CURRENT_CONTEXT(ctx
);
9246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9247 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9249 n
[1].e
= matrixMode
;
9250 for (unsigned i
= 0; i
< 16; i
++) {
9254 if (ctx
->ExecuteFlag
) {
9255 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9259 static void GLAPIENTRY
9260 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9263 for (unsigned i
= 0; i
< 16; i
++) {
9264 f
[i
] = (GLfloat
) m
[i
];
9266 save_MatrixMultfEXT(matrixMode
, f
);
9269 static void GLAPIENTRY
9270 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9272 GET_CURRENT_CONTEXT(ctx
);
9274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9275 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9277 n
[1].e
= matrixMode
;
9283 if (ctx
->ExecuteFlag
) {
9284 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9288 static void GLAPIENTRY
9289 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9291 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9294 static void GLAPIENTRY
9295 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9297 GET_CURRENT_CONTEXT(ctx
);
9299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9300 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9302 n
[1].e
= matrixMode
;
9307 if (ctx
->ExecuteFlag
) {
9308 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9312 static void GLAPIENTRY
9313 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9315 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9318 static void GLAPIENTRY
9319 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9321 GET_CURRENT_CONTEXT(ctx
);
9323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9324 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9326 n
[1].e
= matrixMode
;
9331 if (ctx
->ExecuteFlag
) {
9332 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9336 static void GLAPIENTRY
9337 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9339 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9342 static void GLAPIENTRY
9343 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9345 GET_CURRENT_CONTEXT(ctx
);
9347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9348 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9350 n
[1].e
= matrixMode
;
9352 if (ctx
->ExecuteFlag
) {
9353 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9357 static void GLAPIENTRY
9358 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9359 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9361 GET_CURRENT_CONTEXT(ctx
);
9363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9364 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9366 n
[1].e
= matrixMode
;
9367 n
[2].f
= (GLfloat
) left
;
9368 n
[3].f
= (GLfloat
) right
;
9369 n
[4].f
= (GLfloat
) bottom
;
9370 n
[5].f
= (GLfloat
) top
;
9371 n
[6].f
= (GLfloat
) nearval
;
9372 n
[7].f
= (GLfloat
) farval
;
9374 if (ctx
->ExecuteFlag
) {
9375 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9380 static void GLAPIENTRY
9381 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9382 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9384 GET_CURRENT_CONTEXT(ctx
);
9386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9387 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9389 n
[1].e
= matrixMode
;
9390 n
[2].f
= (GLfloat
) left
;
9391 n
[3].f
= (GLfloat
) right
;
9392 n
[4].f
= (GLfloat
) bottom
;
9393 n
[5].f
= (GLfloat
) top
;
9394 n
[6].f
= (GLfloat
) nearval
;
9395 n
[7].f
= (GLfloat
) farval
;
9397 if (ctx
->ExecuteFlag
) {
9398 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9402 static void GLAPIENTRY
9403 save_MatrixPushEXT(GLenum matrixMode
)
9405 GET_CURRENT_CONTEXT(ctx
);
9407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9408 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9410 n
[1].e
= matrixMode
;
9412 if (ctx
->ExecuteFlag
) {
9413 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9417 static void GLAPIENTRY
9418 save_MatrixPopEXT(GLenum matrixMode
)
9420 GET_CURRENT_CONTEXT(ctx
);
9422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9423 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9425 n
[1].e
= matrixMode
;
9427 if (ctx
->ExecuteFlag
) {
9428 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9432 static void GLAPIENTRY
9433 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9436 _math_transposef(tm
, m
);
9437 save_MatrixLoadfEXT(matrixMode
, tm
);
9440 static void GLAPIENTRY
9441 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9444 _math_transposefd(tm
, m
);
9445 save_MatrixLoadfEXT(matrixMode
, tm
);
9448 static void GLAPIENTRY
9449 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9452 _math_transposef(tm
, m
);
9453 save_MatrixMultfEXT(matrixMode
, tm
);
9456 static void GLAPIENTRY
9457 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9460 _math_transposefd(tm
, m
);
9461 save_MatrixMultfEXT(matrixMode
, tm
);
9466 * Save an error-generating command into display list.
9468 * KW: Will appear in the list before the vertex buffer containing the
9469 * command that provoked the error. I don't see this as a problem.
9472 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9475 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
9478 save_pointer(&n
[2], (void *) s
);
9479 /* note: the data/string here doesn't have to be freed in
9480 * _mesa_delete_list() since the string is never dynamically
9488 * Compile an error into current display list.
9491 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9493 if (ctx
->CompileFlag
)
9494 save_error(ctx
, error
, s
);
9495 if (ctx
->ExecuteFlag
)
9496 _mesa_error(ctx
, error
, "%s", s
);
9501 * Test if ID names a display list.
9504 islist(struct gl_context
*ctx
, GLuint list
)
9506 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
9516 /**********************************************************************/
9517 /* Display list execution */
9518 /**********************************************************************/
9522 * Execute a display list. Note that the ListBase offset must have already
9523 * been added before calling this function. I.e. the list argument is
9524 * the absolute list number, not relative to ListBase.
9525 * \param list - display list number
9528 execute_list(struct gl_context
*ctx
, GLuint list
)
9530 struct gl_display_list
*dlist
;
9534 if (list
== 0 || !islist(ctx
, list
))
9537 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
9538 /* raise an error? */
9542 dlist
= _mesa_lookup_list(ctx
, list
);
9546 ctx
->ListState
.CallDepth
++;
9548 vbo_save_BeginCallList(ctx
, dlist
);
9554 const OpCode opcode
= n
[0].opcode
;
9556 if (is_ext_opcode(opcode
)) {
9557 n
+= ext_opcode_execute(ctx
, n
);
9562 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
9565 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9567 case OPCODE_ALPHA_FUNC
:
9568 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9570 case OPCODE_BIND_TEXTURE
:
9571 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9575 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9576 ctx
->Unpack
= ctx
->DefaultPacking
;
9577 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
9578 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9579 get_pointer(&n
[7])));
9580 ctx
->Unpack
= save
; /* restore */
9583 case OPCODE_BLEND_COLOR
:
9584 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9586 case OPCODE_BLEND_EQUATION
:
9587 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
9589 case OPCODE_BLEND_EQUATION_SEPARATE
:
9590 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9592 case OPCODE_BLEND_FUNC_SEPARATE
:
9593 CALL_BlendFuncSeparate(ctx
->Exec
,
9594 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
9597 case OPCODE_BLEND_FUNC_I
:
9598 /* GL_ARB_draw_buffers_blend */
9599 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
9601 case OPCODE_BLEND_FUNC_SEPARATE_I
:
9602 /* GL_ARB_draw_buffers_blend */
9603 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
9606 case OPCODE_BLEND_EQUATION_I
:
9607 /* GL_ARB_draw_buffers_blend */
9608 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9610 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
9611 /* GL_ARB_draw_buffers_blend */
9612 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
9613 (n
[1].ui
, n
[2].e
, n
[3].e
));
9616 case OPCODE_CALL_LIST
:
9617 /* Generated by glCallList(), don't add ListBase */
9618 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9619 execute_list(ctx
, n
[1].ui
);
9622 case OPCODE_CALL_LISTS
:
9623 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9624 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
9628 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
9630 case OPCODE_CLEAR_BUFFER_IV
:
9637 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9640 case OPCODE_CLEAR_BUFFER_UIV
:
9647 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9650 case OPCODE_CLEAR_BUFFER_FV
:
9657 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9660 case OPCODE_CLEAR_BUFFER_FI
:
9661 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
9663 case OPCODE_CLEAR_COLOR
:
9664 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9666 case OPCODE_CLEAR_ACCUM
:
9667 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9669 case OPCODE_CLEAR_DEPTH
:
9670 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
9672 case OPCODE_CLEAR_INDEX
:
9673 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
9675 case OPCODE_CLEAR_STENCIL
:
9676 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
9678 case OPCODE_CLIP_PLANE
:
9685 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
9688 case OPCODE_COLOR_MASK
:
9689 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
9691 case OPCODE_COLOR_MASK_INDEXED
:
9692 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
9695 case OPCODE_COLOR_MATERIAL
:
9696 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9698 case OPCODE_COPY_PIXELS
:
9699 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
9700 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
9703 case OPCODE_COPY_TEX_IMAGE1D
:
9704 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9705 n
[5].i
, n
[6].i
, n
[7].i
));
9707 case OPCODE_COPY_TEX_IMAGE2D
:
9708 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9709 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
9711 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
9712 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9713 n
[4].i
, n
[5].i
, n
[6].i
));
9715 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
9716 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9717 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9720 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
9721 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9722 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9725 case OPCODE_CULL_FACE
:
9726 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
9728 case OPCODE_DEPTH_FUNC
:
9729 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
9731 case OPCODE_DEPTH_MASK
:
9732 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
9734 case OPCODE_DEPTH_RANGE
:
9735 CALL_DepthRange(ctx
->Exec
,
9736 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
9738 case OPCODE_DISABLE
:
9739 CALL_Disable(ctx
->Exec
, (n
[1].e
));
9741 case OPCODE_DISABLE_INDEXED
:
9742 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9744 case OPCODE_DRAW_BUFFER
:
9745 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
9747 case OPCODE_DRAW_PIXELS
:
9749 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9750 ctx
->Unpack
= ctx
->DefaultPacking
;
9751 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
9752 get_pointer(&n
[5])));
9753 ctx
->Unpack
= save
; /* restore */
9757 CALL_Enable(ctx
->Exec
, (n
[1].e
));
9759 case OPCODE_ENABLE_INDEXED
:
9760 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9762 case OPCODE_EVALMESH1
:
9763 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
9765 case OPCODE_EVALMESH2
:
9766 CALL_EvalMesh2(ctx
->Exec
,
9767 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
9776 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
9779 case OPCODE_FRONT_FACE
:
9780 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
9782 case OPCODE_FRUSTUM
:
9783 CALL_Frustum(ctx
->Exec
,
9784 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9787 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9789 case OPCODE_INDEX_MASK
:
9790 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
9792 case OPCODE_INIT_NAMES
:
9793 CALL_InitNames(ctx
->Exec
, ());
9802 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
9805 case OPCODE_LIGHT_MODEL
:
9812 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
9815 case OPCODE_LINE_STIPPLE
:
9816 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
9818 case OPCODE_LINE_WIDTH
:
9819 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
9821 case OPCODE_LIST_BASE
:
9822 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
9824 case OPCODE_LOAD_IDENTITY
:
9825 CALL_LoadIdentity(ctx
->Exec
, ());
9827 case OPCODE_LOAD_MATRIX
:
9828 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
9829 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
9831 case OPCODE_LOAD_NAME
:
9832 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
9834 case OPCODE_LOGIC_OP
:
9835 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
9839 GLenum target
= n
[1].e
;
9840 GLint ustride
= _mesa_evaluator_components(target
);
9841 GLint uorder
= n
[5].i
;
9842 GLfloat u1
= n
[2].f
;
9843 GLfloat u2
= n
[3].f
;
9844 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9845 (GLfloat
*) get_pointer(&n
[6])));
9850 GLenum target
= n
[1].e
;
9851 GLfloat u1
= n
[2].f
;
9852 GLfloat u2
= n
[3].f
;
9853 GLfloat v1
= n
[4].f
;
9854 GLfloat v2
= n
[5].f
;
9855 GLint ustride
= n
[6].i
;
9856 GLint vstride
= n
[7].i
;
9857 GLint uorder
= n
[8].i
;
9858 GLint vorder
= n
[9].i
;
9859 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9860 v1
, v2
, vstride
, vorder
,
9861 (GLfloat
*) get_pointer(&n
[10])));
9864 case OPCODE_MAPGRID1
:
9865 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
9867 case OPCODE_MAPGRID2
:
9868 CALL_MapGrid2f(ctx
->Exec
,
9869 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
9871 case OPCODE_MATRIX_MODE
:
9872 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
9874 case OPCODE_MULT_MATRIX
:
9875 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
9878 CALL_Ortho(ctx
->Exec
,
9879 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9881 case OPCODE_PASSTHROUGH
:
9882 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
9884 case OPCODE_PATCH_PARAMETER_I
:
9885 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
9887 case OPCODE_PATCH_PARAMETER_FV_INNER
:
9892 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9895 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
9902 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9905 case OPCODE_PIXEL_MAP
:
9906 CALL_PixelMapfv(ctx
->Exec
,
9907 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
9909 case OPCODE_PIXEL_TRANSFER
:
9910 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9912 case OPCODE_PIXEL_ZOOM
:
9913 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9915 case OPCODE_POINT_SIZE
:
9916 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
9918 case OPCODE_POINT_PARAMETERS
:
9924 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9927 case OPCODE_POLYGON_MODE
:
9928 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9930 case OPCODE_POLYGON_STIPPLE
:
9932 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9933 ctx
->Unpack
= ctx
->DefaultPacking
;
9934 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
9935 ctx
->Unpack
= save
; /* restore */
9938 case OPCODE_POLYGON_OFFSET
:
9939 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9941 case OPCODE_POLYGON_OFFSET_CLAMP
:
9942 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9944 case OPCODE_POP_ATTRIB
:
9945 CALL_PopAttrib(ctx
->Exec
, ());
9947 case OPCODE_POP_MATRIX
:
9948 CALL_PopMatrix(ctx
->Exec
, ());
9950 case OPCODE_POP_NAME
:
9951 CALL_PopName(ctx
->Exec
, ());
9953 case OPCODE_PRIORITIZE_TEXTURE
:
9954 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
9956 case OPCODE_PUSH_ATTRIB
:
9957 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
9959 case OPCODE_PUSH_MATRIX
:
9960 CALL_PushMatrix(ctx
->Exec
, ());
9962 case OPCODE_PUSH_NAME
:
9963 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
9965 case OPCODE_RASTER_POS
:
9966 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9968 case OPCODE_READ_BUFFER
:
9969 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
9972 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9975 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9977 case OPCODE_SCISSOR
:
9978 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
9980 case OPCODE_SHADE_MODEL
:
9981 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
9983 case OPCODE_PROVOKING_VERTEX
:
9984 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
9986 case OPCODE_STENCIL_FUNC
:
9987 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
9989 case OPCODE_STENCIL_MASK
:
9990 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
9992 case OPCODE_STENCIL_OP
:
9993 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
9995 case OPCODE_STENCIL_FUNC_SEPARATE
:
9996 CALL_StencilFuncSeparate(ctx
->Exec
,
9997 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
9999 case OPCODE_STENCIL_MASK_SEPARATE
:
10000 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10002 case OPCODE_STENCIL_OP_SEPARATE
:
10003 CALL_StencilOpSeparate(ctx
->Exec
,
10004 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10006 case OPCODE_TEXENV
:
10009 params
[0] = n
[3].f
;
10010 params
[1] = n
[4].f
;
10011 params
[2] = n
[5].f
;
10012 params
[3] = n
[6].f
;
10013 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10016 case OPCODE_TEXGEN
:
10019 params
[0] = n
[3].f
;
10020 params
[1] = n
[4].f
;
10021 params
[2] = n
[5].f
;
10022 params
[3] = n
[6].f
;
10023 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10026 case OPCODE_TEXPARAMETER
:
10029 params
[0] = n
[3].f
;
10030 params
[1] = n
[4].f
;
10031 params
[2] = n
[5].f
;
10032 params
[3] = n
[6].f
;
10033 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10036 case OPCODE_TEX_IMAGE1D
:
10038 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10039 ctx
->Unpack
= ctx
->DefaultPacking
;
10040 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10041 n
[2].i
, /* level */
10042 n
[3].i
, /* components */
10043 n
[4].i
, /* width */
10044 n
[5].e
, /* border */
10045 n
[6].e
, /* format */
10047 get_pointer(&n
[8])));
10048 ctx
->Unpack
= save
; /* restore */
10051 case OPCODE_TEX_IMAGE2D
:
10053 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10054 ctx
->Unpack
= ctx
->DefaultPacking
;
10055 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10056 n
[2].i
, /* level */
10057 n
[3].i
, /* components */
10058 n
[4].i
, /* width */
10059 n
[5].i
, /* height */
10060 n
[6].e
, /* border */
10061 n
[7].e
, /* format */
10063 get_pointer(&n
[9])));
10064 ctx
->Unpack
= save
; /* restore */
10067 case OPCODE_TEX_IMAGE3D
:
10069 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10070 ctx
->Unpack
= ctx
->DefaultPacking
;
10071 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10072 n
[2].i
, /* level */
10073 n
[3].i
, /* components */
10074 n
[4].i
, /* width */
10075 n
[5].i
, /* height */
10076 n
[6].i
, /* depth */
10077 n
[7].e
, /* border */
10078 n
[8].e
, /* format */
10080 get_pointer(&n
[10])));
10081 ctx
->Unpack
= save
; /* restore */
10084 case OPCODE_TEX_SUB_IMAGE1D
:
10086 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10087 ctx
->Unpack
= ctx
->DefaultPacking
;
10088 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10090 n
[6].e
, get_pointer(&n
[7])));
10091 ctx
->Unpack
= save
; /* restore */
10094 case OPCODE_TEX_SUB_IMAGE2D
:
10096 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10097 ctx
->Unpack
= ctx
->DefaultPacking
;
10098 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10100 n
[6].i
, n
[7].e
, n
[8].e
,
10101 get_pointer(&n
[9])));
10102 ctx
->Unpack
= save
; /* restore */
10105 case OPCODE_TEX_SUB_IMAGE3D
:
10107 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10108 ctx
->Unpack
= ctx
->DefaultPacking
;
10109 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10110 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10111 n
[8].i
, n
[9].e
, n
[10].e
,
10112 get_pointer(&n
[11])));
10113 ctx
->Unpack
= save
; /* restore */
10116 case OPCODE_TRANSLATE
:
10117 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10119 case OPCODE_VIEWPORT
:
10120 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10121 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10123 case OPCODE_WINDOW_POS
:
10124 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10126 case OPCODE_VIEWPORT_ARRAY_V
:
10127 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10128 get_pointer(&n
[3])));
10130 case OPCODE_VIEWPORT_INDEXED_F
:
10131 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10134 case OPCODE_VIEWPORT_INDEXED_FV
: {
10140 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
10143 case OPCODE_SCISSOR_ARRAY_V
:
10144 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10145 get_pointer(&n
[3])));
10147 case OPCODE_SCISSOR_INDEXED
:
10148 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
10151 case OPCODE_SCISSOR_INDEXED_V
: {
10157 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
10160 case OPCODE_DEPTH_ARRAY_V
:
10161 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10162 get_pointer(&n
[3])));
10164 case OPCODE_DEPTH_INDEXED
:
10165 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
10167 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
10168 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
10170 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
10171 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10172 n
[4].i
, n
[5].i
, n
[6].i
,
10173 get_pointer(&n
[7])));
10175 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
10176 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10177 n
[4].i
, n
[5].i
, n
[6].i
,
10178 n
[7].i
, get_pointer(&n
[8])));
10180 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
10181 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10182 n
[4].i
, n
[5].i
, n
[6].i
,
10184 get_pointer(&n
[9])));
10186 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
10187 CALL_CompressedTexSubImage1D(ctx
->Exec
,
10188 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10190 get_pointer(&n
[7])));
10192 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
10193 CALL_CompressedTexSubImage2D(ctx
->Exec
,
10194 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10195 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
10196 get_pointer(&n
[9])));
10198 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
10199 CALL_CompressedTexSubImage3D(ctx
->Exec
,
10200 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10201 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10203 get_pointer(&n
[11])));
10205 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
10206 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
10208 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
10209 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10211 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
10212 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10214 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
10215 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
10216 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
10219 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
10220 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
10222 case OPCODE_DEPTH_BOUNDS_EXT
:
10223 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10225 case OPCODE_PROGRAM_STRING_ARB
:
10226 CALL_ProgramStringARB(ctx
->Exec
,
10227 (n
[1].e
, n
[2].e
, n
[3].i
,
10228 get_pointer(&n
[4])));
10230 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
10231 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
10235 case OPCODE_BEGIN_QUERY_ARB
:
10236 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10238 case OPCODE_END_QUERY_ARB
:
10239 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
10241 case OPCODE_QUERY_COUNTER
:
10242 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10244 case OPCODE_BEGIN_QUERY_INDEXED
:
10245 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
10247 case OPCODE_END_QUERY_INDEXED
:
10248 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10250 case OPCODE_DRAW_BUFFERS_ARB
:
10252 GLenum buffers
[MAX_DRAW_BUFFERS
];
10253 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
10254 for (i
= 0; i
< count
; i
++)
10255 buffers
[i
] = n
[2 + i
].e
;
10256 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
10259 case OPCODE_BLIT_FRAMEBUFFER
:
10260 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
10261 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10264 case OPCODE_PRIMITIVE_RESTART_NV
:
10265 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10268 case OPCODE_USE_PROGRAM
:
10269 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10271 case OPCODE_UNIFORM_1F
:
10272 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10274 case OPCODE_UNIFORM_2F
:
10275 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10277 case OPCODE_UNIFORM_3F
:
10278 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10280 case OPCODE_UNIFORM_4F
:
10281 CALL_Uniform4f(ctx
->Exec
,
10282 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10284 case OPCODE_UNIFORM_1FV
:
10285 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10287 case OPCODE_UNIFORM_2FV
:
10288 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10290 case OPCODE_UNIFORM_3FV
:
10291 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10293 case OPCODE_UNIFORM_4FV
:
10294 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10296 case OPCODE_UNIFORM_1D
: {
10297 union float64_pair x
;
10299 x
.uint32
[0] = n
[2].ui
;
10300 x
.uint32
[1] = n
[3].ui
;
10302 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10305 case OPCODE_UNIFORM_2D
: {
10306 union float64_pair x
;
10307 union float64_pair y
;
10309 x
.uint32
[0] = n
[2].ui
;
10310 x
.uint32
[1] = n
[3].ui
;
10311 y
.uint32
[0] = n
[4].ui
;
10312 y
.uint32
[1] = n
[5].ui
;
10314 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10317 case OPCODE_UNIFORM_3D
: {
10318 union float64_pair x
;
10319 union float64_pair y
;
10320 union float64_pair z
;
10322 x
.uint32
[0] = n
[2].ui
;
10323 x
.uint32
[1] = n
[3].ui
;
10324 y
.uint32
[0] = n
[4].ui
;
10325 y
.uint32
[1] = n
[5].ui
;
10326 z
.uint32
[0] = n
[6].ui
;
10327 z
.uint32
[1] = n
[7].ui
;
10329 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10332 case OPCODE_UNIFORM_4D
: {
10333 union float64_pair x
;
10334 union float64_pair y
;
10335 union float64_pair z
;
10336 union float64_pair w
;
10338 x
.uint32
[0] = n
[2].ui
;
10339 x
.uint32
[1] = n
[3].ui
;
10340 y
.uint32
[0] = n
[4].ui
;
10341 y
.uint32
[1] = n
[5].ui
;
10342 z
.uint32
[0] = n
[6].ui
;
10343 z
.uint32
[1] = n
[7].ui
;
10344 w
.uint32
[0] = n
[8].ui
;
10345 w
.uint32
[1] = n
[9].ui
;
10347 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10350 case OPCODE_UNIFORM_1DV
:
10351 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10353 case OPCODE_UNIFORM_2DV
:
10354 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10356 case OPCODE_UNIFORM_3DV
:
10357 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10359 case OPCODE_UNIFORM_4DV
:
10360 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10362 case OPCODE_UNIFORM_1I
:
10363 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10365 case OPCODE_UNIFORM_2I
:
10366 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10368 case OPCODE_UNIFORM_3I
:
10369 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10371 case OPCODE_UNIFORM_4I
:
10372 CALL_Uniform4i(ctx
->Exec
,
10373 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10375 case OPCODE_UNIFORM_1IV
:
10376 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10378 case OPCODE_UNIFORM_2IV
:
10379 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10381 case OPCODE_UNIFORM_3IV
:
10382 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10384 case OPCODE_UNIFORM_4IV
:
10385 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10387 case OPCODE_UNIFORM_1UI
:
10388 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10390 case OPCODE_UNIFORM_2UI
:
10391 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10393 case OPCODE_UNIFORM_3UI
:
10394 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10396 case OPCODE_UNIFORM_4UI
:
10397 CALL_Uniform4ui(ctx
->Exec
,
10398 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10400 case OPCODE_UNIFORM_1UIV
:
10401 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10403 case OPCODE_UNIFORM_2UIV
:
10404 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10406 case OPCODE_UNIFORM_3UIV
:
10407 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10409 case OPCODE_UNIFORM_4UIV
:
10410 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10412 case OPCODE_UNIFORM_MATRIX22
:
10413 CALL_UniformMatrix2fv(ctx
->Exec
,
10414 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10416 case OPCODE_UNIFORM_MATRIX33
:
10417 CALL_UniformMatrix3fv(ctx
->Exec
,
10418 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10420 case OPCODE_UNIFORM_MATRIX44
:
10421 CALL_UniformMatrix4fv(ctx
->Exec
,
10422 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10424 case OPCODE_UNIFORM_MATRIX23
:
10425 CALL_UniformMatrix2x3fv(ctx
->Exec
,
10426 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10428 case OPCODE_UNIFORM_MATRIX32
:
10429 CALL_UniformMatrix3x2fv(ctx
->Exec
,
10430 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10432 case OPCODE_UNIFORM_MATRIX24
:
10433 CALL_UniformMatrix2x4fv(ctx
->Exec
,
10434 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10436 case OPCODE_UNIFORM_MATRIX42
:
10437 CALL_UniformMatrix4x2fv(ctx
->Exec
,
10438 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10440 case OPCODE_UNIFORM_MATRIX34
:
10441 CALL_UniformMatrix3x4fv(ctx
->Exec
,
10442 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10444 case OPCODE_UNIFORM_MATRIX43
:
10445 CALL_UniformMatrix4x3fv(ctx
->Exec
,
10446 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10448 case OPCODE_UNIFORM_MATRIX22D
:
10449 CALL_UniformMatrix2dv(ctx
->Exec
,
10450 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10452 case OPCODE_UNIFORM_MATRIX33D
:
10453 CALL_UniformMatrix3dv(ctx
->Exec
,
10454 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10456 case OPCODE_UNIFORM_MATRIX44D
:
10457 CALL_UniformMatrix4dv(ctx
->Exec
,
10458 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10460 case OPCODE_UNIFORM_MATRIX23D
:
10461 CALL_UniformMatrix2x3dv(ctx
->Exec
,
10462 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10464 case OPCODE_UNIFORM_MATRIX32D
:
10465 CALL_UniformMatrix3x2dv(ctx
->Exec
,
10466 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10468 case OPCODE_UNIFORM_MATRIX24D
:
10469 CALL_UniformMatrix2x4dv(ctx
->Exec
,
10470 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10472 case OPCODE_UNIFORM_MATRIX42D
:
10473 CALL_UniformMatrix4x2dv(ctx
->Exec
,
10474 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10476 case OPCODE_UNIFORM_MATRIX34D
:
10477 CALL_UniformMatrix3x4dv(ctx
->Exec
,
10478 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10480 case OPCODE_UNIFORM_MATRIX43D
:
10481 CALL_UniformMatrix4x3dv(ctx
->Exec
,
10482 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10485 case OPCODE_USE_PROGRAM_STAGES
:
10486 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10488 case OPCODE_PROGRAM_UNIFORM_1F
:
10489 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
10491 case OPCODE_PROGRAM_UNIFORM_2F
:
10492 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
10494 case OPCODE_PROGRAM_UNIFORM_3F
:
10495 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10496 n
[3].f
, n
[4].f
, n
[5].f
));
10498 case OPCODE_PROGRAM_UNIFORM_4F
:
10499 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10500 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10502 case OPCODE_PROGRAM_UNIFORM_1FV
:
10503 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10504 get_pointer(&n
[4])));
10506 case OPCODE_PROGRAM_UNIFORM_2FV
:
10507 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10508 get_pointer(&n
[4])));
10510 case OPCODE_PROGRAM_UNIFORM_3FV
:
10511 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10512 get_pointer(&n
[4])));
10514 case OPCODE_PROGRAM_UNIFORM_4FV
:
10515 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10516 get_pointer(&n
[4])));
10518 case OPCODE_PROGRAM_UNIFORM_1D
: {
10519 union float64_pair x
;
10521 x
.uint32
[0] = n
[3].ui
;
10522 x
.uint32
[1] = n
[4].ui
;
10524 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
10527 case OPCODE_PROGRAM_UNIFORM_2D
: {
10528 union float64_pair x
;
10529 union float64_pair y
;
10531 x
.uint32
[0] = n
[3].ui
;
10532 x
.uint32
[1] = n
[4].ui
;
10533 y
.uint32
[0] = n
[5].ui
;
10534 y
.uint32
[1] = n
[6].ui
;
10536 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
10539 case OPCODE_PROGRAM_UNIFORM_3D
: {
10540 union float64_pair x
;
10541 union float64_pair y
;
10542 union float64_pair z
;
10544 x
.uint32
[0] = n
[3].ui
;
10545 x
.uint32
[1] = n
[4].ui
;
10546 y
.uint32
[0] = n
[5].ui
;
10547 y
.uint32
[1] = n
[6].ui
;
10548 z
.uint32
[0] = n
[7].ui
;
10549 z
.uint32
[1] = n
[8].ui
;
10551 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10555 case OPCODE_PROGRAM_UNIFORM_4D
: {
10556 union float64_pair x
;
10557 union float64_pair y
;
10558 union float64_pair z
;
10559 union float64_pair w
;
10561 x
.uint32
[0] = n
[3].ui
;
10562 x
.uint32
[1] = n
[4].ui
;
10563 y
.uint32
[0] = n
[5].ui
;
10564 y
.uint32
[1] = n
[6].ui
;
10565 z
.uint32
[0] = n
[7].ui
;
10566 z
.uint32
[1] = n
[8].ui
;
10567 w
.uint32
[0] = n
[9].ui
;
10568 w
.uint32
[1] = n
[10].ui
;
10570 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10571 x
.d
, y
.d
, z
.d
, w
.d
));
10574 case OPCODE_PROGRAM_UNIFORM_1DV
:
10575 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10576 get_pointer(&n
[4])));
10578 case OPCODE_PROGRAM_UNIFORM_2DV
:
10579 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10580 get_pointer(&n
[4])));
10582 case OPCODE_PROGRAM_UNIFORM_3DV
:
10583 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10584 get_pointer(&n
[4])));
10586 case OPCODE_PROGRAM_UNIFORM_4DV
:
10587 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10588 get_pointer(&n
[4])));
10590 case OPCODE_PROGRAM_UNIFORM_1I
:
10591 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
10593 case OPCODE_PROGRAM_UNIFORM_2I
:
10594 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
10596 case OPCODE_PROGRAM_UNIFORM_3I
:
10597 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10598 n
[3].i
, n
[4].i
, n
[5].i
));
10600 case OPCODE_PROGRAM_UNIFORM_4I
:
10601 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10602 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
10604 case OPCODE_PROGRAM_UNIFORM_1IV
:
10605 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10606 get_pointer(&n
[4])));
10608 case OPCODE_PROGRAM_UNIFORM_2IV
:
10609 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10610 get_pointer(&n
[4])));
10612 case OPCODE_PROGRAM_UNIFORM_3IV
:
10613 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10614 get_pointer(&n
[4])));
10616 case OPCODE_PROGRAM_UNIFORM_4IV
:
10617 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10618 get_pointer(&n
[4])));
10620 case OPCODE_PROGRAM_UNIFORM_1UI
:
10621 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
10623 case OPCODE_PROGRAM_UNIFORM_2UI
:
10624 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10625 n
[3].ui
, n
[4].ui
));
10627 case OPCODE_PROGRAM_UNIFORM_3UI
:
10628 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10629 n
[3].ui
, n
[4].ui
, n
[5].ui
));
10631 case OPCODE_PROGRAM_UNIFORM_4UI
:
10632 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10634 n
[4].ui
, n
[5].ui
, n
[6].ui
));
10636 case OPCODE_PROGRAM_UNIFORM_1UIV
:
10637 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10638 get_pointer(&n
[4])));
10640 case OPCODE_PROGRAM_UNIFORM_2UIV
:
10641 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10642 get_pointer(&n
[4])));
10644 case OPCODE_PROGRAM_UNIFORM_3UIV
:
10645 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10646 get_pointer(&n
[4])));
10648 case OPCODE_PROGRAM_UNIFORM_4UIV
:
10649 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10650 get_pointer(&n
[4])));
10652 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
10653 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
10654 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10655 get_pointer(&n
[5])));
10657 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
10658 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
10659 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10660 get_pointer(&n
[5])));
10662 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
10663 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
10664 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10665 get_pointer(&n
[5])));
10667 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
10668 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
10669 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10670 get_pointer(&n
[5])));
10672 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
10673 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
10674 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10675 get_pointer(&n
[5])));
10677 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
10678 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
10679 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10680 get_pointer(&n
[5])));
10682 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
10683 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
10684 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10685 get_pointer(&n
[5])));
10687 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
10688 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
10689 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10690 get_pointer(&n
[5])));
10692 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
10693 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
10694 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10695 get_pointer(&n
[5])));
10697 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
10698 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
10699 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10700 get_pointer(&n
[5])));
10702 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
10703 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
10704 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10705 get_pointer(&n
[5])));
10707 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
10708 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
10709 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10710 get_pointer(&n
[5])));
10712 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
10713 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
10714 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10715 get_pointer(&n
[5])));
10717 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
10718 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
10719 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10720 get_pointer(&n
[5])));
10722 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
10723 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
10724 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10725 get_pointer(&n
[5])));
10727 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
10728 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
10729 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10730 get_pointer(&n
[5])));
10732 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
10733 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
10734 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10735 get_pointer(&n
[5])));
10737 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
10738 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
10739 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10740 get_pointer(&n
[5])));
10743 case OPCODE_CLIP_CONTROL
:
10744 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10747 case OPCODE_CLAMP_COLOR
:
10748 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10751 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
10752 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
10754 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
10755 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
10757 case OPCODE_ATTR_1F_NV
:
10758 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10760 case OPCODE_ATTR_2F_NV
:
10761 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10763 case OPCODE_ATTR_3F_NV
:
10764 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10766 case OPCODE_ATTR_4F_NV
:
10767 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10769 case OPCODE_ATTR_1F_ARB
:
10770 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10772 case OPCODE_ATTR_2F_ARB
:
10773 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10775 case OPCODE_ATTR_3F_ARB
:
10776 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10778 case OPCODE_ATTR_4F_ARB
:
10779 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10781 case OPCODE_ATTR_1D
: {
10782 GLdouble
*d
= (GLdouble
*) &n
[2];
10783 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
10786 case OPCODE_ATTR_2D
: {
10787 GLdouble
*d
= (GLdouble
*) &n
[2];
10788 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
10791 case OPCODE_ATTR_3D
: {
10792 GLdouble
*d
= (GLdouble
*) &n
[2];
10793 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
10796 case OPCODE_ATTR_4D
: {
10797 GLdouble
*d
= (GLdouble
*) &n
[2];
10798 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
10801 case OPCODE_MATERIAL
:
10802 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
10805 CALL_Begin(ctx
->Exec
, (n
[1].e
));
10808 CALL_End(ctx
->Exec
, ());
10811 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10813 case OPCODE_EVAL_C1
:
10814 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
10816 case OPCODE_EVAL_C2
:
10817 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10819 case OPCODE_EVAL_P1
:
10820 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
10822 case OPCODE_EVAL_P2
:
10823 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10826 /* GL_EXT_texture_integer */
10827 case OPCODE_CLEARCOLOR_I
:
10828 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10830 case OPCODE_CLEARCOLOR_UI
:
10831 CALL_ClearColorIuiEXT(ctx
->Exec
,
10832 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
10834 case OPCODE_TEXPARAMETER_I
:
10837 params
[0] = n
[3].i
;
10838 params
[1] = n
[4].i
;
10839 params
[2] = n
[5].i
;
10840 params
[3] = n
[6].i
;
10841 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10844 case OPCODE_TEXPARAMETER_UI
:
10847 params
[0] = n
[3].ui
;
10848 params
[1] = n
[4].ui
;
10849 params
[2] = n
[5].ui
;
10850 params
[3] = n
[6].ui
;
10851 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10855 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
10856 /* GL_ARB_instanced_arrays */
10857 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10860 case OPCODE_TEXTURE_BARRIER_NV
:
10861 CALL_TextureBarrierNV(ctx
->Exec
, ());
10864 /* GL_EXT/ARB_transform_feedback */
10865 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
10866 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
10868 case OPCODE_END_TRANSFORM_FEEDBACK
:
10869 CALL_EndTransformFeedback(ctx
->Exec
, ());
10871 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
10872 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10874 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
10875 CALL_PauseTransformFeedback(ctx
->Exec
, ());
10877 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
10878 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
10880 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
10881 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10883 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
10884 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
10885 (n
[1].e
, n
[2].ui
, n
[3].ui
));
10887 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
10888 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
10889 (n
[1].e
, n
[2].ui
, n
[3].si
));
10891 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
10892 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
10893 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
10897 case OPCODE_BIND_SAMPLER
:
10898 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10900 case OPCODE_SAMPLER_PARAMETERIV
:
10903 params
[0] = n
[3].i
;
10904 params
[1] = n
[4].i
;
10905 params
[2] = n
[5].i
;
10906 params
[3] = n
[6].i
;
10907 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10910 case OPCODE_SAMPLER_PARAMETERFV
:
10913 params
[0] = n
[3].f
;
10914 params
[1] = n
[4].f
;
10915 params
[2] = n
[5].f
;
10916 params
[3] = n
[6].f
;
10917 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10920 case OPCODE_SAMPLER_PARAMETERIIV
:
10923 params
[0] = n
[3].i
;
10924 params
[1] = n
[4].i
;
10925 params
[2] = n
[5].i
;
10926 params
[3] = n
[6].i
;
10927 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10930 case OPCODE_SAMPLER_PARAMETERUIV
:
10933 params
[0] = n
[3].ui
;
10934 params
[1] = n
[4].ui
;
10935 params
[2] = n
[5].ui
;
10936 params
[3] = n
[6].ui
;
10937 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10941 /* ARB_compute_shader */
10942 case OPCODE_DISPATCH_COMPUTE
:
10943 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10947 case OPCODE_WAIT_SYNC
:
10949 union uint64_pair p
;
10950 p
.uint32
[0] = n
[2].ui
;
10951 p
.uint32
[1] = n
[3].ui
;
10952 CALL_WaitSync(ctx
->Exec
,
10953 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
10957 /* GL_NV_conditional_render */
10958 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
10959 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
10961 case OPCODE_END_CONDITIONAL_RENDER
:
10962 CALL_EndConditionalRender(ctx
->Exec
, ());
10965 case OPCODE_UNIFORM_BLOCK_BINDING
:
10966 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10969 case OPCODE_UNIFORM_SUBROUTINES
:
10970 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
10971 get_pointer(&n
[3])));
10974 /* GL_EXT_window_rectangles */
10975 case OPCODE_WINDOW_RECTANGLES
:
10976 CALL_WindowRectanglesEXT(
10977 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
10980 /* GL_NV_conservative_raster */
10981 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
10982 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10985 /* GL_NV_conservative_raster_dilate */
10986 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
10987 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10990 /* GL_NV_conservative_raster_pre_snap_triangles */
10991 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
10992 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10995 /* GL_EXT_direct_state_access */
10996 case OPCODE_MATRIX_LOAD
:
10997 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10999 case OPCODE_MATRIX_MULT
:
11000 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11002 case OPCODE_MATRIX_ROTATE
:
11003 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11005 case OPCODE_MATRIX_SCALE
:
11006 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11008 case OPCODE_MATRIX_TRANSLATE
:
11009 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11011 case OPCODE_MATRIX_LOAD_IDENTITY
:
11012 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11014 case OPCODE_MATRIX_ORTHO
:
11015 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11016 n
[2].f
, n
[3].f
, n
[4].f
,
11017 n
[5].f
, n
[6].f
, n
[7].f
));
11019 case OPCODE_MATRIX_FRUSTUM
:
11020 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11021 n
[2].f
, n
[3].f
, n
[4].f
,
11022 n
[5].f
, n
[6].f
, n
[7].f
));
11024 case OPCODE_MATRIX_PUSH
:
11025 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11027 case OPCODE_MATRIX_POP
:
11028 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11031 case OPCODE_CONTINUE
:
11032 n
= (Node
*) get_pointer(&n
[1]);
11037 case OPCODE_END_OF_LIST
:
11043 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
11045 _mesa_problem(ctx
, "%s", msg
);
11050 /* increment n to point to next compiled command */
11051 if (opcode
!= OPCODE_CONTINUE
) {
11052 assert(InstSize
[opcode
] > 0);
11053 n
+= InstSize
[opcode
];
11058 vbo_save_EndCallList(ctx
);
11060 ctx
->ListState
.CallDepth
--;
11065 /**********************************************************************/
11067 /**********************************************************************/
11070 * Test if a display list number is valid.
11072 GLboolean GLAPIENTRY
11073 _mesa_IsList(GLuint list
)
11075 GET_CURRENT_CONTEXT(ctx
);
11076 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11077 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
11078 return islist(ctx
, list
);
11083 * Delete a sequence of consecutive display lists.
11086 _mesa_DeleteLists(GLuint list
, GLsizei range
)
11088 GET_CURRENT_CONTEXT(ctx
);
11090 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11091 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11094 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
11099 /* We may be deleting a set of bitmap lists. See if there's a
11100 * bitmap atlas to free.
11102 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
11104 _mesa_delete_bitmap_atlas(ctx
, atlas
);
11105 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
11109 for (i
= list
; i
< list
+ range
; i
++) {
11110 destroy_list(ctx
, i
);
11116 * Return a display list number, n, such that lists n through n+range-1
11120 _mesa_GenLists(GLsizei range
)
11122 GET_CURRENT_CONTEXT(ctx
);
11124 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11125 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
11128 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
11136 * Make this an atomic operation
11138 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
11140 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
11142 /* reserve the list IDs by with empty/dummy lists */
11144 for (i
= 0; i
< range
; i
++) {
11145 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
11146 make_list(base
+ i
, 1));
11150 if (USE_BITMAP_ATLAS
&&
11152 ctx
->Driver
.DrawAtlasBitmaps
) {
11153 /* "range > 16" is a rough heuristic to guess when glGenLists might be
11154 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
11155 * Create the empty atlas now.
11157 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
11159 atlas
= alloc_bitmap_atlas(ctx
, base
);
11162 /* Atlas _should_ be new/empty now, but clobbering is OK */
11163 assert(atlas
->numBitmaps
== 0);
11164 atlas
->numBitmaps
= range
;
11168 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
11175 * Begin a new display list.
11178 _mesa_NewList(GLuint name
, GLenum mode
)
11180 GET_CURRENT_CONTEXT(ctx
);
11182 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
11183 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11185 if (MESA_VERBOSE
& VERBOSE_API
)
11186 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
11187 _mesa_enum_to_string(mode
));
11190 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
11194 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
11195 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
11199 if (ctx
->ListState
.CurrentList
) {
11200 /* already compiling a display list */
11201 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
11205 ctx
->CompileFlag
= GL_TRUE
;
11206 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
11208 /* Reset accumulated list state */
11209 invalidate_saved_current_state( ctx
);
11211 /* Allocate new display list */
11212 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
11213 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
11214 ctx
->ListState
.CurrentPos
= 0;
11216 vbo_save_NewList(ctx
, name
, mode
);
11218 ctx
->CurrentServerDispatch
= ctx
->Save
;
11219 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11220 if (ctx
->MarshalExec
== NULL
) {
11221 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11227 * End definition of current display list.
11230 _mesa_EndList(void)
11232 GET_CURRENT_CONTEXT(ctx
);
11233 SAVE_FLUSH_VERTICES(ctx
);
11234 FLUSH_VERTICES(ctx
, 0);
11236 if (MESA_VERBOSE
& VERBOSE_API
)
11237 _mesa_debug(ctx
, "glEndList\n");
11239 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
11240 _mesa_error(ctx
, GL_INVALID_OPERATION
,
11241 "glEndList() called inside glBegin/End");
11244 /* Check that a list is under construction */
11245 if (!ctx
->ListState
.CurrentList
) {
11246 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
11250 /* Call before emitting END_OF_LIST, in case the driver wants to
11251 * emit opcodes itself.
11253 vbo_save_EndList(ctx
);
11255 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
11259 /* Destroy old list, if any */
11260 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
11262 /* Install the new list */
11263 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
11264 ctx
->ListState
.CurrentList
->Name
,
11265 ctx
->ListState
.CurrentList
);
11268 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
11269 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
11271 ctx
->ListState
.CurrentList
= NULL
;
11272 ctx
->ListState
.CurrentBlock
= NULL
;
11273 ctx
->ListState
.CurrentPos
= 0;
11274 ctx
->ExecuteFlag
= GL_TRUE
;
11275 ctx
->CompileFlag
= GL_FALSE
;
11277 ctx
->CurrentServerDispatch
= ctx
->Exec
;
11278 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11279 if (ctx
->MarshalExec
== NULL
) {
11280 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11286 _mesa_CallList(GLuint list
)
11288 GLboolean save_compile_flag
;
11289 GET_CURRENT_CONTEXT(ctx
);
11290 FLUSH_CURRENT(ctx
, 0);
11292 if (MESA_VERBOSE
& VERBOSE_API
)
11293 _mesa_debug(ctx
, "glCallList %d\n", list
);
11296 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
11301 mesa_print_display_list( list
);
11303 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
11304 * execute the display list, and restore the CompileFlag.
11306 save_compile_flag
= ctx
->CompileFlag
;
11307 if (save_compile_flag
) {
11308 ctx
->CompileFlag
= GL_FALSE
;
11311 execute_list(ctx
, list
);
11312 ctx
->CompileFlag
= save_compile_flag
;
11314 /* also restore API function pointers to point to "save" versions */
11315 if (save_compile_flag
) {
11316 ctx
->CurrentServerDispatch
= ctx
->Save
;
11317 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11318 if (ctx
->MarshalExec
== NULL
) {
11319 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11326 * Try to execute a glCallLists() command where the display lists contain
11327 * glBitmap commands with a texture atlas.
11328 * \return true for success, false otherwise
11331 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
11334 struct gl_bitmap_atlas
*atlas
;
11337 if (!USE_BITMAP_ATLAS
||
11338 !ctx
->Current
.RasterPosValid
||
11339 ctx
->List
.ListBase
== 0 ||
11340 type
!= GL_UNSIGNED_BYTE
||
11341 !ctx
->Driver
.DrawAtlasBitmaps
) {
11346 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11349 /* Even if glGenLists wasn't called, we can still try to create
11352 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11355 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
11356 /* Try to build the bitmap atlas now.
11357 * If the atlas was created in glGenLists, we'll have recorded the
11358 * number of lists (bitmaps). Otherwise, take a guess at 256.
11360 if (atlas
->numBitmaps
== 0)
11361 atlas
->numBitmaps
= 256;
11362 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
11365 if (!atlas
|| !atlas
->complete
) {
11369 /* check that all display list IDs are in the atlas */
11370 for (i
= 0; i
< n
; i
++) {
11371 const GLubyte
*ids
= (const GLubyte
*) lists
;
11373 if (ids
[i
] >= atlas
->numBitmaps
) {
11378 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
11385 * Execute glCallLists: call multiple display lists.
11388 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
11390 GET_CURRENT_CONTEXT(ctx
);
11392 GLboolean save_compile_flag
;
11394 if (MESA_VERBOSE
& VERBOSE_API
)
11395 _mesa_debug(ctx
, "glCallLists %d\n", n
);
11399 case GL_UNSIGNED_BYTE
:
11401 case GL_UNSIGNED_SHORT
:
11403 case GL_UNSIGNED_INT
:
11411 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
11416 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
11418 } else if (n
== 0 || lists
== NULL
) {
11419 /* nothing to do */
11423 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
11427 /* Save the CompileFlag status, turn it off, execute display list,
11428 * and restore the CompileFlag.
11430 save_compile_flag
= ctx
->CompileFlag
;
11431 ctx
->CompileFlag
= GL_FALSE
;
11433 for (i
= 0; i
< n
; i
++) {
11434 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
11435 execute_list(ctx
, list
);
11438 ctx
->CompileFlag
= save_compile_flag
;
11440 /* also restore API function pointers to point to "save" versions */
11441 if (save_compile_flag
) {
11442 ctx
->CurrentServerDispatch
= ctx
->Save
;
11443 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11444 if (ctx
->MarshalExec
== NULL
) {
11445 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11452 * Set the offset added to list numbers in glCallLists.
11455 _mesa_ListBase(GLuint base
)
11457 GET_CURRENT_CONTEXT(ctx
);
11458 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11459 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11460 ctx
->List
.ListBase
= base
;
11464 * Setup the given dispatch table to point to Mesa's display list
11465 * building functions.
11467 * This does not include any of the tnl functions - they are
11468 * initialized from _mesa_init_api_defaults and from the active vtxfmt
11472 _mesa_initialize_save_table(const struct gl_context
*ctx
)
11474 struct _glapi_table
*table
= ctx
->Save
;
11475 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
11477 /* Initially populate the dispatch table with the contents of the
11478 * normal-execution dispatch table. This lets us skip populating functions
11479 * that should be called directly instead of compiled into display lists.
11481 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
11483 _mesa_loopback_init_api_table(ctx
, table
);
11485 /* VBO functions */
11486 vbo_initialize_save_dispatch(ctx
, table
);
11489 SET_Accum(table
, save_Accum
);
11490 SET_AlphaFunc(table
, save_AlphaFunc
);
11491 SET_Bitmap(table
, save_Bitmap
);
11492 SET_BlendFunc(table
, save_BlendFunc
);
11493 SET_CallList(table
, save_CallList
);
11494 SET_CallLists(table
, save_CallLists
);
11495 SET_Clear(table
, save_Clear
);
11496 SET_ClearAccum(table
, save_ClearAccum
);
11497 SET_ClearColor(table
, save_ClearColor
);
11498 SET_ClearDepth(table
, save_ClearDepth
);
11499 SET_ClearIndex(table
, save_ClearIndex
);
11500 SET_ClearStencil(table
, save_ClearStencil
);
11501 SET_ClipPlane(table
, save_ClipPlane
);
11502 SET_ColorMask(table
, save_ColorMask
);
11503 SET_ColorMaski(table
, save_ColorMaskIndexed
);
11504 SET_ColorMaterial(table
, save_ColorMaterial
);
11505 SET_CopyPixels(table
, save_CopyPixels
);
11506 SET_CullFace(table
, save_CullFace
);
11507 SET_DepthFunc(table
, save_DepthFunc
);
11508 SET_DepthMask(table
, save_DepthMask
);
11509 SET_DepthRange(table
, save_DepthRange
);
11510 SET_Disable(table
, save_Disable
);
11511 SET_Disablei(table
, save_DisableIndexed
);
11512 SET_DrawBuffer(table
, save_DrawBuffer
);
11513 SET_DrawPixels(table
, save_DrawPixels
);
11514 SET_Enable(table
, save_Enable
);
11515 SET_Enablei(table
, save_EnableIndexed
);
11516 SET_EvalMesh1(table
, save_EvalMesh1
);
11517 SET_EvalMesh2(table
, save_EvalMesh2
);
11518 SET_Fogf(table
, save_Fogf
);
11519 SET_Fogfv(table
, save_Fogfv
);
11520 SET_Fogi(table
, save_Fogi
);
11521 SET_Fogiv(table
, save_Fogiv
);
11522 SET_FrontFace(table
, save_FrontFace
);
11523 SET_Frustum(table
, save_Frustum
);
11524 SET_Hint(table
, save_Hint
);
11525 SET_IndexMask(table
, save_IndexMask
);
11526 SET_InitNames(table
, save_InitNames
);
11527 SET_LightModelf(table
, save_LightModelf
);
11528 SET_LightModelfv(table
, save_LightModelfv
);
11529 SET_LightModeli(table
, save_LightModeli
);
11530 SET_LightModeliv(table
, save_LightModeliv
);
11531 SET_Lightf(table
, save_Lightf
);
11532 SET_Lightfv(table
, save_Lightfv
);
11533 SET_Lighti(table
, save_Lighti
);
11534 SET_Lightiv(table
, save_Lightiv
);
11535 SET_LineStipple(table
, save_LineStipple
);
11536 SET_LineWidth(table
, save_LineWidth
);
11537 SET_ListBase(table
, save_ListBase
);
11538 SET_LoadIdentity(table
, save_LoadIdentity
);
11539 SET_LoadMatrixd(table
, save_LoadMatrixd
);
11540 SET_LoadMatrixf(table
, save_LoadMatrixf
);
11541 SET_LoadName(table
, save_LoadName
);
11542 SET_LogicOp(table
, save_LogicOp
);
11543 SET_Map1d(table
, save_Map1d
);
11544 SET_Map1f(table
, save_Map1f
);
11545 SET_Map2d(table
, save_Map2d
);
11546 SET_Map2f(table
, save_Map2f
);
11547 SET_MapGrid1d(table
, save_MapGrid1d
);
11548 SET_MapGrid1f(table
, save_MapGrid1f
);
11549 SET_MapGrid2d(table
, save_MapGrid2d
);
11550 SET_MapGrid2f(table
, save_MapGrid2f
);
11551 SET_MatrixMode(table
, save_MatrixMode
);
11552 SET_MultMatrixd(table
, save_MultMatrixd
);
11553 SET_MultMatrixf(table
, save_MultMatrixf
);
11554 SET_NewList(table
, save_NewList
);
11555 SET_Ortho(table
, save_Ortho
);
11556 SET_PassThrough(table
, save_PassThrough
);
11557 SET_PixelMapfv(table
, save_PixelMapfv
);
11558 SET_PixelMapuiv(table
, save_PixelMapuiv
);
11559 SET_PixelMapusv(table
, save_PixelMapusv
);
11560 SET_PixelTransferf(table
, save_PixelTransferf
);
11561 SET_PixelTransferi(table
, save_PixelTransferi
);
11562 SET_PixelZoom(table
, save_PixelZoom
);
11563 SET_PointSize(table
, save_PointSize
);
11564 SET_PolygonMode(table
, save_PolygonMode
);
11565 SET_PolygonOffset(table
, save_PolygonOffset
);
11566 SET_PolygonStipple(table
, save_PolygonStipple
);
11567 SET_PopAttrib(table
, save_PopAttrib
);
11568 SET_PopMatrix(table
, save_PopMatrix
);
11569 SET_PopName(table
, save_PopName
);
11570 SET_PushAttrib(table
, save_PushAttrib
);
11571 SET_PushMatrix(table
, save_PushMatrix
);
11572 SET_PushName(table
, save_PushName
);
11573 SET_RasterPos2d(table
, save_RasterPos2d
);
11574 SET_RasterPos2dv(table
, save_RasterPos2dv
);
11575 SET_RasterPos2f(table
, save_RasterPos2f
);
11576 SET_RasterPos2fv(table
, save_RasterPos2fv
);
11577 SET_RasterPos2i(table
, save_RasterPos2i
);
11578 SET_RasterPos2iv(table
, save_RasterPos2iv
);
11579 SET_RasterPos2s(table
, save_RasterPos2s
);
11580 SET_RasterPos2sv(table
, save_RasterPos2sv
);
11581 SET_RasterPos3d(table
, save_RasterPos3d
);
11582 SET_RasterPos3dv(table
, save_RasterPos3dv
);
11583 SET_RasterPos3f(table
, save_RasterPos3f
);
11584 SET_RasterPos3fv(table
, save_RasterPos3fv
);
11585 SET_RasterPos3i(table
, save_RasterPos3i
);
11586 SET_RasterPos3iv(table
, save_RasterPos3iv
);
11587 SET_RasterPos3s(table
, save_RasterPos3s
);
11588 SET_RasterPos3sv(table
, save_RasterPos3sv
);
11589 SET_RasterPos4d(table
, save_RasterPos4d
);
11590 SET_RasterPos4dv(table
, save_RasterPos4dv
);
11591 SET_RasterPos4f(table
, save_RasterPos4f
);
11592 SET_RasterPos4fv(table
, save_RasterPos4fv
);
11593 SET_RasterPos4i(table
, save_RasterPos4i
);
11594 SET_RasterPos4iv(table
, save_RasterPos4iv
);
11595 SET_RasterPos4s(table
, save_RasterPos4s
);
11596 SET_RasterPos4sv(table
, save_RasterPos4sv
);
11597 SET_ReadBuffer(table
, save_ReadBuffer
);
11598 SET_Rectf(table
, save_Rectf
);
11599 SET_Rotated(table
, save_Rotated
);
11600 SET_Rotatef(table
, save_Rotatef
);
11601 SET_Scaled(table
, save_Scaled
);
11602 SET_Scalef(table
, save_Scalef
);
11603 SET_Scissor(table
, save_Scissor
);
11604 SET_ShadeModel(table
, save_ShadeModel
);
11605 SET_StencilFunc(table
, save_StencilFunc
);
11606 SET_StencilMask(table
, save_StencilMask
);
11607 SET_StencilOp(table
, save_StencilOp
);
11608 SET_TexEnvf(table
, save_TexEnvf
);
11609 SET_TexEnvfv(table
, save_TexEnvfv
);
11610 SET_TexEnvi(table
, save_TexEnvi
);
11611 SET_TexEnviv(table
, save_TexEnviv
);
11612 SET_TexGend(table
, save_TexGend
);
11613 SET_TexGendv(table
, save_TexGendv
);
11614 SET_TexGenf(table
, save_TexGenf
);
11615 SET_TexGenfv(table
, save_TexGenfv
);
11616 SET_TexGeni(table
, save_TexGeni
);
11617 SET_TexGeniv(table
, save_TexGeniv
);
11618 SET_TexImage1D(table
, save_TexImage1D
);
11619 SET_TexImage2D(table
, save_TexImage2D
);
11620 SET_TexParameterf(table
, save_TexParameterf
);
11621 SET_TexParameterfv(table
, save_TexParameterfv
);
11622 SET_TexParameteri(table
, save_TexParameteri
);
11623 SET_TexParameteriv(table
, save_TexParameteriv
);
11624 SET_Translated(table
, save_Translated
);
11625 SET_Translatef(table
, save_Translatef
);
11626 SET_Viewport(table
, save_Viewport
);
11629 SET_BindTexture(table
, save_BindTexture
);
11630 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
11631 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
11632 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
11633 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
11634 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
11635 SET_TexSubImage1D(table
, save_TexSubImage1D
);
11636 SET_TexSubImage2D(table
, save_TexSubImage2D
);
11639 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
11640 SET_TexImage3D(table
, save_TexImage3D
);
11641 SET_TexSubImage3D(table
, save_TexSubImage3D
);
11644 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
11645 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
11646 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
11648 /* ATI_separate_stencil */
11649 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
11651 /* GL_ARB_imaging */
11652 /* Not all are supported */
11653 SET_BlendColor(table
, save_BlendColor
);
11654 SET_BlendEquation(table
, save_BlendEquation
);
11656 /* 2. GL_EXT_blend_color */
11658 SET_BlendColorEXT(table
, save_BlendColorEXT
);
11661 /* 6. GL_EXT_texture3d */
11663 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
11664 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
11665 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
11668 /* 37. GL_EXT_blend_minmax */
11670 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
11673 /* 54. GL_EXT_point_parameters */
11674 SET_PointParameterf(table
, save_PointParameterfEXT
);
11675 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
11677 /* 91. GL_ARB_tessellation_shader */
11678 SET_PatchParameteri(table
, save_PatchParameteri
);
11679 SET_PatchParameterfv(table
, save_PatchParameterfv
);
11681 /* 100. ARB_viewport_array */
11682 SET_ViewportArrayv(table
, save_ViewportArrayv
);
11683 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
11684 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
11685 SET_ScissorArrayv(table
, save_ScissorArrayv
);
11686 SET_ScissorIndexed(table
, save_ScissorIndexed
);
11687 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
11688 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
11689 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
11691 /* 122. ARB_compute_shader */
11692 SET_DispatchCompute(table
, save_DispatchCompute
);
11693 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
11695 /* 173. GL_EXT_blend_func_separate */
11696 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
11698 /* 197. GL_MESA_window_pos */
11699 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
11700 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
11701 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
11702 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
11703 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
11704 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
11705 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
11706 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
11707 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
11708 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
11709 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
11710 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
11711 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
11712 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
11713 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
11714 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
11715 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
11716 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
11717 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
11718 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
11719 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
11720 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
11721 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
11722 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
11724 /* 245. GL_ATI_fragment_shader */
11725 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
11726 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
11728 /* 262. GL_NV_point_sprite */
11729 SET_PointParameteri(table
, save_PointParameteriNV
);
11730 SET_PointParameteriv(table
, save_PointParameterivNV
);
11732 /* 268. GL_EXT_stencil_two_side */
11733 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
11735 /* ???. GL_EXT_depth_bounds_test */
11736 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
11738 /* ARB 1. GL_ARB_multitexture */
11739 SET_ActiveTexture(table
, save_ActiveTextureARB
);
11741 /* ARB 3. GL_ARB_transpose_matrix */
11742 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
11743 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
11744 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
11745 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
11747 /* ARB 5. GL_ARB_multisample */
11748 SET_SampleCoverage(table
, save_SampleCoverageARB
);
11750 /* ARB 12. GL_ARB_texture_compression */
11751 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
11752 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
11753 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
11754 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
11755 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
11756 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
11758 /* ARB 14. GL_ARB_point_parameters */
11759 /* aliased with EXT_point_parameters functions */
11761 /* ARB 25. GL_ARB_window_pos */
11762 /* aliased with MESA_window_pos functions */
11764 /* ARB 26. GL_ARB_vertex_program */
11765 /* ARB 27. GL_ARB_fragment_program */
11766 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
11767 SET_ProgramStringARB(table
, save_ProgramStringARB
);
11768 SET_BindProgramARB(table
, save_BindProgramARB
);
11769 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
11770 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
11771 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
11772 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
11773 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
11774 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
11775 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
11776 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
11778 SET_BeginQuery(table
, save_BeginQueryARB
);
11779 SET_EndQuery(table
, save_EndQueryARB
);
11780 SET_QueryCounter(table
, save_QueryCounter
);
11782 SET_DrawBuffers(table
, save_DrawBuffersARB
);
11784 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
11786 SET_UseProgram(table
, save_UseProgram
);
11787 SET_Uniform1f(table
, save_Uniform1fARB
);
11788 SET_Uniform2f(table
, save_Uniform2fARB
);
11789 SET_Uniform3f(table
, save_Uniform3fARB
);
11790 SET_Uniform4f(table
, save_Uniform4fARB
);
11791 SET_Uniform1fv(table
, save_Uniform1fvARB
);
11792 SET_Uniform2fv(table
, save_Uniform2fvARB
);
11793 SET_Uniform3fv(table
, save_Uniform3fvARB
);
11794 SET_Uniform4fv(table
, save_Uniform4fvARB
);
11795 SET_Uniform1i(table
, save_Uniform1iARB
);
11796 SET_Uniform2i(table
, save_Uniform2iARB
);
11797 SET_Uniform3i(table
, save_Uniform3iARB
);
11798 SET_Uniform4i(table
, save_Uniform4iARB
);
11799 SET_Uniform1iv(table
, save_Uniform1ivARB
);
11800 SET_Uniform2iv(table
, save_Uniform2ivARB
);
11801 SET_Uniform3iv(table
, save_Uniform3ivARB
);
11802 SET_Uniform4iv(table
, save_Uniform4ivARB
);
11803 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
11804 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
11805 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
11806 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
11807 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
11808 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
11809 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
11810 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
11811 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
11813 /* 299. GL_EXT_blend_equation_separate */
11814 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
11816 /* GL_EXT_gpu_program_parameters */
11817 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
11818 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
11820 /* 364. GL_EXT_provoking_vertex */
11821 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
11823 /* GL_EXT_texture_integer */
11824 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
11825 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
11826 SET_TexParameterIiv(table
, save_TexParameterIiv
);
11827 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
11829 /* GL_ARB_clip_control */
11830 SET_ClipControl(table
, save_ClipControl
);
11832 /* GL_ARB_color_buffer_float */
11833 SET_ClampColor(table
, save_ClampColorARB
);
11836 SET_ClearBufferiv(table
, save_ClearBufferiv
);
11837 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
11838 SET_ClearBufferfv(table
, save_ClearBufferfv
);
11839 SET_ClearBufferfi(table
, save_ClearBufferfi
);
11840 SET_Uniform1ui(table
, save_Uniform1ui
);
11841 SET_Uniform2ui(table
, save_Uniform2ui
);
11842 SET_Uniform3ui(table
, save_Uniform3ui
);
11843 SET_Uniform4ui(table
, save_Uniform4ui
);
11844 SET_Uniform1uiv(table
, save_Uniform1uiv
);
11845 SET_Uniform2uiv(table
, save_Uniform2uiv
);
11846 SET_Uniform3uiv(table
, save_Uniform3uiv
);
11847 SET_Uniform4uiv(table
, save_Uniform4uiv
);
11849 /* GL_ARB_gpu_shader_fp64 */
11850 SET_Uniform1d(table
, save_Uniform1d
);
11851 SET_Uniform2d(table
, save_Uniform2d
);
11852 SET_Uniform3d(table
, save_Uniform3d
);
11853 SET_Uniform4d(table
, save_Uniform4d
);
11854 SET_Uniform1dv(table
, save_Uniform1dv
);
11855 SET_Uniform2dv(table
, save_Uniform2dv
);
11856 SET_Uniform3dv(table
, save_Uniform3dv
);
11857 SET_Uniform4dv(table
, save_Uniform4dv
);
11858 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
11859 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
11860 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
11861 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
11862 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
11863 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
11864 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
11865 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
11866 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
11869 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
11870 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
11871 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
11872 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
11873 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
11874 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
11875 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
11876 SET_DrawTransformFeedbackInstanced(table
,
11877 save_DrawTransformFeedbackInstanced
);
11878 SET_DrawTransformFeedbackStreamInstanced(table
,
11879 save_DrawTransformFeedbackStreamInstanced
);
11880 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
11881 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
11883 /* GL_ARB_instanced_arrays */
11884 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
11886 /* GL_NV_texture_barrier */
11887 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
11889 SET_BindSampler(table
, save_BindSampler
);
11890 SET_SamplerParameteri(table
, save_SamplerParameteri
);
11891 SET_SamplerParameterf(table
, save_SamplerParameterf
);
11892 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
11893 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
11894 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
11895 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
11897 /* GL_ARB_draw_buffer_blend */
11898 SET_BlendFunciARB(table
, save_BlendFunci
);
11899 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
11900 SET_BlendEquationiARB(table
, save_BlendEquationi
);
11901 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
11903 /* GL_NV_conditional_render */
11904 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
11905 SET_EndConditionalRender(table
, save_EndConditionalRender
);
11908 SET_WaitSync(table
, save_WaitSync
);
11910 /* GL_ARB_uniform_buffer_object */
11911 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
11913 /* GL_ARB_shader_subroutines */
11914 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
11916 /* GL_ARB_draw_instanced */
11917 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
11918 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
11920 /* GL_ARB_draw_elements_base_vertex */
11921 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
11923 /* GL_ARB_base_instance */
11924 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
11925 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
11926 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
11928 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
11929 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
11930 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
11931 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
11932 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
11934 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
11935 SET_UseProgramStages(table
, save_UseProgramStages
);
11936 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
11937 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
11938 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
11939 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
11940 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
11941 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
11942 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
11943 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
11944 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
11945 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
11946 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
11947 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
11948 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
11949 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
11950 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
11951 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
11952 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
11953 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
11954 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
11955 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
11956 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
11957 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
11958 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
11959 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
11960 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
11961 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
11962 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
11963 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
11964 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
11965 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
11966 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
11967 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
11968 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
11969 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
11970 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
11971 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
11972 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
11973 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
11974 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
11975 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
11976 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
11977 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
11978 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
11979 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
11980 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
11981 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
11982 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
11983 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
11984 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
11985 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
11987 /* GL_{ARB,EXT}_polygon_offset_clamp */
11988 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
11990 /* GL_EXT_window_rectangles */
11991 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
11993 /* GL_NV_conservative_raster */
11994 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
11996 /* GL_NV_conservative_raster_dilate */
11997 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
11999 /* GL_NV_conservative_raster_pre_snap_triangles */
12000 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
12002 /* GL_EXT_direct_state_access */
12003 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
12004 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
12005 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
12006 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
12007 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
12008 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
12009 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
12010 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
12011 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
12012 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
12013 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
12014 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
12015 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
12016 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
12017 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
12018 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
12019 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
12020 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
12021 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
12026 static const char *
12027 enum_string(GLenum k
)
12029 return _mesa_enum_to_string(k
);
12034 * Print the commands in a display list. For debugging only.
12035 * TODO: many commands aren't handled yet.
12036 * \param fname filename to write display list to. If null, use stdout.
12038 static void GLAPIENTRY
12039 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
12041 struct gl_display_list
*dlist
;
12047 f
= fopen(fname
, "w");
12052 if (!islist(ctx
, list
)) {
12053 fprintf(f
, "%u is not a display list ID\n", list
);
12057 dlist
= _mesa_lookup_list(ctx
, list
);
12064 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
12066 done
= n
? GL_FALSE
: GL_TRUE
;
12068 const OpCode opcode
= n
[0].opcode
;
12070 if (is_ext_opcode(opcode
)) {
12071 n
+= ext_opcode_print(ctx
, n
, f
);
12076 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
12078 case OPCODE_ACTIVE_TEXTURE
:
12079 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
12081 case OPCODE_BITMAP
:
12082 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
12083 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
12084 get_pointer(&n
[7]));
12086 case OPCODE_BLEND_COLOR
:
12087 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
12088 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12090 case OPCODE_BLEND_EQUATION
:
12091 fprintf(f
, "BlendEquation %s\n",
12092 enum_string(n
[1].e
));
12094 case OPCODE_BLEND_EQUATION_SEPARATE
:
12095 fprintf(f
, "BlendEquationSeparate %s, %s\n",
12096 enum_string(n
[1].e
),
12097 enum_string(n
[2].e
));
12099 case OPCODE_BLEND_FUNC_SEPARATE
:
12100 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
12101 enum_string(n
[1].e
),
12102 enum_string(n
[2].e
),
12103 enum_string(n
[3].e
),
12104 enum_string(n
[4].e
));
12106 case OPCODE_BLEND_EQUATION_I
:
12107 fprintf(f
, "BlendEquationi %u, %s\n",
12108 n
[1].ui
, enum_string(n
[2].e
));
12110 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
12111 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
12112 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12114 case OPCODE_BLEND_FUNC_I
:
12115 fprintf(f
, "BlendFunci %u, %s, %s\n",
12116 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12118 case OPCODE_BLEND_FUNC_SEPARATE_I
:
12119 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
12121 enum_string(n
[2].e
),
12122 enum_string(n
[3].e
),
12123 enum_string(n
[4].e
),
12124 enum_string(n
[5].e
));
12126 case OPCODE_CALL_LIST
:
12127 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
12129 case OPCODE_CALL_LISTS
:
12130 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
12132 case OPCODE_DISABLE
:
12133 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
12135 case OPCODE_ENABLE
:
12136 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
12138 case OPCODE_FRUSTUM
:
12139 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
12140 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12142 case OPCODE_LINE_STIPPLE
:
12143 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
12145 case OPCODE_LINE_WIDTH
:
12146 fprintf(f
, "LineWidth %f\n", n
[1].f
);
12148 case OPCODE_LOAD_IDENTITY
:
12149 fprintf(f
, "LoadIdentity\n");
12151 case OPCODE_LOAD_MATRIX
:
12152 fprintf(f
, "LoadMatrix\n");
12153 fprintf(f
, " %8f %8f %8f %8f\n",
12154 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12155 fprintf(f
, " %8f %8f %8f %8f\n",
12156 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12157 fprintf(f
, " %8f %8f %8f %8f\n",
12158 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12159 fprintf(f
, " %8f %8f %8f %8f\n",
12160 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12162 case OPCODE_MULT_MATRIX
:
12163 fprintf(f
, "MultMatrix (or Rotate)\n");
12164 fprintf(f
, " %8f %8f %8f %8f\n",
12165 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12166 fprintf(f
, " %8f %8f %8f %8f\n",
12167 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12168 fprintf(f
, " %8f %8f %8f %8f\n",
12169 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12170 fprintf(f
, " %8f %8f %8f %8f\n",
12171 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12174 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
12175 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12177 case OPCODE_POINT_SIZE
:
12178 fprintf(f
, "PointSize %f\n", n
[1].f
);
12180 case OPCODE_POP_ATTRIB
:
12181 fprintf(f
, "PopAttrib\n");
12183 case OPCODE_POP_MATRIX
:
12184 fprintf(f
, "PopMatrix\n");
12186 case OPCODE_POP_NAME
:
12187 fprintf(f
, "PopName\n");
12189 case OPCODE_PUSH_ATTRIB
:
12190 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
12192 case OPCODE_PUSH_MATRIX
:
12193 fprintf(f
, "PushMatrix\n");
12195 case OPCODE_PUSH_NAME
:
12196 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
12198 case OPCODE_RASTER_POS
:
12199 fprintf(f
, "RasterPos %g %g %g %g\n",
12200 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12202 case OPCODE_ROTATE
:
12203 fprintf(f
, "Rotate %g %g %g %g\n",
12204 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12207 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12209 case OPCODE_TRANSLATE
:
12210 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12212 case OPCODE_BIND_TEXTURE
:
12213 fprintf(f
, "BindTexture %s %d\n",
12214 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
12216 case OPCODE_SHADE_MODEL
:
12217 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
12220 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
12221 _mesa_enum_to_string(n
[1].ui
),
12222 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
12225 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
12226 _mesa_enum_to_string(n
[1].ui
),
12227 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
12228 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
12230 case OPCODE_MAPGRID1
:
12231 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
12233 case OPCODE_MAPGRID2
:
12234 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
12235 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
12237 case OPCODE_EVALMESH1
:
12238 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
12240 case OPCODE_EVALMESH2
:
12241 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
12242 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
12245 case OPCODE_ATTR_1F_NV
:
12246 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
12248 case OPCODE_ATTR_2F_NV
:
12249 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
12250 n
[1].i
, n
[2].f
, n
[3].f
);
12252 case OPCODE_ATTR_3F_NV
:
12253 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
12254 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12256 case OPCODE_ATTR_4F_NV
:
12257 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
12258 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12260 case OPCODE_ATTR_1F_ARB
:
12261 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
12263 case OPCODE_ATTR_2F_ARB
:
12264 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
12265 n
[1].i
, n
[2].f
, n
[3].f
);
12267 case OPCODE_ATTR_3F_ARB
:
12268 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
12269 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12271 case OPCODE_ATTR_4F_ARB
:
12272 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
12273 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12276 case OPCODE_MATERIAL
:
12277 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
12278 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12281 fprintf(f
, "BEGIN %x\n", n
[1].i
);
12284 fprintf(f
, "END\n");
12287 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
12290 case OPCODE_EVAL_C1
:
12291 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
12293 case OPCODE_EVAL_C2
:
12294 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
12296 case OPCODE_EVAL_P1
:
12297 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
12299 case OPCODE_EVAL_P2
:
12300 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
12303 case OPCODE_PROVOKING_VERTEX
:
12304 fprintf(f
, "ProvokingVertex %s\n",
12305 _mesa_enum_to_string(n
[1].ui
));
12309 * meta opcodes/commands
12312 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
12313 (const char *) get_pointer(&n
[2]));
12315 case OPCODE_CONTINUE
:
12316 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
12317 n
= (Node
*) get_pointer(&n
[1]);
12320 fprintf(f
, "NOP\n");
12322 case OPCODE_END_OF_LIST
:
12323 fprintf(f
, "END-LIST %u\n", list
);
12327 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
12329 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
12330 opcode
, (void *) n
);
12334 fprintf(f
, "command %d, %u operands\n", opcode
,
12338 /* increment n to point to next compiled command */
12339 if (opcode
!= OPCODE_CONTINUE
) {
12340 assert(InstSize
[opcode
] > 0);
12341 n
+= InstSize
[opcode
];
12355 * Clients may call this function to help debug display list problems.
12356 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
12357 * changed, or break in the future without notice.
12360 mesa_print_display_list(GLuint list
)
12362 GET_CURRENT_CONTEXT(ctx
);
12363 print_list(ctx
, list
, NULL
);
12367 /**********************************************************************/
12368 /***** Initialization *****/
12369 /**********************************************************************/
12372 save_vtxfmt_init(GLvertexformat
* vfmt
)
12374 vfmt
->ArrayElement
= _ae_ArrayElement
;
12376 vfmt
->Begin
= save_Begin
;
12378 vfmt
->CallList
= save_CallList
;
12379 vfmt
->CallLists
= save_CallLists
;
12381 vfmt
->Color3f
= save_Color3f
;
12382 vfmt
->Color3fv
= save_Color3fv
;
12383 vfmt
->Color4f
= save_Color4f
;
12384 vfmt
->Color4fv
= save_Color4fv
;
12385 vfmt
->EdgeFlag
= save_EdgeFlag
;
12386 vfmt
->End
= save_End
;
12388 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
12389 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
12390 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
12391 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
12392 vfmt
->EvalPoint1
= save_EvalPoint1
;
12393 vfmt
->EvalPoint2
= save_EvalPoint2
;
12395 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
12396 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
12397 vfmt
->Indexf
= save_Indexf
;
12398 vfmt
->Indexfv
= save_Indexfv
;
12399 vfmt
->Materialfv
= save_Materialfv
;
12400 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
12401 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
12402 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
12403 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
12404 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
12405 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
12406 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
12407 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
12408 vfmt
->Normal3f
= save_Normal3f
;
12409 vfmt
->Normal3fv
= save_Normal3fv
;
12410 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
12411 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
12412 vfmt
->TexCoord1f
= save_TexCoord1f
;
12413 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
12414 vfmt
->TexCoord2f
= save_TexCoord2f
;
12415 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
12416 vfmt
->TexCoord3f
= save_TexCoord3f
;
12417 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
12418 vfmt
->TexCoord4f
= save_TexCoord4f
;
12419 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
12420 vfmt
->Vertex2f
= save_Vertex2f
;
12421 vfmt
->Vertex2fv
= save_Vertex2fv
;
12422 vfmt
->Vertex3f
= save_Vertex3f
;
12423 vfmt
->Vertex3fv
= save_Vertex3fv
;
12424 vfmt
->Vertex4f
= save_Vertex4f
;
12425 vfmt
->Vertex4fv
= save_Vertex4fv
;
12426 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
12427 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
12428 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
12429 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
12430 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
12431 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
12432 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
12433 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
12434 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
12435 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
12436 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
12437 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
12438 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
12439 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
12440 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
12441 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
12443 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
12448 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
12449 const GLvertexformat
*vfmt
)
12451 SET_CallList(disp
, vfmt
->CallList
);
12452 SET_CallLists(disp
, vfmt
->CallLists
);
12457 * Initialize display list state for given context.
12460 _mesa_init_display_list(struct gl_context
*ctx
)
12462 static GLboolean tableInitialized
= GL_FALSE
;
12464 /* zero-out the instruction size table, just once */
12465 if (!tableInitialized
) {
12466 memset(InstSize
, 0, sizeof(InstSize
));
12467 tableInitialized
= GL_TRUE
;
12470 /* extension info */
12471 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
12474 ctx
->ListState
.CallDepth
= 0;
12475 ctx
->ExecuteFlag
= GL_TRUE
;
12476 ctx
->CompileFlag
= GL_FALSE
;
12477 ctx
->ListState
.CurrentBlock
= NULL
;
12478 ctx
->ListState
.CurrentPos
= 0;
12480 /* Display List group */
12481 ctx
->List
.ListBase
= 0;
12483 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
12485 InstSize
[OPCODE_NOP
] = 1;
12490 _mesa_free_display_list_data(struct gl_context
*ctx
)
12492 free(ctx
->ListExt
);
12493 ctx
->ListExt
= NULL
;