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 /* The following three are meta instructions */
561 OPCODE_ERROR
, /* raise compiled-in error */
563 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
573 * Display list instructions are stored as sequences of "nodes". Nodes
574 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
575 * are linked together with a pointer.
577 * Each instruction in the display list is stored as a sequence of
578 * contiguous nodes in memory.
579 * Each node is the union of a variety of data types.
581 * Note, all of these members should be 4 bytes in size or less for the
582 * sake of compact display lists. We store 8-byte pointers in a pair of
583 * these nodes using the save/get_pointer() functions below.
601 typedef union gl_dlist_node Node
;
604 /** How many 4-byte dwords to store a pointer */
605 #define POINTER_DWORDS (sizeof(void *) / 4)
607 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
608 * space for display lists. The following types and functions are
609 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
614 GLuint dwords
[POINTER_DWORDS
];
619 * Save a 4 or 8-byte pointer at dest (and dest+1).
622 save_pointer(Node
*dest
, void *src
)
627 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
628 STATIC_ASSERT(sizeof(Node
) == 4);
632 for (i
= 0; i
< POINTER_DWORDS
; i
++)
633 dest
[i
].ui
= p
.dwords
[i
];
638 * Retrieve a 4 or 8-byte pointer from node (node+1).
641 get_pointer(const Node
*node
)
646 for (i
= 0; i
< POINTER_DWORDS
; i
++)
647 p
.dwords
[i
] = node
[i
].ui
;
654 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
671 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
673 union float64_pair tmp; \
675 n[idx].ui = tmp.uint32[0]; \
676 n[idx+1].ui = tmp.uint32[1]; \
681 * How many nodes to allocate at a time. Note that bulk vertex data
682 * from glBegin/glVertex/glEnd primitives will typically wind up in
683 * a VBO, and not directly in the display list itself.
685 #define BLOCK_SIZE 256
690 * Number of nodes of storage needed for each instruction.
691 * Sizes for dynamically allocated opcodes are stored in the context struct.
693 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
696 void mesa_print_display_list(GLuint list
);
700 * Does the given display list only contain a single glBitmap call?
703 is_bitmap_list(const struct gl_display_list
*dlist
)
705 const Node
*n
= dlist
->Head
;
706 if (n
[0].opcode
== OPCODE_BITMAP
) {
707 n
+= InstSize
[OPCODE_BITMAP
];
708 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
716 * Is the given display list an empty list?
719 is_empty_list(const struct gl_display_list
*dlist
)
721 const Node
*n
= dlist
->Head
;
722 return n
[0].opcode
== OPCODE_END_OF_LIST
;
727 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
730 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
733 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
740 * Lookup a gl_bitmap_atlas by listBase ID.
742 static struct gl_bitmap_atlas
*
743 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
745 struct gl_bitmap_atlas
*atlas
;
747 assert(listBase
> 0);
748 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
754 * Create new bitmap atlas and insert into hash table.
756 static struct gl_bitmap_atlas
*
757 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
759 struct gl_bitmap_atlas
*atlas
;
761 assert(listBase
> 0);
762 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
764 atlas
= calloc(1, sizeof(*atlas
));
766 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
774 * Try to build a bitmap atlas. This involves examining a sequence of
775 * display lists which contain glBitmap commands and putting the bitmap
776 * images into a texture map (the atlas).
777 * If we succeed, gl_bitmap_atlas::complete will be set to true.
778 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
781 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
784 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
789 assert(!atlas
->complete
);
790 assert(atlas
->numBitmaps
> 0);
792 /* We use a rectangle texture (non-normalized coords) for the atlas */
793 assert(ctx
->Extensions
.NV_texture_rectangle
);
794 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
796 atlas
->texWidth
= 1024;
797 atlas
->texHeight
= 0; /* determined below */
799 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
800 if (!atlas
->glyphs
) {
802 atlas
->incomplete
= true;
806 /* Loop over the display lists. They should all contain a single glBitmap
807 * call. If not, bail out. Also, compute the position and sizes of each
808 * bitmap in the atlas to determine the texture atlas size.
810 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
811 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
813 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
814 unsigned bitmap_width
, bitmap_height
;
815 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
817 if (!list
|| is_empty_list(list
)) {
819 atlas
->numBitmaps
= i
;
823 if (!is_bitmap_list(list
)) {
824 /* This list does not contain exactly one glBitmap command. Give up. */
825 atlas
->incomplete
= true;
829 /* get bitmap info from the display list command */
831 assert(n
[0].opcode
== OPCODE_BITMAP
);
832 bitmap_width
= n
[1].i
;
833 bitmap_height
= n
[2].i
;
834 bitmap_xorig
= n
[3].f
;
835 bitmap_yorig
= n
[4].f
;
836 bitmap_xmove
= n
[5].f
;
837 bitmap_ymove
= n
[6].f
;
839 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
840 /* advance to the next row of the texture */
846 /* save the bitmap's position in the atlas */
850 g
->h
= bitmap_height
;
851 g
->xorig
= bitmap_xorig
;
852 g
->yorig
= bitmap_yorig
;
853 g
->xmove
= bitmap_xmove
;
854 g
->ymove
= bitmap_ymove
;
856 xpos
+= bitmap_width
;
858 /* keep track of tallest bitmap in the row */
859 row_height
= MAX2(row_height
, bitmap_height
);
862 /* Now we know the texture height */
863 atlas
->texHeight
= ypos
+ row_height
;
865 if (atlas
->texHeight
== 0) {
866 /* no glyphs found, give up */
869 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
870 /* too large, give up */
874 /* Create atlas texture (texture ID is irrelevant) */
875 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
876 if (!atlas
->texObj
) {
880 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
881 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
882 atlas
->texObj
->MaxLevel
= 0;
883 atlas
->texObj
->Immutable
= GL_TRUE
;
885 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
886 GL_TEXTURE_RECTANGLE
, 0);
887 if (!atlas
->texImage
) {
891 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
892 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
893 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
895 /* alloc image storage */
896 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
900 /* map teximage, load with bitmap glyphs */
901 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
902 0, 0, atlas
->texWidth
, atlas
->texHeight
,
903 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
908 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
909 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
911 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
912 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
913 const Node
*n
= list
->Head
;
915 assert(n
[0].opcode
== OPCODE_BITMAP
||
916 n
[0].opcode
== OPCODE_END_OF_LIST
);
918 if (n
[0].opcode
== OPCODE_BITMAP
) {
919 unsigned bitmap_width
= n
[1].i
;
920 unsigned bitmap_height
= n
[2].i
;
921 unsigned xpos
= atlas
->glyphs
[i
].x
;
922 unsigned ypos
= atlas
->glyphs
[i
].y
;
923 const void *bitmap_image
= get_pointer(&n
[7]);
925 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
926 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
928 /* put the bitmap image into the texture image */
929 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
930 &ctx
->DefaultPacking
, bitmap_image
,
931 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
936 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
938 atlas
->complete
= true;
943 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
946 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
949 atlas
->glyphs
= NULL
;
950 atlas
->incomplete
= true;
955 * Allocate a gl_display_list object with an initial block of storage.
956 * \param count how many display list nodes/tokens to allocate
958 static struct gl_display_list
*
959 make_list(GLuint name
, GLuint count
)
961 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
963 dlist
->Head
= malloc(sizeof(Node
) * count
);
964 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
970 * Lookup function to just encapsulate casting.
972 struct gl_display_list
*
973 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
975 return (struct gl_display_list
*)
976 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
980 /** Is the given opcode an extension code? */
981 static inline GLboolean
982 is_ext_opcode(OpCode opcode
)
984 return (opcode
>= OPCODE_EXT_0
);
988 /** Destroy an extended opcode instruction */
990 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
992 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
994 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
995 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1000 /** Execute an extended opcode instruction */
1002 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1004 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1006 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1007 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1012 /** Print an extended opcode instruction */
1014 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1016 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1018 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1019 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1025 * Delete the named display list, but don't remove from hash table.
1026 * \param dlist - display list pointer
1029 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1034 n
= block
= dlist
->Head
;
1036 done
= block
? GL_FALSE
: GL_TRUE
;
1038 const OpCode opcode
= n
[0].opcode
;
1040 /* check for extension opcodes first */
1041 if (is_ext_opcode(opcode
)) {
1042 n
+= ext_opcode_destroy(ctx
, n
);
1046 /* for some commands, we need to free malloc'd memory */
1048 free(get_pointer(&n
[6]));
1051 free(get_pointer(&n
[10]));
1053 case OPCODE_CALL_LISTS
:
1054 free(get_pointer(&n
[3]));
1056 case OPCODE_DRAW_PIXELS
:
1057 free(get_pointer(&n
[5]));
1060 free(get_pointer(&n
[7]));
1062 case OPCODE_POLYGON_STIPPLE
:
1063 free(get_pointer(&n
[1]));
1065 case OPCODE_TEX_IMAGE1D
:
1066 free(get_pointer(&n
[8]));
1068 case OPCODE_TEX_IMAGE2D
:
1069 free(get_pointer(&n
[9]));
1071 case OPCODE_TEX_IMAGE3D
:
1072 free(get_pointer(&n
[10]));
1074 case OPCODE_TEX_SUB_IMAGE1D
:
1075 free(get_pointer(&n
[7]));
1077 case OPCODE_TEX_SUB_IMAGE2D
:
1078 free(get_pointer(&n
[9]));
1080 case OPCODE_TEX_SUB_IMAGE3D
:
1081 free(get_pointer(&n
[11]));
1083 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1084 free(get_pointer(&n
[7]));
1086 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1087 free(get_pointer(&n
[8]));
1089 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1090 free(get_pointer(&n
[9]));
1092 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1093 free(get_pointer(&n
[7]));
1095 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1096 free(get_pointer(&n
[9]));
1098 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1099 free(get_pointer(&n
[11]));
1101 case OPCODE_PROGRAM_STRING_ARB
:
1102 free(get_pointer(&n
[4])); /* program string */
1104 case OPCODE_UNIFORM_1FV
:
1105 case OPCODE_UNIFORM_2FV
:
1106 case OPCODE_UNIFORM_3FV
:
1107 case OPCODE_UNIFORM_4FV
:
1108 case OPCODE_UNIFORM_1DV
:
1109 case OPCODE_UNIFORM_2DV
:
1110 case OPCODE_UNIFORM_3DV
:
1111 case OPCODE_UNIFORM_4DV
:
1112 case OPCODE_UNIFORM_1IV
:
1113 case OPCODE_UNIFORM_2IV
:
1114 case OPCODE_UNIFORM_3IV
:
1115 case OPCODE_UNIFORM_4IV
:
1116 case OPCODE_UNIFORM_1UIV
:
1117 case OPCODE_UNIFORM_2UIV
:
1118 case OPCODE_UNIFORM_3UIV
:
1119 case OPCODE_UNIFORM_4UIV
:
1120 free(get_pointer(&n
[3]));
1122 case OPCODE_UNIFORM_MATRIX22
:
1123 case OPCODE_UNIFORM_MATRIX33
:
1124 case OPCODE_UNIFORM_MATRIX44
:
1125 case OPCODE_UNIFORM_MATRIX24
:
1126 case OPCODE_UNIFORM_MATRIX42
:
1127 case OPCODE_UNIFORM_MATRIX23
:
1128 case OPCODE_UNIFORM_MATRIX32
:
1129 case OPCODE_UNIFORM_MATRIX34
:
1130 case OPCODE_UNIFORM_MATRIX43
:
1131 case OPCODE_UNIFORM_MATRIX22D
:
1132 case OPCODE_UNIFORM_MATRIX33D
:
1133 case OPCODE_UNIFORM_MATRIX44D
:
1134 case OPCODE_UNIFORM_MATRIX24D
:
1135 case OPCODE_UNIFORM_MATRIX42D
:
1136 case OPCODE_UNIFORM_MATRIX23D
:
1137 case OPCODE_UNIFORM_MATRIX32D
:
1138 case OPCODE_UNIFORM_MATRIX34D
:
1139 case OPCODE_UNIFORM_MATRIX43D
:
1140 free(get_pointer(&n
[4]));
1142 case OPCODE_PROGRAM_UNIFORM_1FV
:
1143 case OPCODE_PROGRAM_UNIFORM_2FV
:
1144 case OPCODE_PROGRAM_UNIFORM_3FV
:
1145 case OPCODE_PROGRAM_UNIFORM_4FV
:
1146 case OPCODE_PROGRAM_UNIFORM_1DV
:
1147 case OPCODE_PROGRAM_UNIFORM_2DV
:
1148 case OPCODE_PROGRAM_UNIFORM_3DV
:
1149 case OPCODE_PROGRAM_UNIFORM_4DV
:
1150 case OPCODE_PROGRAM_UNIFORM_1IV
:
1151 case OPCODE_PROGRAM_UNIFORM_2IV
:
1152 case OPCODE_PROGRAM_UNIFORM_3IV
:
1153 case OPCODE_PROGRAM_UNIFORM_4IV
:
1154 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1155 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1156 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1157 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1158 free(get_pointer(&n
[4]));
1160 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1161 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1162 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1163 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1164 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1165 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1166 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1167 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1168 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1169 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1170 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1171 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1172 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1173 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1174 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1175 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1176 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1177 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1178 free(get_pointer(&n
[5]));
1180 case OPCODE_PIXEL_MAP
:
1181 free(get_pointer(&n
[3]));
1183 case OPCODE_VIEWPORT_ARRAY_V
:
1184 case OPCODE_SCISSOR_ARRAY_V
:
1185 case OPCODE_DEPTH_ARRAY_V
:
1186 case OPCODE_UNIFORM_SUBROUTINES
:
1187 case OPCODE_WINDOW_RECTANGLES
:
1188 free(get_pointer(&n
[3]));
1190 case OPCODE_CONTINUE
:
1191 n
= (Node
*) get_pointer(&n
[1]);
1195 case OPCODE_END_OF_LIST
:
1200 /* just increment 'n' pointer, below */
1204 if (opcode
!= OPCODE_CONTINUE
) {
1205 assert(InstSize
[opcode
] > 0);
1206 n
+= InstSize
[opcode
];
1217 * Called by _mesa_HashWalk() to check if a display list which is being
1218 * deleted belongs to a bitmap texture atlas.
1221 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1223 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1224 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1226 /* See if the list_id falls in the range contained in this texture atlas */
1227 if (atlas
->complete
&&
1228 list_id
>= atlas_id
&&
1229 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1230 /* Mark the atlas as incomplete so it doesn't get used. But don't
1231 * delete it yet since we don't want to try to recreate it in the next
1234 atlas
->complete
= false;
1235 atlas
->incomplete
= true;
1241 * Destroy a display list and remove from hash table.
1242 * \param list - display list number
1245 destroy_list(struct gl_context
*ctx
, GLuint list
)
1247 struct gl_display_list
*dlist
;
1252 dlist
= _mesa_lookup_list(ctx
, list
);
1256 if (is_bitmap_list(dlist
)) {
1257 /* If we're destroying a simple glBitmap display list, there's a
1258 * chance that we're destroying a bitmap image that's in a texture
1259 * atlas. Examine all atlases to see if that's the case. There's
1260 * usually few (if any) atlases so this isn't expensive.
1262 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1263 check_atlas_for_deleted_list
, &list
);
1266 _mesa_delete_list(ctx
, dlist
);
1267 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1272 * Translate the nth element of list from <type> to GLint.
1275 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1287 bptr
= (GLbyte
*) list
;
1288 return (GLint
) bptr
[n
];
1289 case GL_UNSIGNED_BYTE
:
1290 ubptr
= (GLubyte
*) list
;
1291 return (GLint
) ubptr
[n
];
1293 sptr
= (GLshort
*) list
;
1294 return (GLint
) sptr
[n
];
1295 case GL_UNSIGNED_SHORT
:
1296 usptr
= (GLushort
*) list
;
1297 return (GLint
) usptr
[n
];
1299 iptr
= (GLint
*) list
;
1301 case GL_UNSIGNED_INT
:
1302 uiptr
= (GLuint
*) list
;
1303 return (GLint
) uiptr
[n
];
1305 fptr
= (GLfloat
*) list
;
1306 return (GLint
) floorf(fptr
[n
]);
1308 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1309 return (GLint
) ubptr
[0] * 256
1312 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1313 return (GLint
) ubptr
[0] * 65536
1314 + (GLint
) ubptr
[1] * 256
1317 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1318 return (GLint
) ubptr
[0] * 16777216
1319 + (GLint
) ubptr
[1] * 65536
1320 + (GLint
) ubptr
[2] * 256
1329 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1330 * If width < 0 or height < 0 or format or type are invalid we'll just
1331 * return NULL. We will not generate an error since OpenGL command
1332 * arguments aren't error-checked until the command is actually executed
1333 * (not when they're compiled).
1334 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1337 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1338 GLsizei width
, GLsizei height
, GLsizei depth
,
1339 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1340 const struct gl_pixelstore_attrib
*unpack
)
1342 if (width
<= 0 || height
<= 0) {
1346 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1347 /* bad format and/or type */
1351 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1355 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1356 format
, type
, pixels
, unpack
);
1357 if (pixels
&& !image
) {
1358 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1362 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1363 depth
, format
, type
, INT_MAX
, pixels
)) {
1364 const GLubyte
*map
, *src
;
1368 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1369 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1372 /* unable to map src buffer! */
1373 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1377 src
= ADD_POINTERS(map
, pixels
);
1378 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1379 format
, type
, src
, unpack
);
1381 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1384 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1390 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1395 /** Return copy of memory */
1397 memdup(const void *src
, GLsizei bytes
)
1399 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1401 memcpy(b
, src
, bytes
);
1407 * Allocate space for a display list instruction (opcode + payload space).
1408 * \param opcode the instruction opcode (OPCODE_* value)
1409 * \param bytes instruction payload size (not counting opcode)
1410 * \param align8 does the payload need to be 8-byte aligned?
1411 * This is only relevant in 64-bit environments.
1412 * \return pointer to allocated memory (the payload will be at pointer+1)
1415 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1417 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1418 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1422 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1424 if (opcode
< OPCODE_EXT_0
) {
1425 if (InstSize
[opcode
] == 0) {
1426 /* save instruction size now */
1427 InstSize
[opcode
] = numNodes
;
1430 /* make sure instruction size agrees */
1431 assert(numNodes
== InstSize
[opcode
]);
1435 if (sizeof(void *) > sizeof(Node
) && align8
1436 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1437 /* The opcode would get placed at node[0] and the payload would start
1438 * at node[1]. But the payload needs to be at an even offset (8-byte
1447 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1449 /* This block is full. Allocate a new block and chain to it */
1451 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1452 n
[0].opcode
= OPCODE_CONTINUE
;
1453 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1455 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1459 /* a fresh block should be 8-byte aligned on 64-bit systems */
1460 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1462 save_pointer(&n
[1], newblock
);
1463 ctx
->ListState
.CurrentBlock
= newblock
;
1464 ctx
->ListState
.CurrentPos
= 0;
1466 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1467 * we have to insert a NOP so that the payload of the real opcode lands
1468 * on an even location:
1469 * node[0] = OPCODE_NOP
1470 * node[1] = OPCODE_x;
1471 * node[2] = start of payload
1473 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1476 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1478 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1479 n
[0].opcode
= OPCODE_NOP
;
1481 /* The "real" opcode will now be at an odd location and the payload
1482 * will be at an even location.
1485 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1487 n
[0].opcode
= opcode
;
1495 * Allocate space for a display list instruction. Used by callers outside
1496 * this file for things like VBO vertex data.
1498 * \param opcode the instruction opcode (OPCODE_* value)
1499 * \param bytes instruction size in bytes, not counting opcode.
1500 * \return pointer to the usable data area (not including the internal
1504 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1506 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1508 return n
+ 1; /* return pointer to payload area, after opcode */
1515 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1516 * aligned in 64-bit environments, 4-byte aligned otherwise.
1519 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1521 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1523 return n
+ 1; /* return pointer to payload area, after opcode */
1530 * This function allows modules and drivers to get their own opcodes
1531 * for extending display list functionality.
1532 * \param ctx the rendering context
1533 * \param size number of bytes for storing the new display list command
1534 * \param execute function to execute the new display list command
1535 * \param destroy function to destroy the new display list command
1536 * \param print function to print the new display list command
1537 * \return the new opcode number or -1 if error
1540 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1542 void (*execute
) (struct gl_context
*, void *),
1543 void (*destroy
) (struct gl_context
*, void *),
1544 void (*print
) (struct gl_context
*, void *, FILE *))
1546 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1547 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1548 ctx
->ListExt
->Opcode
[i
].Size
=
1549 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1550 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1551 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1552 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1553 return i
+ OPCODE_EXT_0
;
1560 * Allocate space for a display list instruction. The space is basically
1561 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1562 * function parameter, node[2] is the second parameter, etc.
1564 * \param opcode one of OPCODE_x
1565 * \param nparams number of function parameters
1566 * \return pointer to start of instruction space
1568 static inline Node
*
1569 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1571 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1576 * Called by EndList to try to reduce memory used for the list.
1579 trim_list(struct gl_context
*ctx
)
1581 /* If the list we're ending only has one allocated block of nodes/tokens
1582 * and its size isn't a full block size, realloc the block to use less
1583 * memory. This is important for apps that create many small display
1584 * lists and apps that use glXUseXFont (many lists each containing one
1586 * Note: we currently only trim display lists that allocated one block
1587 * of tokens. That hits the short list case which is what we're mainly
1588 * concerned with. Trimming longer lists would involve traversing the
1589 * linked list of blocks.
1591 struct gl_dlist_state
*list
= &ctx
->ListState
;
1593 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1594 (list
->CurrentPos
< BLOCK_SIZE
)) {
1595 /* There's only one block and it's not full, so realloc */
1596 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1597 list
->CurrentList
->Head
=
1598 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1599 if (!list
->CurrentBlock
) {
1600 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1608 * Display List compilation functions
1610 static void GLAPIENTRY
1611 save_Accum(GLenum op
, GLfloat value
)
1613 GET_CURRENT_CONTEXT(ctx
);
1615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1616 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1621 if (ctx
->ExecuteFlag
) {
1622 CALL_Accum(ctx
->Exec
, (op
, value
));
1627 static void GLAPIENTRY
1628 save_AlphaFunc(GLenum func
, GLclampf ref
)
1630 GET_CURRENT_CONTEXT(ctx
);
1632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1633 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1636 n
[2].f
= (GLfloat
) ref
;
1638 if (ctx
->ExecuteFlag
) {
1639 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1644 static void GLAPIENTRY
1645 save_BindTexture(GLenum target
, GLuint texture
)
1647 GET_CURRENT_CONTEXT(ctx
);
1649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1650 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1655 if (ctx
->ExecuteFlag
) {
1656 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1661 static void GLAPIENTRY
1662 save_Bitmap(GLsizei width
, GLsizei height
,
1663 GLfloat xorig
, GLfloat yorig
,
1664 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1666 GET_CURRENT_CONTEXT(ctx
);
1668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1669 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1671 n
[1].i
= (GLint
) width
;
1672 n
[2].i
= (GLint
) height
;
1678 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1679 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1681 if (ctx
->ExecuteFlag
) {
1682 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1683 xorig
, yorig
, xmove
, ymove
, pixels
));
1688 static void GLAPIENTRY
1689 save_BlendEquation(GLenum mode
)
1691 GET_CURRENT_CONTEXT(ctx
);
1693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1694 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1698 if (ctx
->ExecuteFlag
) {
1699 CALL_BlendEquation(ctx
->Exec
, (mode
));
1704 static void GLAPIENTRY
1705 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1707 GET_CURRENT_CONTEXT(ctx
);
1709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1710 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1715 if (ctx
->ExecuteFlag
) {
1716 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1721 static void GLAPIENTRY
1722 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1723 GLenum sfactorA
, GLenum dfactorA
)
1725 GET_CURRENT_CONTEXT(ctx
);
1727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1728 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1730 n
[1].e
= sfactorRGB
;
1731 n
[2].e
= dfactorRGB
;
1735 if (ctx
->ExecuteFlag
) {
1736 CALL_BlendFuncSeparate(ctx
->Exec
,
1737 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1742 static void GLAPIENTRY
1743 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1745 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1749 static void GLAPIENTRY
1750 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1752 GET_CURRENT_CONTEXT(ctx
);
1754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1755 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1767 /* GL_ARB_draw_buffers_blend */
1768 static void GLAPIENTRY
1769 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1770 GLenum sfactorA
, GLenum dfactorA
)
1772 GET_CURRENT_CONTEXT(ctx
);
1774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1775 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1778 n
[2].e
= sfactorRGB
;
1779 n
[3].e
= dfactorRGB
;
1783 if (ctx
->ExecuteFlag
) {
1784 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1785 sfactorA
, dfactorA
));
1789 /* GL_ARB_draw_buffers_blend */
1790 static void GLAPIENTRY
1791 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1793 GET_CURRENT_CONTEXT(ctx
);
1795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1796 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1802 if (ctx
->ExecuteFlag
) {
1803 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1807 /* GL_ARB_draw_buffers_blend */
1808 static void GLAPIENTRY
1809 save_BlendEquationi(GLuint buf
, GLenum mode
)
1811 GET_CURRENT_CONTEXT(ctx
);
1813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1814 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1819 if (ctx
->ExecuteFlag
) {
1820 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1824 /* GL_ARB_draw_buffers_blend */
1825 static void GLAPIENTRY
1826 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1828 GET_CURRENT_CONTEXT(ctx
);
1830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1831 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1837 if (ctx
->ExecuteFlag
) {
1838 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1843 /* GL_ARB_draw_instanced. */
1844 static void GLAPIENTRY
1845 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1847 UNUSED GLsizei count
,
1848 UNUSED GLsizei primcount
)
1850 GET_CURRENT_CONTEXT(ctx
);
1851 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1852 "glDrawArraysInstanced() during display list compile");
1855 static void GLAPIENTRY
1856 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1857 UNUSED GLsizei count
,
1859 UNUSED
const GLvoid
*indices
,
1860 UNUSED GLsizei primcount
)
1862 GET_CURRENT_CONTEXT(ctx
);
1863 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1864 "glDrawElementsInstanced() during display list compile");
1867 static void GLAPIENTRY
1868 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1869 UNUSED GLsizei count
,
1871 UNUSED
const GLvoid
*indices
,
1872 UNUSED GLsizei primcount
,
1873 UNUSED GLint basevertex
)
1875 GET_CURRENT_CONTEXT(ctx
);
1876 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1877 "glDrawElementsInstancedBaseVertex() during display list compile");
1880 /* GL_ARB_base_instance. */
1881 static void GLAPIENTRY
1882 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1884 UNUSED GLsizei count
,
1885 UNUSED GLsizei primcount
,
1886 UNUSED GLuint baseinstance
)
1888 GET_CURRENT_CONTEXT(ctx
);
1889 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1890 "glDrawArraysInstancedBaseInstance() during display list compile");
1893 static void APIENTRY
1894 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1895 UNUSED GLsizei count
,
1897 UNUSED
const void *indices
,
1898 UNUSED GLsizei primcount
,
1899 UNUSED GLuint baseinstance
)
1901 GET_CURRENT_CONTEXT(ctx
);
1902 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1903 "glDrawElementsInstancedBaseInstance() during display list compile");
1906 static void APIENTRY
1907 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1908 UNUSED GLsizei count
,
1910 UNUSED
const void *indices
,
1911 UNUSED GLsizei primcount
,
1912 UNUSED GLint basevertex
,
1913 UNUSED GLuint baseinstance
)
1915 GET_CURRENT_CONTEXT(ctx
);
1916 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1917 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1920 static void APIENTRY
1921 save_DrawArraysIndirect(UNUSED GLenum mode
,
1922 UNUSED
const void *indirect
)
1924 GET_CURRENT_CONTEXT(ctx
);
1925 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1926 "glDrawArraysIndirect() during display list compile");
1929 static void APIENTRY
1930 save_DrawElementsIndirect(UNUSED GLenum mode
,
1932 UNUSED
const void *indirect
)
1934 GET_CURRENT_CONTEXT(ctx
);
1935 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1936 "glDrawElementsIndirect() during display list compile");
1939 static void APIENTRY
1940 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1941 UNUSED
const void *indirect
,
1942 UNUSED GLsizei primcount
,
1943 UNUSED GLsizei stride
)
1945 GET_CURRENT_CONTEXT(ctx
);
1946 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1947 "glMultiDrawArraysIndirect() during display list compile");
1950 static void APIENTRY
1951 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
1953 UNUSED
const void *indirect
,
1954 UNUSED GLsizei primcount
,
1955 UNUSED GLsizei stride
)
1957 GET_CURRENT_CONTEXT(ctx
);
1958 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1959 "glMultiDrawElementsIndirect() during display list compile");
1963 * While building a display list we cache some OpenGL state.
1964 * Under some circumstances we need to invalidate that state (immediately
1965 * when we start compiling a list, or after glCallList(s)).
1968 invalidate_saved_current_state(struct gl_context
*ctx
)
1972 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1973 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1975 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1976 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1978 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1980 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1984 static void GLAPIENTRY
1985 save_CallList(GLuint list
)
1987 GET_CURRENT_CONTEXT(ctx
);
1989 SAVE_FLUSH_VERTICES(ctx
);
1991 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1996 /* After this, we don't know what state we're in. Invalidate all
1997 * cached information previously gathered:
1999 invalidate_saved_current_state( ctx
);
2001 if (ctx
->ExecuteFlag
) {
2002 _mesa_CallList(list
);
2007 static void GLAPIENTRY
2008 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2010 GET_CURRENT_CONTEXT(ctx
);
2015 SAVE_FLUSH_VERTICES(ctx
);
2019 case GL_UNSIGNED_BYTE
:
2023 case GL_UNSIGNED_SHORT
:
2031 case GL_UNSIGNED_INT
:
2040 if (num
> 0 && type_size
> 0) {
2041 /* create a copy of the array of list IDs to save in the display list */
2042 lists_copy
= memdup(lists
, num
* type_size
);
2047 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2051 save_pointer(&n
[3], lists_copy
);
2054 /* After this, we don't know what state we're in. Invalidate all
2055 * cached information previously gathered:
2057 invalidate_saved_current_state( ctx
);
2059 if (ctx
->ExecuteFlag
) {
2060 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2065 static void GLAPIENTRY
2066 save_Clear(GLbitfield mask
)
2068 GET_CURRENT_CONTEXT(ctx
);
2070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2071 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2075 if (ctx
->ExecuteFlag
) {
2076 CALL_Clear(ctx
->Exec
, (mask
));
2081 static void GLAPIENTRY
2082 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2084 GET_CURRENT_CONTEXT(ctx
);
2086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2087 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2090 n
[2].i
= drawbuffer
;
2092 if (buffer
== GL_COLOR
) {
2103 if (ctx
->ExecuteFlag
) {
2104 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2109 static void GLAPIENTRY
2110 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2112 GET_CURRENT_CONTEXT(ctx
);
2114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2115 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2118 n
[2].i
= drawbuffer
;
2120 if (buffer
== GL_COLOR
) {
2131 if (ctx
->ExecuteFlag
) {
2132 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2137 static void GLAPIENTRY
2138 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2140 GET_CURRENT_CONTEXT(ctx
);
2142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2143 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2146 n
[2].i
= drawbuffer
;
2148 if (buffer
== GL_COLOR
) {
2159 if (ctx
->ExecuteFlag
) {
2160 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2165 static void GLAPIENTRY
2166 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2167 GLfloat depth
, GLint stencil
)
2169 GET_CURRENT_CONTEXT(ctx
);
2171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2172 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2175 n
[2].i
= drawbuffer
;
2179 if (ctx
->ExecuteFlag
) {
2180 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2185 static void GLAPIENTRY
2186 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2188 GET_CURRENT_CONTEXT(ctx
);
2190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2191 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2198 if (ctx
->ExecuteFlag
) {
2199 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2204 static void GLAPIENTRY
2205 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2207 GET_CURRENT_CONTEXT(ctx
);
2209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2210 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2217 if (ctx
->ExecuteFlag
) {
2218 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2223 static void GLAPIENTRY
2224 save_ClearDepth(GLclampd depth
)
2226 GET_CURRENT_CONTEXT(ctx
);
2228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2229 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2231 n
[1].f
= (GLfloat
) depth
;
2233 if (ctx
->ExecuteFlag
) {
2234 CALL_ClearDepth(ctx
->Exec
, (depth
));
2239 static void GLAPIENTRY
2240 save_ClearIndex(GLfloat c
)
2242 GET_CURRENT_CONTEXT(ctx
);
2244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2245 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2249 if (ctx
->ExecuteFlag
) {
2250 CALL_ClearIndex(ctx
->Exec
, (c
));
2255 static void GLAPIENTRY
2256 save_ClearStencil(GLint s
)
2258 GET_CURRENT_CONTEXT(ctx
);
2260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2261 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2265 if (ctx
->ExecuteFlag
) {
2266 CALL_ClearStencil(ctx
->Exec
, (s
));
2271 static void GLAPIENTRY
2272 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2274 GET_CURRENT_CONTEXT(ctx
);
2276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2277 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2280 n
[2].f
= (GLfloat
) equ
[0];
2281 n
[3].f
= (GLfloat
) equ
[1];
2282 n
[4].f
= (GLfloat
) equ
[2];
2283 n
[5].f
= (GLfloat
) equ
[3];
2285 if (ctx
->ExecuteFlag
) {
2286 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2292 static void GLAPIENTRY
2293 save_ColorMask(GLboolean red
, GLboolean green
,
2294 GLboolean blue
, GLboolean alpha
)
2296 GET_CURRENT_CONTEXT(ctx
);
2298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2299 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2306 if (ctx
->ExecuteFlag
) {
2307 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2312 static void GLAPIENTRY
2313 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2314 GLboolean blue
, GLboolean alpha
)
2316 GET_CURRENT_CONTEXT(ctx
);
2318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2319 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2327 if (ctx
->ExecuteFlag
) {
2328 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2333 static void GLAPIENTRY
2334 save_ColorMaterial(GLenum face
, GLenum mode
)
2336 GET_CURRENT_CONTEXT(ctx
);
2338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2340 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2345 if (ctx
->ExecuteFlag
) {
2346 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2351 static void GLAPIENTRY
2352 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2354 GET_CURRENT_CONTEXT(ctx
);
2356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2357 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2361 n
[3].i
= (GLint
) width
;
2362 n
[4].i
= (GLint
) height
;
2365 if (ctx
->ExecuteFlag
) {
2366 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2372 static void GLAPIENTRY
2373 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2374 GLint x
, GLint y
, GLsizei width
, GLint border
)
2376 GET_CURRENT_CONTEXT(ctx
);
2378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2379 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2383 n
[3].e
= internalformat
;
2389 if (ctx
->ExecuteFlag
) {
2390 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2391 x
, y
, width
, border
));
2396 static void GLAPIENTRY
2397 save_CopyTexImage2D(GLenum target
, GLint level
,
2398 GLenum internalformat
,
2399 GLint x
, GLint y
, GLsizei width
,
2400 GLsizei height
, GLint border
)
2402 GET_CURRENT_CONTEXT(ctx
);
2404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2405 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2409 n
[3].e
= internalformat
;
2416 if (ctx
->ExecuteFlag
) {
2417 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2418 x
, y
, width
, height
, border
));
2424 static void GLAPIENTRY
2425 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2426 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2428 GET_CURRENT_CONTEXT(ctx
);
2430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2431 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2440 if (ctx
->ExecuteFlag
) {
2441 CALL_CopyTexSubImage1D(ctx
->Exec
,
2442 (target
, level
, xoffset
, x
, y
, width
));
2447 static void GLAPIENTRY
2448 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2449 GLint xoffset
, GLint yoffset
,
2450 GLint x
, GLint y
, GLsizei width
, GLint height
)
2452 GET_CURRENT_CONTEXT(ctx
);
2454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2455 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2466 if (ctx
->ExecuteFlag
) {
2467 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2468 x
, y
, width
, height
));
2473 static void GLAPIENTRY
2474 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2475 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2476 GLint x
, GLint y
, GLsizei width
, GLint height
)
2478 GET_CURRENT_CONTEXT(ctx
);
2480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2481 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2493 if (ctx
->ExecuteFlag
) {
2494 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2495 xoffset
, yoffset
, zoffset
,
2496 x
, y
, width
, height
));
2501 static void GLAPIENTRY
2502 save_CullFace(GLenum mode
)
2504 GET_CURRENT_CONTEXT(ctx
);
2506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2507 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2511 if (ctx
->ExecuteFlag
) {
2512 CALL_CullFace(ctx
->Exec
, (mode
));
2517 static void GLAPIENTRY
2518 save_DepthFunc(GLenum func
)
2520 GET_CURRENT_CONTEXT(ctx
);
2522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2523 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2527 if (ctx
->ExecuteFlag
) {
2528 CALL_DepthFunc(ctx
->Exec
, (func
));
2533 static void GLAPIENTRY
2534 save_DepthMask(GLboolean mask
)
2536 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2543 if (ctx
->ExecuteFlag
) {
2544 CALL_DepthMask(ctx
->Exec
, (mask
));
2549 static void GLAPIENTRY
2550 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2552 GET_CURRENT_CONTEXT(ctx
);
2554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2555 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2557 n
[1].f
= (GLfloat
) nearval
;
2558 n
[2].f
= (GLfloat
) farval
;
2560 if (ctx
->ExecuteFlag
) {
2561 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2566 static void GLAPIENTRY
2567 save_Disable(GLenum cap
)
2569 GET_CURRENT_CONTEXT(ctx
);
2571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2572 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2576 if (ctx
->ExecuteFlag
) {
2577 CALL_Disable(ctx
->Exec
, (cap
));
2582 static void GLAPIENTRY
2583 save_DisableIndexed(GLuint index
, GLenum cap
)
2585 GET_CURRENT_CONTEXT(ctx
);
2587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2588 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2593 if (ctx
->ExecuteFlag
) {
2594 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2599 static void GLAPIENTRY
2600 save_DrawBuffer(GLenum mode
)
2602 GET_CURRENT_CONTEXT(ctx
);
2604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2605 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2609 if (ctx
->ExecuteFlag
) {
2610 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2615 static void GLAPIENTRY
2616 save_DrawPixels(GLsizei width
, GLsizei height
,
2617 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2619 GET_CURRENT_CONTEXT(ctx
);
2622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2624 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2631 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2632 pixels
, &ctx
->Unpack
));
2634 if (ctx
->ExecuteFlag
) {
2635 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2641 static void GLAPIENTRY
2642 save_Enable(GLenum cap
)
2644 GET_CURRENT_CONTEXT(ctx
);
2646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2647 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2651 if (ctx
->ExecuteFlag
) {
2652 CALL_Enable(ctx
->Exec
, (cap
));
2658 static void GLAPIENTRY
2659 save_EnableIndexed(GLuint index
, GLenum cap
)
2661 GET_CURRENT_CONTEXT(ctx
);
2663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2664 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2669 if (ctx
->ExecuteFlag
) {
2670 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2676 static void GLAPIENTRY
2677 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2679 GET_CURRENT_CONTEXT(ctx
);
2681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2682 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2688 if (ctx
->ExecuteFlag
) {
2689 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2694 static void GLAPIENTRY
2695 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2697 GET_CURRENT_CONTEXT(ctx
);
2699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2700 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2708 if (ctx
->ExecuteFlag
) {
2709 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2716 static void GLAPIENTRY
2717 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2719 GET_CURRENT_CONTEXT(ctx
);
2721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2722 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2730 if (ctx
->ExecuteFlag
) {
2731 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2736 static void GLAPIENTRY
2737 save_Fogf(GLenum pname
, GLfloat param
)
2741 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2742 save_Fogfv(pname
, parray
);
2746 static void GLAPIENTRY
2747 save_Fogiv(GLenum pname
, const GLint
*params
)
2752 case GL_FOG_DENSITY
:
2756 p
[0] = (GLfloat
) *params
;
2762 p
[0] = INT_TO_FLOAT(params
[0]);
2763 p
[1] = INT_TO_FLOAT(params
[1]);
2764 p
[2] = INT_TO_FLOAT(params
[2]);
2765 p
[3] = INT_TO_FLOAT(params
[3]);
2768 /* Error will be caught later in gl_Fogfv */
2769 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2771 save_Fogfv(pname
, p
);
2775 static void GLAPIENTRY
2776 save_Fogi(GLenum pname
, GLint param
)
2780 parray
[1] = parray
[2] = parray
[3] = 0;
2781 save_Fogiv(pname
, parray
);
2785 static void GLAPIENTRY
2786 save_FrontFace(GLenum mode
)
2788 GET_CURRENT_CONTEXT(ctx
);
2790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2791 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2795 if (ctx
->ExecuteFlag
) {
2796 CALL_FrontFace(ctx
->Exec
, (mode
));
2801 static void GLAPIENTRY
2802 save_Frustum(GLdouble left
, GLdouble right
,
2803 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2805 GET_CURRENT_CONTEXT(ctx
);
2807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2808 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2810 n
[1].f
= (GLfloat
) left
;
2811 n
[2].f
= (GLfloat
) right
;
2812 n
[3].f
= (GLfloat
) bottom
;
2813 n
[4].f
= (GLfloat
) top
;
2814 n
[5].f
= (GLfloat
) nearval
;
2815 n
[6].f
= (GLfloat
) farval
;
2817 if (ctx
->ExecuteFlag
) {
2818 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2823 static void GLAPIENTRY
2824 save_Hint(GLenum target
, GLenum mode
)
2826 GET_CURRENT_CONTEXT(ctx
);
2828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2829 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2834 if (ctx
->ExecuteFlag
) {
2835 CALL_Hint(ctx
->Exec
, (target
, mode
));
2840 static void GLAPIENTRY
2841 save_IndexMask(GLuint mask
)
2843 GET_CURRENT_CONTEXT(ctx
);
2845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2846 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2850 if (ctx
->ExecuteFlag
) {
2851 CALL_IndexMask(ctx
->Exec
, (mask
));
2856 static void GLAPIENTRY
2857 save_InitNames(void)
2859 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2862 if (ctx
->ExecuteFlag
) {
2863 CALL_InitNames(ctx
->Exec
, ());
2868 static void GLAPIENTRY
2869 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2871 GET_CURRENT_CONTEXT(ctx
);
2873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2874 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2892 case GL_SPOT_DIRECTION
:
2895 case GL_SPOT_EXPONENT
:
2898 case GL_SPOT_CUTOFF
:
2901 case GL_CONSTANT_ATTENUATION
:
2904 case GL_LINEAR_ATTENUATION
:
2907 case GL_QUADRATIC_ATTENUATION
:
2913 for (i
= 0; i
< nParams
; i
++) {
2914 n
[3 + i
].f
= params
[i
];
2917 if (ctx
->ExecuteFlag
) {
2918 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2923 static void GLAPIENTRY
2924 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2928 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2929 save_Lightfv(light
, pname
, parray
);
2933 static void GLAPIENTRY
2934 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2941 fparam
[0] = INT_TO_FLOAT(params
[0]);
2942 fparam
[1] = INT_TO_FLOAT(params
[1]);
2943 fparam
[2] = INT_TO_FLOAT(params
[2]);
2944 fparam
[3] = INT_TO_FLOAT(params
[3]);
2947 fparam
[0] = (GLfloat
) params
[0];
2948 fparam
[1] = (GLfloat
) params
[1];
2949 fparam
[2] = (GLfloat
) params
[2];
2950 fparam
[3] = (GLfloat
) params
[3];
2952 case GL_SPOT_DIRECTION
:
2953 fparam
[0] = (GLfloat
) params
[0];
2954 fparam
[1] = (GLfloat
) params
[1];
2955 fparam
[2] = (GLfloat
) params
[2];
2957 case GL_SPOT_EXPONENT
:
2958 case GL_SPOT_CUTOFF
:
2959 case GL_CONSTANT_ATTENUATION
:
2960 case GL_LINEAR_ATTENUATION
:
2961 case GL_QUADRATIC_ATTENUATION
:
2962 fparam
[0] = (GLfloat
) params
[0];
2965 /* error will be caught later in gl_Lightfv */
2968 save_Lightfv(light
, pname
, fparam
);
2972 static void GLAPIENTRY
2973 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2977 parray
[1] = parray
[2] = parray
[3] = 0;
2978 save_Lightiv(light
, pname
, parray
);
2982 static void GLAPIENTRY
2983 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2985 GET_CURRENT_CONTEXT(ctx
);
2987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2988 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2996 if (ctx
->ExecuteFlag
) {
2997 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3002 static void GLAPIENTRY
3003 save_LightModelf(GLenum pname
, GLfloat param
)
3007 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3008 save_LightModelfv(pname
, parray
);
3012 static void GLAPIENTRY
3013 save_LightModeliv(GLenum pname
, const GLint
*params
)
3017 case GL_LIGHT_MODEL_AMBIENT
:
3018 fparam
[0] = INT_TO_FLOAT(params
[0]);
3019 fparam
[1] = INT_TO_FLOAT(params
[1]);
3020 fparam
[2] = INT_TO_FLOAT(params
[2]);
3021 fparam
[3] = INT_TO_FLOAT(params
[3]);
3023 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3024 case GL_LIGHT_MODEL_TWO_SIDE
:
3025 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3026 fparam
[0] = (GLfloat
) params
[0];
3032 /* Error will be caught later in gl_LightModelfv */
3033 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3035 save_LightModelfv(pname
, fparam
);
3039 static void GLAPIENTRY
3040 save_LightModeli(GLenum pname
, GLint param
)
3044 parray
[1] = parray
[2] = parray
[3] = 0;
3045 save_LightModeliv(pname
, parray
);
3049 static void GLAPIENTRY
3050 save_LineStipple(GLint factor
, GLushort pattern
)
3052 GET_CURRENT_CONTEXT(ctx
);
3054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3055 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3060 if (ctx
->ExecuteFlag
) {
3061 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3066 static void GLAPIENTRY
3067 save_LineWidth(GLfloat width
)
3069 GET_CURRENT_CONTEXT(ctx
);
3071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3072 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3076 if (ctx
->ExecuteFlag
) {
3077 CALL_LineWidth(ctx
->Exec
, (width
));
3082 static void GLAPIENTRY
3083 save_ListBase(GLuint base
)
3085 GET_CURRENT_CONTEXT(ctx
);
3087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3088 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3092 if (ctx
->ExecuteFlag
) {
3093 CALL_ListBase(ctx
->Exec
, (base
));
3098 static void GLAPIENTRY
3099 save_LoadIdentity(void)
3101 GET_CURRENT_CONTEXT(ctx
);
3102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3103 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3104 if (ctx
->ExecuteFlag
) {
3105 CALL_LoadIdentity(ctx
->Exec
, ());
3110 static void GLAPIENTRY
3111 save_LoadMatrixf(const GLfloat
* m
)
3113 GET_CURRENT_CONTEXT(ctx
);
3115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3116 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3119 for (i
= 0; i
< 16; i
++) {
3123 if (ctx
->ExecuteFlag
) {
3124 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3129 static void GLAPIENTRY
3130 save_LoadMatrixd(const GLdouble
* m
)
3134 for (i
= 0; i
< 16; i
++) {
3135 f
[i
] = (GLfloat
) m
[i
];
3137 save_LoadMatrixf(f
);
3141 static void GLAPIENTRY
3142 save_LoadName(GLuint name
)
3144 GET_CURRENT_CONTEXT(ctx
);
3146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3147 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3151 if (ctx
->ExecuteFlag
) {
3152 CALL_LoadName(ctx
->Exec
, (name
));
3157 static void GLAPIENTRY
3158 save_LogicOp(GLenum opcode
)
3160 GET_CURRENT_CONTEXT(ctx
);
3162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3163 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3167 if (ctx
->ExecuteFlag
) {
3168 CALL_LogicOp(ctx
->Exec
, (opcode
));
3173 static void GLAPIENTRY
3174 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3175 GLint order
, const GLdouble
* points
)
3177 GET_CURRENT_CONTEXT(ctx
);
3179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3180 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3182 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3184 n
[2].f
= (GLfloat
) u1
;
3185 n
[3].f
= (GLfloat
) u2
;
3186 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3188 save_pointer(&n
[6], pnts
);
3190 if (ctx
->ExecuteFlag
) {
3191 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3195 static void GLAPIENTRY
3196 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3197 GLint order
, const GLfloat
* points
)
3199 GET_CURRENT_CONTEXT(ctx
);
3201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3202 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3204 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3208 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3210 save_pointer(&n
[6], pnts
);
3212 if (ctx
->ExecuteFlag
) {
3213 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3218 static void GLAPIENTRY
3219 save_Map2d(GLenum target
,
3220 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3221 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3222 const GLdouble
* points
)
3224 GET_CURRENT_CONTEXT(ctx
);
3226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3227 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3229 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3230 vstride
, vorder
, points
);
3232 n
[2].f
= (GLfloat
) u1
;
3233 n
[3].f
= (GLfloat
) u2
;
3234 n
[4].f
= (GLfloat
) v1
;
3235 n
[5].f
= (GLfloat
) v2
;
3236 /* XXX verify these strides are correct */
3237 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3238 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3241 save_pointer(&n
[10], pnts
);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_Map2d(ctx
->Exec
, (target
,
3245 u1
, u2
, ustride
, uorder
,
3246 v1
, v2
, vstride
, vorder
, points
));
3251 static void GLAPIENTRY
3252 save_Map2f(GLenum target
,
3253 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3254 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3255 const GLfloat
* points
)
3257 GET_CURRENT_CONTEXT(ctx
);
3259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3260 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3262 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3263 vstride
, vorder
, points
);
3269 /* XXX verify these strides are correct */
3270 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3271 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3274 save_pointer(&n
[10], pnts
);
3276 if (ctx
->ExecuteFlag
) {
3277 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3278 v1
, v2
, vstride
, vorder
, points
));
3283 static void GLAPIENTRY
3284 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3286 GET_CURRENT_CONTEXT(ctx
);
3288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3289 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3295 if (ctx
->ExecuteFlag
) {
3296 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3301 static void GLAPIENTRY
3302 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3304 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3308 static void GLAPIENTRY
3309 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3310 GLint vn
, GLfloat v1
, GLfloat v2
)
3312 GET_CURRENT_CONTEXT(ctx
);
3314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3315 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3324 if (ctx
->ExecuteFlag
) {
3325 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3331 static void GLAPIENTRY
3332 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3333 GLint vn
, GLdouble v1
, GLdouble v2
)
3335 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3336 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3340 static void GLAPIENTRY
3341 save_MatrixMode(GLenum mode
)
3343 GET_CURRENT_CONTEXT(ctx
);
3345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3346 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3350 if (ctx
->ExecuteFlag
) {
3351 CALL_MatrixMode(ctx
->Exec
, (mode
));
3356 static void GLAPIENTRY
3357 save_MultMatrixf(const GLfloat
* m
)
3359 GET_CURRENT_CONTEXT(ctx
);
3361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3362 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3365 for (i
= 0; i
< 16; i
++) {
3369 if (ctx
->ExecuteFlag
) {
3370 CALL_MultMatrixf(ctx
->Exec
, (m
));
3375 static void GLAPIENTRY
3376 save_MultMatrixd(const GLdouble
* m
)
3380 for (i
= 0; i
< 16; i
++) {
3381 f
[i
] = (GLfloat
) m
[i
];
3383 save_MultMatrixf(f
);
3387 static void GLAPIENTRY
3388 save_NewList(GLuint name
, GLenum mode
)
3390 GET_CURRENT_CONTEXT(ctx
);
3391 /* It's an error to call this function while building a display list */
3392 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3399 static void GLAPIENTRY
3400 save_Ortho(GLdouble left
, GLdouble right
,
3401 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3403 GET_CURRENT_CONTEXT(ctx
);
3405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3406 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3408 n
[1].f
= (GLfloat
) left
;
3409 n
[2].f
= (GLfloat
) right
;
3410 n
[3].f
= (GLfloat
) bottom
;
3411 n
[4].f
= (GLfloat
) top
;
3412 n
[5].f
= (GLfloat
) nearval
;
3413 n
[6].f
= (GLfloat
) farval
;
3415 if (ctx
->ExecuteFlag
) {
3416 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3421 static void GLAPIENTRY
3422 save_PatchParameteri(GLenum pname
, const GLint value
)
3424 GET_CURRENT_CONTEXT(ctx
);
3426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3427 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3432 if (ctx
->ExecuteFlag
) {
3433 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3438 static void GLAPIENTRY
3439 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3441 GET_CURRENT_CONTEXT(ctx
);
3443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3445 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3446 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3448 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3449 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3453 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3463 if (ctx
->ExecuteFlag
) {
3464 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3469 static void GLAPIENTRY
3470 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3472 GET_CURRENT_CONTEXT(ctx
);
3474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3475 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3479 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3481 if (ctx
->ExecuteFlag
) {
3482 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3487 static void GLAPIENTRY
3488 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3490 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3492 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3493 for (i
= 0; i
< mapsize
; i
++) {
3494 fvalues
[i
] = (GLfloat
) values
[i
];
3498 for (i
= 0; i
< mapsize
; i
++) {
3499 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3502 save_PixelMapfv(map
, mapsize
, fvalues
);
3506 static void GLAPIENTRY
3507 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3509 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3511 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3512 for (i
= 0; i
< mapsize
; i
++) {
3513 fvalues
[i
] = (GLfloat
) values
[i
];
3517 for (i
= 0; i
< mapsize
; i
++) {
3518 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3521 save_PixelMapfv(map
, mapsize
, fvalues
);
3525 static void GLAPIENTRY
3526 save_PixelTransferf(GLenum pname
, GLfloat param
)
3528 GET_CURRENT_CONTEXT(ctx
);
3530 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3531 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3536 if (ctx
->ExecuteFlag
) {
3537 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3542 static void GLAPIENTRY
3543 save_PixelTransferi(GLenum pname
, GLint param
)
3545 save_PixelTransferf(pname
, (GLfloat
) param
);
3549 static void GLAPIENTRY
3550 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3552 GET_CURRENT_CONTEXT(ctx
);
3554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3555 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3560 if (ctx
->ExecuteFlag
) {
3561 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3566 static void GLAPIENTRY
3567 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3569 GET_CURRENT_CONTEXT(ctx
);
3571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3572 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3579 if (ctx
->ExecuteFlag
) {
3580 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3585 static void GLAPIENTRY
3586 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3590 parray
[1] = parray
[2] = 0.0F
;
3591 save_PointParameterfvEXT(pname
, parray
);
3594 static void GLAPIENTRY
3595 save_PointParameteriNV(GLenum pname
, GLint param
)
3598 parray
[0] = (GLfloat
) param
;
3599 parray
[1] = parray
[2] = 0.0F
;
3600 save_PointParameterfvEXT(pname
, parray
);
3603 static void GLAPIENTRY
3604 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3607 parray
[0] = (GLfloat
) param
[0];
3608 parray
[1] = parray
[2] = 0.0F
;
3609 save_PointParameterfvEXT(pname
, parray
);
3613 static void GLAPIENTRY
3614 save_PointSize(GLfloat size
)
3616 GET_CURRENT_CONTEXT(ctx
);
3618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3619 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3623 if (ctx
->ExecuteFlag
) {
3624 CALL_PointSize(ctx
->Exec
, (size
));
3629 static void GLAPIENTRY
3630 save_PolygonMode(GLenum face
, GLenum mode
)
3632 GET_CURRENT_CONTEXT(ctx
);
3634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3635 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3640 if (ctx
->ExecuteFlag
) {
3641 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3646 static void GLAPIENTRY
3647 save_PolygonStipple(const GLubyte
* pattern
)
3649 GET_CURRENT_CONTEXT(ctx
);
3652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3654 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3657 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3658 pattern
, &ctx
->Unpack
));
3660 if (ctx
->ExecuteFlag
) {
3661 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3666 static void GLAPIENTRY
3667 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3669 GET_CURRENT_CONTEXT(ctx
);
3671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3672 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3677 if (ctx
->ExecuteFlag
) {
3678 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3683 static void GLAPIENTRY
3684 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3686 GET_CURRENT_CONTEXT(ctx
);
3688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3689 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3695 if (ctx
->ExecuteFlag
) {
3696 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3700 static void GLAPIENTRY
3701 save_PopAttrib(void)
3703 GET_CURRENT_CONTEXT(ctx
);
3704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3705 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3706 if (ctx
->ExecuteFlag
) {
3707 CALL_PopAttrib(ctx
->Exec
, ());
3712 static void GLAPIENTRY
3713 save_PopMatrix(void)
3715 GET_CURRENT_CONTEXT(ctx
);
3716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3717 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3718 if (ctx
->ExecuteFlag
) {
3719 CALL_PopMatrix(ctx
->Exec
, ());
3724 static void GLAPIENTRY
3727 GET_CURRENT_CONTEXT(ctx
);
3728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3729 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3730 if (ctx
->ExecuteFlag
) {
3731 CALL_PopName(ctx
->Exec
, ());
3736 static void GLAPIENTRY
3737 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3738 const GLclampf
* priorities
)
3740 GET_CURRENT_CONTEXT(ctx
);
3742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3744 for (i
= 0; i
< num
; i
++) {
3746 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3748 n
[1].ui
= textures
[i
];
3749 n
[2].f
= priorities
[i
];
3752 if (ctx
->ExecuteFlag
) {
3753 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3758 static void GLAPIENTRY
3759 save_PushAttrib(GLbitfield mask
)
3761 GET_CURRENT_CONTEXT(ctx
);
3763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3764 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3768 if (ctx
->ExecuteFlag
) {
3769 CALL_PushAttrib(ctx
->Exec
, (mask
));
3774 static void GLAPIENTRY
3775 save_PushMatrix(void)
3777 GET_CURRENT_CONTEXT(ctx
);
3778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3779 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3780 if (ctx
->ExecuteFlag
) {
3781 CALL_PushMatrix(ctx
->Exec
, ());
3786 static void GLAPIENTRY
3787 save_PushName(GLuint name
)
3789 GET_CURRENT_CONTEXT(ctx
);
3791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3792 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3796 if (ctx
->ExecuteFlag
) {
3797 CALL_PushName(ctx
->Exec
, (name
));
3802 static void GLAPIENTRY
3803 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3805 GET_CURRENT_CONTEXT(ctx
);
3807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3808 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3815 if (ctx
->ExecuteFlag
) {
3816 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3820 static void GLAPIENTRY
3821 save_RasterPos2d(GLdouble x
, GLdouble y
)
3823 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3826 static void GLAPIENTRY
3827 save_RasterPos2f(GLfloat x
, GLfloat y
)
3829 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3832 static void GLAPIENTRY
3833 save_RasterPos2i(GLint x
, GLint y
)
3835 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3838 static void GLAPIENTRY
3839 save_RasterPos2s(GLshort x
, GLshort y
)
3841 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3844 static void GLAPIENTRY
3845 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3847 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3850 static void GLAPIENTRY
3851 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3853 save_RasterPos4f(x
, y
, z
, 1.0F
);
3856 static void GLAPIENTRY
3857 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3859 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3862 static void GLAPIENTRY
3863 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3865 save_RasterPos4f(x
, y
, z
, 1.0F
);
3868 static void GLAPIENTRY
3869 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3871 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3874 static void GLAPIENTRY
3875 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3877 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3880 static void GLAPIENTRY
3881 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3883 save_RasterPos4f(x
, y
, z
, w
);
3886 static void GLAPIENTRY
3887 save_RasterPos2dv(const GLdouble
* v
)
3889 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3892 static void GLAPIENTRY
3893 save_RasterPos2fv(const GLfloat
* v
)
3895 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3898 static void GLAPIENTRY
3899 save_RasterPos2iv(const GLint
* v
)
3901 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3904 static void GLAPIENTRY
3905 save_RasterPos2sv(const GLshort
* v
)
3907 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3910 static void GLAPIENTRY
3911 save_RasterPos3dv(const GLdouble
* v
)
3913 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3916 static void GLAPIENTRY
3917 save_RasterPos3fv(const GLfloat
* v
)
3919 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3922 static void GLAPIENTRY
3923 save_RasterPos3iv(const GLint
* v
)
3925 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3928 static void GLAPIENTRY
3929 save_RasterPos3sv(const GLshort
* v
)
3931 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3934 static void GLAPIENTRY
3935 save_RasterPos4dv(const GLdouble
* v
)
3937 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3938 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3941 static void GLAPIENTRY
3942 save_RasterPos4fv(const GLfloat
* v
)
3944 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3947 static void GLAPIENTRY
3948 save_RasterPos4iv(const GLint
* v
)
3950 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3951 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3954 static void GLAPIENTRY
3955 save_RasterPos4sv(const GLshort
* v
)
3957 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3961 static void GLAPIENTRY
3962 save_PassThrough(GLfloat token
)
3964 GET_CURRENT_CONTEXT(ctx
);
3966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3967 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3971 if (ctx
->ExecuteFlag
) {
3972 CALL_PassThrough(ctx
->Exec
, (token
));
3977 static void GLAPIENTRY
3978 save_ReadBuffer(GLenum mode
)
3980 GET_CURRENT_CONTEXT(ctx
);
3982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3983 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3987 if (ctx
->ExecuteFlag
) {
3988 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3993 static void GLAPIENTRY
3994 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3996 GET_CURRENT_CONTEXT(ctx
);
3998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3999 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4006 if (ctx
->ExecuteFlag
) {
4007 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4012 static void GLAPIENTRY
4013 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4015 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4019 static void GLAPIENTRY
4020 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4022 GET_CURRENT_CONTEXT(ctx
);
4024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4025 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4031 if (ctx
->ExecuteFlag
) {
4032 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4037 static void GLAPIENTRY
4038 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4040 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4044 static void GLAPIENTRY
4045 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4047 GET_CURRENT_CONTEXT(ctx
);
4049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4050 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4057 if (ctx
->ExecuteFlag
) {
4058 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4063 static void GLAPIENTRY
4064 save_ShadeModel(GLenum mode
)
4066 GET_CURRENT_CONTEXT(ctx
);
4068 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4070 if (ctx
->ExecuteFlag
) {
4071 CALL_ShadeModel(ctx
->Exec
, (mode
));
4074 /* Don't compile this call if it's a no-op.
4075 * By avoiding this state change we have a better chance of
4076 * coalescing subsequent drawing commands into one batch.
4078 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4081 SAVE_FLUSH_VERTICES(ctx
);
4083 ctx
->ListState
.Current
.ShadeModel
= mode
;
4085 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4092 static void GLAPIENTRY
4093 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4095 GET_CURRENT_CONTEXT(ctx
);
4097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4098 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4104 if (ctx
->ExecuteFlag
) {
4105 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4110 static void GLAPIENTRY
4111 save_StencilMask(GLuint mask
)
4113 GET_CURRENT_CONTEXT(ctx
);
4115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4116 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4120 if (ctx
->ExecuteFlag
) {
4121 CALL_StencilMask(ctx
->Exec
, (mask
));
4126 static void GLAPIENTRY
4127 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4129 GET_CURRENT_CONTEXT(ctx
);
4131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4132 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4138 if (ctx
->ExecuteFlag
) {
4139 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4144 static void GLAPIENTRY
4145 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4147 GET_CURRENT_CONTEXT(ctx
);
4149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4150 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4157 if (ctx
->ExecuteFlag
) {
4158 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4163 static void GLAPIENTRY
4164 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4167 GET_CURRENT_CONTEXT(ctx
);
4169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4171 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4179 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4186 if (ctx
->ExecuteFlag
) {
4187 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4188 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4193 static void GLAPIENTRY
4194 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4196 GET_CURRENT_CONTEXT(ctx
);
4198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4199 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4204 if (ctx
->ExecuteFlag
) {
4205 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4210 static void GLAPIENTRY
4211 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4213 GET_CURRENT_CONTEXT(ctx
);
4215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4216 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4223 if (ctx
->ExecuteFlag
) {
4224 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4229 static void GLAPIENTRY
4230 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4232 GET_CURRENT_CONTEXT(ctx
);
4234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4235 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4239 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4247 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4250 if (ctx
->ExecuteFlag
) {
4251 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4256 static void GLAPIENTRY
4257 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4260 parray
[0] = (GLfloat
) param
;
4261 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4262 save_TexEnvfv(target
, pname
, parray
);
4266 static void GLAPIENTRY
4267 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4270 p
[0] = (GLfloat
) param
;
4271 p
[1] = p
[2] = p
[3] = 0.0F
;
4272 save_TexEnvfv(target
, pname
, p
);
4276 static void GLAPIENTRY
4277 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4280 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4281 p
[0] = INT_TO_FLOAT(param
[0]);
4282 p
[1] = INT_TO_FLOAT(param
[1]);
4283 p
[2] = INT_TO_FLOAT(param
[2]);
4284 p
[3] = INT_TO_FLOAT(param
[3]);
4287 p
[0] = (GLfloat
) param
[0];
4288 p
[1] = p
[2] = p
[3] = 0.0F
;
4290 save_TexEnvfv(target
, pname
, p
);
4294 static void GLAPIENTRY
4295 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4297 GET_CURRENT_CONTEXT(ctx
);
4299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4300 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4309 if (ctx
->ExecuteFlag
) {
4310 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4315 static void GLAPIENTRY
4316 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4319 p
[0] = (GLfloat
) params
[0];
4320 p
[1] = (GLfloat
) params
[1];
4321 p
[2] = (GLfloat
) params
[2];
4322 p
[3] = (GLfloat
) params
[3];
4323 save_TexGenfv(coord
, pname
, p
);
4327 static void GLAPIENTRY
4328 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4331 parray
[0] = (GLfloat
) param
;
4332 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4333 save_TexGenfv(coord
, pname
, parray
);
4337 static void GLAPIENTRY
4338 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4341 p
[0] = (GLfloat
) params
[0];
4342 p
[1] = (GLfloat
) params
[1];
4343 p
[2] = (GLfloat
) params
[2];
4344 p
[3] = (GLfloat
) params
[3];
4345 save_TexGenfv(coord
, pname
, p
);
4349 static void GLAPIENTRY
4350 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4354 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4355 save_TexGenfv(coord
, pname
, parray
);
4359 static void GLAPIENTRY
4360 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4364 parray
[1] = parray
[2] = parray
[3] = 0;
4365 save_TexGeniv(coord
, pname
, parray
);
4369 static void GLAPIENTRY
4370 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4372 GET_CURRENT_CONTEXT(ctx
);
4374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4375 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4384 if (ctx
->ExecuteFlag
) {
4385 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4390 static void GLAPIENTRY
4391 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4395 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4396 save_TexParameterfv(target
, pname
, parray
);
4400 static void GLAPIENTRY
4401 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4404 fparam
[0] = (GLfloat
) param
;
4405 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4406 save_TexParameterfv(target
, pname
, fparam
);
4410 static void GLAPIENTRY
4411 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4414 fparam
[0] = (GLfloat
) params
[0];
4415 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4416 save_TexParameterfv(target
, pname
, fparam
);
4420 static void GLAPIENTRY
4421 save_TexImage1D(GLenum target
,
4422 GLint level
, GLint components
,
4423 GLsizei width
, GLint border
,
4424 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4426 GET_CURRENT_CONTEXT(ctx
);
4427 if (target
== GL_PROXY_TEXTURE_1D
) {
4428 /* don't compile, execute immediately */
4429 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4430 border
, format
, type
, pixels
));
4434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4435 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4439 n
[3].i
= components
;
4440 n
[4].i
= (GLint
) width
;
4445 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4446 pixels
, &ctx
->Unpack
));
4448 if (ctx
->ExecuteFlag
) {
4449 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4450 border
, format
, type
, pixels
));
4456 static void GLAPIENTRY
4457 save_TexImage2D(GLenum target
,
4458 GLint level
, GLint components
,
4459 GLsizei width
, GLsizei height
, GLint border
,
4460 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4462 GET_CURRENT_CONTEXT(ctx
);
4463 if (target
== GL_PROXY_TEXTURE_2D
) {
4464 /* don't compile, execute immediately */
4465 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4466 height
, border
, format
, type
, pixels
));
4470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4471 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4475 n
[3].i
= components
;
4476 n
[4].i
= (GLint
) width
;
4477 n
[5].i
= (GLint
) height
;
4482 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4483 pixels
, &ctx
->Unpack
));
4485 if (ctx
->ExecuteFlag
) {
4486 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4487 height
, border
, format
, type
, pixels
));
4493 static void GLAPIENTRY
4494 save_TexImage3D(GLenum target
,
4495 GLint level
, GLint internalFormat
,
4496 GLsizei width
, GLsizei height
, GLsizei depth
,
4498 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4500 GET_CURRENT_CONTEXT(ctx
);
4501 if (target
== GL_PROXY_TEXTURE_3D
) {
4502 /* don't compile, execute immediately */
4503 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4504 height
, depth
, border
, format
, type
,
4509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4510 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4514 n
[3].i
= (GLint
) internalFormat
;
4515 n
[4].i
= (GLint
) width
;
4516 n
[5].i
= (GLint
) height
;
4517 n
[6].i
= (GLint
) depth
;
4521 save_pointer(&n
[10],
4522 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4523 pixels
, &ctx
->Unpack
));
4525 if (ctx
->ExecuteFlag
) {
4526 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4527 height
, depth
, border
, format
, type
,
4534 static void GLAPIENTRY
4535 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4536 GLsizei width
, GLenum format
, GLenum type
,
4537 const GLvoid
* pixels
)
4539 GET_CURRENT_CONTEXT(ctx
);
4542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4544 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4549 n
[4].i
= (GLint
) width
;
4553 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4554 pixels
, &ctx
->Unpack
));
4556 if (ctx
->ExecuteFlag
) {
4557 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4558 format
, type
, pixels
));
4563 static void GLAPIENTRY
4564 save_TexSubImage2D(GLenum target
, GLint level
,
4565 GLint xoffset
, GLint yoffset
,
4566 GLsizei width
, GLsizei height
,
4567 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4569 GET_CURRENT_CONTEXT(ctx
);
4572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4574 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4580 n
[5].i
= (GLint
) width
;
4581 n
[6].i
= (GLint
) height
;
4585 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4586 pixels
, &ctx
->Unpack
));
4588 if (ctx
->ExecuteFlag
) {
4589 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4590 width
, height
, format
, type
, pixels
));
4595 static void GLAPIENTRY
4596 save_TexSubImage3D(GLenum target
, GLint level
,
4597 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4598 GLsizei width
, GLsizei height
, GLsizei depth
,
4599 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4601 GET_CURRENT_CONTEXT(ctx
);
4604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4606 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4613 n
[6].i
= (GLint
) width
;
4614 n
[7].i
= (GLint
) height
;
4615 n
[8].i
= (GLint
) depth
;
4618 save_pointer(&n
[11],
4619 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4620 pixels
, &ctx
->Unpack
));
4622 if (ctx
->ExecuteFlag
) {
4623 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4624 xoffset
, yoffset
, zoffset
,
4625 width
, height
, depth
, format
, type
,
4631 static void GLAPIENTRY
4632 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4634 GET_CURRENT_CONTEXT(ctx
);
4636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4637 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4643 if (ctx
->ExecuteFlag
) {
4644 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4649 static void GLAPIENTRY
4650 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4652 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4657 static void GLAPIENTRY
4658 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4660 GET_CURRENT_CONTEXT(ctx
);
4662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4663 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4667 n
[3].i
= (GLint
) width
;
4668 n
[4].i
= (GLint
) height
;
4670 if (ctx
->ExecuteFlag
) {
4671 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4675 static void GLAPIENTRY
4676 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4679 GET_CURRENT_CONTEXT(ctx
);
4681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4682 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4690 if (ctx
->ExecuteFlag
) {
4691 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4695 static void GLAPIENTRY
4696 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4698 GET_CURRENT_CONTEXT(ctx
);
4700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4701 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4709 if (ctx
->ExecuteFlag
) {
4710 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4714 static void GLAPIENTRY
4715 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4717 GET_CURRENT_CONTEXT(ctx
);
4719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4720 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4724 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4726 if (ctx
->ExecuteFlag
) {
4727 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4731 static void GLAPIENTRY
4732 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4735 GET_CURRENT_CONTEXT(ctx
);
4737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4738 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4746 if (ctx
->ExecuteFlag
) {
4747 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4751 static void GLAPIENTRY
4752 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4754 GET_CURRENT_CONTEXT(ctx
);
4756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4757 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4765 if (ctx
->ExecuteFlag
) {
4766 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4770 static void GLAPIENTRY
4771 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4773 GET_CURRENT_CONTEXT(ctx
);
4775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4776 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4780 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4782 if (ctx
->ExecuteFlag
) {
4783 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4787 static void GLAPIENTRY
4788 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4790 GET_CURRENT_CONTEXT(ctx
);
4792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4793 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4796 /* Mesa stores these as floats internally so we deliberately convert
4797 * them to a float here.
4802 if (ctx
->ExecuteFlag
) {
4803 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4807 static void GLAPIENTRY
4808 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4810 GET_CURRENT_CONTEXT(ctx
);
4812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4813 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4817 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4819 if (ctx
->ExecuteFlag
) {
4820 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4824 static void GLAPIENTRY
4825 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4827 GET_CURRENT_CONTEXT(ctx
);
4829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4830 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4837 if (ctx
->ExecuteFlag
) {
4838 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4842 static void GLAPIENTRY
4843 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4845 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4848 static void GLAPIENTRY
4849 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4851 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4854 static void GLAPIENTRY
4855 save_WindowPos2iMESA(GLint x
, GLint y
)
4857 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4860 static void GLAPIENTRY
4861 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4863 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4866 static void GLAPIENTRY
4867 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4869 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4872 static void GLAPIENTRY
4873 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4875 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4878 static void GLAPIENTRY
4879 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4881 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4884 static void GLAPIENTRY
4885 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4887 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4890 static void GLAPIENTRY
4891 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4893 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4896 static void GLAPIENTRY
4897 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4899 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4902 static void GLAPIENTRY
4903 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4905 save_WindowPos4fMESA(x
, y
, z
, w
);
4908 static void GLAPIENTRY
4909 save_WindowPos2dvMESA(const GLdouble
* v
)
4911 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4914 static void GLAPIENTRY
4915 save_WindowPos2fvMESA(const GLfloat
* v
)
4917 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4920 static void GLAPIENTRY
4921 save_WindowPos2ivMESA(const GLint
* v
)
4923 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4926 static void GLAPIENTRY
4927 save_WindowPos2svMESA(const GLshort
* v
)
4929 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4932 static void GLAPIENTRY
4933 save_WindowPos3dvMESA(const GLdouble
* v
)
4935 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4938 static void GLAPIENTRY
4939 save_WindowPos3fvMESA(const GLfloat
* v
)
4941 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4944 static void GLAPIENTRY
4945 save_WindowPos3ivMESA(const GLint
* v
)
4947 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4950 static void GLAPIENTRY
4951 save_WindowPos3svMESA(const GLshort
* v
)
4953 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4956 static void GLAPIENTRY
4957 save_WindowPos4dvMESA(const GLdouble
* v
)
4959 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4960 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4963 static void GLAPIENTRY
4964 save_WindowPos4fvMESA(const GLfloat
* v
)
4966 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4969 static void GLAPIENTRY
4970 save_WindowPos4ivMESA(const GLint
* v
)
4972 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4973 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4976 static void GLAPIENTRY
4977 save_WindowPos4svMESA(const GLshort
* v
)
4979 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4984 /* GL_ARB_multitexture */
4985 static void GLAPIENTRY
4986 save_ActiveTextureARB(GLenum target
)
4988 GET_CURRENT_CONTEXT(ctx
);
4990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4991 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4995 if (ctx
->ExecuteFlag
) {
4996 CALL_ActiveTexture(ctx
->Exec
, (target
));
5001 /* GL_ARB_transpose_matrix */
5003 static void GLAPIENTRY
5004 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5007 _math_transposefd(tm
, m
);
5008 save_LoadMatrixf(tm
);
5012 static void GLAPIENTRY
5013 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5016 _math_transposef(tm
, m
);
5017 save_LoadMatrixf(tm
);
5021 static void GLAPIENTRY
5022 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5025 _math_transposefd(tm
, m
);
5026 save_MultMatrixf(tm
);
5030 static void GLAPIENTRY
5031 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5034 _math_transposef(tm
, m
);
5035 save_MultMatrixf(tm
);
5038 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5040 GET_CURRENT_CONTEXT(ctx
);
5046 image
= malloc(size
);
5048 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5051 memcpy(image
, data
, size
);
5057 /* GL_ARB_texture_compression */
5058 static void GLAPIENTRY
5059 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5060 GLenum internalFormat
, GLsizei width
,
5061 GLint border
, GLsizei imageSize
,
5062 const GLvoid
* data
)
5064 GET_CURRENT_CONTEXT(ctx
);
5065 if (target
== GL_PROXY_TEXTURE_1D
) {
5066 /* don't compile, execute immediately */
5067 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5068 width
, border
, imageSize
,
5073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5075 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5076 6 + POINTER_DWORDS
);
5080 n
[3].e
= internalFormat
;
5081 n
[4].i
= (GLint
) width
;
5085 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5087 if (ctx
->ExecuteFlag
) {
5088 CALL_CompressedTexImage1D(ctx
->Exec
,
5089 (target
, level
, internalFormat
, width
,
5090 border
, imageSize
, data
));
5096 static void GLAPIENTRY
5097 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5098 GLenum internalFormat
, GLsizei width
,
5099 GLsizei height
, GLint border
, GLsizei imageSize
,
5100 const GLvoid
* data
)
5102 GET_CURRENT_CONTEXT(ctx
);
5103 if (target
== GL_PROXY_TEXTURE_2D
) {
5104 /* don't compile, execute immediately */
5105 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5106 width
, height
, border
,
5111 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5113 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5114 7 + POINTER_DWORDS
);
5118 n
[3].e
= internalFormat
;
5119 n
[4].i
= (GLint
) width
;
5120 n
[5].i
= (GLint
) height
;
5124 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5126 if (ctx
->ExecuteFlag
) {
5127 CALL_CompressedTexImage2D(ctx
->Exec
,
5128 (target
, level
, internalFormat
, width
,
5129 height
, border
, imageSize
, data
));
5135 static void GLAPIENTRY
5136 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5137 GLenum internalFormat
, GLsizei width
,
5138 GLsizei height
, GLsizei depth
, GLint border
,
5139 GLsizei imageSize
, const GLvoid
* data
)
5141 GET_CURRENT_CONTEXT(ctx
);
5142 if (target
== GL_PROXY_TEXTURE_3D
) {
5143 /* don't compile, execute immediately */
5144 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5145 width
, height
, depth
, border
,
5150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5152 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5153 8 + POINTER_DWORDS
);
5157 n
[3].e
= internalFormat
;
5158 n
[4].i
= (GLint
) width
;
5159 n
[5].i
= (GLint
) height
;
5160 n
[6].i
= (GLint
) depth
;
5164 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5166 if (ctx
->ExecuteFlag
) {
5167 CALL_CompressedTexImage3D(ctx
->Exec
,
5168 (target
, level
, internalFormat
, width
,
5169 height
, depth
, border
, imageSize
,
5176 static void GLAPIENTRY
5177 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5178 GLsizei width
, GLenum format
,
5179 GLsizei imageSize
, const GLvoid
* data
)
5182 GET_CURRENT_CONTEXT(ctx
);
5183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5185 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5186 6 + POINTER_DWORDS
);
5191 n
[4].i
= (GLint
) width
;
5195 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5197 if (ctx
->ExecuteFlag
) {
5198 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5199 width
, format
, imageSize
,
5205 static void GLAPIENTRY
5206 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5207 GLint yoffset
, GLsizei width
, GLsizei height
,
5208 GLenum format
, GLsizei imageSize
,
5209 const GLvoid
* data
)
5212 GET_CURRENT_CONTEXT(ctx
);
5213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5215 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5216 8 + POINTER_DWORDS
);
5222 n
[5].i
= (GLint
) width
;
5223 n
[6].i
= (GLint
) height
;
5227 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5229 if (ctx
->ExecuteFlag
) {
5230 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5231 (target
, level
, xoffset
, yoffset
, width
,
5232 height
, format
, imageSize
, data
));
5237 static void GLAPIENTRY
5238 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5239 GLint yoffset
, GLint zoffset
, GLsizei width
,
5240 GLsizei height
, GLsizei depth
, GLenum format
,
5241 GLsizei imageSize
, const GLvoid
* data
)
5244 GET_CURRENT_CONTEXT(ctx
);
5245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5247 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5248 10 + POINTER_DWORDS
);
5255 n
[6].i
= (GLint
) width
;
5256 n
[7].i
= (GLint
) height
;
5257 n
[8].i
= (GLint
) depth
;
5259 n
[10].i
= imageSize
;
5260 save_pointer(&n
[11],
5261 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5263 if (ctx
->ExecuteFlag
) {
5264 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5265 (target
, level
, xoffset
, yoffset
,
5266 zoffset
, width
, height
, depth
, format
,
5272 /* GL_ARB_multisample */
5273 static void GLAPIENTRY
5274 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5276 GET_CURRENT_CONTEXT(ctx
);
5278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5279 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5284 if (ctx
->ExecuteFlag
) {
5285 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5291 * GL_ARB_vertex_program
5293 static void GLAPIENTRY
5294 save_BindProgramARB(GLenum target
, GLuint id
)
5296 GET_CURRENT_CONTEXT(ctx
);
5298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5299 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5304 if (ctx
->ExecuteFlag
) {
5305 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5309 static void GLAPIENTRY
5310 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5311 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5313 GET_CURRENT_CONTEXT(ctx
);
5315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5316 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5325 if (ctx
->ExecuteFlag
) {
5326 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5331 static void GLAPIENTRY
5332 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5333 const GLfloat
*params
)
5335 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5336 params
[2], params
[3]);
5340 static void GLAPIENTRY
5341 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5342 const GLfloat
* params
)
5344 GET_CURRENT_CONTEXT(ctx
);
5346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5350 const GLfloat
* p
= params
;
5352 for (i
= 0 ; i
< count
; i
++) {
5353 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5366 if (ctx
->ExecuteFlag
) {
5367 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5372 static void GLAPIENTRY
5373 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5374 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5376 save_ProgramEnvParameter4fARB(target
, index
,
5378 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5382 static void GLAPIENTRY
5383 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5384 const GLdouble
*params
)
5386 save_ProgramEnvParameter4fARB(target
, index
,
5387 (GLfloat
) params
[0],
5388 (GLfloat
) params
[1],
5389 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5393 static void GLAPIENTRY
5394 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5395 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5397 GET_CURRENT_CONTEXT(ctx
);
5399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5400 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5409 if (ctx
->ExecuteFlag
) {
5410 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5415 static void GLAPIENTRY
5416 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5417 const GLfloat
*params
)
5419 GET_CURRENT_CONTEXT(ctx
);
5421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5422 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5431 if (ctx
->ExecuteFlag
) {
5432 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5437 static void GLAPIENTRY
5438 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5439 const GLfloat
*params
)
5441 GET_CURRENT_CONTEXT(ctx
);
5443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5447 const GLfloat
* p
= params
;
5449 for (i
= 0 ; i
< count
; i
++) {
5450 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5463 if (ctx
->ExecuteFlag
) {
5464 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5469 static void GLAPIENTRY
5470 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5471 GLdouble x
, GLdouble y
,
5472 GLdouble z
, GLdouble w
)
5474 GET_CURRENT_CONTEXT(ctx
);
5476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5477 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5481 n
[3].f
= (GLfloat
) x
;
5482 n
[4].f
= (GLfloat
) y
;
5483 n
[5].f
= (GLfloat
) z
;
5484 n
[6].f
= (GLfloat
) w
;
5486 if (ctx
->ExecuteFlag
) {
5487 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5492 static void GLAPIENTRY
5493 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5494 const GLdouble
*params
)
5496 GET_CURRENT_CONTEXT(ctx
);
5498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5499 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5503 n
[3].f
= (GLfloat
) params
[0];
5504 n
[4].f
= (GLfloat
) params
[1];
5505 n
[5].f
= (GLfloat
) params
[2];
5506 n
[6].f
= (GLfloat
) params
[3];
5508 if (ctx
->ExecuteFlag
) {
5509 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5514 /* GL_EXT_stencil_two_side */
5515 static void GLAPIENTRY
5516 save_ActiveStencilFaceEXT(GLenum face
)
5518 GET_CURRENT_CONTEXT(ctx
);
5520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5521 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5525 if (ctx
->ExecuteFlag
) {
5526 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5531 /* GL_EXT_depth_bounds_test */
5532 static void GLAPIENTRY
5533 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5535 GET_CURRENT_CONTEXT(ctx
);
5537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5538 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5540 n
[1].f
= (GLfloat
) zmin
;
5541 n
[2].f
= (GLfloat
) zmax
;
5543 if (ctx
->ExecuteFlag
) {
5544 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5550 static void GLAPIENTRY
5551 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5552 const GLvoid
* string
)
5554 GET_CURRENT_CONTEXT(ctx
);
5557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5559 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5561 GLubyte
*programCopy
= malloc(len
);
5563 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5566 memcpy(programCopy
, string
, len
);
5570 save_pointer(&n
[4], programCopy
);
5572 if (ctx
->ExecuteFlag
) {
5573 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5578 static void GLAPIENTRY
5579 save_BeginQueryARB(GLenum target
, GLuint id
)
5581 GET_CURRENT_CONTEXT(ctx
);
5583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5584 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5589 if (ctx
->ExecuteFlag
) {
5590 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5594 static void GLAPIENTRY
5595 save_EndQueryARB(GLenum target
)
5597 GET_CURRENT_CONTEXT(ctx
);
5599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5600 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5604 if (ctx
->ExecuteFlag
) {
5605 CALL_EndQuery(ctx
->Exec
, (target
));
5609 static void GLAPIENTRY
5610 save_QueryCounter(GLuint id
, GLenum target
)
5612 GET_CURRENT_CONTEXT(ctx
);
5614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5615 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5620 if (ctx
->ExecuteFlag
) {
5621 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5625 static void GLAPIENTRY
5626 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5628 GET_CURRENT_CONTEXT(ctx
);
5630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5631 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5637 if (ctx
->ExecuteFlag
) {
5638 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5642 static void GLAPIENTRY
5643 save_EndQueryIndexed(GLenum target
, GLuint index
)
5645 GET_CURRENT_CONTEXT(ctx
);
5647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5648 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5653 if (ctx
->ExecuteFlag
) {
5654 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5659 static void GLAPIENTRY
5660 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5662 GET_CURRENT_CONTEXT(ctx
);
5664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5665 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5669 if (count
> MAX_DRAW_BUFFERS
)
5670 count
= MAX_DRAW_BUFFERS
;
5671 for (i
= 0; i
< count
; i
++) {
5672 n
[2 + i
].e
= buffers
[i
];
5675 if (ctx
->ExecuteFlag
) {
5676 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5680 static void GLAPIENTRY
5681 save_BindFragmentShaderATI(GLuint id
)
5683 GET_CURRENT_CONTEXT(ctx
);
5686 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5695 static void GLAPIENTRY
5696 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5698 GET_CURRENT_CONTEXT(ctx
);
5701 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5709 if (ctx
->ExecuteFlag
) {
5710 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5714 static void GLAPIENTRY
5715 save_Attr1fNV(GLenum attr
, GLfloat x
)
5717 GET_CURRENT_CONTEXT(ctx
);
5719 SAVE_FLUSH_VERTICES(ctx
);
5720 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5726 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5727 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5728 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5730 if (ctx
->ExecuteFlag
) {
5731 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5735 static void GLAPIENTRY
5736 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5738 GET_CURRENT_CONTEXT(ctx
);
5740 SAVE_FLUSH_VERTICES(ctx
);
5741 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5748 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5749 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5750 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5752 if (ctx
->ExecuteFlag
) {
5753 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5757 static void GLAPIENTRY
5758 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5760 GET_CURRENT_CONTEXT(ctx
);
5762 SAVE_FLUSH_VERTICES(ctx
);
5763 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5771 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5772 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5773 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5775 if (ctx
->ExecuteFlag
) {
5776 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5780 static void GLAPIENTRY
5781 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5783 GET_CURRENT_CONTEXT(ctx
);
5785 SAVE_FLUSH_VERTICES(ctx
);
5786 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5795 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5796 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5797 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5799 if (ctx
->ExecuteFlag
) {
5800 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5805 static void GLAPIENTRY
5806 save_Attr1fARB(GLenum attr
, GLfloat x
)
5808 GET_CURRENT_CONTEXT(ctx
);
5810 SAVE_FLUSH_VERTICES(ctx
);
5811 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5817 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5818 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5819 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5821 if (ctx
->ExecuteFlag
) {
5822 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5826 static void GLAPIENTRY
5827 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5829 GET_CURRENT_CONTEXT(ctx
);
5831 SAVE_FLUSH_VERTICES(ctx
);
5832 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5839 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5840 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5841 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5843 if (ctx
->ExecuteFlag
) {
5844 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5848 static void GLAPIENTRY
5849 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5851 GET_CURRENT_CONTEXT(ctx
);
5853 SAVE_FLUSH_VERTICES(ctx
);
5854 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5862 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5863 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5864 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5866 if (ctx
->ExecuteFlag
) {
5867 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5871 static void GLAPIENTRY
5872 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5874 GET_CURRENT_CONTEXT(ctx
);
5876 SAVE_FLUSH_VERTICES(ctx
);
5877 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5886 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5887 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5888 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5890 if (ctx
->ExecuteFlag
) {
5891 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5896 static void GLAPIENTRY
5897 save_EvalCoord1f(GLfloat x
)
5899 GET_CURRENT_CONTEXT(ctx
);
5901 SAVE_FLUSH_VERTICES(ctx
);
5902 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5906 if (ctx
->ExecuteFlag
) {
5907 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5911 static void GLAPIENTRY
5912 save_EvalCoord1fv(const GLfloat
* v
)
5914 save_EvalCoord1f(v
[0]);
5917 static void GLAPIENTRY
5918 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5920 GET_CURRENT_CONTEXT(ctx
);
5922 SAVE_FLUSH_VERTICES(ctx
);
5923 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5928 if (ctx
->ExecuteFlag
) {
5929 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5933 static void GLAPIENTRY
5934 save_EvalCoord2fv(const GLfloat
* v
)
5936 save_EvalCoord2f(v
[0], v
[1]);
5940 static void GLAPIENTRY
5941 save_EvalPoint1(GLint x
)
5943 GET_CURRENT_CONTEXT(ctx
);
5945 SAVE_FLUSH_VERTICES(ctx
);
5946 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5950 if (ctx
->ExecuteFlag
) {
5951 CALL_EvalPoint1(ctx
->Exec
, (x
));
5955 static void GLAPIENTRY
5956 save_EvalPoint2(GLint x
, GLint y
)
5958 GET_CURRENT_CONTEXT(ctx
);
5960 SAVE_FLUSH_VERTICES(ctx
);
5961 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5966 if (ctx
->ExecuteFlag
) {
5967 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5971 static void GLAPIENTRY
5972 save_Indexf(GLfloat x
)
5974 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5977 static void GLAPIENTRY
5978 save_Indexfv(const GLfloat
* v
)
5980 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5983 static void GLAPIENTRY
5984 save_EdgeFlag(GLboolean x
)
5986 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5991 * Compare 'count' elements of vectors 'a' and 'b'.
5992 * \return GL_TRUE if equal, GL_FALSE if different.
5994 static inline GLboolean
5995 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5997 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6002 * This glMaterial function is used for glMaterial calls that are outside
6003 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6005 static void GLAPIENTRY
6006 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6008 GET_CURRENT_CONTEXT(ctx
);
6016 case GL_FRONT_AND_BACK
:
6019 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6028 case GL_AMBIENT_AND_DIFFUSE
:
6034 case GL_COLOR_INDEXES
:
6038 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6042 if (ctx
->ExecuteFlag
) {
6043 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6046 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6048 /* Try to eliminate redundant statechanges. Because it is legal to
6049 * call glMaterial even inside begin/end calls, don't need to worry
6050 * about ctx->Driver.CurrentSavePrimitive here.
6052 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6053 if (bitmask
& (1 << i
)) {
6054 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6055 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6056 /* no change in material value */
6057 bitmask
&= ~(1 << i
);
6060 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6061 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6066 /* If this call has no effect, return early */
6070 SAVE_FLUSH_VERTICES(ctx
);
6072 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6076 for (i
= 0; i
< args
; i
++)
6077 n
[3 + i
].f
= param
[i
];
6081 static void GLAPIENTRY
6082 save_Begin(GLenum mode
)
6084 GET_CURRENT_CONTEXT(ctx
);
6086 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6087 /* compile this error into the display list */
6088 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6090 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6091 /* compile this error into the display list */
6092 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6095 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6097 vbo_save_NotifyBegin(ctx
, mode
);
6101 static void GLAPIENTRY
6104 GET_CURRENT_CONTEXT(ctx
);
6105 SAVE_FLUSH_VERTICES(ctx
);
6106 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6107 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6108 if (ctx
->ExecuteFlag
) {
6109 CALL_End(ctx
->Exec
, ());
6113 static void GLAPIENTRY
6114 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6116 GET_CURRENT_CONTEXT(ctx
);
6118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6119 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6126 if (ctx
->ExecuteFlag
) {
6127 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6132 static void GLAPIENTRY
6133 save_Vertex2f(GLfloat x
, GLfloat y
)
6135 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6138 static void GLAPIENTRY
6139 save_Vertex2fv(const GLfloat
* v
)
6141 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6144 static void GLAPIENTRY
6145 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6147 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6150 static void GLAPIENTRY
6151 save_Vertex3fv(const GLfloat
* v
)
6153 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6156 static void GLAPIENTRY
6157 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6159 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6162 static void GLAPIENTRY
6163 save_Vertex4fv(const GLfloat
* v
)
6165 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6168 static void GLAPIENTRY
6169 save_TexCoord1f(GLfloat x
)
6171 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6174 static void GLAPIENTRY
6175 save_TexCoord1fv(const GLfloat
* v
)
6177 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6180 static void GLAPIENTRY
6181 save_TexCoord2f(GLfloat x
, GLfloat y
)
6183 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6186 static void GLAPIENTRY
6187 save_TexCoord2fv(const GLfloat
* v
)
6189 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6192 static void GLAPIENTRY
6193 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6195 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6198 static void GLAPIENTRY
6199 save_TexCoord3fv(const GLfloat
* v
)
6201 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6204 static void GLAPIENTRY
6205 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6207 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6210 static void GLAPIENTRY
6211 save_TexCoord4fv(const GLfloat
* v
)
6213 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6216 static void GLAPIENTRY
6217 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6219 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6222 static void GLAPIENTRY
6223 save_Normal3fv(const GLfloat
* v
)
6225 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6228 static void GLAPIENTRY
6229 save_FogCoordfEXT(GLfloat x
)
6231 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6234 static void GLAPIENTRY
6235 save_FogCoordfvEXT(const GLfloat
* v
)
6237 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6240 static void GLAPIENTRY
6241 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6243 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6246 static void GLAPIENTRY
6247 save_Color3fv(const GLfloat
* v
)
6249 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6252 static void GLAPIENTRY
6253 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6255 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6258 static void GLAPIENTRY
6259 save_Color4fv(const GLfloat
* v
)
6261 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6264 static void GLAPIENTRY
6265 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6267 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6270 static void GLAPIENTRY
6271 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6273 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6277 /* Just call the respective ATTR for texcoord
6279 static void GLAPIENTRY
6280 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6282 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6283 save_Attr1fNV(attr
, x
);
6286 static void GLAPIENTRY
6287 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6289 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6290 save_Attr1fNV(attr
, v
[0]);
6293 static void GLAPIENTRY
6294 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6296 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6297 save_Attr2fNV(attr
, x
, y
);
6300 static void GLAPIENTRY
6301 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6303 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6304 save_Attr2fNV(attr
, v
[0], v
[1]);
6307 static void GLAPIENTRY
6308 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6310 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6311 save_Attr3fNV(attr
, x
, y
, z
);
6314 static void GLAPIENTRY
6315 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6317 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6318 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6321 static void GLAPIENTRY
6322 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6323 GLfloat z
, GLfloat w
)
6325 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6326 save_Attr4fNV(attr
, x
, y
, z
, w
);
6329 static void GLAPIENTRY
6330 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6332 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6333 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6338 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6344 GET_CURRENT_CONTEXT(ctx
);
6345 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6350 static void GLAPIENTRY
6351 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6353 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6354 save_Attr1fARB(index
, x
);
6359 static void GLAPIENTRY
6360 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6362 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6363 save_Attr1fARB(index
, v
[0]);
6368 static void GLAPIENTRY
6369 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6371 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6372 save_Attr2fARB(index
, x
, y
);
6377 static void GLAPIENTRY
6378 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6380 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6381 save_Attr2fARB(index
, v
[0], v
[1]);
6386 static void GLAPIENTRY
6387 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6389 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6390 save_Attr3fARB(index
, x
, y
, z
);
6395 static void GLAPIENTRY
6396 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6398 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6399 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6404 static void GLAPIENTRY
6405 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6408 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6409 save_Attr4fARB(index
, x
, y
, z
, w
);
6414 static void GLAPIENTRY
6415 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6417 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6418 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6423 static void GLAPIENTRY
6424 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6426 GET_CURRENT_CONTEXT(ctx
);
6428 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6430 SAVE_FLUSH_VERTICES(ctx
);
6431 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6434 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6437 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6438 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6440 if (ctx
->ExecuteFlag
) {
6441 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6448 static void GLAPIENTRY
6449 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6451 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6452 save_VertexAttribL1d(index
, v
[0]);
6457 static void GLAPIENTRY
6458 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6460 GET_CURRENT_CONTEXT(ctx
);
6462 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6464 SAVE_FLUSH_VERTICES(ctx
);
6465 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6468 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6469 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6472 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6473 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6474 2 * sizeof(GLdouble
));
6476 if (ctx
->ExecuteFlag
) {
6477 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6484 static void GLAPIENTRY
6485 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6487 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6488 save_VertexAttribL2d(index
, v
[0], v
[1]);
6493 static void GLAPIENTRY
6494 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6496 GET_CURRENT_CONTEXT(ctx
);
6498 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6500 SAVE_FLUSH_VERTICES(ctx
);
6501 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6504 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6505 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6506 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6509 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6510 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6511 3 * sizeof(GLdouble
));
6513 if (ctx
->ExecuteFlag
) {
6514 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6521 static void GLAPIENTRY
6522 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6524 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6525 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6530 static void GLAPIENTRY
6531 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6534 GET_CURRENT_CONTEXT(ctx
);
6536 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6538 SAVE_FLUSH_VERTICES(ctx
);
6539 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6542 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6543 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6544 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6545 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6548 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6549 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6550 4 * sizeof(GLdouble
));
6552 if (ctx
->ExecuteFlag
) {
6553 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6560 static void GLAPIENTRY
6561 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6563 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6564 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6569 static void GLAPIENTRY
6570 save_PrimitiveRestartNV(void)
6572 /* Note: this is used when outside a glBegin/End pair in a display list */
6573 GET_CURRENT_CONTEXT(ctx
);
6574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6575 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6576 if (ctx
->ExecuteFlag
) {
6577 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6582 static void GLAPIENTRY
6583 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6584 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6585 GLbitfield mask
, GLenum filter
)
6587 GET_CURRENT_CONTEXT(ctx
);
6589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6590 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6603 if (ctx
->ExecuteFlag
) {
6604 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6605 dstX0
, dstY0
, dstX1
, dstY1
,
6611 /** GL_EXT_provoking_vertex */
6612 static void GLAPIENTRY
6613 save_ProvokingVertexEXT(GLenum mode
)
6615 GET_CURRENT_CONTEXT(ctx
);
6617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6618 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6622 if (ctx
->ExecuteFlag
) {
6623 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6624 _mesa_ProvokingVertex(mode
);
6629 /** GL_EXT_transform_feedback */
6630 static void GLAPIENTRY
6631 save_BeginTransformFeedback(GLenum mode
)
6633 GET_CURRENT_CONTEXT(ctx
);
6635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6636 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6640 if (ctx
->ExecuteFlag
) {
6641 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6646 /** GL_EXT_transform_feedback */
6647 static void GLAPIENTRY
6648 save_EndTransformFeedback(void)
6650 GET_CURRENT_CONTEXT(ctx
);
6651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6652 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6653 if (ctx
->ExecuteFlag
) {
6654 CALL_EndTransformFeedback(ctx
->Exec
, ());
6658 static void GLAPIENTRY
6659 save_BindTransformFeedback(GLenum target
, GLuint name
)
6661 GET_CURRENT_CONTEXT(ctx
);
6663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6664 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6669 if (ctx
->ExecuteFlag
) {
6670 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6674 static void GLAPIENTRY
6675 save_PauseTransformFeedback(void)
6677 GET_CURRENT_CONTEXT(ctx
);
6678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6679 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6680 if (ctx
->ExecuteFlag
) {
6681 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6685 static void GLAPIENTRY
6686 save_ResumeTransformFeedback(void)
6688 GET_CURRENT_CONTEXT(ctx
);
6689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6690 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6691 if (ctx
->ExecuteFlag
) {
6692 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6696 static void GLAPIENTRY
6697 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6699 GET_CURRENT_CONTEXT(ctx
);
6701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6702 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6707 if (ctx
->ExecuteFlag
) {
6708 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6712 static void GLAPIENTRY
6713 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6715 GET_CURRENT_CONTEXT(ctx
);
6717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6718 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6724 if (ctx
->ExecuteFlag
) {
6725 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6729 static void GLAPIENTRY
6730 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6733 GET_CURRENT_CONTEXT(ctx
);
6735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6736 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6740 n
[3].si
= primcount
;
6742 if (ctx
->ExecuteFlag
) {
6743 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6747 static void GLAPIENTRY
6748 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6749 GLuint stream
, GLsizei primcount
)
6751 GET_CURRENT_CONTEXT(ctx
);
6753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6754 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6759 n
[4].si
= primcount
;
6761 if (ctx
->ExecuteFlag
) {
6762 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6767 static void GLAPIENTRY
6768 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6769 GLuint num_groups_z
)
6771 GET_CURRENT_CONTEXT(ctx
);
6773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6774 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6776 n
[1].ui
= num_groups_x
;
6777 n
[2].ui
= num_groups_y
;
6778 n
[3].ui
= num_groups_z
;
6780 if (ctx
->ExecuteFlag
) {
6781 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6786 static void GLAPIENTRY
6787 save_DispatchComputeIndirect(GLintptr indirect
)
6789 GET_CURRENT_CONTEXT(ctx
);
6790 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6791 "glDispatchComputeIndirect() during display list compile");
6794 static void GLAPIENTRY
6795 save_UseProgram(GLuint program
)
6797 GET_CURRENT_CONTEXT(ctx
);
6799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6800 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6804 if (ctx
->ExecuteFlag
) {
6805 CALL_UseProgram(ctx
->Exec
, (program
));
6810 static void GLAPIENTRY
6811 save_Uniform1fARB(GLint location
, GLfloat x
)
6813 GET_CURRENT_CONTEXT(ctx
);
6815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6816 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6821 if (ctx
->ExecuteFlag
) {
6822 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6827 static void GLAPIENTRY
6828 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6830 GET_CURRENT_CONTEXT(ctx
);
6832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6833 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6839 if (ctx
->ExecuteFlag
) {
6840 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6845 static void GLAPIENTRY
6846 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6848 GET_CURRENT_CONTEXT(ctx
);
6850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6851 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6858 if (ctx
->ExecuteFlag
) {
6859 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6864 static void GLAPIENTRY
6865 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6867 GET_CURRENT_CONTEXT(ctx
);
6869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6870 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6878 if (ctx
->ExecuteFlag
) {
6879 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6884 static void GLAPIENTRY
6885 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6887 GET_CURRENT_CONTEXT(ctx
);
6889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6890 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6894 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6896 if (ctx
->ExecuteFlag
) {
6897 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6901 static void GLAPIENTRY
6902 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6904 GET_CURRENT_CONTEXT(ctx
);
6906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6907 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6911 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6913 if (ctx
->ExecuteFlag
) {
6914 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6918 static void GLAPIENTRY
6919 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6921 GET_CURRENT_CONTEXT(ctx
);
6923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6924 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6928 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6930 if (ctx
->ExecuteFlag
) {
6931 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6935 static void GLAPIENTRY
6936 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6938 GET_CURRENT_CONTEXT(ctx
);
6940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6941 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6945 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6947 if (ctx
->ExecuteFlag
) {
6948 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6953 static void GLAPIENTRY
6954 save_Uniform1d(GLint location
, GLdouble x
)
6956 GET_CURRENT_CONTEXT(ctx
);
6958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6959 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
6962 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6964 if (ctx
->ExecuteFlag
) {
6965 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
6970 static void GLAPIENTRY
6971 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
6973 GET_CURRENT_CONTEXT(ctx
);
6975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6976 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
6979 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6980 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6982 if (ctx
->ExecuteFlag
) {
6983 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
6988 static void GLAPIENTRY
6989 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
6991 GET_CURRENT_CONTEXT(ctx
);
6993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6994 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
6997 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6998 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6999 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7001 if (ctx
->ExecuteFlag
) {
7002 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7007 static void GLAPIENTRY
7008 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7010 GET_CURRENT_CONTEXT(ctx
);
7012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7013 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7016 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7017 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7018 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7019 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7021 if (ctx
->ExecuteFlag
) {
7022 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7027 static void GLAPIENTRY
7028 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7030 GET_CURRENT_CONTEXT(ctx
);
7032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7033 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7037 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7039 if (ctx
->ExecuteFlag
) {
7040 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7045 static void GLAPIENTRY
7046 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7048 GET_CURRENT_CONTEXT(ctx
);
7050 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7051 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7055 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7057 if (ctx
->ExecuteFlag
) {
7058 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7063 static void GLAPIENTRY
7064 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7066 GET_CURRENT_CONTEXT(ctx
);
7068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7069 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7073 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7075 if (ctx
->ExecuteFlag
) {
7076 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7081 static void GLAPIENTRY
7082 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7084 GET_CURRENT_CONTEXT(ctx
);
7086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7087 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7091 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7093 if (ctx
->ExecuteFlag
) {
7094 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7099 static void GLAPIENTRY
7100 save_Uniform1iARB(GLint location
, GLint x
)
7102 GET_CURRENT_CONTEXT(ctx
);
7104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7105 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7110 if (ctx
->ExecuteFlag
) {
7111 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7115 static void GLAPIENTRY
7116 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7118 GET_CURRENT_CONTEXT(ctx
);
7120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7121 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7127 if (ctx
->ExecuteFlag
) {
7128 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7132 static void GLAPIENTRY
7133 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7135 GET_CURRENT_CONTEXT(ctx
);
7137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7138 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7145 if (ctx
->ExecuteFlag
) {
7146 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7150 static void GLAPIENTRY
7151 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7153 GET_CURRENT_CONTEXT(ctx
);
7155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7156 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7164 if (ctx
->ExecuteFlag
) {
7165 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7171 static void GLAPIENTRY
7172 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7174 GET_CURRENT_CONTEXT(ctx
);
7176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7177 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7181 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7183 if (ctx
->ExecuteFlag
) {
7184 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7188 static void GLAPIENTRY
7189 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7191 GET_CURRENT_CONTEXT(ctx
);
7193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7194 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7198 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7200 if (ctx
->ExecuteFlag
) {
7201 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7205 static void GLAPIENTRY
7206 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7208 GET_CURRENT_CONTEXT(ctx
);
7210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7211 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7215 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7217 if (ctx
->ExecuteFlag
) {
7218 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7222 static void GLAPIENTRY
7223 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7225 GET_CURRENT_CONTEXT(ctx
);
7227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7228 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7232 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7234 if (ctx
->ExecuteFlag
) {
7235 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7241 static void GLAPIENTRY
7242 save_Uniform1ui(GLint location
, GLuint x
)
7244 GET_CURRENT_CONTEXT(ctx
);
7246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7247 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7252 if (ctx
->ExecuteFlag
) {
7253 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7257 static void GLAPIENTRY
7258 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7260 GET_CURRENT_CONTEXT(ctx
);
7262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7263 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7269 if (ctx
->ExecuteFlag
) {
7270 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7274 static void GLAPIENTRY
7275 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7277 GET_CURRENT_CONTEXT(ctx
);
7279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7280 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7287 if (ctx
->ExecuteFlag
) {
7288 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7292 static void GLAPIENTRY
7293 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7295 GET_CURRENT_CONTEXT(ctx
);
7297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7298 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7306 if (ctx
->ExecuteFlag
) {
7307 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7313 static void GLAPIENTRY
7314 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7316 GET_CURRENT_CONTEXT(ctx
);
7318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7319 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7323 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7325 if (ctx
->ExecuteFlag
) {
7326 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7330 static void GLAPIENTRY
7331 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7333 GET_CURRENT_CONTEXT(ctx
);
7335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7336 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7340 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7342 if (ctx
->ExecuteFlag
) {
7343 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7347 static void GLAPIENTRY
7348 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7350 GET_CURRENT_CONTEXT(ctx
);
7352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7353 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7357 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7359 if (ctx
->ExecuteFlag
) {
7360 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7364 static void GLAPIENTRY
7365 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7367 GET_CURRENT_CONTEXT(ctx
);
7369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7370 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7374 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7376 if (ctx
->ExecuteFlag
) {
7377 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7383 static void GLAPIENTRY
7384 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7387 GET_CURRENT_CONTEXT(ctx
);
7389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7390 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7395 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7397 if (ctx
->ExecuteFlag
) {
7398 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7402 static void GLAPIENTRY
7403 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7406 GET_CURRENT_CONTEXT(ctx
);
7408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7409 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7414 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7416 if (ctx
->ExecuteFlag
) {
7417 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7421 static void GLAPIENTRY
7422 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7425 GET_CURRENT_CONTEXT(ctx
);
7427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7428 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7433 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7435 if (ctx
->ExecuteFlag
) {
7436 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7441 static void GLAPIENTRY
7442 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7445 GET_CURRENT_CONTEXT(ctx
);
7447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7448 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7453 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7455 if (ctx
->ExecuteFlag
) {
7456 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7460 static void GLAPIENTRY
7461 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7464 GET_CURRENT_CONTEXT(ctx
);
7466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7467 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7472 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7474 if (ctx
->ExecuteFlag
) {
7475 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7480 static void GLAPIENTRY
7481 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7484 GET_CURRENT_CONTEXT(ctx
);
7486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7487 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7492 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7494 if (ctx
->ExecuteFlag
) {
7495 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7499 static void GLAPIENTRY
7500 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7503 GET_CURRENT_CONTEXT(ctx
);
7505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7506 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7511 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7513 if (ctx
->ExecuteFlag
) {
7514 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7519 static void GLAPIENTRY
7520 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7523 GET_CURRENT_CONTEXT(ctx
);
7525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7531 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7533 if (ctx
->ExecuteFlag
) {
7534 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7538 static void GLAPIENTRY
7539 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7542 GET_CURRENT_CONTEXT(ctx
);
7544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7545 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7550 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7552 if (ctx
->ExecuteFlag
) {
7553 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7558 static void GLAPIENTRY
7559 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7562 GET_CURRENT_CONTEXT(ctx
);
7564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7565 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7570 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7572 if (ctx
->ExecuteFlag
) {
7573 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7577 static void GLAPIENTRY
7578 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7581 GET_CURRENT_CONTEXT(ctx
);
7583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7584 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7589 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7591 if (ctx
->ExecuteFlag
) {
7592 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7596 static void GLAPIENTRY
7597 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7600 GET_CURRENT_CONTEXT(ctx
);
7602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7603 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7608 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7610 if (ctx
->ExecuteFlag
) {
7611 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7616 static void GLAPIENTRY
7617 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7620 GET_CURRENT_CONTEXT(ctx
);
7622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7623 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7628 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7630 if (ctx
->ExecuteFlag
) {
7631 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7636 static void GLAPIENTRY
7637 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7640 GET_CURRENT_CONTEXT(ctx
);
7642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7643 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7648 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7650 if (ctx
->ExecuteFlag
) {
7651 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7656 static void GLAPIENTRY
7657 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7660 GET_CURRENT_CONTEXT(ctx
);
7662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7663 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7668 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7670 if (ctx
->ExecuteFlag
) {
7671 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7675 static void GLAPIENTRY
7676 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7679 GET_CURRENT_CONTEXT(ctx
);
7681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7682 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7687 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7689 if (ctx
->ExecuteFlag
) {
7690 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7695 static void GLAPIENTRY
7696 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7699 GET_CURRENT_CONTEXT(ctx
);
7701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7702 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7707 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7709 if (ctx
->ExecuteFlag
) {
7710 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7715 static void GLAPIENTRY
7716 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7719 GET_CURRENT_CONTEXT(ctx
);
7721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7722 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7727 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7729 if (ctx
->ExecuteFlag
) {
7730 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7735 static void GLAPIENTRY
7736 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7738 GET_CURRENT_CONTEXT(ctx
);
7740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7741 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7747 if (ctx
->ExecuteFlag
) {
7748 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7752 static void GLAPIENTRY
7753 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7755 GET_CURRENT_CONTEXT(ctx
);
7757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7758 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7764 if (ctx
->ExecuteFlag
) {
7765 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7769 static void GLAPIENTRY
7770 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7772 GET_CURRENT_CONTEXT(ctx
);
7774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7775 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7782 if (ctx
->ExecuteFlag
) {
7783 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7787 static void GLAPIENTRY
7788 save_ProgramUniform3f(GLuint program
, GLint location
,
7789 GLfloat x
, GLfloat y
, GLfloat z
)
7791 GET_CURRENT_CONTEXT(ctx
);
7793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7794 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7802 if (ctx
->ExecuteFlag
) {
7803 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7807 static void GLAPIENTRY
7808 save_ProgramUniform4f(GLuint program
, GLint location
,
7809 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7811 GET_CURRENT_CONTEXT(ctx
);
7813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7814 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7823 if (ctx
->ExecuteFlag
) {
7824 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7828 static void GLAPIENTRY
7829 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7832 GET_CURRENT_CONTEXT(ctx
);
7834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7835 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7840 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7842 if (ctx
->ExecuteFlag
) {
7843 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7847 static void GLAPIENTRY
7848 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7851 GET_CURRENT_CONTEXT(ctx
);
7853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7854 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7859 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7861 if (ctx
->ExecuteFlag
) {
7862 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7866 static void GLAPIENTRY
7867 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7870 GET_CURRENT_CONTEXT(ctx
);
7872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7873 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7878 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7880 if (ctx
->ExecuteFlag
) {
7881 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7885 static void GLAPIENTRY
7886 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7889 GET_CURRENT_CONTEXT(ctx
);
7891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7892 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7897 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7899 if (ctx
->ExecuteFlag
) {
7900 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7904 static void GLAPIENTRY
7905 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7907 GET_CURRENT_CONTEXT(ctx
);
7909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7910 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7914 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7916 if (ctx
->ExecuteFlag
) {
7917 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7921 static void GLAPIENTRY
7922 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7924 GET_CURRENT_CONTEXT(ctx
);
7926 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7927 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7931 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7932 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7934 if (ctx
->ExecuteFlag
) {
7935 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7939 static void GLAPIENTRY
7940 save_ProgramUniform3d(GLuint program
, GLint location
,
7941 GLdouble x
, GLdouble y
, GLdouble z
)
7943 GET_CURRENT_CONTEXT(ctx
);
7945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7946 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
7950 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7951 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7952 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7954 if (ctx
->ExecuteFlag
) {
7955 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
7959 static void GLAPIENTRY
7960 save_ProgramUniform4d(GLuint program
, GLint location
,
7961 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7963 GET_CURRENT_CONTEXT(ctx
);
7965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7966 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
7970 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7971 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7972 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7973 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
7975 if (ctx
->ExecuteFlag
) {
7976 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7980 static void GLAPIENTRY
7981 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
7984 GET_CURRENT_CONTEXT(ctx
);
7986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7987 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
7992 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7994 if (ctx
->ExecuteFlag
) {
7995 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
7999 static void GLAPIENTRY
8000 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8003 GET_CURRENT_CONTEXT(ctx
);
8005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8006 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8011 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8013 if (ctx
->ExecuteFlag
) {
8014 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8018 static void GLAPIENTRY
8019 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8022 GET_CURRENT_CONTEXT(ctx
);
8024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8025 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8030 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8032 if (ctx
->ExecuteFlag
) {
8033 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8037 static void GLAPIENTRY
8038 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8041 GET_CURRENT_CONTEXT(ctx
);
8043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8044 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8049 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8051 if (ctx
->ExecuteFlag
) {
8052 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8056 static void GLAPIENTRY
8057 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8059 GET_CURRENT_CONTEXT(ctx
);
8061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8062 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8068 if (ctx
->ExecuteFlag
) {
8069 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8073 static void GLAPIENTRY
8074 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8076 GET_CURRENT_CONTEXT(ctx
);
8078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8079 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8086 if (ctx
->ExecuteFlag
) {
8087 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8091 static void GLAPIENTRY
8092 save_ProgramUniform3i(GLuint program
, GLint location
,
8093 GLint x
, GLint y
, GLint z
)
8095 GET_CURRENT_CONTEXT(ctx
);
8097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8098 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8106 if (ctx
->ExecuteFlag
) {
8107 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8111 static void GLAPIENTRY
8112 save_ProgramUniform4i(GLuint program
, GLint location
,
8113 GLint x
, GLint y
, GLint z
, GLint w
)
8115 GET_CURRENT_CONTEXT(ctx
);
8117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8118 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8127 if (ctx
->ExecuteFlag
) {
8128 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8132 static void GLAPIENTRY
8133 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8136 GET_CURRENT_CONTEXT(ctx
);
8138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8139 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8144 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8146 if (ctx
->ExecuteFlag
) {
8147 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8151 static void GLAPIENTRY
8152 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8155 GET_CURRENT_CONTEXT(ctx
);
8157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8158 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8163 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8165 if (ctx
->ExecuteFlag
) {
8166 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8170 static void GLAPIENTRY
8171 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8174 GET_CURRENT_CONTEXT(ctx
);
8176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8177 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8182 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8184 if (ctx
->ExecuteFlag
) {
8185 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8189 static void GLAPIENTRY
8190 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8193 GET_CURRENT_CONTEXT(ctx
);
8195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8196 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8201 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8203 if (ctx
->ExecuteFlag
) {
8204 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8208 static void GLAPIENTRY
8209 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8211 GET_CURRENT_CONTEXT(ctx
);
8213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8214 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8220 if (ctx
->ExecuteFlag
) {
8221 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8225 static void GLAPIENTRY
8226 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8228 GET_CURRENT_CONTEXT(ctx
);
8230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8231 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8238 if (ctx
->ExecuteFlag
) {
8239 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8243 static void GLAPIENTRY
8244 save_ProgramUniform3ui(GLuint program
, GLint location
,
8245 GLuint x
, GLuint y
, GLuint z
)
8247 GET_CURRENT_CONTEXT(ctx
);
8249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8250 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8258 if (ctx
->ExecuteFlag
) {
8259 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8263 static void GLAPIENTRY
8264 save_ProgramUniform4ui(GLuint program
, GLint location
,
8265 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8267 GET_CURRENT_CONTEXT(ctx
);
8269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8270 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8279 if (ctx
->ExecuteFlag
) {
8280 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8284 static void GLAPIENTRY
8285 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8288 GET_CURRENT_CONTEXT(ctx
);
8290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8291 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8296 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8298 if (ctx
->ExecuteFlag
) {
8299 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8303 static void GLAPIENTRY
8304 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8307 GET_CURRENT_CONTEXT(ctx
);
8309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8310 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8315 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8317 if (ctx
->ExecuteFlag
) {
8318 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8322 static void GLAPIENTRY
8323 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8326 GET_CURRENT_CONTEXT(ctx
);
8328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8329 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8334 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8336 if (ctx
->ExecuteFlag
) {
8337 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8341 static void GLAPIENTRY
8342 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8345 GET_CURRENT_CONTEXT(ctx
);
8347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8348 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8353 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8355 if (ctx
->ExecuteFlag
) {
8356 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8360 static void GLAPIENTRY
8361 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8362 GLboolean transpose
, const GLfloat
*v
)
8364 GET_CURRENT_CONTEXT(ctx
);
8366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8367 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8368 4 + POINTER_DWORDS
);
8374 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8376 if (ctx
->ExecuteFlag
) {
8377 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8378 (program
, location
, count
, transpose
, v
));
8382 static void GLAPIENTRY
8383 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8384 GLboolean transpose
, const GLfloat
*v
)
8386 GET_CURRENT_CONTEXT(ctx
);
8388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8389 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8390 4 + POINTER_DWORDS
);
8396 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8398 if (ctx
->ExecuteFlag
) {
8399 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8400 (program
, location
, count
, transpose
, v
));
8404 static void GLAPIENTRY
8405 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8406 GLboolean transpose
, const GLfloat
*v
)
8408 GET_CURRENT_CONTEXT(ctx
);
8410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8411 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8412 4 + POINTER_DWORDS
);
8418 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8420 if (ctx
->ExecuteFlag
) {
8421 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8422 (program
, location
, count
, transpose
, v
));
8426 static void GLAPIENTRY
8427 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8428 GLboolean transpose
, const GLfloat
*v
)
8430 GET_CURRENT_CONTEXT(ctx
);
8432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8433 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8434 4 + POINTER_DWORDS
);
8440 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8442 if (ctx
->ExecuteFlag
) {
8443 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8444 (program
, location
, count
, transpose
, v
));
8448 static void GLAPIENTRY
8449 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8450 GLboolean transpose
, const GLfloat
*v
)
8452 GET_CURRENT_CONTEXT(ctx
);
8454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8455 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8456 4 + POINTER_DWORDS
);
8462 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8464 if (ctx
->ExecuteFlag
) {
8465 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8466 (program
, location
, count
, transpose
, v
));
8470 static void GLAPIENTRY
8471 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8472 GLboolean transpose
, const GLfloat
*v
)
8474 GET_CURRENT_CONTEXT(ctx
);
8476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8477 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8478 4 + POINTER_DWORDS
);
8484 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8486 if (ctx
->ExecuteFlag
) {
8487 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8488 (program
, location
, count
, transpose
, v
));
8492 static void GLAPIENTRY
8493 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8494 GLboolean transpose
, const GLfloat
*v
)
8496 GET_CURRENT_CONTEXT(ctx
);
8498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8499 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8500 4 + POINTER_DWORDS
);
8506 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8508 if (ctx
->ExecuteFlag
) {
8509 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8510 (program
, location
, count
, transpose
, v
));
8514 static void GLAPIENTRY
8515 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8516 GLboolean transpose
, const GLfloat
*v
)
8518 GET_CURRENT_CONTEXT(ctx
);
8520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8521 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8522 4 + POINTER_DWORDS
);
8528 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8530 if (ctx
->ExecuteFlag
) {
8531 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8532 (program
, location
, count
, transpose
, v
));
8536 static void GLAPIENTRY
8537 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8538 GLboolean transpose
, const GLfloat
*v
)
8540 GET_CURRENT_CONTEXT(ctx
);
8542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8543 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8544 4 + POINTER_DWORDS
);
8550 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8552 if (ctx
->ExecuteFlag
) {
8553 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8554 (program
, location
, count
, transpose
, v
));
8558 static void GLAPIENTRY
8559 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8560 GLboolean transpose
, const GLdouble
*v
)
8562 GET_CURRENT_CONTEXT(ctx
);
8564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8565 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8566 4 + POINTER_DWORDS
);
8572 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8574 if (ctx
->ExecuteFlag
) {
8575 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8576 (program
, location
, count
, transpose
, v
));
8580 static void GLAPIENTRY
8581 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8582 GLboolean transpose
, const GLdouble
*v
)
8584 GET_CURRENT_CONTEXT(ctx
);
8586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8587 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8588 4 + POINTER_DWORDS
);
8594 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8596 if (ctx
->ExecuteFlag
) {
8597 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8598 (program
, location
, count
, transpose
, v
));
8602 static void GLAPIENTRY
8603 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8604 GLboolean transpose
, const GLdouble
*v
)
8606 GET_CURRENT_CONTEXT(ctx
);
8608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8609 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8610 4 + POINTER_DWORDS
);
8616 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8618 if (ctx
->ExecuteFlag
) {
8619 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8620 (program
, location
, count
, transpose
, v
));
8624 static void GLAPIENTRY
8625 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8626 GLboolean transpose
, const GLdouble
*v
)
8628 GET_CURRENT_CONTEXT(ctx
);
8630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8631 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8632 4 + POINTER_DWORDS
);
8638 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8640 if (ctx
->ExecuteFlag
) {
8641 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8642 (program
, location
, count
, transpose
, v
));
8646 static void GLAPIENTRY
8647 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8648 GLboolean transpose
, const GLdouble
*v
)
8650 GET_CURRENT_CONTEXT(ctx
);
8652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8653 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8654 4 + POINTER_DWORDS
);
8660 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8662 if (ctx
->ExecuteFlag
) {
8663 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8664 (program
, location
, count
, transpose
, v
));
8668 static void GLAPIENTRY
8669 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8670 GLboolean transpose
, const GLdouble
*v
)
8672 GET_CURRENT_CONTEXT(ctx
);
8674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8675 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8676 4 + POINTER_DWORDS
);
8682 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8684 if (ctx
->ExecuteFlag
) {
8685 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8686 (program
, location
, count
, transpose
, v
));
8690 static void GLAPIENTRY
8691 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8692 GLboolean transpose
, const GLdouble
*v
)
8694 GET_CURRENT_CONTEXT(ctx
);
8696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8697 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8698 4 + POINTER_DWORDS
);
8704 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8706 if (ctx
->ExecuteFlag
) {
8707 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8708 (program
, location
, count
, transpose
, v
));
8712 static void GLAPIENTRY
8713 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8714 GLboolean transpose
, const GLdouble
*v
)
8716 GET_CURRENT_CONTEXT(ctx
);
8718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8719 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8720 4 + POINTER_DWORDS
);
8726 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8728 if (ctx
->ExecuteFlag
) {
8729 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8730 (program
, location
, count
, transpose
, v
));
8734 static void GLAPIENTRY
8735 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8736 GLboolean transpose
, const GLdouble
*v
)
8738 GET_CURRENT_CONTEXT(ctx
);
8740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8741 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8742 4 + POINTER_DWORDS
);
8748 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8750 if (ctx
->ExecuteFlag
) {
8751 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8752 (program
, location
, count
, transpose
, v
));
8756 static void GLAPIENTRY
8757 save_ClipControl(GLenum origin
, GLenum depth
)
8759 GET_CURRENT_CONTEXT(ctx
);
8761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8762 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8767 if (ctx
->ExecuteFlag
) {
8768 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8772 static void GLAPIENTRY
8773 save_ClampColorARB(GLenum target
, GLenum clamp
)
8775 GET_CURRENT_CONTEXT(ctx
);
8777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8778 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8783 if (ctx
->ExecuteFlag
) {
8784 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8788 /** GL_EXT_texture_integer */
8789 static void GLAPIENTRY
8790 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8792 GET_CURRENT_CONTEXT(ctx
);
8794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8795 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8802 if (ctx
->ExecuteFlag
) {
8803 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8807 /** GL_EXT_texture_integer */
8808 static void GLAPIENTRY
8809 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8811 GET_CURRENT_CONTEXT(ctx
);
8813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8814 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8821 if (ctx
->ExecuteFlag
) {
8822 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8826 /** GL_EXT_texture_integer */
8827 static void GLAPIENTRY
8828 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8830 GET_CURRENT_CONTEXT(ctx
);
8832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8833 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8842 if (ctx
->ExecuteFlag
) {
8843 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8847 /** GL_EXT_texture_integer */
8848 static void GLAPIENTRY
8849 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8851 GET_CURRENT_CONTEXT(ctx
);
8853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8854 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8858 n
[3].ui
= params
[0];
8859 n
[4].ui
= params
[1];
8860 n
[5].ui
= params
[2];
8861 n
[6].ui
= params
[3];
8863 if (ctx
->ExecuteFlag
) {
8864 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8868 /* GL_ARB_instanced_arrays */
8869 static void GLAPIENTRY
8870 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8872 GET_CURRENT_CONTEXT(ctx
);
8874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8875 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8880 if (ctx
->ExecuteFlag
) {
8881 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8886 /* GL_NV_texture_barrier */
8887 static void GLAPIENTRY
8888 save_TextureBarrierNV(void)
8890 GET_CURRENT_CONTEXT(ctx
);
8891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8892 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8893 if (ctx
->ExecuteFlag
) {
8894 CALL_TextureBarrierNV(ctx
->Exec
, ());
8899 /* GL_ARB_sampler_objects */
8900 static void GLAPIENTRY
8901 save_BindSampler(GLuint unit
, GLuint sampler
)
8904 GET_CURRENT_CONTEXT(ctx
);
8905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8906 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8911 if (ctx
->ExecuteFlag
) {
8912 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8916 static void GLAPIENTRY
8917 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8920 GET_CURRENT_CONTEXT(ctx
);
8921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8922 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8927 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8933 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8936 if (ctx
->ExecuteFlag
) {
8937 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8941 static void GLAPIENTRY
8942 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8946 parray
[1] = parray
[2] = parray
[3] = 0;
8947 save_SamplerParameteriv(sampler
, pname
, parray
);
8950 static void GLAPIENTRY
8951 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
8954 GET_CURRENT_CONTEXT(ctx
);
8955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8956 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
8961 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8967 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
8970 if (ctx
->ExecuteFlag
) {
8971 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
8975 static void GLAPIENTRY
8976 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
8980 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
8981 save_SamplerParameterfv(sampler
, pname
, parray
);
8984 static void GLAPIENTRY
8985 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8988 GET_CURRENT_CONTEXT(ctx
);
8989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8990 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
8995 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9001 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9004 if (ctx
->ExecuteFlag
) {
9005 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9009 static void GLAPIENTRY
9010 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9013 GET_CURRENT_CONTEXT(ctx
);
9014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9015 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9019 n
[3].ui
= params
[0];
9020 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9021 n
[4].ui
= params
[1];
9022 n
[5].ui
= params
[2];
9023 n
[6].ui
= params
[3];
9026 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9029 if (ctx
->ExecuteFlag
) {
9030 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9034 static void GLAPIENTRY
9035 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9038 GET_CURRENT_CONTEXT(ctx
);
9039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9040 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9042 union uint64_pair p
;
9045 n
[2].ui
= p
.uint32
[0];
9046 n
[3].ui
= p
.uint32
[1];
9047 save_pointer(&n
[4], sync
);
9049 if (ctx
->ExecuteFlag
) {
9050 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9055 /** GL_NV_conditional_render */
9056 static void GLAPIENTRY
9057 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9059 GET_CURRENT_CONTEXT(ctx
);
9061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9062 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9067 if (ctx
->ExecuteFlag
) {
9068 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9072 static void GLAPIENTRY
9073 save_EndConditionalRender(void)
9075 GET_CURRENT_CONTEXT(ctx
);
9076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9077 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9078 if (ctx
->ExecuteFlag
) {
9079 CALL_EndConditionalRender(ctx
->Exec
, ());
9083 static void GLAPIENTRY
9084 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9086 GET_CURRENT_CONTEXT(ctx
);
9088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9089 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9095 if (ctx
->ExecuteFlag
) {
9096 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9100 static void GLAPIENTRY
9101 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9102 const GLuint
*indices
)
9104 GET_CURRENT_CONTEXT(ctx
);
9106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9107 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9109 GLint
*indices_copy
= NULL
;
9112 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9113 n
[1].e
= shadertype
;
9115 save_pointer(&n
[3], indices_copy
);
9117 if (ctx
->ExecuteFlag
) {
9118 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9122 /** GL_EXT_window_rectangles */
9123 static void GLAPIENTRY
9124 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9126 GET_CURRENT_CONTEXT(ctx
);
9128 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9129 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9131 GLint
*box_copy
= NULL
;
9134 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9137 save_pointer(&n
[3], box_copy
);
9139 if (ctx
->ExecuteFlag
) {
9140 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9145 /** GL_NV_conservative_raster */
9146 static void GLAPIENTRY
9147 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9149 GET_CURRENT_CONTEXT(ctx
);
9151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9152 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9157 if (ctx
->ExecuteFlag
) {
9158 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9162 /** GL_NV_conservative_raster_dilate */
9163 static void GLAPIENTRY
9164 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9166 GET_CURRENT_CONTEXT(ctx
);
9168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9169 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9174 if (ctx
->ExecuteFlag
) {
9175 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9179 /** GL_NV_conservative_raster_pre_snap_triangles */
9180 static void GLAPIENTRY
9181 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9183 GET_CURRENT_CONTEXT(ctx
);
9185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9186 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9191 if (ctx
->ExecuteFlag
) {
9192 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9198 * Save an error-generating command into display list.
9200 * KW: Will appear in the list before the vertex buffer containing the
9201 * command that provoked the error. I don't see this as a problem.
9204 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9207 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
9210 save_pointer(&n
[2], (void *) s
);
9211 /* note: the data/string here doesn't have to be freed in
9212 * _mesa_delete_list() since the string is never dynamically
9220 * Compile an error into current display list.
9223 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9225 if (ctx
->CompileFlag
)
9226 save_error(ctx
, error
, s
);
9227 if (ctx
->ExecuteFlag
)
9228 _mesa_error(ctx
, error
, "%s", s
);
9233 * Test if ID names a display list.
9236 islist(struct gl_context
*ctx
, GLuint list
)
9238 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
9248 /**********************************************************************/
9249 /* Display list execution */
9250 /**********************************************************************/
9254 * Execute a display list. Note that the ListBase offset must have already
9255 * been added before calling this function. I.e. the list argument is
9256 * the absolute list number, not relative to ListBase.
9257 * \param list - display list number
9260 execute_list(struct gl_context
*ctx
, GLuint list
)
9262 struct gl_display_list
*dlist
;
9266 if (list
== 0 || !islist(ctx
, list
))
9269 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
9270 /* raise an error? */
9274 dlist
= _mesa_lookup_list(ctx
, list
);
9278 ctx
->ListState
.CallDepth
++;
9280 vbo_save_BeginCallList(ctx
, dlist
);
9286 const OpCode opcode
= n
[0].opcode
;
9288 if (is_ext_opcode(opcode
)) {
9289 n
+= ext_opcode_execute(ctx
, n
);
9294 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
9297 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9299 case OPCODE_ALPHA_FUNC
:
9300 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9302 case OPCODE_BIND_TEXTURE
:
9303 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9307 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9308 ctx
->Unpack
= ctx
->DefaultPacking
;
9309 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
9310 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9311 get_pointer(&n
[7])));
9312 ctx
->Unpack
= save
; /* restore */
9315 case OPCODE_BLEND_COLOR
:
9316 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9318 case OPCODE_BLEND_EQUATION
:
9319 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
9321 case OPCODE_BLEND_EQUATION_SEPARATE
:
9322 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9324 case OPCODE_BLEND_FUNC_SEPARATE
:
9325 CALL_BlendFuncSeparate(ctx
->Exec
,
9326 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
9329 case OPCODE_BLEND_FUNC_I
:
9330 /* GL_ARB_draw_buffers_blend */
9331 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
9333 case OPCODE_BLEND_FUNC_SEPARATE_I
:
9334 /* GL_ARB_draw_buffers_blend */
9335 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
9338 case OPCODE_BLEND_EQUATION_I
:
9339 /* GL_ARB_draw_buffers_blend */
9340 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9342 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
9343 /* GL_ARB_draw_buffers_blend */
9344 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
9345 (n
[1].ui
, n
[2].e
, n
[3].e
));
9348 case OPCODE_CALL_LIST
:
9349 /* Generated by glCallList(), don't add ListBase */
9350 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9351 execute_list(ctx
, n
[1].ui
);
9354 case OPCODE_CALL_LISTS
:
9355 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9356 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
9360 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
9362 case OPCODE_CLEAR_BUFFER_IV
:
9369 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9372 case OPCODE_CLEAR_BUFFER_UIV
:
9379 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9382 case OPCODE_CLEAR_BUFFER_FV
:
9389 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9392 case OPCODE_CLEAR_BUFFER_FI
:
9393 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
9395 case OPCODE_CLEAR_COLOR
:
9396 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9398 case OPCODE_CLEAR_ACCUM
:
9399 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9401 case OPCODE_CLEAR_DEPTH
:
9402 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
9404 case OPCODE_CLEAR_INDEX
:
9405 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
9407 case OPCODE_CLEAR_STENCIL
:
9408 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
9410 case OPCODE_CLIP_PLANE
:
9417 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
9420 case OPCODE_COLOR_MASK
:
9421 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
9423 case OPCODE_COLOR_MASK_INDEXED
:
9424 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
9427 case OPCODE_COLOR_MATERIAL
:
9428 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9430 case OPCODE_COPY_PIXELS
:
9431 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
9432 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
9435 case OPCODE_COPY_TEX_IMAGE1D
:
9436 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9437 n
[5].i
, n
[6].i
, n
[7].i
));
9439 case OPCODE_COPY_TEX_IMAGE2D
:
9440 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9441 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
9443 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
9444 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9445 n
[4].i
, n
[5].i
, n
[6].i
));
9447 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
9448 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9449 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9452 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
9453 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9454 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9457 case OPCODE_CULL_FACE
:
9458 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
9460 case OPCODE_DEPTH_FUNC
:
9461 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
9463 case OPCODE_DEPTH_MASK
:
9464 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
9466 case OPCODE_DEPTH_RANGE
:
9467 CALL_DepthRange(ctx
->Exec
,
9468 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
9470 case OPCODE_DISABLE
:
9471 CALL_Disable(ctx
->Exec
, (n
[1].e
));
9473 case OPCODE_DISABLE_INDEXED
:
9474 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9476 case OPCODE_DRAW_BUFFER
:
9477 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
9479 case OPCODE_DRAW_PIXELS
:
9481 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9482 ctx
->Unpack
= ctx
->DefaultPacking
;
9483 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
9484 get_pointer(&n
[5])));
9485 ctx
->Unpack
= save
; /* restore */
9489 CALL_Enable(ctx
->Exec
, (n
[1].e
));
9491 case OPCODE_ENABLE_INDEXED
:
9492 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9494 case OPCODE_EVALMESH1
:
9495 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
9497 case OPCODE_EVALMESH2
:
9498 CALL_EvalMesh2(ctx
->Exec
,
9499 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
9508 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
9511 case OPCODE_FRONT_FACE
:
9512 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
9514 case OPCODE_FRUSTUM
:
9515 CALL_Frustum(ctx
->Exec
,
9516 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9519 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9521 case OPCODE_INDEX_MASK
:
9522 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
9524 case OPCODE_INIT_NAMES
:
9525 CALL_InitNames(ctx
->Exec
, ());
9534 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
9537 case OPCODE_LIGHT_MODEL
:
9544 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
9547 case OPCODE_LINE_STIPPLE
:
9548 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
9550 case OPCODE_LINE_WIDTH
:
9551 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
9553 case OPCODE_LIST_BASE
:
9554 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
9556 case OPCODE_LOAD_IDENTITY
:
9557 CALL_LoadIdentity(ctx
->Exec
, ());
9559 case OPCODE_LOAD_MATRIX
:
9560 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
9561 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
9563 case OPCODE_LOAD_NAME
:
9564 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
9566 case OPCODE_LOGIC_OP
:
9567 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
9571 GLenum target
= n
[1].e
;
9572 GLint ustride
= _mesa_evaluator_components(target
);
9573 GLint uorder
= n
[5].i
;
9574 GLfloat u1
= n
[2].f
;
9575 GLfloat u2
= n
[3].f
;
9576 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9577 (GLfloat
*) get_pointer(&n
[6])));
9582 GLenum target
= n
[1].e
;
9583 GLfloat u1
= n
[2].f
;
9584 GLfloat u2
= n
[3].f
;
9585 GLfloat v1
= n
[4].f
;
9586 GLfloat v2
= n
[5].f
;
9587 GLint ustride
= n
[6].i
;
9588 GLint vstride
= n
[7].i
;
9589 GLint uorder
= n
[8].i
;
9590 GLint vorder
= n
[9].i
;
9591 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9592 v1
, v2
, vstride
, vorder
,
9593 (GLfloat
*) get_pointer(&n
[10])));
9596 case OPCODE_MAPGRID1
:
9597 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
9599 case OPCODE_MAPGRID2
:
9600 CALL_MapGrid2f(ctx
->Exec
,
9601 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
9603 case OPCODE_MATRIX_MODE
:
9604 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
9606 case OPCODE_MULT_MATRIX
:
9607 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
9610 CALL_Ortho(ctx
->Exec
,
9611 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9613 case OPCODE_PASSTHROUGH
:
9614 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
9616 case OPCODE_PATCH_PARAMETER_I
:
9617 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
9619 case OPCODE_PATCH_PARAMETER_FV_INNER
:
9624 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9627 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
9634 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9637 case OPCODE_PIXEL_MAP
:
9638 CALL_PixelMapfv(ctx
->Exec
,
9639 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
9641 case OPCODE_PIXEL_TRANSFER
:
9642 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9644 case OPCODE_PIXEL_ZOOM
:
9645 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9647 case OPCODE_POINT_SIZE
:
9648 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
9650 case OPCODE_POINT_PARAMETERS
:
9656 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9659 case OPCODE_POLYGON_MODE
:
9660 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9662 case OPCODE_POLYGON_STIPPLE
:
9664 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9665 ctx
->Unpack
= ctx
->DefaultPacking
;
9666 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
9667 ctx
->Unpack
= save
; /* restore */
9670 case OPCODE_POLYGON_OFFSET
:
9671 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9673 case OPCODE_POLYGON_OFFSET_CLAMP
:
9674 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9676 case OPCODE_POP_ATTRIB
:
9677 CALL_PopAttrib(ctx
->Exec
, ());
9679 case OPCODE_POP_MATRIX
:
9680 CALL_PopMatrix(ctx
->Exec
, ());
9682 case OPCODE_POP_NAME
:
9683 CALL_PopName(ctx
->Exec
, ());
9685 case OPCODE_PRIORITIZE_TEXTURE
:
9686 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
9688 case OPCODE_PUSH_ATTRIB
:
9689 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
9691 case OPCODE_PUSH_MATRIX
:
9692 CALL_PushMatrix(ctx
->Exec
, ());
9694 case OPCODE_PUSH_NAME
:
9695 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
9697 case OPCODE_RASTER_POS
:
9698 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9700 case OPCODE_READ_BUFFER
:
9701 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
9704 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9707 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9709 case OPCODE_SCISSOR
:
9710 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
9712 case OPCODE_SHADE_MODEL
:
9713 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
9715 case OPCODE_PROVOKING_VERTEX
:
9716 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
9718 case OPCODE_STENCIL_FUNC
:
9719 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
9721 case OPCODE_STENCIL_MASK
:
9722 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
9724 case OPCODE_STENCIL_OP
:
9725 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
9727 case OPCODE_STENCIL_FUNC_SEPARATE
:
9728 CALL_StencilFuncSeparate(ctx
->Exec
,
9729 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
9731 case OPCODE_STENCIL_MASK_SEPARATE
:
9732 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9734 case OPCODE_STENCIL_OP_SEPARATE
:
9735 CALL_StencilOpSeparate(ctx
->Exec
,
9736 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
9745 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9755 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9758 case OPCODE_TEXPARAMETER
:
9765 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9768 case OPCODE_TEX_IMAGE1D
:
9770 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9771 ctx
->Unpack
= ctx
->DefaultPacking
;
9772 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
9774 n
[3].i
, /* components */
9776 n
[5].e
, /* border */
9777 n
[6].e
, /* format */
9779 get_pointer(&n
[8])));
9780 ctx
->Unpack
= save
; /* restore */
9783 case OPCODE_TEX_IMAGE2D
:
9785 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9786 ctx
->Unpack
= ctx
->DefaultPacking
;
9787 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
9789 n
[3].i
, /* components */
9791 n
[5].i
, /* height */
9792 n
[6].e
, /* border */
9793 n
[7].e
, /* format */
9795 get_pointer(&n
[9])));
9796 ctx
->Unpack
= save
; /* restore */
9799 case OPCODE_TEX_IMAGE3D
:
9801 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9802 ctx
->Unpack
= ctx
->DefaultPacking
;
9803 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
9805 n
[3].i
, /* components */
9807 n
[5].i
, /* height */
9809 n
[7].e
, /* border */
9810 n
[8].e
, /* format */
9812 get_pointer(&n
[10])));
9813 ctx
->Unpack
= save
; /* restore */
9816 case OPCODE_TEX_SUB_IMAGE1D
:
9818 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9819 ctx
->Unpack
= ctx
->DefaultPacking
;
9820 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9822 n
[6].e
, get_pointer(&n
[7])));
9823 ctx
->Unpack
= save
; /* restore */
9826 case OPCODE_TEX_SUB_IMAGE2D
:
9828 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9829 ctx
->Unpack
= ctx
->DefaultPacking
;
9830 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9832 n
[6].i
, n
[7].e
, n
[8].e
,
9833 get_pointer(&n
[9])));
9834 ctx
->Unpack
= save
; /* restore */
9837 case OPCODE_TEX_SUB_IMAGE3D
:
9839 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9840 ctx
->Unpack
= ctx
->DefaultPacking
;
9841 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9842 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9843 n
[8].i
, n
[9].e
, n
[10].e
,
9844 get_pointer(&n
[11])));
9845 ctx
->Unpack
= save
; /* restore */
9848 case OPCODE_TRANSLATE
:
9849 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9851 case OPCODE_VIEWPORT
:
9852 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
9853 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
9855 case OPCODE_WINDOW_POS
:
9856 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9858 case OPCODE_VIEWPORT_ARRAY_V
:
9859 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9860 get_pointer(&n
[3])));
9862 case OPCODE_VIEWPORT_INDEXED_F
:
9863 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
9866 case OPCODE_VIEWPORT_INDEXED_FV
: {
9872 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
9875 case OPCODE_SCISSOR_ARRAY_V
:
9876 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9877 get_pointer(&n
[3])));
9879 case OPCODE_SCISSOR_INDEXED
:
9880 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
9883 case OPCODE_SCISSOR_INDEXED_V
: {
9889 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
9892 case OPCODE_DEPTH_ARRAY_V
:
9893 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9894 get_pointer(&n
[3])));
9896 case OPCODE_DEPTH_INDEXED
:
9897 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
9899 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
9900 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
9902 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
9903 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9904 n
[4].i
, n
[5].i
, n
[6].i
,
9905 get_pointer(&n
[7])));
9907 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
9908 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9909 n
[4].i
, n
[5].i
, n
[6].i
,
9910 n
[7].i
, get_pointer(&n
[8])));
9912 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
9913 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9914 n
[4].i
, n
[5].i
, n
[6].i
,
9916 get_pointer(&n
[9])));
9918 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
9919 CALL_CompressedTexSubImage1D(ctx
->Exec
,
9920 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9922 get_pointer(&n
[7])));
9924 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
9925 CALL_CompressedTexSubImage2D(ctx
->Exec
,
9926 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9927 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
9928 get_pointer(&n
[9])));
9930 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
9931 CALL_CompressedTexSubImage3D(ctx
->Exec
,
9932 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9933 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
9935 get_pointer(&n
[11])));
9937 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
9938 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
9940 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
9941 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9943 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
9944 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9946 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
9947 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
9948 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
9951 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
9952 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
9954 case OPCODE_DEPTH_BOUNDS_EXT
:
9955 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9957 case OPCODE_PROGRAM_STRING_ARB
:
9958 CALL_ProgramStringARB(ctx
->Exec
,
9959 (n
[1].e
, n
[2].e
, n
[3].i
,
9960 get_pointer(&n
[4])));
9962 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
9963 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
9967 case OPCODE_BEGIN_QUERY_ARB
:
9968 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9970 case OPCODE_END_QUERY_ARB
:
9971 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
9973 case OPCODE_QUERY_COUNTER
:
9974 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9976 case OPCODE_BEGIN_QUERY_INDEXED
:
9977 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
9979 case OPCODE_END_QUERY_INDEXED
:
9980 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9982 case OPCODE_DRAW_BUFFERS_ARB
:
9984 GLenum buffers
[MAX_DRAW_BUFFERS
];
9985 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
9986 for (i
= 0; i
< count
; i
++)
9987 buffers
[i
] = n
[2 + i
].e
;
9988 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
9991 case OPCODE_BLIT_FRAMEBUFFER
:
9992 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
9993 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
9996 case OPCODE_PRIMITIVE_RESTART_NV
:
9997 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10000 case OPCODE_USE_PROGRAM
:
10001 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10003 case OPCODE_UNIFORM_1F
:
10004 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10006 case OPCODE_UNIFORM_2F
:
10007 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10009 case OPCODE_UNIFORM_3F
:
10010 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10012 case OPCODE_UNIFORM_4F
:
10013 CALL_Uniform4f(ctx
->Exec
,
10014 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10016 case OPCODE_UNIFORM_1FV
:
10017 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10019 case OPCODE_UNIFORM_2FV
:
10020 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10022 case OPCODE_UNIFORM_3FV
:
10023 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10025 case OPCODE_UNIFORM_4FV
:
10026 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10028 case OPCODE_UNIFORM_1D
: {
10029 union float64_pair x
;
10031 x
.uint32
[0] = n
[2].ui
;
10032 x
.uint32
[1] = n
[3].ui
;
10034 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10037 case OPCODE_UNIFORM_2D
: {
10038 union float64_pair x
;
10039 union float64_pair y
;
10041 x
.uint32
[0] = n
[2].ui
;
10042 x
.uint32
[1] = n
[3].ui
;
10043 y
.uint32
[0] = n
[4].ui
;
10044 y
.uint32
[1] = n
[5].ui
;
10046 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10049 case OPCODE_UNIFORM_3D
: {
10050 union float64_pair x
;
10051 union float64_pair y
;
10052 union float64_pair z
;
10054 x
.uint32
[0] = n
[2].ui
;
10055 x
.uint32
[1] = n
[3].ui
;
10056 y
.uint32
[0] = n
[4].ui
;
10057 y
.uint32
[1] = n
[5].ui
;
10058 z
.uint32
[0] = n
[6].ui
;
10059 z
.uint32
[1] = n
[7].ui
;
10061 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10064 case OPCODE_UNIFORM_4D
: {
10065 union float64_pair x
;
10066 union float64_pair y
;
10067 union float64_pair z
;
10068 union float64_pair w
;
10070 x
.uint32
[0] = n
[2].ui
;
10071 x
.uint32
[1] = n
[3].ui
;
10072 y
.uint32
[0] = n
[4].ui
;
10073 y
.uint32
[1] = n
[5].ui
;
10074 z
.uint32
[0] = n
[6].ui
;
10075 z
.uint32
[1] = n
[7].ui
;
10076 w
.uint32
[0] = n
[8].ui
;
10077 w
.uint32
[1] = n
[9].ui
;
10079 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10082 case OPCODE_UNIFORM_1DV
:
10083 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10085 case OPCODE_UNIFORM_2DV
:
10086 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10088 case OPCODE_UNIFORM_3DV
:
10089 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10091 case OPCODE_UNIFORM_4DV
:
10092 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10094 case OPCODE_UNIFORM_1I
:
10095 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10097 case OPCODE_UNIFORM_2I
:
10098 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10100 case OPCODE_UNIFORM_3I
:
10101 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10103 case OPCODE_UNIFORM_4I
:
10104 CALL_Uniform4i(ctx
->Exec
,
10105 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10107 case OPCODE_UNIFORM_1IV
:
10108 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10110 case OPCODE_UNIFORM_2IV
:
10111 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10113 case OPCODE_UNIFORM_3IV
:
10114 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10116 case OPCODE_UNIFORM_4IV
:
10117 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10119 case OPCODE_UNIFORM_1UI
:
10120 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10122 case OPCODE_UNIFORM_2UI
:
10123 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10125 case OPCODE_UNIFORM_3UI
:
10126 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10128 case OPCODE_UNIFORM_4UI
:
10129 CALL_Uniform4ui(ctx
->Exec
,
10130 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10132 case OPCODE_UNIFORM_1UIV
:
10133 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10135 case OPCODE_UNIFORM_2UIV
:
10136 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10138 case OPCODE_UNIFORM_3UIV
:
10139 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10141 case OPCODE_UNIFORM_4UIV
:
10142 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10144 case OPCODE_UNIFORM_MATRIX22
:
10145 CALL_UniformMatrix2fv(ctx
->Exec
,
10146 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10148 case OPCODE_UNIFORM_MATRIX33
:
10149 CALL_UniformMatrix3fv(ctx
->Exec
,
10150 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10152 case OPCODE_UNIFORM_MATRIX44
:
10153 CALL_UniformMatrix4fv(ctx
->Exec
,
10154 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10156 case OPCODE_UNIFORM_MATRIX23
:
10157 CALL_UniformMatrix2x3fv(ctx
->Exec
,
10158 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10160 case OPCODE_UNIFORM_MATRIX32
:
10161 CALL_UniformMatrix3x2fv(ctx
->Exec
,
10162 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10164 case OPCODE_UNIFORM_MATRIX24
:
10165 CALL_UniformMatrix2x4fv(ctx
->Exec
,
10166 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10168 case OPCODE_UNIFORM_MATRIX42
:
10169 CALL_UniformMatrix4x2fv(ctx
->Exec
,
10170 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10172 case OPCODE_UNIFORM_MATRIX34
:
10173 CALL_UniformMatrix3x4fv(ctx
->Exec
,
10174 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10176 case OPCODE_UNIFORM_MATRIX43
:
10177 CALL_UniformMatrix4x3fv(ctx
->Exec
,
10178 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10180 case OPCODE_UNIFORM_MATRIX22D
:
10181 CALL_UniformMatrix2dv(ctx
->Exec
,
10182 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10184 case OPCODE_UNIFORM_MATRIX33D
:
10185 CALL_UniformMatrix3dv(ctx
->Exec
,
10186 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10188 case OPCODE_UNIFORM_MATRIX44D
:
10189 CALL_UniformMatrix4dv(ctx
->Exec
,
10190 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10192 case OPCODE_UNIFORM_MATRIX23D
:
10193 CALL_UniformMatrix2x3dv(ctx
->Exec
,
10194 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10196 case OPCODE_UNIFORM_MATRIX32D
:
10197 CALL_UniformMatrix3x2dv(ctx
->Exec
,
10198 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10200 case OPCODE_UNIFORM_MATRIX24D
:
10201 CALL_UniformMatrix2x4dv(ctx
->Exec
,
10202 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10204 case OPCODE_UNIFORM_MATRIX42D
:
10205 CALL_UniformMatrix4x2dv(ctx
->Exec
,
10206 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10208 case OPCODE_UNIFORM_MATRIX34D
:
10209 CALL_UniformMatrix3x4dv(ctx
->Exec
,
10210 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10212 case OPCODE_UNIFORM_MATRIX43D
:
10213 CALL_UniformMatrix4x3dv(ctx
->Exec
,
10214 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10217 case OPCODE_USE_PROGRAM_STAGES
:
10218 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10220 case OPCODE_PROGRAM_UNIFORM_1F
:
10221 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
10223 case OPCODE_PROGRAM_UNIFORM_2F
:
10224 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
10226 case OPCODE_PROGRAM_UNIFORM_3F
:
10227 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10228 n
[3].f
, n
[4].f
, n
[5].f
));
10230 case OPCODE_PROGRAM_UNIFORM_4F
:
10231 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10232 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10234 case OPCODE_PROGRAM_UNIFORM_1FV
:
10235 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10236 get_pointer(&n
[4])));
10238 case OPCODE_PROGRAM_UNIFORM_2FV
:
10239 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10240 get_pointer(&n
[4])));
10242 case OPCODE_PROGRAM_UNIFORM_3FV
:
10243 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10244 get_pointer(&n
[4])));
10246 case OPCODE_PROGRAM_UNIFORM_4FV
:
10247 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10248 get_pointer(&n
[4])));
10250 case OPCODE_PROGRAM_UNIFORM_1D
: {
10251 union float64_pair x
;
10253 x
.uint32
[0] = n
[3].ui
;
10254 x
.uint32
[1] = n
[4].ui
;
10256 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
10259 case OPCODE_PROGRAM_UNIFORM_2D
: {
10260 union float64_pair x
;
10261 union float64_pair y
;
10263 x
.uint32
[0] = n
[3].ui
;
10264 x
.uint32
[1] = n
[4].ui
;
10265 y
.uint32
[0] = n
[5].ui
;
10266 y
.uint32
[1] = n
[6].ui
;
10268 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
10271 case OPCODE_PROGRAM_UNIFORM_3D
: {
10272 union float64_pair x
;
10273 union float64_pair y
;
10274 union float64_pair z
;
10276 x
.uint32
[0] = n
[3].ui
;
10277 x
.uint32
[1] = n
[4].ui
;
10278 y
.uint32
[0] = n
[5].ui
;
10279 y
.uint32
[1] = n
[6].ui
;
10280 z
.uint32
[0] = n
[7].ui
;
10281 z
.uint32
[1] = n
[8].ui
;
10283 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10287 case OPCODE_PROGRAM_UNIFORM_4D
: {
10288 union float64_pair x
;
10289 union float64_pair y
;
10290 union float64_pair z
;
10291 union float64_pair w
;
10293 x
.uint32
[0] = n
[3].ui
;
10294 x
.uint32
[1] = n
[4].ui
;
10295 y
.uint32
[0] = n
[5].ui
;
10296 y
.uint32
[1] = n
[6].ui
;
10297 z
.uint32
[0] = n
[7].ui
;
10298 z
.uint32
[1] = n
[8].ui
;
10299 w
.uint32
[0] = n
[9].ui
;
10300 w
.uint32
[1] = n
[10].ui
;
10302 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10303 x
.d
, y
.d
, z
.d
, w
.d
));
10306 case OPCODE_PROGRAM_UNIFORM_1DV
:
10307 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10308 get_pointer(&n
[4])));
10310 case OPCODE_PROGRAM_UNIFORM_2DV
:
10311 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10312 get_pointer(&n
[4])));
10314 case OPCODE_PROGRAM_UNIFORM_3DV
:
10315 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10316 get_pointer(&n
[4])));
10318 case OPCODE_PROGRAM_UNIFORM_4DV
:
10319 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10320 get_pointer(&n
[4])));
10322 case OPCODE_PROGRAM_UNIFORM_1I
:
10323 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
10325 case OPCODE_PROGRAM_UNIFORM_2I
:
10326 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
10328 case OPCODE_PROGRAM_UNIFORM_3I
:
10329 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10330 n
[3].i
, n
[4].i
, n
[5].i
));
10332 case OPCODE_PROGRAM_UNIFORM_4I
:
10333 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10334 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
10336 case OPCODE_PROGRAM_UNIFORM_1IV
:
10337 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10338 get_pointer(&n
[4])));
10340 case OPCODE_PROGRAM_UNIFORM_2IV
:
10341 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10342 get_pointer(&n
[4])));
10344 case OPCODE_PROGRAM_UNIFORM_3IV
:
10345 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10346 get_pointer(&n
[4])));
10348 case OPCODE_PROGRAM_UNIFORM_4IV
:
10349 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10350 get_pointer(&n
[4])));
10352 case OPCODE_PROGRAM_UNIFORM_1UI
:
10353 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
10355 case OPCODE_PROGRAM_UNIFORM_2UI
:
10356 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10357 n
[3].ui
, n
[4].ui
));
10359 case OPCODE_PROGRAM_UNIFORM_3UI
:
10360 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10361 n
[3].ui
, n
[4].ui
, n
[5].ui
));
10363 case OPCODE_PROGRAM_UNIFORM_4UI
:
10364 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10366 n
[4].ui
, n
[5].ui
, n
[6].ui
));
10368 case OPCODE_PROGRAM_UNIFORM_1UIV
:
10369 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10370 get_pointer(&n
[4])));
10372 case OPCODE_PROGRAM_UNIFORM_2UIV
:
10373 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10374 get_pointer(&n
[4])));
10376 case OPCODE_PROGRAM_UNIFORM_3UIV
:
10377 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10378 get_pointer(&n
[4])));
10380 case OPCODE_PROGRAM_UNIFORM_4UIV
:
10381 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10382 get_pointer(&n
[4])));
10384 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
10385 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
10386 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10387 get_pointer(&n
[5])));
10389 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
10390 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
10391 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10392 get_pointer(&n
[5])));
10394 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
10395 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
10396 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10397 get_pointer(&n
[5])));
10399 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
10400 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
10401 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10402 get_pointer(&n
[5])));
10404 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
10405 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
10406 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10407 get_pointer(&n
[5])));
10409 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
10410 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
10411 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10412 get_pointer(&n
[5])));
10414 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
10415 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
10416 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10417 get_pointer(&n
[5])));
10419 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
10420 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
10421 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10422 get_pointer(&n
[5])));
10424 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
10425 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
10426 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10427 get_pointer(&n
[5])));
10429 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
10430 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
10431 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10432 get_pointer(&n
[5])));
10434 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
10435 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
10436 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10437 get_pointer(&n
[5])));
10439 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
10440 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
10441 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10442 get_pointer(&n
[5])));
10444 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
10445 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
10446 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10447 get_pointer(&n
[5])));
10449 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
10450 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
10451 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10452 get_pointer(&n
[5])));
10454 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
10455 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
10456 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10457 get_pointer(&n
[5])));
10459 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
10460 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
10461 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10462 get_pointer(&n
[5])));
10464 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
10465 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
10466 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10467 get_pointer(&n
[5])));
10469 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
10470 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
10471 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10472 get_pointer(&n
[5])));
10475 case OPCODE_CLIP_CONTROL
:
10476 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10479 case OPCODE_CLAMP_COLOR
:
10480 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10483 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
10484 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
10486 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
10487 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
10489 case OPCODE_ATTR_1F_NV
:
10490 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10492 case OPCODE_ATTR_2F_NV
:
10493 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10495 case OPCODE_ATTR_3F_NV
:
10496 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10498 case OPCODE_ATTR_4F_NV
:
10499 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10501 case OPCODE_ATTR_1F_ARB
:
10502 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10504 case OPCODE_ATTR_2F_ARB
:
10505 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10507 case OPCODE_ATTR_3F_ARB
:
10508 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10510 case OPCODE_ATTR_4F_ARB
:
10511 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10513 case OPCODE_ATTR_1D
: {
10514 GLdouble
*d
= (GLdouble
*) &n
[2];
10515 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
10518 case OPCODE_ATTR_2D
: {
10519 GLdouble
*d
= (GLdouble
*) &n
[2];
10520 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
10523 case OPCODE_ATTR_3D
: {
10524 GLdouble
*d
= (GLdouble
*) &n
[2];
10525 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
10528 case OPCODE_ATTR_4D
: {
10529 GLdouble
*d
= (GLdouble
*) &n
[2];
10530 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
10533 case OPCODE_MATERIAL
:
10534 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
10537 CALL_Begin(ctx
->Exec
, (n
[1].e
));
10540 CALL_End(ctx
->Exec
, ());
10543 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10545 case OPCODE_EVAL_C1
:
10546 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
10548 case OPCODE_EVAL_C2
:
10549 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10551 case OPCODE_EVAL_P1
:
10552 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
10554 case OPCODE_EVAL_P2
:
10555 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10558 /* GL_EXT_texture_integer */
10559 case OPCODE_CLEARCOLOR_I
:
10560 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10562 case OPCODE_CLEARCOLOR_UI
:
10563 CALL_ClearColorIuiEXT(ctx
->Exec
,
10564 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
10566 case OPCODE_TEXPARAMETER_I
:
10569 params
[0] = n
[3].i
;
10570 params
[1] = n
[4].i
;
10571 params
[2] = n
[5].i
;
10572 params
[3] = n
[6].i
;
10573 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10576 case OPCODE_TEXPARAMETER_UI
:
10579 params
[0] = n
[3].ui
;
10580 params
[1] = n
[4].ui
;
10581 params
[2] = n
[5].ui
;
10582 params
[3] = n
[6].ui
;
10583 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10587 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
10588 /* GL_ARB_instanced_arrays */
10589 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10592 case OPCODE_TEXTURE_BARRIER_NV
:
10593 CALL_TextureBarrierNV(ctx
->Exec
, ());
10596 /* GL_EXT/ARB_transform_feedback */
10597 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
10598 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
10600 case OPCODE_END_TRANSFORM_FEEDBACK
:
10601 CALL_EndTransformFeedback(ctx
->Exec
, ());
10603 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
10604 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10606 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
10607 CALL_PauseTransformFeedback(ctx
->Exec
, ());
10609 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
10610 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
10612 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
10613 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10615 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
10616 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
10617 (n
[1].e
, n
[2].ui
, n
[3].ui
));
10619 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
10620 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
10621 (n
[1].e
, n
[2].ui
, n
[3].si
));
10623 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
10624 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
10625 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
10629 case OPCODE_BIND_SAMPLER
:
10630 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10632 case OPCODE_SAMPLER_PARAMETERIV
:
10635 params
[0] = n
[3].i
;
10636 params
[1] = n
[4].i
;
10637 params
[2] = n
[5].i
;
10638 params
[3] = n
[6].i
;
10639 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10642 case OPCODE_SAMPLER_PARAMETERFV
:
10645 params
[0] = n
[3].f
;
10646 params
[1] = n
[4].f
;
10647 params
[2] = n
[5].f
;
10648 params
[3] = n
[6].f
;
10649 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10652 case OPCODE_SAMPLER_PARAMETERIIV
:
10655 params
[0] = n
[3].i
;
10656 params
[1] = n
[4].i
;
10657 params
[2] = n
[5].i
;
10658 params
[3] = n
[6].i
;
10659 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10662 case OPCODE_SAMPLER_PARAMETERUIV
:
10665 params
[0] = n
[3].ui
;
10666 params
[1] = n
[4].ui
;
10667 params
[2] = n
[5].ui
;
10668 params
[3] = n
[6].ui
;
10669 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10673 /* ARB_compute_shader */
10674 case OPCODE_DISPATCH_COMPUTE
:
10675 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10679 case OPCODE_WAIT_SYNC
:
10681 union uint64_pair p
;
10682 p
.uint32
[0] = n
[2].ui
;
10683 p
.uint32
[1] = n
[3].ui
;
10684 CALL_WaitSync(ctx
->Exec
,
10685 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
10689 /* GL_NV_conditional_render */
10690 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
10691 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
10693 case OPCODE_END_CONDITIONAL_RENDER
:
10694 CALL_EndConditionalRender(ctx
->Exec
, ());
10697 case OPCODE_UNIFORM_BLOCK_BINDING
:
10698 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10701 case OPCODE_UNIFORM_SUBROUTINES
:
10702 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
10703 get_pointer(&n
[3])));
10706 /* GL_EXT_window_rectangles */
10707 case OPCODE_WINDOW_RECTANGLES
:
10708 CALL_WindowRectanglesEXT(
10709 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
10712 /* GL_NV_conservative_raster */
10713 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
10714 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10717 /* GL_NV_conservative_raster_dilate */
10718 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
10719 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10722 /* GL_NV_conservative_raster_pre_snap_triangles */
10723 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
10724 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10727 case OPCODE_CONTINUE
:
10728 n
= (Node
*) get_pointer(&n
[1]);
10733 case OPCODE_END_OF_LIST
:
10739 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
10741 _mesa_problem(ctx
, "%s", msg
);
10746 /* increment n to point to next compiled command */
10747 if (opcode
!= OPCODE_CONTINUE
) {
10748 assert(InstSize
[opcode
] > 0);
10749 n
+= InstSize
[opcode
];
10754 vbo_save_EndCallList(ctx
);
10756 ctx
->ListState
.CallDepth
--;
10761 /**********************************************************************/
10763 /**********************************************************************/
10766 * Test if a display list number is valid.
10768 GLboolean GLAPIENTRY
10769 _mesa_IsList(GLuint list
)
10771 GET_CURRENT_CONTEXT(ctx
);
10772 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10773 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
10774 return islist(ctx
, list
);
10779 * Delete a sequence of consecutive display lists.
10782 _mesa_DeleteLists(GLuint list
, GLsizei range
)
10784 GET_CURRENT_CONTEXT(ctx
);
10786 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10787 ASSERT_OUTSIDE_BEGIN_END(ctx
);
10790 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
10795 /* We may be deleting a set of bitmap lists. See if there's a
10796 * bitmap atlas to free.
10798 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
10800 _mesa_delete_bitmap_atlas(ctx
, atlas
);
10801 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
10805 for (i
= list
; i
< list
+ range
; i
++) {
10806 destroy_list(ctx
, i
);
10812 * Return a display list number, n, such that lists n through n+range-1
10816 _mesa_GenLists(GLsizei range
)
10818 GET_CURRENT_CONTEXT(ctx
);
10820 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10821 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
10824 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
10832 * Make this an atomic operation
10834 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
10836 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
10838 /* reserve the list IDs by with empty/dummy lists */
10840 for (i
= 0; i
< range
; i
++) {
10841 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
10842 make_list(base
+ i
, 1));
10846 if (USE_BITMAP_ATLAS
&&
10848 ctx
->Driver
.DrawAtlasBitmaps
) {
10849 /* "range > 16" is a rough heuristic to guess when glGenLists might be
10850 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
10851 * Create the empty atlas now.
10853 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
10855 atlas
= alloc_bitmap_atlas(ctx
, base
);
10858 /* Atlas _should_ be new/empty now, but clobbering is OK */
10859 assert(atlas
->numBitmaps
== 0);
10860 atlas
->numBitmaps
= range
;
10864 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
10871 * Begin a new display list.
10874 _mesa_NewList(GLuint name
, GLenum mode
)
10876 GET_CURRENT_CONTEXT(ctx
);
10878 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
10879 ASSERT_OUTSIDE_BEGIN_END(ctx
);
10881 if (MESA_VERBOSE
& VERBOSE_API
)
10882 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
10883 _mesa_enum_to_string(mode
));
10886 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
10890 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
10891 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
10895 if (ctx
->ListState
.CurrentList
) {
10896 /* already compiling a display list */
10897 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
10901 ctx
->CompileFlag
= GL_TRUE
;
10902 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
10904 /* Reset accumulated list state */
10905 invalidate_saved_current_state( ctx
);
10907 /* Allocate new display list */
10908 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
10909 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
10910 ctx
->ListState
.CurrentPos
= 0;
10912 vbo_save_NewList(ctx
, name
, mode
);
10914 ctx
->CurrentServerDispatch
= ctx
->Save
;
10915 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
10916 if (ctx
->MarshalExec
== NULL
) {
10917 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
10923 * End definition of current display list.
10926 _mesa_EndList(void)
10928 GET_CURRENT_CONTEXT(ctx
);
10929 SAVE_FLUSH_VERTICES(ctx
);
10930 FLUSH_VERTICES(ctx
, 0);
10932 if (MESA_VERBOSE
& VERBOSE_API
)
10933 _mesa_debug(ctx
, "glEndList\n");
10935 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
10936 _mesa_error(ctx
, GL_INVALID_OPERATION
,
10937 "glEndList() called inside glBegin/End");
10940 /* Check that a list is under construction */
10941 if (!ctx
->ListState
.CurrentList
) {
10942 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
10946 /* Call before emitting END_OF_LIST, in case the driver wants to
10947 * emit opcodes itself.
10949 vbo_save_EndList(ctx
);
10951 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
10955 /* Destroy old list, if any */
10956 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
10958 /* Install the new list */
10959 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
10960 ctx
->ListState
.CurrentList
->Name
,
10961 ctx
->ListState
.CurrentList
);
10964 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
10965 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
10967 ctx
->ListState
.CurrentList
= NULL
;
10968 ctx
->ListState
.CurrentBlock
= NULL
;
10969 ctx
->ListState
.CurrentPos
= 0;
10970 ctx
->ExecuteFlag
= GL_TRUE
;
10971 ctx
->CompileFlag
= GL_FALSE
;
10973 ctx
->CurrentServerDispatch
= ctx
->Exec
;
10974 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
10975 if (ctx
->MarshalExec
== NULL
) {
10976 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
10982 _mesa_CallList(GLuint list
)
10984 GLboolean save_compile_flag
;
10985 GET_CURRENT_CONTEXT(ctx
);
10986 FLUSH_CURRENT(ctx
, 0);
10988 if (MESA_VERBOSE
& VERBOSE_API
)
10989 _mesa_debug(ctx
, "glCallList %d\n", list
);
10992 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
10997 mesa_print_display_list( list
);
10999 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
11000 * execute the display list, and restore the CompileFlag.
11002 save_compile_flag
= ctx
->CompileFlag
;
11003 if (save_compile_flag
) {
11004 ctx
->CompileFlag
= GL_FALSE
;
11007 execute_list(ctx
, list
);
11008 ctx
->CompileFlag
= save_compile_flag
;
11010 /* also restore API function pointers to point to "save" versions */
11011 if (save_compile_flag
) {
11012 ctx
->CurrentServerDispatch
= ctx
->Save
;
11013 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11014 if (ctx
->MarshalExec
== NULL
) {
11015 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11022 * Try to execute a glCallLists() command where the display lists contain
11023 * glBitmap commands with a texture atlas.
11024 * \return true for success, false otherwise
11027 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
11030 struct gl_bitmap_atlas
*atlas
;
11033 if (!USE_BITMAP_ATLAS
||
11034 !ctx
->Current
.RasterPosValid
||
11035 ctx
->List
.ListBase
== 0 ||
11036 type
!= GL_UNSIGNED_BYTE
||
11037 !ctx
->Driver
.DrawAtlasBitmaps
) {
11042 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11045 /* Even if glGenLists wasn't called, we can still try to create
11048 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11051 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
11052 /* Try to build the bitmap atlas now.
11053 * If the atlas was created in glGenLists, we'll have recorded the
11054 * number of lists (bitmaps). Otherwise, take a guess at 256.
11056 if (atlas
->numBitmaps
== 0)
11057 atlas
->numBitmaps
= 256;
11058 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
11061 if (!atlas
|| !atlas
->complete
) {
11065 /* check that all display list IDs are in the atlas */
11066 for (i
= 0; i
< n
; i
++) {
11067 const GLubyte
*ids
= (const GLubyte
*) lists
;
11069 if (ids
[i
] >= atlas
->numBitmaps
) {
11074 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
11081 * Execute glCallLists: call multiple display lists.
11084 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
11086 GET_CURRENT_CONTEXT(ctx
);
11088 GLboolean save_compile_flag
;
11090 if (MESA_VERBOSE
& VERBOSE_API
)
11091 _mesa_debug(ctx
, "glCallLists %d\n", n
);
11095 case GL_UNSIGNED_BYTE
:
11097 case GL_UNSIGNED_SHORT
:
11099 case GL_UNSIGNED_INT
:
11107 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
11112 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
11114 } else if (n
== 0 || lists
== NULL
) {
11115 /* nothing to do */
11119 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
11123 /* Save the CompileFlag status, turn it off, execute display list,
11124 * and restore the CompileFlag.
11126 save_compile_flag
= ctx
->CompileFlag
;
11127 ctx
->CompileFlag
= GL_FALSE
;
11129 for (i
= 0; i
< n
; i
++) {
11130 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
11131 execute_list(ctx
, list
);
11134 ctx
->CompileFlag
= save_compile_flag
;
11136 /* also restore API function pointers to point to "save" versions */
11137 if (save_compile_flag
) {
11138 ctx
->CurrentServerDispatch
= ctx
->Save
;
11139 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11140 if (ctx
->MarshalExec
== NULL
) {
11141 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11148 * Set the offset added to list numbers in glCallLists.
11151 _mesa_ListBase(GLuint base
)
11153 GET_CURRENT_CONTEXT(ctx
);
11154 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11155 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11156 ctx
->List
.ListBase
= base
;
11160 * Setup the given dispatch table to point to Mesa's display list
11161 * building functions.
11163 * This does not include any of the tnl functions - they are
11164 * initialized from _mesa_init_api_defaults and from the active vtxfmt
11168 _mesa_initialize_save_table(const struct gl_context
*ctx
)
11170 struct _glapi_table
*table
= ctx
->Save
;
11171 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
11173 /* Initially populate the dispatch table with the contents of the
11174 * normal-execution dispatch table. This lets us skip populating functions
11175 * that should be called directly instead of compiled into display lists.
11177 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
11179 _mesa_loopback_init_api_table(ctx
, table
);
11181 /* VBO functions */
11182 vbo_initialize_save_dispatch(ctx
, table
);
11185 SET_Accum(table
, save_Accum
);
11186 SET_AlphaFunc(table
, save_AlphaFunc
);
11187 SET_Bitmap(table
, save_Bitmap
);
11188 SET_BlendFunc(table
, save_BlendFunc
);
11189 SET_CallList(table
, save_CallList
);
11190 SET_CallLists(table
, save_CallLists
);
11191 SET_Clear(table
, save_Clear
);
11192 SET_ClearAccum(table
, save_ClearAccum
);
11193 SET_ClearColor(table
, save_ClearColor
);
11194 SET_ClearDepth(table
, save_ClearDepth
);
11195 SET_ClearIndex(table
, save_ClearIndex
);
11196 SET_ClearStencil(table
, save_ClearStencil
);
11197 SET_ClipPlane(table
, save_ClipPlane
);
11198 SET_ColorMask(table
, save_ColorMask
);
11199 SET_ColorMaski(table
, save_ColorMaskIndexed
);
11200 SET_ColorMaterial(table
, save_ColorMaterial
);
11201 SET_CopyPixels(table
, save_CopyPixels
);
11202 SET_CullFace(table
, save_CullFace
);
11203 SET_DepthFunc(table
, save_DepthFunc
);
11204 SET_DepthMask(table
, save_DepthMask
);
11205 SET_DepthRange(table
, save_DepthRange
);
11206 SET_Disable(table
, save_Disable
);
11207 SET_Disablei(table
, save_DisableIndexed
);
11208 SET_DrawBuffer(table
, save_DrawBuffer
);
11209 SET_DrawPixels(table
, save_DrawPixels
);
11210 SET_Enable(table
, save_Enable
);
11211 SET_Enablei(table
, save_EnableIndexed
);
11212 SET_EvalMesh1(table
, save_EvalMesh1
);
11213 SET_EvalMesh2(table
, save_EvalMesh2
);
11214 SET_Fogf(table
, save_Fogf
);
11215 SET_Fogfv(table
, save_Fogfv
);
11216 SET_Fogi(table
, save_Fogi
);
11217 SET_Fogiv(table
, save_Fogiv
);
11218 SET_FrontFace(table
, save_FrontFace
);
11219 SET_Frustum(table
, save_Frustum
);
11220 SET_Hint(table
, save_Hint
);
11221 SET_IndexMask(table
, save_IndexMask
);
11222 SET_InitNames(table
, save_InitNames
);
11223 SET_LightModelf(table
, save_LightModelf
);
11224 SET_LightModelfv(table
, save_LightModelfv
);
11225 SET_LightModeli(table
, save_LightModeli
);
11226 SET_LightModeliv(table
, save_LightModeliv
);
11227 SET_Lightf(table
, save_Lightf
);
11228 SET_Lightfv(table
, save_Lightfv
);
11229 SET_Lighti(table
, save_Lighti
);
11230 SET_Lightiv(table
, save_Lightiv
);
11231 SET_LineStipple(table
, save_LineStipple
);
11232 SET_LineWidth(table
, save_LineWidth
);
11233 SET_ListBase(table
, save_ListBase
);
11234 SET_LoadIdentity(table
, save_LoadIdentity
);
11235 SET_LoadMatrixd(table
, save_LoadMatrixd
);
11236 SET_LoadMatrixf(table
, save_LoadMatrixf
);
11237 SET_LoadName(table
, save_LoadName
);
11238 SET_LogicOp(table
, save_LogicOp
);
11239 SET_Map1d(table
, save_Map1d
);
11240 SET_Map1f(table
, save_Map1f
);
11241 SET_Map2d(table
, save_Map2d
);
11242 SET_Map2f(table
, save_Map2f
);
11243 SET_MapGrid1d(table
, save_MapGrid1d
);
11244 SET_MapGrid1f(table
, save_MapGrid1f
);
11245 SET_MapGrid2d(table
, save_MapGrid2d
);
11246 SET_MapGrid2f(table
, save_MapGrid2f
);
11247 SET_MatrixMode(table
, save_MatrixMode
);
11248 SET_MultMatrixd(table
, save_MultMatrixd
);
11249 SET_MultMatrixf(table
, save_MultMatrixf
);
11250 SET_NewList(table
, save_NewList
);
11251 SET_Ortho(table
, save_Ortho
);
11252 SET_PassThrough(table
, save_PassThrough
);
11253 SET_PixelMapfv(table
, save_PixelMapfv
);
11254 SET_PixelMapuiv(table
, save_PixelMapuiv
);
11255 SET_PixelMapusv(table
, save_PixelMapusv
);
11256 SET_PixelTransferf(table
, save_PixelTransferf
);
11257 SET_PixelTransferi(table
, save_PixelTransferi
);
11258 SET_PixelZoom(table
, save_PixelZoom
);
11259 SET_PointSize(table
, save_PointSize
);
11260 SET_PolygonMode(table
, save_PolygonMode
);
11261 SET_PolygonOffset(table
, save_PolygonOffset
);
11262 SET_PolygonStipple(table
, save_PolygonStipple
);
11263 SET_PopAttrib(table
, save_PopAttrib
);
11264 SET_PopMatrix(table
, save_PopMatrix
);
11265 SET_PopName(table
, save_PopName
);
11266 SET_PushAttrib(table
, save_PushAttrib
);
11267 SET_PushMatrix(table
, save_PushMatrix
);
11268 SET_PushName(table
, save_PushName
);
11269 SET_RasterPos2d(table
, save_RasterPos2d
);
11270 SET_RasterPos2dv(table
, save_RasterPos2dv
);
11271 SET_RasterPos2f(table
, save_RasterPos2f
);
11272 SET_RasterPos2fv(table
, save_RasterPos2fv
);
11273 SET_RasterPos2i(table
, save_RasterPos2i
);
11274 SET_RasterPos2iv(table
, save_RasterPos2iv
);
11275 SET_RasterPos2s(table
, save_RasterPos2s
);
11276 SET_RasterPos2sv(table
, save_RasterPos2sv
);
11277 SET_RasterPos3d(table
, save_RasterPos3d
);
11278 SET_RasterPos3dv(table
, save_RasterPos3dv
);
11279 SET_RasterPos3f(table
, save_RasterPos3f
);
11280 SET_RasterPos3fv(table
, save_RasterPos3fv
);
11281 SET_RasterPos3i(table
, save_RasterPos3i
);
11282 SET_RasterPos3iv(table
, save_RasterPos3iv
);
11283 SET_RasterPos3s(table
, save_RasterPos3s
);
11284 SET_RasterPos3sv(table
, save_RasterPos3sv
);
11285 SET_RasterPos4d(table
, save_RasterPos4d
);
11286 SET_RasterPos4dv(table
, save_RasterPos4dv
);
11287 SET_RasterPos4f(table
, save_RasterPos4f
);
11288 SET_RasterPos4fv(table
, save_RasterPos4fv
);
11289 SET_RasterPos4i(table
, save_RasterPos4i
);
11290 SET_RasterPos4iv(table
, save_RasterPos4iv
);
11291 SET_RasterPos4s(table
, save_RasterPos4s
);
11292 SET_RasterPos4sv(table
, save_RasterPos4sv
);
11293 SET_ReadBuffer(table
, save_ReadBuffer
);
11294 SET_Rectf(table
, save_Rectf
);
11295 SET_Rotated(table
, save_Rotated
);
11296 SET_Rotatef(table
, save_Rotatef
);
11297 SET_Scaled(table
, save_Scaled
);
11298 SET_Scalef(table
, save_Scalef
);
11299 SET_Scissor(table
, save_Scissor
);
11300 SET_ShadeModel(table
, save_ShadeModel
);
11301 SET_StencilFunc(table
, save_StencilFunc
);
11302 SET_StencilMask(table
, save_StencilMask
);
11303 SET_StencilOp(table
, save_StencilOp
);
11304 SET_TexEnvf(table
, save_TexEnvf
);
11305 SET_TexEnvfv(table
, save_TexEnvfv
);
11306 SET_TexEnvi(table
, save_TexEnvi
);
11307 SET_TexEnviv(table
, save_TexEnviv
);
11308 SET_TexGend(table
, save_TexGend
);
11309 SET_TexGendv(table
, save_TexGendv
);
11310 SET_TexGenf(table
, save_TexGenf
);
11311 SET_TexGenfv(table
, save_TexGenfv
);
11312 SET_TexGeni(table
, save_TexGeni
);
11313 SET_TexGeniv(table
, save_TexGeniv
);
11314 SET_TexImage1D(table
, save_TexImage1D
);
11315 SET_TexImage2D(table
, save_TexImage2D
);
11316 SET_TexParameterf(table
, save_TexParameterf
);
11317 SET_TexParameterfv(table
, save_TexParameterfv
);
11318 SET_TexParameteri(table
, save_TexParameteri
);
11319 SET_TexParameteriv(table
, save_TexParameteriv
);
11320 SET_Translated(table
, save_Translated
);
11321 SET_Translatef(table
, save_Translatef
);
11322 SET_Viewport(table
, save_Viewport
);
11325 SET_BindTexture(table
, save_BindTexture
);
11326 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
11327 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
11328 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
11329 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
11330 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
11331 SET_TexSubImage1D(table
, save_TexSubImage1D
);
11332 SET_TexSubImage2D(table
, save_TexSubImage2D
);
11335 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
11336 SET_TexImage3D(table
, save_TexImage3D
);
11337 SET_TexSubImage3D(table
, save_TexSubImage3D
);
11340 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
11341 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
11342 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
11344 /* ATI_separate_stencil */
11345 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
11347 /* GL_ARB_imaging */
11348 /* Not all are supported */
11349 SET_BlendColor(table
, save_BlendColor
);
11350 SET_BlendEquation(table
, save_BlendEquation
);
11352 /* 2. GL_EXT_blend_color */
11354 SET_BlendColorEXT(table
, save_BlendColorEXT
);
11357 /* 6. GL_EXT_texture3d */
11359 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
11360 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
11361 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
11364 /* 37. GL_EXT_blend_minmax */
11366 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
11369 /* 54. GL_EXT_point_parameters */
11370 SET_PointParameterf(table
, save_PointParameterfEXT
);
11371 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
11373 /* 91. GL_ARB_tessellation_shader */
11374 SET_PatchParameteri(table
, save_PatchParameteri
);
11375 SET_PatchParameterfv(table
, save_PatchParameterfv
);
11377 /* 100. ARB_viewport_array */
11378 SET_ViewportArrayv(table
, save_ViewportArrayv
);
11379 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
11380 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
11381 SET_ScissorArrayv(table
, save_ScissorArrayv
);
11382 SET_ScissorIndexed(table
, save_ScissorIndexed
);
11383 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
11384 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
11385 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
11387 /* 122. ARB_compute_shader */
11388 SET_DispatchCompute(table
, save_DispatchCompute
);
11389 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
11391 /* 173. GL_EXT_blend_func_separate */
11392 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
11394 /* 197. GL_MESA_window_pos */
11395 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
11396 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
11397 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
11398 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
11399 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
11400 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
11401 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
11402 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
11403 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
11404 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
11405 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
11406 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
11407 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
11408 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
11409 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
11410 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
11411 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
11412 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
11413 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
11414 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
11415 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
11416 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
11417 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
11418 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
11420 /* 245. GL_ATI_fragment_shader */
11421 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
11422 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
11424 /* 262. GL_NV_point_sprite */
11425 SET_PointParameteri(table
, save_PointParameteriNV
);
11426 SET_PointParameteriv(table
, save_PointParameterivNV
);
11428 /* 268. GL_EXT_stencil_two_side */
11429 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
11431 /* ???. GL_EXT_depth_bounds_test */
11432 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
11434 /* ARB 1. GL_ARB_multitexture */
11435 SET_ActiveTexture(table
, save_ActiveTextureARB
);
11437 /* ARB 3. GL_ARB_transpose_matrix */
11438 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
11439 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
11440 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
11441 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
11443 /* ARB 5. GL_ARB_multisample */
11444 SET_SampleCoverage(table
, save_SampleCoverageARB
);
11446 /* ARB 12. GL_ARB_texture_compression */
11447 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
11448 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
11449 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
11450 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
11451 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
11452 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
11454 /* ARB 14. GL_ARB_point_parameters */
11455 /* aliased with EXT_point_parameters functions */
11457 /* ARB 25. GL_ARB_window_pos */
11458 /* aliased with MESA_window_pos functions */
11460 /* ARB 26. GL_ARB_vertex_program */
11461 /* ARB 27. GL_ARB_fragment_program */
11462 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
11463 SET_ProgramStringARB(table
, save_ProgramStringARB
);
11464 SET_BindProgramARB(table
, save_BindProgramARB
);
11465 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
11466 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
11467 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
11468 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
11469 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
11470 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
11471 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
11472 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
11474 SET_BeginQuery(table
, save_BeginQueryARB
);
11475 SET_EndQuery(table
, save_EndQueryARB
);
11476 SET_QueryCounter(table
, save_QueryCounter
);
11478 SET_DrawBuffers(table
, save_DrawBuffersARB
);
11480 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
11482 SET_UseProgram(table
, save_UseProgram
);
11483 SET_Uniform1f(table
, save_Uniform1fARB
);
11484 SET_Uniform2f(table
, save_Uniform2fARB
);
11485 SET_Uniform3f(table
, save_Uniform3fARB
);
11486 SET_Uniform4f(table
, save_Uniform4fARB
);
11487 SET_Uniform1fv(table
, save_Uniform1fvARB
);
11488 SET_Uniform2fv(table
, save_Uniform2fvARB
);
11489 SET_Uniform3fv(table
, save_Uniform3fvARB
);
11490 SET_Uniform4fv(table
, save_Uniform4fvARB
);
11491 SET_Uniform1i(table
, save_Uniform1iARB
);
11492 SET_Uniform2i(table
, save_Uniform2iARB
);
11493 SET_Uniform3i(table
, save_Uniform3iARB
);
11494 SET_Uniform4i(table
, save_Uniform4iARB
);
11495 SET_Uniform1iv(table
, save_Uniform1ivARB
);
11496 SET_Uniform2iv(table
, save_Uniform2ivARB
);
11497 SET_Uniform3iv(table
, save_Uniform3ivARB
);
11498 SET_Uniform4iv(table
, save_Uniform4ivARB
);
11499 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
11500 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
11501 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
11502 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
11503 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
11504 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
11505 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
11506 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
11507 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
11509 /* 299. GL_EXT_blend_equation_separate */
11510 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
11512 /* GL_EXT_gpu_program_parameters */
11513 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
11514 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
11516 /* 364. GL_EXT_provoking_vertex */
11517 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
11519 /* GL_EXT_texture_integer */
11520 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
11521 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
11522 SET_TexParameterIiv(table
, save_TexParameterIiv
);
11523 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
11525 /* GL_ARB_clip_control */
11526 SET_ClipControl(table
, save_ClipControl
);
11528 /* GL_ARB_color_buffer_float */
11529 SET_ClampColor(table
, save_ClampColorARB
);
11532 SET_ClearBufferiv(table
, save_ClearBufferiv
);
11533 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
11534 SET_ClearBufferfv(table
, save_ClearBufferfv
);
11535 SET_ClearBufferfi(table
, save_ClearBufferfi
);
11536 SET_Uniform1ui(table
, save_Uniform1ui
);
11537 SET_Uniform2ui(table
, save_Uniform2ui
);
11538 SET_Uniform3ui(table
, save_Uniform3ui
);
11539 SET_Uniform4ui(table
, save_Uniform4ui
);
11540 SET_Uniform1uiv(table
, save_Uniform1uiv
);
11541 SET_Uniform2uiv(table
, save_Uniform2uiv
);
11542 SET_Uniform3uiv(table
, save_Uniform3uiv
);
11543 SET_Uniform4uiv(table
, save_Uniform4uiv
);
11545 /* GL_ARB_gpu_shader_fp64 */
11546 SET_Uniform1d(table
, save_Uniform1d
);
11547 SET_Uniform2d(table
, save_Uniform2d
);
11548 SET_Uniform3d(table
, save_Uniform3d
);
11549 SET_Uniform4d(table
, save_Uniform4d
);
11550 SET_Uniform1dv(table
, save_Uniform1dv
);
11551 SET_Uniform2dv(table
, save_Uniform2dv
);
11552 SET_Uniform3dv(table
, save_Uniform3dv
);
11553 SET_Uniform4dv(table
, save_Uniform4dv
);
11554 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
11555 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
11556 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
11557 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
11558 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
11559 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
11560 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
11561 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
11562 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
11565 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
11566 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
11567 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
11568 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
11569 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
11570 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
11571 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
11572 SET_DrawTransformFeedbackInstanced(table
,
11573 save_DrawTransformFeedbackInstanced
);
11574 SET_DrawTransformFeedbackStreamInstanced(table
,
11575 save_DrawTransformFeedbackStreamInstanced
);
11576 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
11577 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
11579 /* GL_ARB_instanced_arrays */
11580 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
11582 /* GL_NV_texture_barrier */
11583 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
11585 SET_BindSampler(table
, save_BindSampler
);
11586 SET_SamplerParameteri(table
, save_SamplerParameteri
);
11587 SET_SamplerParameterf(table
, save_SamplerParameterf
);
11588 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
11589 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
11590 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
11591 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
11593 /* GL_ARB_draw_buffer_blend */
11594 SET_BlendFunciARB(table
, save_BlendFunci
);
11595 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
11596 SET_BlendEquationiARB(table
, save_BlendEquationi
);
11597 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
11599 /* GL_NV_conditional_render */
11600 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
11601 SET_EndConditionalRender(table
, save_EndConditionalRender
);
11604 SET_WaitSync(table
, save_WaitSync
);
11606 /* GL_ARB_uniform_buffer_object */
11607 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
11609 /* GL_ARB_shader_subroutines */
11610 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
11612 /* GL_ARB_draw_instanced */
11613 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
11614 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
11616 /* GL_ARB_draw_elements_base_vertex */
11617 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
11619 /* GL_ARB_base_instance */
11620 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
11621 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
11622 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
11624 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
11625 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
11626 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
11627 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
11628 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
11630 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
11631 SET_UseProgramStages(table
, save_UseProgramStages
);
11632 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
11633 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
11634 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
11635 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
11636 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
11637 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
11638 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
11639 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
11640 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
11641 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
11642 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
11643 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
11644 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
11645 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
11646 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
11647 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
11648 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
11649 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
11650 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
11651 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
11652 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
11653 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
11654 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
11655 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
11656 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
11657 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
11658 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
11659 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
11660 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
11661 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
11662 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
11663 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
11664 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
11665 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
11666 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
11667 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
11668 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
11669 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
11670 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
11671 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
11672 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
11673 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
11674 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
11675 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
11676 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
11677 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
11678 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
11679 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
11680 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
11681 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
11683 /* GL_{ARB,EXT}_polygon_offset_clamp */
11684 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
11686 /* GL_EXT_window_rectangles */
11687 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
11689 /* GL_NV_conservative_raster */
11690 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
11692 /* GL_NV_conservative_raster_dilate */
11693 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
11695 /* GL_NV_conservative_raster_pre_snap_triangles */
11696 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
11701 static const char *
11702 enum_string(GLenum k
)
11704 return _mesa_enum_to_string(k
);
11709 * Print the commands in a display list. For debugging only.
11710 * TODO: many commands aren't handled yet.
11711 * \param fname filename to write display list to. If null, use stdout.
11713 static void GLAPIENTRY
11714 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
11716 struct gl_display_list
*dlist
;
11722 f
= fopen(fname
, "w");
11727 if (!islist(ctx
, list
)) {
11728 fprintf(f
, "%u is not a display list ID\n", list
);
11732 dlist
= _mesa_lookup_list(ctx
, list
);
11739 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
11741 done
= n
? GL_FALSE
: GL_TRUE
;
11743 const OpCode opcode
= n
[0].opcode
;
11745 if (is_ext_opcode(opcode
)) {
11746 n
+= ext_opcode_print(ctx
, n
, f
);
11751 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
11753 case OPCODE_ACTIVE_TEXTURE
:
11754 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
11756 case OPCODE_BITMAP
:
11757 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
11758 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11759 get_pointer(&n
[7]));
11761 case OPCODE_BLEND_COLOR
:
11762 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
11763 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11765 case OPCODE_BLEND_EQUATION
:
11766 fprintf(f
, "BlendEquation %s\n",
11767 enum_string(n
[1].e
));
11769 case OPCODE_BLEND_EQUATION_SEPARATE
:
11770 fprintf(f
, "BlendEquationSeparate %s, %s\n",
11771 enum_string(n
[1].e
),
11772 enum_string(n
[2].e
));
11774 case OPCODE_BLEND_FUNC_SEPARATE
:
11775 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
11776 enum_string(n
[1].e
),
11777 enum_string(n
[2].e
),
11778 enum_string(n
[3].e
),
11779 enum_string(n
[4].e
));
11781 case OPCODE_BLEND_EQUATION_I
:
11782 fprintf(f
, "BlendEquationi %u, %s\n",
11783 n
[1].ui
, enum_string(n
[2].e
));
11785 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11786 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
11787 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
11789 case OPCODE_BLEND_FUNC_I
:
11790 fprintf(f
, "BlendFunci %u, %s, %s\n",
11791 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
11793 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11794 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
11796 enum_string(n
[2].e
),
11797 enum_string(n
[3].e
),
11798 enum_string(n
[4].e
),
11799 enum_string(n
[5].e
));
11801 case OPCODE_CALL_LIST
:
11802 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
11804 case OPCODE_CALL_LISTS
:
11805 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
11807 case OPCODE_DISABLE
:
11808 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
11810 case OPCODE_ENABLE
:
11811 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
11813 case OPCODE_FRUSTUM
:
11814 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
11815 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11817 case OPCODE_LINE_STIPPLE
:
11818 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
11820 case OPCODE_LINE_WIDTH
:
11821 fprintf(f
, "LineWidth %f\n", n
[1].f
);
11823 case OPCODE_LOAD_IDENTITY
:
11824 fprintf(f
, "LoadIdentity\n");
11826 case OPCODE_LOAD_MATRIX
:
11827 fprintf(f
, "LoadMatrix\n");
11828 fprintf(f
, " %8f %8f %8f %8f\n",
11829 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
11830 fprintf(f
, " %8f %8f %8f %8f\n",
11831 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
11832 fprintf(f
, " %8f %8f %8f %8f\n",
11833 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
11834 fprintf(f
, " %8f %8f %8f %8f\n",
11835 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
11837 case OPCODE_MULT_MATRIX
:
11838 fprintf(f
, "MultMatrix (or Rotate)\n");
11839 fprintf(f
, " %8f %8f %8f %8f\n",
11840 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
11841 fprintf(f
, " %8f %8f %8f %8f\n",
11842 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
11843 fprintf(f
, " %8f %8f %8f %8f\n",
11844 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
11845 fprintf(f
, " %8f %8f %8f %8f\n",
11846 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
11849 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
11850 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11852 case OPCODE_POINT_SIZE
:
11853 fprintf(f
, "PointSize %f\n", n
[1].f
);
11855 case OPCODE_POP_ATTRIB
:
11856 fprintf(f
, "PopAttrib\n");
11858 case OPCODE_POP_MATRIX
:
11859 fprintf(f
, "PopMatrix\n");
11861 case OPCODE_POP_NAME
:
11862 fprintf(f
, "PopName\n");
11864 case OPCODE_PUSH_ATTRIB
:
11865 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
11867 case OPCODE_PUSH_MATRIX
:
11868 fprintf(f
, "PushMatrix\n");
11870 case OPCODE_PUSH_NAME
:
11871 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
11873 case OPCODE_RASTER_POS
:
11874 fprintf(f
, "RasterPos %g %g %g %g\n",
11875 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11877 case OPCODE_ROTATE
:
11878 fprintf(f
, "Rotate %g %g %g %g\n",
11879 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11882 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
11884 case OPCODE_TRANSLATE
:
11885 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
11887 case OPCODE_BIND_TEXTURE
:
11888 fprintf(f
, "BindTexture %s %d\n",
11889 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
11891 case OPCODE_SHADE_MODEL
:
11892 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
11895 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
11896 _mesa_enum_to_string(n
[1].ui
),
11897 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
11900 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
11901 _mesa_enum_to_string(n
[1].ui
),
11902 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
11903 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
11905 case OPCODE_MAPGRID1
:
11906 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
11908 case OPCODE_MAPGRID2
:
11909 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
11910 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
11912 case OPCODE_EVALMESH1
:
11913 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
11915 case OPCODE_EVALMESH2
:
11916 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
11917 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
11920 case OPCODE_ATTR_1F_NV
:
11921 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
11923 case OPCODE_ATTR_2F_NV
:
11924 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
11925 n
[1].i
, n
[2].f
, n
[3].f
);
11927 case OPCODE_ATTR_3F_NV
:
11928 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
11929 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
11931 case OPCODE_ATTR_4F_NV
:
11932 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
11933 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
11935 case OPCODE_ATTR_1F_ARB
:
11936 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
11938 case OPCODE_ATTR_2F_ARB
:
11939 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
11940 n
[1].i
, n
[2].f
, n
[3].f
);
11942 case OPCODE_ATTR_3F_ARB
:
11943 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
11944 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
11946 case OPCODE_ATTR_4F_ARB
:
11947 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
11948 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
11951 case OPCODE_MATERIAL
:
11952 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
11953 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11956 fprintf(f
, "BEGIN %x\n", n
[1].i
);
11959 fprintf(f
, "END\n");
11962 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
11965 case OPCODE_EVAL_C1
:
11966 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
11968 case OPCODE_EVAL_C2
:
11969 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
11971 case OPCODE_EVAL_P1
:
11972 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
11974 case OPCODE_EVAL_P2
:
11975 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
11978 case OPCODE_PROVOKING_VERTEX
:
11979 fprintf(f
, "ProvokingVertex %s\n",
11980 _mesa_enum_to_string(n
[1].ui
));
11984 * meta opcodes/commands
11987 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
11988 (const char *) get_pointer(&n
[2]));
11990 case OPCODE_CONTINUE
:
11991 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
11992 n
= (Node
*) get_pointer(&n
[1]);
11995 fprintf(f
, "NOP\n");
11997 case OPCODE_END_OF_LIST
:
11998 fprintf(f
, "END-LIST %u\n", list
);
12002 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
12004 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
12005 opcode
, (void *) n
);
12009 fprintf(f
, "command %d, %u operands\n", opcode
,
12013 /* increment n to point to next compiled command */
12014 if (opcode
!= OPCODE_CONTINUE
) {
12015 assert(InstSize
[opcode
] > 0);
12016 n
+= InstSize
[opcode
];
12030 * Clients may call this function to help debug display list problems.
12031 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
12032 * changed, or break in the future without notice.
12035 mesa_print_display_list(GLuint list
)
12037 GET_CURRENT_CONTEXT(ctx
);
12038 print_list(ctx
, list
, NULL
);
12042 /**********************************************************************/
12043 /***** Initialization *****/
12044 /**********************************************************************/
12047 save_vtxfmt_init(GLvertexformat
* vfmt
)
12049 vfmt
->ArrayElement
= _ae_ArrayElement
;
12051 vfmt
->Begin
= save_Begin
;
12053 vfmt
->CallList
= save_CallList
;
12054 vfmt
->CallLists
= save_CallLists
;
12056 vfmt
->Color3f
= save_Color3f
;
12057 vfmt
->Color3fv
= save_Color3fv
;
12058 vfmt
->Color4f
= save_Color4f
;
12059 vfmt
->Color4fv
= save_Color4fv
;
12060 vfmt
->EdgeFlag
= save_EdgeFlag
;
12061 vfmt
->End
= save_End
;
12063 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
12064 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
12065 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
12066 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
12067 vfmt
->EvalPoint1
= save_EvalPoint1
;
12068 vfmt
->EvalPoint2
= save_EvalPoint2
;
12070 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
12071 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
12072 vfmt
->Indexf
= save_Indexf
;
12073 vfmt
->Indexfv
= save_Indexfv
;
12074 vfmt
->Materialfv
= save_Materialfv
;
12075 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
12076 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
12077 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
12078 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
12079 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
12080 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
12081 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
12082 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
12083 vfmt
->Normal3f
= save_Normal3f
;
12084 vfmt
->Normal3fv
= save_Normal3fv
;
12085 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
12086 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
12087 vfmt
->TexCoord1f
= save_TexCoord1f
;
12088 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
12089 vfmt
->TexCoord2f
= save_TexCoord2f
;
12090 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
12091 vfmt
->TexCoord3f
= save_TexCoord3f
;
12092 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
12093 vfmt
->TexCoord4f
= save_TexCoord4f
;
12094 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
12095 vfmt
->Vertex2f
= save_Vertex2f
;
12096 vfmt
->Vertex2fv
= save_Vertex2fv
;
12097 vfmt
->Vertex3f
= save_Vertex3f
;
12098 vfmt
->Vertex3fv
= save_Vertex3fv
;
12099 vfmt
->Vertex4f
= save_Vertex4f
;
12100 vfmt
->Vertex4fv
= save_Vertex4fv
;
12101 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
12102 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
12103 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
12104 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
12105 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
12106 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
12107 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
12108 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
12109 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
12110 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
12111 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
12112 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
12113 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
12114 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
12115 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
12116 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
12118 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
12123 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
12124 const GLvertexformat
*vfmt
)
12126 SET_CallList(disp
, vfmt
->CallList
);
12127 SET_CallLists(disp
, vfmt
->CallLists
);
12132 * Initialize display list state for given context.
12135 _mesa_init_display_list(struct gl_context
*ctx
)
12137 static GLboolean tableInitialized
= GL_FALSE
;
12139 /* zero-out the instruction size table, just once */
12140 if (!tableInitialized
) {
12141 memset(InstSize
, 0, sizeof(InstSize
));
12142 tableInitialized
= GL_TRUE
;
12145 /* extension info */
12146 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
12149 ctx
->ListState
.CallDepth
= 0;
12150 ctx
->ExecuteFlag
= GL_TRUE
;
12151 ctx
->CompileFlag
= GL_FALSE
;
12152 ctx
->ListState
.CurrentBlock
= NULL
;
12153 ctx
->ListState
.CurrentPos
= 0;
12155 /* Display List group */
12156 ctx
->List
.ListBase
= 0;
12158 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
12160 InstSize
[OPCODE_NOP
] = 1;
12165 _mesa_free_display_list_data(struct gl_context
*ctx
)
12167 free(ctx
->ListExt
);
12168 ctx
->ListExt
= NULL
;