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
;
965 /* All InstSize[] entries must be non-zero */
966 InstSize
[OPCODE_END_OF_LIST
] = 1;
972 * Lookup function to just encapsulate casting.
974 struct gl_display_list
*
975 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
977 return (struct gl_display_list
*)
978 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
982 /** Is the given opcode an extension code? */
983 static inline GLboolean
984 is_ext_opcode(OpCode opcode
)
986 return (opcode
>= OPCODE_EXT_0
);
990 /** Destroy an extended opcode instruction */
992 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
994 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
996 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
997 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1002 /** Execute an extended opcode instruction */
1004 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1006 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1008 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1009 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1014 /** Print an extended opcode instruction */
1016 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1018 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1020 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1021 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1027 * Delete the named display list, but don't remove from hash table.
1028 * \param dlist - display list pointer
1031 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1036 n
= block
= dlist
->Head
;
1038 done
= block
? GL_FALSE
: GL_TRUE
;
1040 const OpCode opcode
= n
[0].opcode
;
1042 /* check for extension opcodes first */
1043 if (is_ext_opcode(opcode
)) {
1044 n
+= ext_opcode_destroy(ctx
, n
);
1048 /* for some commands, we need to free malloc'd memory */
1050 free(get_pointer(&n
[6]));
1053 free(get_pointer(&n
[10]));
1055 case OPCODE_CALL_LISTS
:
1056 free(get_pointer(&n
[3]));
1058 case OPCODE_DRAW_PIXELS
:
1059 free(get_pointer(&n
[5]));
1062 free(get_pointer(&n
[7]));
1064 case OPCODE_POLYGON_STIPPLE
:
1065 free(get_pointer(&n
[1]));
1067 case OPCODE_TEX_IMAGE1D
:
1068 free(get_pointer(&n
[8]));
1070 case OPCODE_TEX_IMAGE2D
:
1071 free(get_pointer(&n
[9]));
1073 case OPCODE_TEX_IMAGE3D
:
1074 free(get_pointer(&n
[10]));
1076 case OPCODE_TEX_SUB_IMAGE1D
:
1077 free(get_pointer(&n
[7]));
1079 case OPCODE_TEX_SUB_IMAGE2D
:
1080 free(get_pointer(&n
[9]));
1082 case OPCODE_TEX_SUB_IMAGE3D
:
1083 free(get_pointer(&n
[11]));
1085 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1086 free(get_pointer(&n
[7]));
1088 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1089 free(get_pointer(&n
[8]));
1091 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1092 free(get_pointer(&n
[9]));
1094 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1095 free(get_pointer(&n
[7]));
1097 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1098 free(get_pointer(&n
[9]));
1100 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1101 free(get_pointer(&n
[11]));
1103 case OPCODE_PROGRAM_STRING_ARB
:
1104 free(get_pointer(&n
[4])); /* program string */
1106 case OPCODE_UNIFORM_1FV
:
1107 case OPCODE_UNIFORM_2FV
:
1108 case OPCODE_UNIFORM_3FV
:
1109 case OPCODE_UNIFORM_4FV
:
1110 case OPCODE_UNIFORM_1DV
:
1111 case OPCODE_UNIFORM_2DV
:
1112 case OPCODE_UNIFORM_3DV
:
1113 case OPCODE_UNIFORM_4DV
:
1114 case OPCODE_UNIFORM_1IV
:
1115 case OPCODE_UNIFORM_2IV
:
1116 case OPCODE_UNIFORM_3IV
:
1117 case OPCODE_UNIFORM_4IV
:
1118 case OPCODE_UNIFORM_1UIV
:
1119 case OPCODE_UNIFORM_2UIV
:
1120 case OPCODE_UNIFORM_3UIV
:
1121 case OPCODE_UNIFORM_4UIV
:
1122 free(get_pointer(&n
[3]));
1124 case OPCODE_UNIFORM_MATRIX22
:
1125 case OPCODE_UNIFORM_MATRIX33
:
1126 case OPCODE_UNIFORM_MATRIX44
:
1127 case OPCODE_UNIFORM_MATRIX24
:
1128 case OPCODE_UNIFORM_MATRIX42
:
1129 case OPCODE_UNIFORM_MATRIX23
:
1130 case OPCODE_UNIFORM_MATRIX32
:
1131 case OPCODE_UNIFORM_MATRIX34
:
1132 case OPCODE_UNIFORM_MATRIX43
:
1133 case OPCODE_UNIFORM_MATRIX22D
:
1134 case OPCODE_UNIFORM_MATRIX33D
:
1135 case OPCODE_UNIFORM_MATRIX44D
:
1136 case OPCODE_UNIFORM_MATRIX24D
:
1137 case OPCODE_UNIFORM_MATRIX42D
:
1138 case OPCODE_UNIFORM_MATRIX23D
:
1139 case OPCODE_UNIFORM_MATRIX32D
:
1140 case OPCODE_UNIFORM_MATRIX34D
:
1141 case OPCODE_UNIFORM_MATRIX43D
:
1142 free(get_pointer(&n
[4]));
1144 case OPCODE_PROGRAM_UNIFORM_1FV
:
1145 case OPCODE_PROGRAM_UNIFORM_2FV
:
1146 case OPCODE_PROGRAM_UNIFORM_3FV
:
1147 case OPCODE_PROGRAM_UNIFORM_4FV
:
1148 case OPCODE_PROGRAM_UNIFORM_1DV
:
1149 case OPCODE_PROGRAM_UNIFORM_2DV
:
1150 case OPCODE_PROGRAM_UNIFORM_3DV
:
1151 case OPCODE_PROGRAM_UNIFORM_4DV
:
1152 case OPCODE_PROGRAM_UNIFORM_1IV
:
1153 case OPCODE_PROGRAM_UNIFORM_2IV
:
1154 case OPCODE_PROGRAM_UNIFORM_3IV
:
1155 case OPCODE_PROGRAM_UNIFORM_4IV
:
1156 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1157 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1158 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1159 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1160 free(get_pointer(&n
[4]));
1162 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1163 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1164 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1165 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1166 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1167 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1168 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1169 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1170 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1171 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1172 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1173 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1174 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1175 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1176 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1177 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1178 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1179 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1180 free(get_pointer(&n
[5]));
1182 case OPCODE_PIXEL_MAP
:
1183 free(get_pointer(&n
[3]));
1185 case OPCODE_VIEWPORT_ARRAY_V
:
1186 case OPCODE_SCISSOR_ARRAY_V
:
1187 case OPCODE_DEPTH_ARRAY_V
:
1188 case OPCODE_UNIFORM_SUBROUTINES
:
1189 case OPCODE_WINDOW_RECTANGLES
:
1190 free(get_pointer(&n
[3]));
1192 case OPCODE_CONTINUE
:
1193 n
= (Node
*) get_pointer(&n
[1]);
1197 case OPCODE_END_OF_LIST
:
1202 /* just increment 'n' pointer, below */
1206 if (opcode
!= OPCODE_CONTINUE
) {
1207 assert(InstSize
[opcode
] > 0);
1208 n
+= InstSize
[opcode
];
1219 * Called by _mesa_HashWalk() to check if a display list which is being
1220 * deleted belongs to a bitmap texture atlas.
1223 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1225 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1226 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1228 /* See if the list_id falls in the range contained in this texture atlas */
1229 if (atlas
->complete
&&
1230 list_id
>= atlas_id
&&
1231 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1232 /* Mark the atlas as incomplete so it doesn't get used. But don't
1233 * delete it yet since we don't want to try to recreate it in the next
1236 atlas
->complete
= false;
1237 atlas
->incomplete
= true;
1243 * Destroy a display list and remove from hash table.
1244 * \param list - display list number
1247 destroy_list(struct gl_context
*ctx
, GLuint list
)
1249 struct gl_display_list
*dlist
;
1254 dlist
= _mesa_lookup_list(ctx
, list
);
1258 if (is_bitmap_list(dlist
)) {
1259 /* If we're destroying a simple glBitmap display list, there's a
1260 * chance that we're destroying a bitmap image that's in a texture
1261 * atlas. Examine all atlases to see if that's the case. There's
1262 * usually few (if any) atlases so this isn't expensive.
1264 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1265 check_atlas_for_deleted_list
, &list
);
1268 _mesa_delete_list(ctx
, dlist
);
1269 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1274 * Translate the nth element of list from <type> to GLint.
1277 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1289 bptr
= (GLbyte
*) list
;
1290 return (GLint
) bptr
[n
];
1291 case GL_UNSIGNED_BYTE
:
1292 ubptr
= (GLubyte
*) list
;
1293 return (GLint
) ubptr
[n
];
1295 sptr
= (GLshort
*) list
;
1296 return (GLint
) sptr
[n
];
1297 case GL_UNSIGNED_SHORT
:
1298 usptr
= (GLushort
*) list
;
1299 return (GLint
) usptr
[n
];
1301 iptr
= (GLint
*) list
;
1303 case GL_UNSIGNED_INT
:
1304 uiptr
= (GLuint
*) list
;
1305 return (GLint
) uiptr
[n
];
1307 fptr
= (GLfloat
*) list
;
1308 return (GLint
) floorf(fptr
[n
]);
1310 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1311 return (GLint
) ubptr
[0] * 256
1314 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1315 return (GLint
) ubptr
[0] * 65536
1316 + (GLint
) ubptr
[1] * 256
1319 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1320 return (GLint
) ubptr
[0] * 16777216
1321 + (GLint
) ubptr
[1] * 65536
1322 + (GLint
) ubptr
[2] * 256
1331 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1332 * If width < 0 or height < 0 or format or type are invalid we'll just
1333 * return NULL. We will not generate an error since OpenGL command
1334 * arguments aren't error-checked until the command is actually executed
1335 * (not when they're compiled).
1336 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1339 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1340 GLsizei width
, GLsizei height
, GLsizei depth
,
1341 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1342 const struct gl_pixelstore_attrib
*unpack
)
1344 if (width
<= 0 || height
<= 0) {
1348 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1349 /* bad format and/or type */
1353 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1357 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1358 format
, type
, pixels
, unpack
);
1359 if (pixels
&& !image
) {
1360 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1364 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1365 depth
, format
, type
, INT_MAX
, pixels
)) {
1366 const GLubyte
*map
, *src
;
1370 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1371 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1374 /* unable to map src buffer! */
1375 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1379 src
= ADD_POINTERS(map
, pixels
);
1380 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1381 format
, type
, src
, unpack
);
1383 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1386 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1392 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1397 /** Return copy of memory */
1399 memdup(const void *src
, GLsizei bytes
)
1401 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1403 memcpy(b
, src
, bytes
);
1409 * Allocate space for a display list instruction (opcode + payload space).
1410 * \param opcode the instruction opcode (OPCODE_* value)
1411 * \param bytes instruction payload size (not counting opcode)
1412 * \param align8 does the payload need to be 8-byte aligned?
1413 * This is only relevant in 64-bit environments.
1414 * \return pointer to allocated memory (the payload will be at pointer+1)
1417 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1419 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1420 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1424 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1426 if (opcode
< OPCODE_EXT_0
) {
1427 if (InstSize
[opcode
] == 0) {
1428 /* save instruction size now */
1429 InstSize
[opcode
] = numNodes
;
1432 /* make sure instruction size agrees */
1433 assert(numNodes
== InstSize
[opcode
]);
1437 if (sizeof(void *) > sizeof(Node
) && align8
1438 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1439 /* The opcode would get placed at node[0] and the payload would start
1440 * at node[1]. But the payload needs to be at an even offset (8-byte
1449 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1451 /* This block is full. Allocate a new block and chain to it */
1453 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1454 n
[0].opcode
= OPCODE_CONTINUE
;
1455 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1457 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1461 /* a fresh block should be 8-byte aligned on 64-bit systems */
1462 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1464 save_pointer(&n
[1], newblock
);
1465 ctx
->ListState
.CurrentBlock
= newblock
;
1466 ctx
->ListState
.CurrentPos
= 0;
1468 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1469 * we have to insert a NOP so that the payload of the real opcode lands
1470 * on an even location:
1471 * node[0] = OPCODE_NOP
1472 * node[1] = OPCODE_x;
1473 * node[2] = start of payload
1475 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1478 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1480 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1481 n
[0].opcode
= OPCODE_NOP
;
1483 /* The "real" opcode will now be at an odd location and the payload
1484 * will be at an even location.
1487 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1489 n
[0].opcode
= opcode
;
1497 * Allocate space for a display list instruction. Used by callers outside
1498 * this file for things like VBO vertex data.
1500 * \param opcode the instruction opcode (OPCODE_* value)
1501 * \param bytes instruction size in bytes, not counting opcode.
1502 * \return pointer to the usable data area (not including the internal
1506 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1508 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1510 return n
+ 1; /* return pointer to payload area, after opcode */
1517 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1518 * aligned in 64-bit environments, 4-byte aligned otherwise.
1521 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1523 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1525 return n
+ 1; /* return pointer to payload area, after opcode */
1532 * This function allows modules and drivers to get their own opcodes
1533 * for extending display list functionality.
1534 * \param ctx the rendering context
1535 * \param size number of bytes for storing the new display list command
1536 * \param execute function to execute the new display list command
1537 * \param destroy function to destroy the new display list command
1538 * \param print function to print the new display list command
1539 * \return the new opcode number or -1 if error
1542 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1544 void (*execute
) (struct gl_context
*, void *),
1545 void (*destroy
) (struct gl_context
*, void *),
1546 void (*print
) (struct gl_context
*, void *, FILE *))
1548 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1549 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1550 ctx
->ListExt
->Opcode
[i
].Size
=
1551 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1552 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1553 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1554 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1555 return i
+ OPCODE_EXT_0
;
1562 * Allocate space for a display list instruction. The space is basically
1563 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1564 * function parameter, node[2] is the second parameter, etc.
1566 * \param opcode one of OPCODE_x
1567 * \param nparams number of function parameters
1568 * \return pointer to start of instruction space
1570 static inline Node
*
1571 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1573 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1578 * Called by EndList to try to reduce memory used for the list.
1581 trim_list(struct gl_context
*ctx
)
1583 /* If the list we're ending only has one allocated block of nodes/tokens
1584 * and its size isn't a full block size, realloc the block to use less
1585 * memory. This is important for apps that create many small display
1586 * lists and apps that use glXUseXFont (many lists each containing one
1588 * Note: we currently only trim display lists that allocated one block
1589 * of tokens. That hits the short list case which is what we're mainly
1590 * concerned with. Trimming longer lists would involve traversing the
1591 * linked list of blocks.
1593 struct gl_dlist_state
*list
= &ctx
->ListState
;
1595 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1596 (list
->CurrentPos
< BLOCK_SIZE
)) {
1597 /* There's only one block and it's not full, so realloc */
1598 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1599 list
->CurrentList
->Head
=
1600 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1601 if (!list
->CurrentBlock
) {
1602 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1610 * Display List compilation functions
1612 static void GLAPIENTRY
1613 save_Accum(GLenum op
, GLfloat value
)
1615 GET_CURRENT_CONTEXT(ctx
);
1617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1618 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1623 if (ctx
->ExecuteFlag
) {
1624 CALL_Accum(ctx
->Exec
, (op
, value
));
1629 static void GLAPIENTRY
1630 save_AlphaFunc(GLenum func
, GLclampf ref
)
1632 GET_CURRENT_CONTEXT(ctx
);
1634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1635 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1638 n
[2].f
= (GLfloat
) ref
;
1640 if (ctx
->ExecuteFlag
) {
1641 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1646 static void GLAPIENTRY
1647 save_BindTexture(GLenum target
, GLuint texture
)
1649 GET_CURRENT_CONTEXT(ctx
);
1651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1652 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1657 if (ctx
->ExecuteFlag
) {
1658 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1663 static void GLAPIENTRY
1664 save_Bitmap(GLsizei width
, GLsizei height
,
1665 GLfloat xorig
, GLfloat yorig
,
1666 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1668 GET_CURRENT_CONTEXT(ctx
);
1670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1671 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1673 n
[1].i
= (GLint
) width
;
1674 n
[2].i
= (GLint
) height
;
1680 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1681 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1683 if (ctx
->ExecuteFlag
) {
1684 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1685 xorig
, yorig
, xmove
, ymove
, pixels
));
1690 static void GLAPIENTRY
1691 save_BlendEquation(GLenum mode
)
1693 GET_CURRENT_CONTEXT(ctx
);
1695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1696 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1700 if (ctx
->ExecuteFlag
) {
1701 CALL_BlendEquation(ctx
->Exec
, (mode
));
1706 static void GLAPIENTRY
1707 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1709 GET_CURRENT_CONTEXT(ctx
);
1711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1712 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1717 if (ctx
->ExecuteFlag
) {
1718 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1723 static void GLAPIENTRY
1724 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1725 GLenum sfactorA
, GLenum dfactorA
)
1727 GET_CURRENT_CONTEXT(ctx
);
1729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1730 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1732 n
[1].e
= sfactorRGB
;
1733 n
[2].e
= dfactorRGB
;
1737 if (ctx
->ExecuteFlag
) {
1738 CALL_BlendFuncSeparate(ctx
->Exec
,
1739 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1744 static void GLAPIENTRY
1745 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1747 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1751 static void GLAPIENTRY
1752 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1754 GET_CURRENT_CONTEXT(ctx
);
1756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1757 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1764 if (ctx
->ExecuteFlag
) {
1765 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1769 /* GL_ARB_draw_buffers_blend */
1770 static void GLAPIENTRY
1771 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1772 GLenum sfactorA
, GLenum dfactorA
)
1774 GET_CURRENT_CONTEXT(ctx
);
1776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1777 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1780 n
[2].e
= sfactorRGB
;
1781 n
[3].e
= dfactorRGB
;
1785 if (ctx
->ExecuteFlag
) {
1786 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1787 sfactorA
, dfactorA
));
1791 /* GL_ARB_draw_buffers_blend */
1792 static void GLAPIENTRY
1793 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1795 GET_CURRENT_CONTEXT(ctx
);
1797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1798 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1804 if (ctx
->ExecuteFlag
) {
1805 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1809 /* GL_ARB_draw_buffers_blend */
1810 static void GLAPIENTRY
1811 save_BlendEquationi(GLuint buf
, GLenum mode
)
1813 GET_CURRENT_CONTEXT(ctx
);
1815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1816 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1821 if (ctx
->ExecuteFlag
) {
1822 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1826 /* GL_ARB_draw_buffers_blend */
1827 static void GLAPIENTRY
1828 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1830 GET_CURRENT_CONTEXT(ctx
);
1832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1833 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1839 if (ctx
->ExecuteFlag
) {
1840 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1845 /* GL_ARB_draw_instanced. */
1846 static void GLAPIENTRY
1847 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1849 UNUSED GLsizei count
,
1850 UNUSED GLsizei primcount
)
1852 GET_CURRENT_CONTEXT(ctx
);
1853 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1854 "glDrawArraysInstanced() during display list compile");
1857 static void GLAPIENTRY
1858 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1859 UNUSED GLsizei count
,
1861 UNUSED
const GLvoid
*indices
,
1862 UNUSED GLsizei primcount
)
1864 GET_CURRENT_CONTEXT(ctx
);
1865 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1866 "glDrawElementsInstanced() during display list compile");
1869 static void GLAPIENTRY
1870 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1871 UNUSED GLsizei count
,
1873 UNUSED
const GLvoid
*indices
,
1874 UNUSED GLsizei primcount
,
1875 UNUSED GLint basevertex
)
1877 GET_CURRENT_CONTEXT(ctx
);
1878 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1879 "glDrawElementsInstancedBaseVertex() during display list compile");
1882 /* GL_ARB_base_instance. */
1883 static void GLAPIENTRY
1884 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1886 UNUSED GLsizei count
,
1887 UNUSED GLsizei primcount
,
1888 UNUSED GLuint baseinstance
)
1890 GET_CURRENT_CONTEXT(ctx
);
1891 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1892 "glDrawArraysInstancedBaseInstance() during display list compile");
1895 static void APIENTRY
1896 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1897 UNUSED GLsizei count
,
1899 UNUSED
const void *indices
,
1900 UNUSED GLsizei primcount
,
1901 UNUSED GLuint baseinstance
)
1903 GET_CURRENT_CONTEXT(ctx
);
1904 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1905 "glDrawElementsInstancedBaseInstance() during display list compile");
1908 static void APIENTRY
1909 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1910 UNUSED GLsizei count
,
1912 UNUSED
const void *indices
,
1913 UNUSED GLsizei primcount
,
1914 UNUSED GLint basevertex
,
1915 UNUSED GLuint baseinstance
)
1917 GET_CURRENT_CONTEXT(ctx
);
1918 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1919 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1922 static void APIENTRY
1923 save_DrawArraysIndirect(UNUSED GLenum mode
,
1924 UNUSED
const void *indirect
)
1926 GET_CURRENT_CONTEXT(ctx
);
1927 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1928 "glDrawArraysIndirect() during display list compile");
1931 static void APIENTRY
1932 save_DrawElementsIndirect(UNUSED GLenum mode
,
1934 UNUSED
const void *indirect
)
1936 GET_CURRENT_CONTEXT(ctx
);
1937 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1938 "glDrawElementsIndirect() during display list compile");
1941 static void APIENTRY
1942 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1943 UNUSED
const void *indirect
,
1944 UNUSED GLsizei primcount
,
1945 UNUSED GLsizei stride
)
1947 GET_CURRENT_CONTEXT(ctx
);
1948 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1949 "glMultiDrawArraysIndirect() during display list compile");
1952 static void APIENTRY
1953 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
1955 UNUSED
const void *indirect
,
1956 UNUSED GLsizei primcount
,
1957 UNUSED GLsizei stride
)
1959 GET_CURRENT_CONTEXT(ctx
);
1960 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1961 "glMultiDrawElementsIndirect() during display list compile");
1965 * While building a display list we cache some OpenGL state.
1966 * Under some circumstances we need to invalidate that state (immediately
1967 * when we start compiling a list, or after glCallList(s)).
1970 invalidate_saved_current_state(struct gl_context
*ctx
)
1974 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1975 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1977 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1978 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1980 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1982 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1986 static void GLAPIENTRY
1987 save_CallList(GLuint list
)
1989 GET_CURRENT_CONTEXT(ctx
);
1991 SAVE_FLUSH_VERTICES(ctx
);
1993 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1998 /* After this, we don't know what state we're in. Invalidate all
1999 * cached information previously gathered:
2001 invalidate_saved_current_state( ctx
);
2003 if (ctx
->ExecuteFlag
) {
2004 _mesa_CallList(list
);
2009 static void GLAPIENTRY
2010 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2012 GET_CURRENT_CONTEXT(ctx
);
2017 SAVE_FLUSH_VERTICES(ctx
);
2021 case GL_UNSIGNED_BYTE
:
2025 case GL_UNSIGNED_SHORT
:
2033 case GL_UNSIGNED_INT
:
2042 if (num
> 0 && type_size
> 0) {
2043 /* create a copy of the array of list IDs to save in the display list */
2044 lists_copy
= memdup(lists
, num
* type_size
);
2049 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2053 save_pointer(&n
[3], lists_copy
);
2056 /* After this, we don't know what state we're in. Invalidate all
2057 * cached information previously gathered:
2059 invalidate_saved_current_state( ctx
);
2061 if (ctx
->ExecuteFlag
) {
2062 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2067 static void GLAPIENTRY
2068 save_Clear(GLbitfield mask
)
2070 GET_CURRENT_CONTEXT(ctx
);
2072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2073 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2077 if (ctx
->ExecuteFlag
) {
2078 CALL_Clear(ctx
->Exec
, (mask
));
2083 static void GLAPIENTRY
2084 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2086 GET_CURRENT_CONTEXT(ctx
);
2088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2089 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2092 n
[2].i
= drawbuffer
;
2094 if (buffer
== GL_COLOR
) {
2105 if (ctx
->ExecuteFlag
) {
2106 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2111 static void GLAPIENTRY
2112 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2114 GET_CURRENT_CONTEXT(ctx
);
2116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2117 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2120 n
[2].i
= drawbuffer
;
2122 if (buffer
== GL_COLOR
) {
2133 if (ctx
->ExecuteFlag
) {
2134 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2139 static void GLAPIENTRY
2140 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2142 GET_CURRENT_CONTEXT(ctx
);
2144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2145 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2148 n
[2].i
= drawbuffer
;
2150 if (buffer
== GL_COLOR
) {
2161 if (ctx
->ExecuteFlag
) {
2162 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2167 static void GLAPIENTRY
2168 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2169 GLfloat depth
, GLint stencil
)
2171 GET_CURRENT_CONTEXT(ctx
);
2173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2174 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2177 n
[2].i
= drawbuffer
;
2181 if (ctx
->ExecuteFlag
) {
2182 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2187 static void GLAPIENTRY
2188 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2190 GET_CURRENT_CONTEXT(ctx
);
2192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2193 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2200 if (ctx
->ExecuteFlag
) {
2201 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2206 static void GLAPIENTRY
2207 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2209 GET_CURRENT_CONTEXT(ctx
);
2211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2212 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2219 if (ctx
->ExecuteFlag
) {
2220 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2225 static void GLAPIENTRY
2226 save_ClearDepth(GLclampd depth
)
2228 GET_CURRENT_CONTEXT(ctx
);
2230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2231 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2233 n
[1].f
= (GLfloat
) depth
;
2235 if (ctx
->ExecuteFlag
) {
2236 CALL_ClearDepth(ctx
->Exec
, (depth
));
2241 static void GLAPIENTRY
2242 save_ClearIndex(GLfloat c
)
2244 GET_CURRENT_CONTEXT(ctx
);
2246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2247 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2251 if (ctx
->ExecuteFlag
) {
2252 CALL_ClearIndex(ctx
->Exec
, (c
));
2257 static void GLAPIENTRY
2258 save_ClearStencil(GLint s
)
2260 GET_CURRENT_CONTEXT(ctx
);
2262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2263 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2267 if (ctx
->ExecuteFlag
) {
2268 CALL_ClearStencil(ctx
->Exec
, (s
));
2273 static void GLAPIENTRY
2274 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2276 GET_CURRENT_CONTEXT(ctx
);
2278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2279 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2282 n
[2].f
= (GLfloat
) equ
[0];
2283 n
[3].f
= (GLfloat
) equ
[1];
2284 n
[4].f
= (GLfloat
) equ
[2];
2285 n
[5].f
= (GLfloat
) equ
[3];
2287 if (ctx
->ExecuteFlag
) {
2288 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2294 static void GLAPIENTRY
2295 save_ColorMask(GLboolean red
, GLboolean green
,
2296 GLboolean blue
, GLboolean alpha
)
2298 GET_CURRENT_CONTEXT(ctx
);
2300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2301 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2308 if (ctx
->ExecuteFlag
) {
2309 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2314 static void GLAPIENTRY
2315 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2316 GLboolean blue
, GLboolean alpha
)
2318 GET_CURRENT_CONTEXT(ctx
);
2320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2321 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2329 if (ctx
->ExecuteFlag
) {
2330 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2335 static void GLAPIENTRY
2336 save_ColorMaterial(GLenum face
, GLenum mode
)
2338 GET_CURRENT_CONTEXT(ctx
);
2340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2342 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2347 if (ctx
->ExecuteFlag
) {
2348 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2353 static void GLAPIENTRY
2354 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2356 GET_CURRENT_CONTEXT(ctx
);
2358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2359 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2363 n
[3].i
= (GLint
) width
;
2364 n
[4].i
= (GLint
) height
;
2367 if (ctx
->ExecuteFlag
) {
2368 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2374 static void GLAPIENTRY
2375 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2376 GLint x
, GLint y
, GLsizei width
, GLint border
)
2378 GET_CURRENT_CONTEXT(ctx
);
2380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2381 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2385 n
[3].e
= internalformat
;
2391 if (ctx
->ExecuteFlag
) {
2392 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2393 x
, y
, width
, border
));
2398 static void GLAPIENTRY
2399 save_CopyTexImage2D(GLenum target
, GLint level
,
2400 GLenum internalformat
,
2401 GLint x
, GLint y
, GLsizei width
,
2402 GLsizei height
, GLint border
)
2404 GET_CURRENT_CONTEXT(ctx
);
2406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2407 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2411 n
[3].e
= internalformat
;
2418 if (ctx
->ExecuteFlag
) {
2419 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2420 x
, y
, width
, height
, border
));
2426 static void GLAPIENTRY
2427 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2428 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2430 GET_CURRENT_CONTEXT(ctx
);
2432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2433 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2442 if (ctx
->ExecuteFlag
) {
2443 CALL_CopyTexSubImage1D(ctx
->Exec
,
2444 (target
, level
, xoffset
, x
, y
, width
));
2449 static void GLAPIENTRY
2450 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2451 GLint xoffset
, GLint yoffset
,
2452 GLint x
, GLint y
, GLsizei width
, GLint height
)
2454 GET_CURRENT_CONTEXT(ctx
);
2456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2457 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2468 if (ctx
->ExecuteFlag
) {
2469 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2470 x
, y
, width
, height
));
2475 static void GLAPIENTRY
2476 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2477 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2478 GLint x
, GLint y
, GLsizei width
, GLint height
)
2480 GET_CURRENT_CONTEXT(ctx
);
2482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2483 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2495 if (ctx
->ExecuteFlag
) {
2496 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2497 xoffset
, yoffset
, zoffset
,
2498 x
, y
, width
, height
));
2503 static void GLAPIENTRY
2504 save_CullFace(GLenum mode
)
2506 GET_CURRENT_CONTEXT(ctx
);
2508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2509 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2513 if (ctx
->ExecuteFlag
) {
2514 CALL_CullFace(ctx
->Exec
, (mode
));
2519 static void GLAPIENTRY
2520 save_DepthFunc(GLenum func
)
2522 GET_CURRENT_CONTEXT(ctx
);
2524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2525 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2529 if (ctx
->ExecuteFlag
) {
2530 CALL_DepthFunc(ctx
->Exec
, (func
));
2535 static void GLAPIENTRY
2536 save_DepthMask(GLboolean mask
)
2538 GET_CURRENT_CONTEXT(ctx
);
2540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2541 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2545 if (ctx
->ExecuteFlag
) {
2546 CALL_DepthMask(ctx
->Exec
, (mask
));
2551 static void GLAPIENTRY
2552 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2554 GET_CURRENT_CONTEXT(ctx
);
2556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2557 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2559 n
[1].f
= (GLfloat
) nearval
;
2560 n
[2].f
= (GLfloat
) farval
;
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2568 static void GLAPIENTRY
2569 save_Disable(GLenum cap
)
2571 GET_CURRENT_CONTEXT(ctx
);
2573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2574 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2578 if (ctx
->ExecuteFlag
) {
2579 CALL_Disable(ctx
->Exec
, (cap
));
2584 static void GLAPIENTRY
2585 save_DisableIndexed(GLuint index
, GLenum cap
)
2587 GET_CURRENT_CONTEXT(ctx
);
2589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2590 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2595 if (ctx
->ExecuteFlag
) {
2596 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2601 static void GLAPIENTRY
2602 save_DrawBuffer(GLenum mode
)
2604 GET_CURRENT_CONTEXT(ctx
);
2606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2607 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2611 if (ctx
->ExecuteFlag
) {
2612 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2617 static void GLAPIENTRY
2618 save_DrawPixels(GLsizei width
, GLsizei height
,
2619 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2621 GET_CURRENT_CONTEXT(ctx
);
2624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2626 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2633 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2634 pixels
, &ctx
->Unpack
));
2636 if (ctx
->ExecuteFlag
) {
2637 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2643 static void GLAPIENTRY
2644 save_Enable(GLenum cap
)
2646 GET_CURRENT_CONTEXT(ctx
);
2648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2649 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2653 if (ctx
->ExecuteFlag
) {
2654 CALL_Enable(ctx
->Exec
, (cap
));
2660 static void GLAPIENTRY
2661 save_EnableIndexed(GLuint index
, GLenum cap
)
2663 GET_CURRENT_CONTEXT(ctx
);
2665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2666 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2671 if (ctx
->ExecuteFlag
) {
2672 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2678 static void GLAPIENTRY
2679 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2681 GET_CURRENT_CONTEXT(ctx
);
2683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2684 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2690 if (ctx
->ExecuteFlag
) {
2691 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2696 static void GLAPIENTRY
2697 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2699 GET_CURRENT_CONTEXT(ctx
);
2701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2702 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2710 if (ctx
->ExecuteFlag
) {
2711 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2718 static void GLAPIENTRY
2719 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2721 GET_CURRENT_CONTEXT(ctx
);
2723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2724 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2732 if (ctx
->ExecuteFlag
) {
2733 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2738 static void GLAPIENTRY
2739 save_Fogf(GLenum pname
, GLfloat param
)
2743 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2744 save_Fogfv(pname
, parray
);
2748 static void GLAPIENTRY
2749 save_Fogiv(GLenum pname
, const GLint
*params
)
2754 case GL_FOG_DENSITY
:
2758 p
[0] = (GLfloat
) *params
;
2764 p
[0] = INT_TO_FLOAT(params
[0]);
2765 p
[1] = INT_TO_FLOAT(params
[1]);
2766 p
[2] = INT_TO_FLOAT(params
[2]);
2767 p
[3] = INT_TO_FLOAT(params
[3]);
2770 /* Error will be caught later in gl_Fogfv */
2771 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2773 save_Fogfv(pname
, p
);
2777 static void GLAPIENTRY
2778 save_Fogi(GLenum pname
, GLint param
)
2782 parray
[1] = parray
[2] = parray
[3] = 0;
2783 save_Fogiv(pname
, parray
);
2787 static void GLAPIENTRY
2788 save_FrontFace(GLenum mode
)
2790 GET_CURRENT_CONTEXT(ctx
);
2792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2793 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2797 if (ctx
->ExecuteFlag
) {
2798 CALL_FrontFace(ctx
->Exec
, (mode
));
2803 static void GLAPIENTRY
2804 save_Frustum(GLdouble left
, GLdouble right
,
2805 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2807 GET_CURRENT_CONTEXT(ctx
);
2809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2810 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2812 n
[1].f
= (GLfloat
) left
;
2813 n
[2].f
= (GLfloat
) right
;
2814 n
[3].f
= (GLfloat
) bottom
;
2815 n
[4].f
= (GLfloat
) top
;
2816 n
[5].f
= (GLfloat
) nearval
;
2817 n
[6].f
= (GLfloat
) farval
;
2819 if (ctx
->ExecuteFlag
) {
2820 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2825 static void GLAPIENTRY
2826 save_Hint(GLenum target
, GLenum mode
)
2828 GET_CURRENT_CONTEXT(ctx
);
2830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2831 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2836 if (ctx
->ExecuteFlag
) {
2837 CALL_Hint(ctx
->Exec
, (target
, mode
));
2842 static void GLAPIENTRY
2843 save_IndexMask(GLuint mask
)
2845 GET_CURRENT_CONTEXT(ctx
);
2847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2848 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2852 if (ctx
->ExecuteFlag
) {
2853 CALL_IndexMask(ctx
->Exec
, (mask
));
2858 static void GLAPIENTRY
2859 save_InitNames(void)
2861 GET_CURRENT_CONTEXT(ctx
);
2862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2863 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2864 if (ctx
->ExecuteFlag
) {
2865 CALL_InitNames(ctx
->Exec
, ());
2870 static void GLAPIENTRY
2871 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2873 GET_CURRENT_CONTEXT(ctx
);
2875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2876 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2894 case GL_SPOT_DIRECTION
:
2897 case GL_SPOT_EXPONENT
:
2900 case GL_SPOT_CUTOFF
:
2903 case GL_CONSTANT_ATTENUATION
:
2906 case GL_LINEAR_ATTENUATION
:
2909 case GL_QUADRATIC_ATTENUATION
:
2915 for (i
= 0; i
< nParams
; i
++) {
2916 n
[3 + i
].f
= params
[i
];
2919 if (ctx
->ExecuteFlag
) {
2920 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2925 static void GLAPIENTRY
2926 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2930 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2931 save_Lightfv(light
, pname
, parray
);
2935 static void GLAPIENTRY
2936 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2943 fparam
[0] = INT_TO_FLOAT(params
[0]);
2944 fparam
[1] = INT_TO_FLOAT(params
[1]);
2945 fparam
[2] = INT_TO_FLOAT(params
[2]);
2946 fparam
[3] = INT_TO_FLOAT(params
[3]);
2949 fparam
[0] = (GLfloat
) params
[0];
2950 fparam
[1] = (GLfloat
) params
[1];
2951 fparam
[2] = (GLfloat
) params
[2];
2952 fparam
[3] = (GLfloat
) params
[3];
2954 case GL_SPOT_DIRECTION
:
2955 fparam
[0] = (GLfloat
) params
[0];
2956 fparam
[1] = (GLfloat
) params
[1];
2957 fparam
[2] = (GLfloat
) params
[2];
2959 case GL_SPOT_EXPONENT
:
2960 case GL_SPOT_CUTOFF
:
2961 case GL_CONSTANT_ATTENUATION
:
2962 case GL_LINEAR_ATTENUATION
:
2963 case GL_QUADRATIC_ATTENUATION
:
2964 fparam
[0] = (GLfloat
) params
[0];
2967 /* error will be caught later in gl_Lightfv */
2970 save_Lightfv(light
, pname
, fparam
);
2974 static void GLAPIENTRY
2975 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2979 parray
[1] = parray
[2] = parray
[3] = 0;
2980 save_Lightiv(light
, pname
, parray
);
2984 static void GLAPIENTRY
2985 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2987 GET_CURRENT_CONTEXT(ctx
);
2989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2990 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2998 if (ctx
->ExecuteFlag
) {
2999 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3004 static void GLAPIENTRY
3005 save_LightModelf(GLenum pname
, GLfloat param
)
3009 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3010 save_LightModelfv(pname
, parray
);
3014 static void GLAPIENTRY
3015 save_LightModeliv(GLenum pname
, const GLint
*params
)
3019 case GL_LIGHT_MODEL_AMBIENT
:
3020 fparam
[0] = INT_TO_FLOAT(params
[0]);
3021 fparam
[1] = INT_TO_FLOAT(params
[1]);
3022 fparam
[2] = INT_TO_FLOAT(params
[2]);
3023 fparam
[3] = INT_TO_FLOAT(params
[3]);
3025 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3026 case GL_LIGHT_MODEL_TWO_SIDE
:
3027 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3028 fparam
[0] = (GLfloat
) params
[0];
3034 /* Error will be caught later in gl_LightModelfv */
3035 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3037 save_LightModelfv(pname
, fparam
);
3041 static void GLAPIENTRY
3042 save_LightModeli(GLenum pname
, GLint param
)
3046 parray
[1] = parray
[2] = parray
[3] = 0;
3047 save_LightModeliv(pname
, parray
);
3051 static void GLAPIENTRY
3052 save_LineStipple(GLint factor
, GLushort pattern
)
3054 GET_CURRENT_CONTEXT(ctx
);
3056 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3057 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3062 if (ctx
->ExecuteFlag
) {
3063 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3068 static void GLAPIENTRY
3069 save_LineWidth(GLfloat width
)
3071 GET_CURRENT_CONTEXT(ctx
);
3073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3074 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3078 if (ctx
->ExecuteFlag
) {
3079 CALL_LineWidth(ctx
->Exec
, (width
));
3084 static void GLAPIENTRY
3085 save_ListBase(GLuint base
)
3087 GET_CURRENT_CONTEXT(ctx
);
3089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3090 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3094 if (ctx
->ExecuteFlag
) {
3095 CALL_ListBase(ctx
->Exec
, (base
));
3100 static void GLAPIENTRY
3101 save_LoadIdentity(void)
3103 GET_CURRENT_CONTEXT(ctx
);
3104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3105 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3106 if (ctx
->ExecuteFlag
) {
3107 CALL_LoadIdentity(ctx
->Exec
, ());
3112 static void GLAPIENTRY
3113 save_LoadMatrixf(const GLfloat
* m
)
3115 GET_CURRENT_CONTEXT(ctx
);
3117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3118 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3121 for (i
= 0; i
< 16; i
++) {
3125 if (ctx
->ExecuteFlag
) {
3126 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3131 static void GLAPIENTRY
3132 save_LoadMatrixd(const GLdouble
* m
)
3136 for (i
= 0; i
< 16; i
++) {
3137 f
[i
] = (GLfloat
) m
[i
];
3139 save_LoadMatrixf(f
);
3143 static void GLAPIENTRY
3144 save_LoadName(GLuint name
)
3146 GET_CURRENT_CONTEXT(ctx
);
3148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3149 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3153 if (ctx
->ExecuteFlag
) {
3154 CALL_LoadName(ctx
->Exec
, (name
));
3159 static void GLAPIENTRY
3160 save_LogicOp(GLenum opcode
)
3162 GET_CURRENT_CONTEXT(ctx
);
3164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3165 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3169 if (ctx
->ExecuteFlag
) {
3170 CALL_LogicOp(ctx
->Exec
, (opcode
));
3175 static void GLAPIENTRY
3176 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3177 GLint order
, const GLdouble
* points
)
3179 GET_CURRENT_CONTEXT(ctx
);
3181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3182 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3184 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3186 n
[2].f
= (GLfloat
) u1
;
3187 n
[3].f
= (GLfloat
) u2
;
3188 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3190 save_pointer(&n
[6], pnts
);
3192 if (ctx
->ExecuteFlag
) {
3193 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3197 static void GLAPIENTRY
3198 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3199 GLint order
, const GLfloat
* points
)
3201 GET_CURRENT_CONTEXT(ctx
);
3203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3204 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3206 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3210 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3212 save_pointer(&n
[6], pnts
);
3214 if (ctx
->ExecuteFlag
) {
3215 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3220 static void GLAPIENTRY
3221 save_Map2d(GLenum target
,
3222 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3223 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3224 const GLdouble
* points
)
3226 GET_CURRENT_CONTEXT(ctx
);
3228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3229 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3231 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3232 vstride
, vorder
, points
);
3234 n
[2].f
= (GLfloat
) u1
;
3235 n
[3].f
= (GLfloat
) u2
;
3236 n
[4].f
= (GLfloat
) v1
;
3237 n
[5].f
= (GLfloat
) v2
;
3238 /* XXX verify these strides are correct */
3239 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3240 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3243 save_pointer(&n
[10], pnts
);
3245 if (ctx
->ExecuteFlag
) {
3246 CALL_Map2d(ctx
->Exec
, (target
,
3247 u1
, u2
, ustride
, uorder
,
3248 v1
, v2
, vstride
, vorder
, points
));
3253 static void GLAPIENTRY
3254 save_Map2f(GLenum target
,
3255 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3256 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3257 const GLfloat
* points
)
3259 GET_CURRENT_CONTEXT(ctx
);
3261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3262 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3264 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3265 vstride
, vorder
, points
);
3271 /* XXX verify these strides are correct */
3272 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3273 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3276 save_pointer(&n
[10], pnts
);
3278 if (ctx
->ExecuteFlag
) {
3279 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3280 v1
, v2
, vstride
, vorder
, points
));
3285 static void GLAPIENTRY
3286 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3288 GET_CURRENT_CONTEXT(ctx
);
3290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3291 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3297 if (ctx
->ExecuteFlag
) {
3298 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3303 static void GLAPIENTRY
3304 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3306 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3310 static void GLAPIENTRY
3311 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3312 GLint vn
, GLfloat v1
, GLfloat v2
)
3314 GET_CURRENT_CONTEXT(ctx
);
3316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3317 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3326 if (ctx
->ExecuteFlag
) {
3327 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3333 static void GLAPIENTRY
3334 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3335 GLint vn
, GLdouble v1
, GLdouble v2
)
3337 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3338 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3342 static void GLAPIENTRY
3343 save_MatrixMode(GLenum mode
)
3345 GET_CURRENT_CONTEXT(ctx
);
3347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3348 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3352 if (ctx
->ExecuteFlag
) {
3353 CALL_MatrixMode(ctx
->Exec
, (mode
));
3358 static void GLAPIENTRY
3359 save_MultMatrixf(const GLfloat
* m
)
3361 GET_CURRENT_CONTEXT(ctx
);
3363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3364 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3367 for (i
= 0; i
< 16; i
++) {
3371 if (ctx
->ExecuteFlag
) {
3372 CALL_MultMatrixf(ctx
->Exec
, (m
));
3377 static void GLAPIENTRY
3378 save_MultMatrixd(const GLdouble
* m
)
3382 for (i
= 0; i
< 16; i
++) {
3383 f
[i
] = (GLfloat
) m
[i
];
3385 save_MultMatrixf(f
);
3389 static void GLAPIENTRY
3390 save_NewList(GLuint name
, GLenum mode
)
3392 GET_CURRENT_CONTEXT(ctx
);
3393 /* It's an error to call this function while building a display list */
3394 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3401 static void GLAPIENTRY
3402 save_Ortho(GLdouble left
, GLdouble right
,
3403 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3405 GET_CURRENT_CONTEXT(ctx
);
3407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3408 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3410 n
[1].f
= (GLfloat
) left
;
3411 n
[2].f
= (GLfloat
) right
;
3412 n
[3].f
= (GLfloat
) bottom
;
3413 n
[4].f
= (GLfloat
) top
;
3414 n
[5].f
= (GLfloat
) nearval
;
3415 n
[6].f
= (GLfloat
) farval
;
3417 if (ctx
->ExecuteFlag
) {
3418 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3423 static void GLAPIENTRY
3424 save_PatchParameteri(GLenum pname
, const GLint value
)
3426 GET_CURRENT_CONTEXT(ctx
);
3428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3429 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3434 if (ctx
->ExecuteFlag
) {
3435 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3440 static void GLAPIENTRY
3441 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3443 GET_CURRENT_CONTEXT(ctx
);
3445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3447 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3448 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3450 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3451 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3455 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3465 if (ctx
->ExecuteFlag
) {
3466 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3471 static void GLAPIENTRY
3472 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3474 GET_CURRENT_CONTEXT(ctx
);
3476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3477 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3481 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3483 if (ctx
->ExecuteFlag
) {
3484 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3489 static void GLAPIENTRY
3490 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3492 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3494 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3495 for (i
= 0; i
< mapsize
; i
++) {
3496 fvalues
[i
] = (GLfloat
) values
[i
];
3500 for (i
= 0; i
< mapsize
; i
++) {
3501 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3504 save_PixelMapfv(map
, mapsize
, fvalues
);
3508 static void GLAPIENTRY
3509 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3511 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3513 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3514 for (i
= 0; i
< mapsize
; i
++) {
3515 fvalues
[i
] = (GLfloat
) values
[i
];
3519 for (i
= 0; i
< mapsize
; i
++) {
3520 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3523 save_PixelMapfv(map
, mapsize
, fvalues
);
3527 static void GLAPIENTRY
3528 save_PixelTransferf(GLenum pname
, GLfloat param
)
3530 GET_CURRENT_CONTEXT(ctx
);
3532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3533 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3538 if (ctx
->ExecuteFlag
) {
3539 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3544 static void GLAPIENTRY
3545 save_PixelTransferi(GLenum pname
, GLint param
)
3547 save_PixelTransferf(pname
, (GLfloat
) param
);
3551 static void GLAPIENTRY
3552 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3554 GET_CURRENT_CONTEXT(ctx
);
3556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3557 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3562 if (ctx
->ExecuteFlag
) {
3563 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3568 static void GLAPIENTRY
3569 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3571 GET_CURRENT_CONTEXT(ctx
);
3573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3574 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3581 if (ctx
->ExecuteFlag
) {
3582 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3587 static void GLAPIENTRY
3588 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3592 parray
[1] = parray
[2] = 0.0F
;
3593 save_PointParameterfvEXT(pname
, parray
);
3596 static void GLAPIENTRY
3597 save_PointParameteriNV(GLenum pname
, GLint param
)
3600 parray
[0] = (GLfloat
) param
;
3601 parray
[1] = parray
[2] = 0.0F
;
3602 save_PointParameterfvEXT(pname
, parray
);
3605 static void GLAPIENTRY
3606 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3609 parray
[0] = (GLfloat
) param
[0];
3610 parray
[1] = parray
[2] = 0.0F
;
3611 save_PointParameterfvEXT(pname
, parray
);
3615 static void GLAPIENTRY
3616 save_PointSize(GLfloat size
)
3618 GET_CURRENT_CONTEXT(ctx
);
3620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3621 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3625 if (ctx
->ExecuteFlag
) {
3626 CALL_PointSize(ctx
->Exec
, (size
));
3631 static void GLAPIENTRY
3632 save_PolygonMode(GLenum face
, GLenum mode
)
3634 GET_CURRENT_CONTEXT(ctx
);
3636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3637 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3642 if (ctx
->ExecuteFlag
) {
3643 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3648 static void GLAPIENTRY
3649 save_PolygonStipple(const GLubyte
* pattern
)
3651 GET_CURRENT_CONTEXT(ctx
);
3654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3656 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3659 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3660 pattern
, &ctx
->Unpack
));
3662 if (ctx
->ExecuteFlag
) {
3663 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3668 static void GLAPIENTRY
3669 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3671 GET_CURRENT_CONTEXT(ctx
);
3673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3674 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3679 if (ctx
->ExecuteFlag
) {
3680 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3685 static void GLAPIENTRY
3686 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3688 GET_CURRENT_CONTEXT(ctx
);
3690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3691 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3697 if (ctx
->ExecuteFlag
) {
3698 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3702 static void GLAPIENTRY
3703 save_PopAttrib(void)
3705 GET_CURRENT_CONTEXT(ctx
);
3706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3707 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3708 if (ctx
->ExecuteFlag
) {
3709 CALL_PopAttrib(ctx
->Exec
, ());
3714 static void GLAPIENTRY
3715 save_PopMatrix(void)
3717 GET_CURRENT_CONTEXT(ctx
);
3718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3719 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3720 if (ctx
->ExecuteFlag
) {
3721 CALL_PopMatrix(ctx
->Exec
, ());
3726 static void GLAPIENTRY
3729 GET_CURRENT_CONTEXT(ctx
);
3730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3731 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3732 if (ctx
->ExecuteFlag
) {
3733 CALL_PopName(ctx
->Exec
, ());
3738 static void GLAPIENTRY
3739 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3740 const GLclampf
* priorities
)
3742 GET_CURRENT_CONTEXT(ctx
);
3744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3746 for (i
= 0; i
< num
; i
++) {
3748 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3750 n
[1].ui
= textures
[i
];
3751 n
[2].f
= priorities
[i
];
3754 if (ctx
->ExecuteFlag
) {
3755 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3760 static void GLAPIENTRY
3761 save_PushAttrib(GLbitfield mask
)
3763 GET_CURRENT_CONTEXT(ctx
);
3765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3766 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3770 if (ctx
->ExecuteFlag
) {
3771 CALL_PushAttrib(ctx
->Exec
, (mask
));
3776 static void GLAPIENTRY
3777 save_PushMatrix(void)
3779 GET_CURRENT_CONTEXT(ctx
);
3780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3781 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3782 if (ctx
->ExecuteFlag
) {
3783 CALL_PushMatrix(ctx
->Exec
, ());
3788 static void GLAPIENTRY
3789 save_PushName(GLuint name
)
3791 GET_CURRENT_CONTEXT(ctx
);
3793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3794 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3798 if (ctx
->ExecuteFlag
) {
3799 CALL_PushName(ctx
->Exec
, (name
));
3804 static void GLAPIENTRY
3805 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3807 GET_CURRENT_CONTEXT(ctx
);
3809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3810 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3817 if (ctx
->ExecuteFlag
) {
3818 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3822 static void GLAPIENTRY
3823 save_RasterPos2d(GLdouble x
, GLdouble y
)
3825 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3828 static void GLAPIENTRY
3829 save_RasterPos2f(GLfloat x
, GLfloat y
)
3831 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3834 static void GLAPIENTRY
3835 save_RasterPos2i(GLint x
, GLint y
)
3837 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3840 static void GLAPIENTRY
3841 save_RasterPos2s(GLshort x
, GLshort y
)
3843 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3846 static void GLAPIENTRY
3847 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3849 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3852 static void GLAPIENTRY
3853 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3855 save_RasterPos4f(x
, y
, z
, 1.0F
);
3858 static void GLAPIENTRY
3859 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3861 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3864 static void GLAPIENTRY
3865 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3867 save_RasterPos4f(x
, y
, z
, 1.0F
);
3870 static void GLAPIENTRY
3871 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3873 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3876 static void GLAPIENTRY
3877 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3879 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3882 static void GLAPIENTRY
3883 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3885 save_RasterPos4f(x
, y
, z
, w
);
3888 static void GLAPIENTRY
3889 save_RasterPos2dv(const GLdouble
* v
)
3891 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3894 static void GLAPIENTRY
3895 save_RasterPos2fv(const GLfloat
* v
)
3897 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3900 static void GLAPIENTRY
3901 save_RasterPos2iv(const GLint
* v
)
3903 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3906 static void GLAPIENTRY
3907 save_RasterPos2sv(const GLshort
* v
)
3909 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3912 static void GLAPIENTRY
3913 save_RasterPos3dv(const GLdouble
* v
)
3915 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3918 static void GLAPIENTRY
3919 save_RasterPos3fv(const GLfloat
* v
)
3921 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3924 static void GLAPIENTRY
3925 save_RasterPos3iv(const GLint
* v
)
3927 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3930 static void GLAPIENTRY
3931 save_RasterPos3sv(const GLshort
* v
)
3933 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3936 static void GLAPIENTRY
3937 save_RasterPos4dv(const GLdouble
* v
)
3939 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3940 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3943 static void GLAPIENTRY
3944 save_RasterPos4fv(const GLfloat
* v
)
3946 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3949 static void GLAPIENTRY
3950 save_RasterPos4iv(const GLint
* v
)
3952 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3953 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3956 static void GLAPIENTRY
3957 save_RasterPos4sv(const GLshort
* v
)
3959 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3963 static void GLAPIENTRY
3964 save_PassThrough(GLfloat token
)
3966 GET_CURRENT_CONTEXT(ctx
);
3968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3969 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3973 if (ctx
->ExecuteFlag
) {
3974 CALL_PassThrough(ctx
->Exec
, (token
));
3979 static void GLAPIENTRY
3980 save_ReadBuffer(GLenum mode
)
3982 GET_CURRENT_CONTEXT(ctx
);
3984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3985 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3989 if (ctx
->ExecuteFlag
) {
3990 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3995 static void GLAPIENTRY
3996 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3998 GET_CURRENT_CONTEXT(ctx
);
4000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4001 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4008 if (ctx
->ExecuteFlag
) {
4009 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4014 static void GLAPIENTRY
4015 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4017 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4021 static void GLAPIENTRY
4022 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4024 GET_CURRENT_CONTEXT(ctx
);
4026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4027 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4033 if (ctx
->ExecuteFlag
) {
4034 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4039 static void GLAPIENTRY
4040 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4042 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4046 static void GLAPIENTRY
4047 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4049 GET_CURRENT_CONTEXT(ctx
);
4051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4052 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4059 if (ctx
->ExecuteFlag
) {
4060 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4065 static void GLAPIENTRY
4066 save_ShadeModel(GLenum mode
)
4068 GET_CURRENT_CONTEXT(ctx
);
4070 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4072 if (ctx
->ExecuteFlag
) {
4073 CALL_ShadeModel(ctx
->Exec
, (mode
));
4076 /* Don't compile this call if it's a no-op.
4077 * By avoiding this state change we have a better chance of
4078 * coalescing subsequent drawing commands into one batch.
4080 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4083 SAVE_FLUSH_VERTICES(ctx
);
4085 ctx
->ListState
.Current
.ShadeModel
= mode
;
4087 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4094 static void GLAPIENTRY
4095 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4097 GET_CURRENT_CONTEXT(ctx
);
4099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4100 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4106 if (ctx
->ExecuteFlag
) {
4107 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4112 static void GLAPIENTRY
4113 save_StencilMask(GLuint mask
)
4115 GET_CURRENT_CONTEXT(ctx
);
4117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4118 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4122 if (ctx
->ExecuteFlag
) {
4123 CALL_StencilMask(ctx
->Exec
, (mask
));
4128 static void GLAPIENTRY
4129 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4131 GET_CURRENT_CONTEXT(ctx
);
4133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4134 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4140 if (ctx
->ExecuteFlag
) {
4141 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4146 static void GLAPIENTRY
4147 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4149 GET_CURRENT_CONTEXT(ctx
);
4151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4152 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4159 if (ctx
->ExecuteFlag
) {
4160 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4165 static void GLAPIENTRY
4166 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4169 GET_CURRENT_CONTEXT(ctx
);
4171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4173 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4181 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4188 if (ctx
->ExecuteFlag
) {
4189 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4190 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4195 static void GLAPIENTRY
4196 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4198 GET_CURRENT_CONTEXT(ctx
);
4200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4201 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4206 if (ctx
->ExecuteFlag
) {
4207 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4212 static void GLAPIENTRY
4213 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4215 GET_CURRENT_CONTEXT(ctx
);
4217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4218 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4225 if (ctx
->ExecuteFlag
) {
4226 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4231 static void GLAPIENTRY
4232 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4234 GET_CURRENT_CONTEXT(ctx
);
4236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4237 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4241 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4249 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4252 if (ctx
->ExecuteFlag
) {
4253 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4258 static void GLAPIENTRY
4259 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4262 parray
[0] = (GLfloat
) param
;
4263 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4264 save_TexEnvfv(target
, pname
, parray
);
4268 static void GLAPIENTRY
4269 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4272 p
[0] = (GLfloat
) param
;
4273 p
[1] = p
[2] = p
[3] = 0.0F
;
4274 save_TexEnvfv(target
, pname
, p
);
4278 static void GLAPIENTRY
4279 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4282 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4283 p
[0] = INT_TO_FLOAT(param
[0]);
4284 p
[1] = INT_TO_FLOAT(param
[1]);
4285 p
[2] = INT_TO_FLOAT(param
[2]);
4286 p
[3] = INT_TO_FLOAT(param
[3]);
4289 p
[0] = (GLfloat
) param
[0];
4290 p
[1] = p
[2] = p
[3] = 0.0F
;
4292 save_TexEnvfv(target
, pname
, p
);
4296 static void GLAPIENTRY
4297 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4299 GET_CURRENT_CONTEXT(ctx
);
4301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4302 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4311 if (ctx
->ExecuteFlag
) {
4312 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4317 static void GLAPIENTRY
4318 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4321 p
[0] = (GLfloat
) params
[0];
4322 p
[1] = (GLfloat
) params
[1];
4323 p
[2] = (GLfloat
) params
[2];
4324 p
[3] = (GLfloat
) params
[3];
4325 save_TexGenfv(coord
, pname
, p
);
4329 static void GLAPIENTRY
4330 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4333 parray
[0] = (GLfloat
) param
;
4334 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4335 save_TexGenfv(coord
, pname
, parray
);
4339 static void GLAPIENTRY
4340 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4343 p
[0] = (GLfloat
) params
[0];
4344 p
[1] = (GLfloat
) params
[1];
4345 p
[2] = (GLfloat
) params
[2];
4346 p
[3] = (GLfloat
) params
[3];
4347 save_TexGenfv(coord
, pname
, p
);
4351 static void GLAPIENTRY
4352 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4356 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4357 save_TexGenfv(coord
, pname
, parray
);
4361 static void GLAPIENTRY
4362 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4366 parray
[1] = parray
[2] = parray
[3] = 0;
4367 save_TexGeniv(coord
, pname
, parray
);
4371 static void GLAPIENTRY
4372 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4374 GET_CURRENT_CONTEXT(ctx
);
4376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4377 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4386 if (ctx
->ExecuteFlag
) {
4387 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4392 static void GLAPIENTRY
4393 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4397 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4398 save_TexParameterfv(target
, pname
, parray
);
4402 static void GLAPIENTRY
4403 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4406 fparam
[0] = (GLfloat
) param
;
4407 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4408 save_TexParameterfv(target
, pname
, fparam
);
4412 static void GLAPIENTRY
4413 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4416 fparam
[0] = (GLfloat
) params
[0];
4417 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4418 save_TexParameterfv(target
, pname
, fparam
);
4422 static void GLAPIENTRY
4423 save_TexImage1D(GLenum target
,
4424 GLint level
, GLint components
,
4425 GLsizei width
, GLint border
,
4426 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4428 GET_CURRENT_CONTEXT(ctx
);
4429 if (target
== GL_PROXY_TEXTURE_1D
) {
4430 /* don't compile, execute immediately */
4431 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4432 border
, format
, type
, pixels
));
4436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4437 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4441 n
[3].i
= components
;
4442 n
[4].i
= (GLint
) width
;
4447 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4448 pixels
, &ctx
->Unpack
));
4450 if (ctx
->ExecuteFlag
) {
4451 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4452 border
, format
, type
, pixels
));
4458 static void GLAPIENTRY
4459 save_TexImage2D(GLenum target
,
4460 GLint level
, GLint components
,
4461 GLsizei width
, GLsizei height
, GLint border
,
4462 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4464 GET_CURRENT_CONTEXT(ctx
);
4465 if (target
== GL_PROXY_TEXTURE_2D
) {
4466 /* don't compile, execute immediately */
4467 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4468 height
, border
, format
, type
, pixels
));
4472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4473 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4477 n
[3].i
= components
;
4478 n
[4].i
= (GLint
) width
;
4479 n
[5].i
= (GLint
) height
;
4484 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4485 pixels
, &ctx
->Unpack
));
4487 if (ctx
->ExecuteFlag
) {
4488 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4489 height
, border
, format
, type
, pixels
));
4495 static void GLAPIENTRY
4496 save_TexImage3D(GLenum target
,
4497 GLint level
, GLint internalFormat
,
4498 GLsizei width
, GLsizei height
, GLsizei depth
,
4500 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4502 GET_CURRENT_CONTEXT(ctx
);
4503 if (target
== GL_PROXY_TEXTURE_3D
) {
4504 /* don't compile, execute immediately */
4505 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4506 height
, depth
, border
, format
, type
,
4511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4512 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4516 n
[3].i
= (GLint
) internalFormat
;
4517 n
[4].i
= (GLint
) width
;
4518 n
[5].i
= (GLint
) height
;
4519 n
[6].i
= (GLint
) depth
;
4523 save_pointer(&n
[10],
4524 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4525 pixels
, &ctx
->Unpack
));
4527 if (ctx
->ExecuteFlag
) {
4528 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4529 height
, depth
, border
, format
, type
,
4536 static void GLAPIENTRY
4537 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4538 GLsizei width
, GLenum format
, GLenum type
,
4539 const GLvoid
* pixels
)
4541 GET_CURRENT_CONTEXT(ctx
);
4544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4546 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4551 n
[4].i
= (GLint
) width
;
4555 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4556 pixels
, &ctx
->Unpack
));
4558 if (ctx
->ExecuteFlag
) {
4559 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4560 format
, type
, pixels
));
4565 static void GLAPIENTRY
4566 save_TexSubImage2D(GLenum target
, GLint level
,
4567 GLint xoffset
, GLint yoffset
,
4568 GLsizei width
, GLsizei height
,
4569 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4571 GET_CURRENT_CONTEXT(ctx
);
4574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4576 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4582 n
[5].i
= (GLint
) width
;
4583 n
[6].i
= (GLint
) height
;
4587 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4588 pixels
, &ctx
->Unpack
));
4590 if (ctx
->ExecuteFlag
) {
4591 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4592 width
, height
, format
, type
, pixels
));
4597 static void GLAPIENTRY
4598 save_TexSubImage3D(GLenum target
, GLint level
,
4599 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4600 GLsizei width
, GLsizei height
, GLsizei depth
,
4601 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4603 GET_CURRENT_CONTEXT(ctx
);
4606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4608 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4615 n
[6].i
= (GLint
) width
;
4616 n
[7].i
= (GLint
) height
;
4617 n
[8].i
= (GLint
) depth
;
4620 save_pointer(&n
[11],
4621 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4622 pixels
, &ctx
->Unpack
));
4624 if (ctx
->ExecuteFlag
) {
4625 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4626 xoffset
, yoffset
, zoffset
,
4627 width
, height
, depth
, format
, type
,
4633 static void GLAPIENTRY
4634 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4636 GET_CURRENT_CONTEXT(ctx
);
4638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4639 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4645 if (ctx
->ExecuteFlag
) {
4646 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4651 static void GLAPIENTRY
4652 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4654 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4659 static void GLAPIENTRY
4660 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4662 GET_CURRENT_CONTEXT(ctx
);
4664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4665 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4669 n
[3].i
= (GLint
) width
;
4670 n
[4].i
= (GLint
) height
;
4672 if (ctx
->ExecuteFlag
) {
4673 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4677 static void GLAPIENTRY
4678 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4681 GET_CURRENT_CONTEXT(ctx
);
4683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4684 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4692 if (ctx
->ExecuteFlag
) {
4693 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4697 static void GLAPIENTRY
4698 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4700 GET_CURRENT_CONTEXT(ctx
);
4702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4703 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4711 if (ctx
->ExecuteFlag
) {
4712 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4716 static void GLAPIENTRY
4717 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4719 GET_CURRENT_CONTEXT(ctx
);
4721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4722 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4726 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4728 if (ctx
->ExecuteFlag
) {
4729 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4733 static void GLAPIENTRY
4734 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4737 GET_CURRENT_CONTEXT(ctx
);
4739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4740 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4748 if (ctx
->ExecuteFlag
) {
4749 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4753 static void GLAPIENTRY
4754 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4756 GET_CURRENT_CONTEXT(ctx
);
4758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4759 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4767 if (ctx
->ExecuteFlag
) {
4768 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4772 static void GLAPIENTRY
4773 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4775 GET_CURRENT_CONTEXT(ctx
);
4777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4778 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4782 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4784 if (ctx
->ExecuteFlag
) {
4785 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4789 static void GLAPIENTRY
4790 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4792 GET_CURRENT_CONTEXT(ctx
);
4794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4795 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4798 /* Mesa stores these as floats internally so we deliberately convert
4799 * them to a float here.
4804 if (ctx
->ExecuteFlag
) {
4805 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4809 static void GLAPIENTRY
4810 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4812 GET_CURRENT_CONTEXT(ctx
);
4814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4815 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4819 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4821 if (ctx
->ExecuteFlag
) {
4822 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4826 static void GLAPIENTRY
4827 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4832 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4839 if (ctx
->ExecuteFlag
) {
4840 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4844 static void GLAPIENTRY
4845 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4847 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4850 static void GLAPIENTRY
4851 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4853 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4856 static void GLAPIENTRY
4857 save_WindowPos2iMESA(GLint x
, GLint y
)
4859 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4862 static void GLAPIENTRY
4863 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4865 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4868 static void GLAPIENTRY
4869 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4871 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4874 static void GLAPIENTRY
4875 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4877 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4880 static void GLAPIENTRY
4881 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4883 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4886 static void GLAPIENTRY
4887 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4889 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4892 static void GLAPIENTRY
4893 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4895 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4898 static void GLAPIENTRY
4899 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4901 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4904 static void GLAPIENTRY
4905 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4907 save_WindowPos4fMESA(x
, y
, z
, w
);
4910 static void GLAPIENTRY
4911 save_WindowPos2dvMESA(const GLdouble
* v
)
4913 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4916 static void GLAPIENTRY
4917 save_WindowPos2fvMESA(const GLfloat
* v
)
4919 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4922 static void GLAPIENTRY
4923 save_WindowPos2ivMESA(const GLint
* v
)
4925 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4928 static void GLAPIENTRY
4929 save_WindowPos2svMESA(const GLshort
* v
)
4931 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4934 static void GLAPIENTRY
4935 save_WindowPos3dvMESA(const GLdouble
* v
)
4937 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4940 static void GLAPIENTRY
4941 save_WindowPos3fvMESA(const GLfloat
* v
)
4943 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4946 static void GLAPIENTRY
4947 save_WindowPos3ivMESA(const GLint
* v
)
4949 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4952 static void GLAPIENTRY
4953 save_WindowPos3svMESA(const GLshort
* v
)
4955 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4958 static void GLAPIENTRY
4959 save_WindowPos4dvMESA(const GLdouble
* v
)
4961 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4962 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4965 static void GLAPIENTRY
4966 save_WindowPos4fvMESA(const GLfloat
* v
)
4968 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4971 static void GLAPIENTRY
4972 save_WindowPos4ivMESA(const GLint
* v
)
4974 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4975 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4978 static void GLAPIENTRY
4979 save_WindowPos4svMESA(const GLshort
* v
)
4981 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4986 /* GL_ARB_multitexture */
4987 static void GLAPIENTRY
4988 save_ActiveTextureARB(GLenum target
)
4990 GET_CURRENT_CONTEXT(ctx
);
4992 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4993 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4997 if (ctx
->ExecuteFlag
) {
4998 CALL_ActiveTexture(ctx
->Exec
, (target
));
5003 /* GL_ARB_transpose_matrix */
5005 static void GLAPIENTRY
5006 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5009 _math_transposefd(tm
, m
);
5010 save_LoadMatrixf(tm
);
5014 static void GLAPIENTRY
5015 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5018 _math_transposef(tm
, m
);
5019 save_LoadMatrixf(tm
);
5023 static void GLAPIENTRY
5024 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5027 _math_transposefd(tm
, m
);
5028 save_MultMatrixf(tm
);
5032 static void GLAPIENTRY
5033 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5036 _math_transposef(tm
, m
);
5037 save_MultMatrixf(tm
);
5040 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5042 GET_CURRENT_CONTEXT(ctx
);
5048 image
= malloc(size
);
5050 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5053 memcpy(image
, data
, size
);
5059 /* GL_ARB_texture_compression */
5060 static void GLAPIENTRY
5061 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5062 GLenum internalFormat
, GLsizei width
,
5063 GLint border
, GLsizei imageSize
,
5064 const GLvoid
* data
)
5066 GET_CURRENT_CONTEXT(ctx
);
5067 if (target
== GL_PROXY_TEXTURE_1D
) {
5068 /* don't compile, execute immediately */
5069 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5070 width
, border
, imageSize
,
5075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5077 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5078 6 + POINTER_DWORDS
);
5082 n
[3].e
= internalFormat
;
5083 n
[4].i
= (GLint
) width
;
5087 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5089 if (ctx
->ExecuteFlag
) {
5090 CALL_CompressedTexImage1D(ctx
->Exec
,
5091 (target
, level
, internalFormat
, width
,
5092 border
, imageSize
, data
));
5098 static void GLAPIENTRY
5099 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5100 GLenum internalFormat
, GLsizei width
,
5101 GLsizei height
, GLint border
, GLsizei imageSize
,
5102 const GLvoid
* data
)
5104 GET_CURRENT_CONTEXT(ctx
);
5105 if (target
== GL_PROXY_TEXTURE_2D
) {
5106 /* don't compile, execute immediately */
5107 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5108 width
, height
, border
,
5113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5115 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5116 7 + POINTER_DWORDS
);
5120 n
[3].e
= internalFormat
;
5121 n
[4].i
= (GLint
) width
;
5122 n
[5].i
= (GLint
) height
;
5126 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5128 if (ctx
->ExecuteFlag
) {
5129 CALL_CompressedTexImage2D(ctx
->Exec
,
5130 (target
, level
, internalFormat
, width
,
5131 height
, border
, imageSize
, data
));
5137 static void GLAPIENTRY
5138 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5139 GLenum internalFormat
, GLsizei width
,
5140 GLsizei height
, GLsizei depth
, GLint border
,
5141 GLsizei imageSize
, const GLvoid
* data
)
5143 GET_CURRENT_CONTEXT(ctx
);
5144 if (target
== GL_PROXY_TEXTURE_3D
) {
5145 /* don't compile, execute immediately */
5146 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5147 width
, height
, depth
, border
,
5152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5154 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5155 8 + POINTER_DWORDS
);
5159 n
[3].e
= internalFormat
;
5160 n
[4].i
= (GLint
) width
;
5161 n
[5].i
= (GLint
) height
;
5162 n
[6].i
= (GLint
) depth
;
5166 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5168 if (ctx
->ExecuteFlag
) {
5169 CALL_CompressedTexImage3D(ctx
->Exec
,
5170 (target
, level
, internalFormat
, width
,
5171 height
, depth
, border
, imageSize
,
5178 static void GLAPIENTRY
5179 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5180 GLsizei width
, GLenum format
,
5181 GLsizei imageSize
, const GLvoid
* data
)
5184 GET_CURRENT_CONTEXT(ctx
);
5185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5187 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5188 6 + POINTER_DWORDS
);
5193 n
[4].i
= (GLint
) width
;
5197 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5199 if (ctx
->ExecuteFlag
) {
5200 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5201 width
, format
, imageSize
,
5207 static void GLAPIENTRY
5208 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5209 GLint yoffset
, GLsizei width
, GLsizei height
,
5210 GLenum format
, GLsizei imageSize
,
5211 const GLvoid
* data
)
5214 GET_CURRENT_CONTEXT(ctx
);
5215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5217 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5218 8 + POINTER_DWORDS
);
5224 n
[5].i
= (GLint
) width
;
5225 n
[6].i
= (GLint
) height
;
5229 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5231 if (ctx
->ExecuteFlag
) {
5232 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5233 (target
, level
, xoffset
, yoffset
, width
,
5234 height
, format
, imageSize
, data
));
5239 static void GLAPIENTRY
5240 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5241 GLint yoffset
, GLint zoffset
, GLsizei width
,
5242 GLsizei height
, GLsizei depth
, GLenum format
,
5243 GLsizei imageSize
, const GLvoid
* data
)
5246 GET_CURRENT_CONTEXT(ctx
);
5247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5249 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5250 10 + POINTER_DWORDS
);
5257 n
[6].i
= (GLint
) width
;
5258 n
[7].i
= (GLint
) height
;
5259 n
[8].i
= (GLint
) depth
;
5261 n
[10].i
= imageSize
;
5262 save_pointer(&n
[11],
5263 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5265 if (ctx
->ExecuteFlag
) {
5266 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5267 (target
, level
, xoffset
, yoffset
,
5268 zoffset
, width
, height
, depth
, format
,
5274 /* GL_ARB_multisample */
5275 static void GLAPIENTRY
5276 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5278 GET_CURRENT_CONTEXT(ctx
);
5280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5281 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5286 if (ctx
->ExecuteFlag
) {
5287 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5293 * GL_ARB_vertex_program
5295 static void GLAPIENTRY
5296 save_BindProgramARB(GLenum target
, GLuint id
)
5298 GET_CURRENT_CONTEXT(ctx
);
5300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5301 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5306 if (ctx
->ExecuteFlag
) {
5307 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5311 static void GLAPIENTRY
5312 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5313 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5315 GET_CURRENT_CONTEXT(ctx
);
5317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5318 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5327 if (ctx
->ExecuteFlag
) {
5328 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5333 static void GLAPIENTRY
5334 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5335 const GLfloat
*params
)
5337 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5338 params
[2], params
[3]);
5342 static void GLAPIENTRY
5343 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5344 const GLfloat
* params
)
5346 GET_CURRENT_CONTEXT(ctx
);
5348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5352 const GLfloat
* p
= params
;
5354 for (i
= 0 ; i
< count
; i
++) {
5355 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5368 if (ctx
->ExecuteFlag
) {
5369 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5374 static void GLAPIENTRY
5375 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5376 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5378 save_ProgramEnvParameter4fARB(target
, index
,
5380 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5384 static void GLAPIENTRY
5385 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5386 const GLdouble
*params
)
5388 save_ProgramEnvParameter4fARB(target
, index
,
5389 (GLfloat
) params
[0],
5390 (GLfloat
) params
[1],
5391 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5395 static void GLAPIENTRY
5396 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5397 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5399 GET_CURRENT_CONTEXT(ctx
);
5401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5402 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5411 if (ctx
->ExecuteFlag
) {
5412 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5417 static void GLAPIENTRY
5418 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5419 const GLfloat
*params
)
5421 GET_CURRENT_CONTEXT(ctx
);
5423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5424 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5433 if (ctx
->ExecuteFlag
) {
5434 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5439 static void GLAPIENTRY
5440 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5441 const GLfloat
*params
)
5443 GET_CURRENT_CONTEXT(ctx
);
5445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5449 const GLfloat
* p
= params
;
5451 for (i
= 0 ; i
< count
; i
++) {
5452 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5465 if (ctx
->ExecuteFlag
) {
5466 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5471 static void GLAPIENTRY
5472 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5473 GLdouble x
, GLdouble y
,
5474 GLdouble z
, GLdouble w
)
5476 GET_CURRENT_CONTEXT(ctx
);
5478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5479 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5483 n
[3].f
= (GLfloat
) x
;
5484 n
[4].f
= (GLfloat
) y
;
5485 n
[5].f
= (GLfloat
) z
;
5486 n
[6].f
= (GLfloat
) w
;
5488 if (ctx
->ExecuteFlag
) {
5489 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5494 static void GLAPIENTRY
5495 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5496 const GLdouble
*params
)
5498 GET_CURRENT_CONTEXT(ctx
);
5500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5501 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5505 n
[3].f
= (GLfloat
) params
[0];
5506 n
[4].f
= (GLfloat
) params
[1];
5507 n
[5].f
= (GLfloat
) params
[2];
5508 n
[6].f
= (GLfloat
) params
[3];
5510 if (ctx
->ExecuteFlag
) {
5511 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5516 /* GL_EXT_stencil_two_side */
5517 static void GLAPIENTRY
5518 save_ActiveStencilFaceEXT(GLenum face
)
5520 GET_CURRENT_CONTEXT(ctx
);
5522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5523 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5527 if (ctx
->ExecuteFlag
) {
5528 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5533 /* GL_EXT_depth_bounds_test */
5534 static void GLAPIENTRY
5535 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5537 GET_CURRENT_CONTEXT(ctx
);
5539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5540 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5542 n
[1].f
= (GLfloat
) zmin
;
5543 n
[2].f
= (GLfloat
) zmax
;
5545 if (ctx
->ExecuteFlag
) {
5546 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5552 static void GLAPIENTRY
5553 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5554 const GLvoid
* string
)
5556 GET_CURRENT_CONTEXT(ctx
);
5559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5561 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5563 GLubyte
*programCopy
= malloc(len
);
5565 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5568 memcpy(programCopy
, string
, len
);
5572 save_pointer(&n
[4], programCopy
);
5574 if (ctx
->ExecuteFlag
) {
5575 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5580 static void GLAPIENTRY
5581 save_BeginQueryARB(GLenum target
, GLuint id
)
5583 GET_CURRENT_CONTEXT(ctx
);
5585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5586 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5591 if (ctx
->ExecuteFlag
) {
5592 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5596 static void GLAPIENTRY
5597 save_EndQueryARB(GLenum target
)
5599 GET_CURRENT_CONTEXT(ctx
);
5601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5602 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5606 if (ctx
->ExecuteFlag
) {
5607 CALL_EndQuery(ctx
->Exec
, (target
));
5611 static void GLAPIENTRY
5612 save_QueryCounter(GLuint id
, GLenum target
)
5614 GET_CURRENT_CONTEXT(ctx
);
5616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5617 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5622 if (ctx
->ExecuteFlag
) {
5623 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5627 static void GLAPIENTRY
5628 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5630 GET_CURRENT_CONTEXT(ctx
);
5632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5633 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5639 if (ctx
->ExecuteFlag
) {
5640 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5644 static void GLAPIENTRY
5645 save_EndQueryIndexed(GLenum target
, GLuint index
)
5647 GET_CURRENT_CONTEXT(ctx
);
5649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5650 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5655 if (ctx
->ExecuteFlag
) {
5656 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5661 static void GLAPIENTRY
5662 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5664 GET_CURRENT_CONTEXT(ctx
);
5666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5667 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5671 if (count
> MAX_DRAW_BUFFERS
)
5672 count
= MAX_DRAW_BUFFERS
;
5673 for (i
= 0; i
< count
; i
++) {
5674 n
[2 + i
].e
= buffers
[i
];
5677 if (ctx
->ExecuteFlag
) {
5678 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5682 static void GLAPIENTRY
5683 save_BindFragmentShaderATI(GLuint id
)
5685 GET_CURRENT_CONTEXT(ctx
);
5688 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5692 if (ctx
->ExecuteFlag
) {
5693 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5697 static void GLAPIENTRY
5698 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5700 GET_CURRENT_CONTEXT(ctx
);
5703 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5711 if (ctx
->ExecuteFlag
) {
5712 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5716 static void GLAPIENTRY
5717 save_Attr1fNV(GLenum attr
, GLfloat x
)
5719 GET_CURRENT_CONTEXT(ctx
);
5721 SAVE_FLUSH_VERTICES(ctx
);
5722 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5728 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5729 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5730 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5732 if (ctx
->ExecuteFlag
) {
5733 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5737 static void GLAPIENTRY
5738 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5740 GET_CURRENT_CONTEXT(ctx
);
5742 SAVE_FLUSH_VERTICES(ctx
);
5743 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5750 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5751 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5752 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5754 if (ctx
->ExecuteFlag
) {
5755 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5759 static void GLAPIENTRY
5760 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5762 GET_CURRENT_CONTEXT(ctx
);
5764 SAVE_FLUSH_VERTICES(ctx
);
5765 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5773 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5774 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5775 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5777 if (ctx
->ExecuteFlag
) {
5778 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5782 static void GLAPIENTRY
5783 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5785 GET_CURRENT_CONTEXT(ctx
);
5787 SAVE_FLUSH_VERTICES(ctx
);
5788 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5797 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5798 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5799 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5801 if (ctx
->ExecuteFlag
) {
5802 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5807 static void GLAPIENTRY
5808 save_Attr1fARB(GLenum attr
, GLfloat x
)
5810 GET_CURRENT_CONTEXT(ctx
);
5812 SAVE_FLUSH_VERTICES(ctx
);
5813 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5819 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5820 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5821 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5823 if (ctx
->ExecuteFlag
) {
5824 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5828 static void GLAPIENTRY
5829 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5831 GET_CURRENT_CONTEXT(ctx
);
5833 SAVE_FLUSH_VERTICES(ctx
);
5834 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5841 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5842 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5843 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5845 if (ctx
->ExecuteFlag
) {
5846 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5850 static void GLAPIENTRY
5851 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5853 GET_CURRENT_CONTEXT(ctx
);
5855 SAVE_FLUSH_VERTICES(ctx
);
5856 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5864 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5865 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5866 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5868 if (ctx
->ExecuteFlag
) {
5869 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5873 static void GLAPIENTRY
5874 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5876 GET_CURRENT_CONTEXT(ctx
);
5878 SAVE_FLUSH_VERTICES(ctx
);
5879 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5888 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5889 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5890 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5892 if (ctx
->ExecuteFlag
) {
5893 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5898 static void GLAPIENTRY
5899 save_EvalCoord1f(GLfloat x
)
5901 GET_CURRENT_CONTEXT(ctx
);
5903 SAVE_FLUSH_VERTICES(ctx
);
5904 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5908 if (ctx
->ExecuteFlag
) {
5909 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5913 static void GLAPIENTRY
5914 save_EvalCoord1fv(const GLfloat
* v
)
5916 save_EvalCoord1f(v
[0]);
5919 static void GLAPIENTRY
5920 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5922 GET_CURRENT_CONTEXT(ctx
);
5924 SAVE_FLUSH_VERTICES(ctx
);
5925 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5930 if (ctx
->ExecuteFlag
) {
5931 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5935 static void GLAPIENTRY
5936 save_EvalCoord2fv(const GLfloat
* v
)
5938 save_EvalCoord2f(v
[0], v
[1]);
5942 static void GLAPIENTRY
5943 save_EvalPoint1(GLint x
)
5945 GET_CURRENT_CONTEXT(ctx
);
5947 SAVE_FLUSH_VERTICES(ctx
);
5948 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5952 if (ctx
->ExecuteFlag
) {
5953 CALL_EvalPoint1(ctx
->Exec
, (x
));
5957 static void GLAPIENTRY
5958 save_EvalPoint2(GLint x
, GLint y
)
5960 GET_CURRENT_CONTEXT(ctx
);
5962 SAVE_FLUSH_VERTICES(ctx
);
5963 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5968 if (ctx
->ExecuteFlag
) {
5969 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5973 static void GLAPIENTRY
5974 save_Indexf(GLfloat x
)
5976 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5979 static void GLAPIENTRY
5980 save_Indexfv(const GLfloat
* v
)
5982 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5985 static void GLAPIENTRY
5986 save_EdgeFlag(GLboolean x
)
5988 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
5993 * Compare 'count' elements of vectors 'a' and 'b'.
5994 * \return GL_TRUE if equal, GL_FALSE if different.
5996 static inline GLboolean
5997 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5999 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6004 * This glMaterial function is used for glMaterial calls that are outside
6005 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6007 static void GLAPIENTRY
6008 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6010 GET_CURRENT_CONTEXT(ctx
);
6018 case GL_FRONT_AND_BACK
:
6021 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6030 case GL_AMBIENT_AND_DIFFUSE
:
6036 case GL_COLOR_INDEXES
:
6040 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6044 if (ctx
->ExecuteFlag
) {
6045 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6048 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6050 /* Try to eliminate redundant statechanges. Because it is legal to
6051 * call glMaterial even inside begin/end calls, don't need to worry
6052 * about ctx->Driver.CurrentSavePrimitive here.
6054 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6055 if (bitmask
& (1 << i
)) {
6056 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6057 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6058 /* no change in material value */
6059 bitmask
&= ~(1 << i
);
6062 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6063 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6068 /* If this call has no effect, return early */
6072 SAVE_FLUSH_VERTICES(ctx
);
6074 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6078 for (i
= 0; i
< args
; i
++)
6079 n
[3 + i
].f
= param
[i
];
6083 static void GLAPIENTRY
6084 save_Begin(GLenum mode
)
6086 GET_CURRENT_CONTEXT(ctx
);
6088 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6089 /* compile this error into the display list */
6090 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6092 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6093 /* compile this error into the display list */
6094 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6097 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6099 vbo_save_NotifyBegin(ctx
, mode
, false);
6103 static void GLAPIENTRY
6106 GET_CURRENT_CONTEXT(ctx
);
6107 SAVE_FLUSH_VERTICES(ctx
);
6108 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6109 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6110 if (ctx
->ExecuteFlag
) {
6111 CALL_End(ctx
->Exec
, ());
6115 static void GLAPIENTRY
6116 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6118 GET_CURRENT_CONTEXT(ctx
);
6120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6121 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6128 if (ctx
->ExecuteFlag
) {
6129 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6134 static void GLAPIENTRY
6135 save_Vertex2f(GLfloat x
, GLfloat y
)
6137 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6140 static void GLAPIENTRY
6141 save_Vertex2fv(const GLfloat
* v
)
6143 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6146 static void GLAPIENTRY
6147 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6149 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6152 static void GLAPIENTRY
6153 save_Vertex3fv(const GLfloat
* v
)
6155 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6158 static void GLAPIENTRY
6159 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6161 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6164 static void GLAPIENTRY
6165 save_Vertex4fv(const GLfloat
* v
)
6167 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6170 static void GLAPIENTRY
6171 save_TexCoord1f(GLfloat x
)
6173 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6176 static void GLAPIENTRY
6177 save_TexCoord1fv(const GLfloat
* v
)
6179 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6182 static void GLAPIENTRY
6183 save_TexCoord2f(GLfloat x
, GLfloat y
)
6185 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6188 static void GLAPIENTRY
6189 save_TexCoord2fv(const GLfloat
* v
)
6191 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6194 static void GLAPIENTRY
6195 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6197 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6200 static void GLAPIENTRY
6201 save_TexCoord3fv(const GLfloat
* v
)
6203 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6206 static void GLAPIENTRY
6207 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6209 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6212 static void GLAPIENTRY
6213 save_TexCoord4fv(const GLfloat
* v
)
6215 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6218 static void GLAPIENTRY
6219 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6221 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6224 static void GLAPIENTRY
6225 save_Normal3fv(const GLfloat
* v
)
6227 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6230 static void GLAPIENTRY
6231 save_FogCoordfEXT(GLfloat x
)
6233 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6236 static void GLAPIENTRY
6237 save_FogCoordfvEXT(const GLfloat
* v
)
6239 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6242 static void GLAPIENTRY
6243 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6245 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6248 static void GLAPIENTRY
6249 save_Color3fv(const GLfloat
* v
)
6251 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6254 static void GLAPIENTRY
6255 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6257 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6260 static void GLAPIENTRY
6261 save_Color4fv(const GLfloat
* v
)
6263 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6266 static void GLAPIENTRY
6267 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6269 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6272 static void GLAPIENTRY
6273 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6275 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6279 /* Just call the respective ATTR for texcoord
6281 static void GLAPIENTRY
6282 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6284 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6285 save_Attr1fNV(attr
, x
);
6288 static void GLAPIENTRY
6289 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6291 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6292 save_Attr1fNV(attr
, v
[0]);
6295 static void GLAPIENTRY
6296 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6298 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6299 save_Attr2fNV(attr
, x
, y
);
6302 static void GLAPIENTRY
6303 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6305 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6306 save_Attr2fNV(attr
, v
[0], v
[1]);
6309 static void GLAPIENTRY
6310 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6312 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6313 save_Attr3fNV(attr
, x
, y
, z
);
6316 static void GLAPIENTRY
6317 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6319 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6320 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6323 static void GLAPIENTRY
6324 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6325 GLfloat z
, GLfloat w
)
6327 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6328 save_Attr4fNV(attr
, x
, y
, z
, w
);
6331 static void GLAPIENTRY
6332 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6334 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6335 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6340 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6346 GET_CURRENT_CONTEXT(ctx
);
6347 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6352 static void GLAPIENTRY
6353 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6355 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6356 save_Attr1fARB(index
, x
);
6361 static void GLAPIENTRY
6362 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6364 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6365 save_Attr1fARB(index
, v
[0]);
6370 static void GLAPIENTRY
6371 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6373 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6374 save_Attr2fARB(index
, x
, y
);
6379 static void GLAPIENTRY
6380 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6382 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6383 save_Attr2fARB(index
, v
[0], v
[1]);
6388 static void GLAPIENTRY
6389 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6391 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6392 save_Attr3fARB(index
, x
, y
, z
);
6397 static void GLAPIENTRY
6398 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6400 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6401 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6406 static void GLAPIENTRY
6407 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6410 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6411 save_Attr4fARB(index
, x
, y
, z
, w
);
6416 static void GLAPIENTRY
6417 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6419 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6420 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6425 static void GLAPIENTRY
6426 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6428 GET_CURRENT_CONTEXT(ctx
);
6430 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6432 SAVE_FLUSH_VERTICES(ctx
);
6433 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6436 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6439 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6440 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6442 if (ctx
->ExecuteFlag
) {
6443 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6450 static void GLAPIENTRY
6451 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6453 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6454 save_VertexAttribL1d(index
, v
[0]);
6459 static void GLAPIENTRY
6460 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6462 GET_CURRENT_CONTEXT(ctx
);
6464 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6466 SAVE_FLUSH_VERTICES(ctx
);
6467 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6470 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6471 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6474 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6475 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6476 2 * sizeof(GLdouble
));
6478 if (ctx
->ExecuteFlag
) {
6479 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6486 static void GLAPIENTRY
6487 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6489 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6490 save_VertexAttribL2d(index
, v
[0], v
[1]);
6495 static void GLAPIENTRY
6496 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6498 GET_CURRENT_CONTEXT(ctx
);
6500 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6502 SAVE_FLUSH_VERTICES(ctx
);
6503 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6506 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6507 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6508 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6511 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6512 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6513 3 * sizeof(GLdouble
));
6515 if (ctx
->ExecuteFlag
) {
6516 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6523 static void GLAPIENTRY
6524 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6526 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6527 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6532 static void GLAPIENTRY
6533 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6536 GET_CURRENT_CONTEXT(ctx
);
6538 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6540 SAVE_FLUSH_VERTICES(ctx
);
6541 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6544 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6545 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6546 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6547 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6550 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6551 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6552 4 * sizeof(GLdouble
));
6554 if (ctx
->ExecuteFlag
) {
6555 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6562 static void GLAPIENTRY
6563 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6565 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6566 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6571 static void GLAPIENTRY
6572 save_PrimitiveRestartNV(void)
6574 /* Note: this is used when outside a glBegin/End pair in a display list */
6575 GET_CURRENT_CONTEXT(ctx
);
6576 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6577 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6578 if (ctx
->ExecuteFlag
) {
6579 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6584 static void GLAPIENTRY
6585 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6586 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6587 GLbitfield mask
, GLenum filter
)
6589 GET_CURRENT_CONTEXT(ctx
);
6591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6592 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6605 if (ctx
->ExecuteFlag
) {
6606 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6607 dstX0
, dstY0
, dstX1
, dstY1
,
6613 /** GL_EXT_provoking_vertex */
6614 static void GLAPIENTRY
6615 save_ProvokingVertexEXT(GLenum mode
)
6617 GET_CURRENT_CONTEXT(ctx
);
6619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6620 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6624 if (ctx
->ExecuteFlag
) {
6625 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6626 _mesa_ProvokingVertex(mode
);
6631 /** GL_EXT_transform_feedback */
6632 static void GLAPIENTRY
6633 save_BeginTransformFeedback(GLenum mode
)
6635 GET_CURRENT_CONTEXT(ctx
);
6637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6638 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6642 if (ctx
->ExecuteFlag
) {
6643 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6648 /** GL_EXT_transform_feedback */
6649 static void GLAPIENTRY
6650 save_EndTransformFeedback(void)
6652 GET_CURRENT_CONTEXT(ctx
);
6653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6654 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6655 if (ctx
->ExecuteFlag
) {
6656 CALL_EndTransformFeedback(ctx
->Exec
, ());
6660 static void GLAPIENTRY
6661 save_BindTransformFeedback(GLenum target
, GLuint name
)
6663 GET_CURRENT_CONTEXT(ctx
);
6665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6666 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6671 if (ctx
->ExecuteFlag
) {
6672 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6676 static void GLAPIENTRY
6677 save_PauseTransformFeedback(void)
6679 GET_CURRENT_CONTEXT(ctx
);
6680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6681 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6682 if (ctx
->ExecuteFlag
) {
6683 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6687 static void GLAPIENTRY
6688 save_ResumeTransformFeedback(void)
6690 GET_CURRENT_CONTEXT(ctx
);
6691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6692 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6693 if (ctx
->ExecuteFlag
) {
6694 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6698 static void GLAPIENTRY
6699 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6701 GET_CURRENT_CONTEXT(ctx
);
6703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6704 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6709 if (ctx
->ExecuteFlag
) {
6710 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6714 static void GLAPIENTRY
6715 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6717 GET_CURRENT_CONTEXT(ctx
);
6719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6720 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6726 if (ctx
->ExecuteFlag
) {
6727 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6731 static void GLAPIENTRY
6732 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6735 GET_CURRENT_CONTEXT(ctx
);
6737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6738 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6742 n
[3].si
= primcount
;
6744 if (ctx
->ExecuteFlag
) {
6745 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6749 static void GLAPIENTRY
6750 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6751 GLuint stream
, GLsizei primcount
)
6753 GET_CURRENT_CONTEXT(ctx
);
6755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6756 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6761 n
[4].si
= primcount
;
6763 if (ctx
->ExecuteFlag
) {
6764 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6769 static void GLAPIENTRY
6770 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6771 GLuint num_groups_z
)
6773 GET_CURRENT_CONTEXT(ctx
);
6775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6776 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6778 n
[1].ui
= num_groups_x
;
6779 n
[2].ui
= num_groups_y
;
6780 n
[3].ui
= num_groups_z
;
6782 if (ctx
->ExecuteFlag
) {
6783 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6788 static void GLAPIENTRY
6789 save_DispatchComputeIndirect(GLintptr indirect
)
6791 GET_CURRENT_CONTEXT(ctx
);
6792 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6793 "glDispatchComputeIndirect() during display list compile");
6796 static void GLAPIENTRY
6797 save_UseProgram(GLuint program
)
6799 GET_CURRENT_CONTEXT(ctx
);
6801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6802 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6806 if (ctx
->ExecuteFlag
) {
6807 CALL_UseProgram(ctx
->Exec
, (program
));
6812 static void GLAPIENTRY
6813 save_Uniform1fARB(GLint location
, GLfloat x
)
6815 GET_CURRENT_CONTEXT(ctx
);
6817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6818 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6823 if (ctx
->ExecuteFlag
) {
6824 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6829 static void GLAPIENTRY
6830 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6832 GET_CURRENT_CONTEXT(ctx
);
6834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6835 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6841 if (ctx
->ExecuteFlag
) {
6842 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6847 static void GLAPIENTRY
6848 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6850 GET_CURRENT_CONTEXT(ctx
);
6852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6853 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6860 if (ctx
->ExecuteFlag
) {
6861 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6866 static void GLAPIENTRY
6867 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6869 GET_CURRENT_CONTEXT(ctx
);
6871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6872 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6880 if (ctx
->ExecuteFlag
) {
6881 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6886 static void GLAPIENTRY
6887 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6889 GET_CURRENT_CONTEXT(ctx
);
6891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6892 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6896 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6898 if (ctx
->ExecuteFlag
) {
6899 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6903 static void GLAPIENTRY
6904 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6906 GET_CURRENT_CONTEXT(ctx
);
6908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6909 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6913 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6915 if (ctx
->ExecuteFlag
) {
6916 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6920 static void GLAPIENTRY
6921 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6923 GET_CURRENT_CONTEXT(ctx
);
6925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6926 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6930 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6932 if (ctx
->ExecuteFlag
) {
6933 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6937 static void GLAPIENTRY
6938 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6940 GET_CURRENT_CONTEXT(ctx
);
6942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6943 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6947 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6949 if (ctx
->ExecuteFlag
) {
6950 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6955 static void GLAPIENTRY
6956 save_Uniform1d(GLint location
, GLdouble x
)
6958 GET_CURRENT_CONTEXT(ctx
);
6960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6961 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
6964 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6966 if (ctx
->ExecuteFlag
) {
6967 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
6972 static void GLAPIENTRY
6973 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
6975 GET_CURRENT_CONTEXT(ctx
);
6977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6978 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
6981 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6982 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6984 if (ctx
->ExecuteFlag
) {
6985 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
6990 static void GLAPIENTRY
6991 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
6993 GET_CURRENT_CONTEXT(ctx
);
6995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6996 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
6999 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7000 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7001 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7003 if (ctx
->ExecuteFlag
) {
7004 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7009 static void GLAPIENTRY
7010 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7012 GET_CURRENT_CONTEXT(ctx
);
7014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7015 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7018 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7019 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7020 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7021 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7023 if (ctx
->ExecuteFlag
) {
7024 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7029 static void GLAPIENTRY
7030 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7032 GET_CURRENT_CONTEXT(ctx
);
7034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7035 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7039 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7041 if (ctx
->ExecuteFlag
) {
7042 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7047 static void GLAPIENTRY
7048 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7050 GET_CURRENT_CONTEXT(ctx
);
7052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7053 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7057 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7059 if (ctx
->ExecuteFlag
) {
7060 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7065 static void GLAPIENTRY
7066 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7068 GET_CURRENT_CONTEXT(ctx
);
7070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7071 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7075 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7077 if (ctx
->ExecuteFlag
) {
7078 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7083 static void GLAPIENTRY
7084 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7086 GET_CURRENT_CONTEXT(ctx
);
7088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7089 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7093 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7095 if (ctx
->ExecuteFlag
) {
7096 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7101 static void GLAPIENTRY
7102 save_Uniform1iARB(GLint location
, GLint x
)
7104 GET_CURRENT_CONTEXT(ctx
);
7106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7107 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7112 if (ctx
->ExecuteFlag
) {
7113 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7117 static void GLAPIENTRY
7118 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7120 GET_CURRENT_CONTEXT(ctx
);
7122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7123 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7129 if (ctx
->ExecuteFlag
) {
7130 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7134 static void GLAPIENTRY
7135 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7137 GET_CURRENT_CONTEXT(ctx
);
7139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7140 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7147 if (ctx
->ExecuteFlag
) {
7148 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7152 static void GLAPIENTRY
7153 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7155 GET_CURRENT_CONTEXT(ctx
);
7157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7158 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7166 if (ctx
->ExecuteFlag
) {
7167 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7173 static void GLAPIENTRY
7174 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7176 GET_CURRENT_CONTEXT(ctx
);
7178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7179 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7183 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7185 if (ctx
->ExecuteFlag
) {
7186 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7190 static void GLAPIENTRY
7191 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7193 GET_CURRENT_CONTEXT(ctx
);
7195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7196 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7200 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7202 if (ctx
->ExecuteFlag
) {
7203 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7207 static void GLAPIENTRY
7208 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7210 GET_CURRENT_CONTEXT(ctx
);
7212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7213 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7217 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7219 if (ctx
->ExecuteFlag
) {
7220 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7224 static void GLAPIENTRY
7225 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7227 GET_CURRENT_CONTEXT(ctx
);
7229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7230 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7234 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7236 if (ctx
->ExecuteFlag
) {
7237 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7243 static void GLAPIENTRY
7244 save_Uniform1ui(GLint location
, GLuint x
)
7246 GET_CURRENT_CONTEXT(ctx
);
7248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7249 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7254 if (ctx
->ExecuteFlag
) {
7255 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7259 static void GLAPIENTRY
7260 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7262 GET_CURRENT_CONTEXT(ctx
);
7264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7265 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7271 if (ctx
->ExecuteFlag
) {
7272 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7276 static void GLAPIENTRY
7277 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7279 GET_CURRENT_CONTEXT(ctx
);
7281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7282 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7289 if (ctx
->ExecuteFlag
) {
7290 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7294 static void GLAPIENTRY
7295 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7297 GET_CURRENT_CONTEXT(ctx
);
7299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7300 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7308 if (ctx
->ExecuteFlag
) {
7309 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7315 static void GLAPIENTRY
7316 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7318 GET_CURRENT_CONTEXT(ctx
);
7320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7321 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7325 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7327 if (ctx
->ExecuteFlag
) {
7328 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7332 static void GLAPIENTRY
7333 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7335 GET_CURRENT_CONTEXT(ctx
);
7337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7338 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7342 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7344 if (ctx
->ExecuteFlag
) {
7345 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7349 static void GLAPIENTRY
7350 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7352 GET_CURRENT_CONTEXT(ctx
);
7354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7355 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7359 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7361 if (ctx
->ExecuteFlag
) {
7362 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7366 static void GLAPIENTRY
7367 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7369 GET_CURRENT_CONTEXT(ctx
);
7371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7372 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7376 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7378 if (ctx
->ExecuteFlag
) {
7379 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7385 static void GLAPIENTRY
7386 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7389 GET_CURRENT_CONTEXT(ctx
);
7391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7392 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7397 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7399 if (ctx
->ExecuteFlag
) {
7400 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7404 static void GLAPIENTRY
7405 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7408 GET_CURRENT_CONTEXT(ctx
);
7410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7411 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7416 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7418 if (ctx
->ExecuteFlag
) {
7419 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7423 static void GLAPIENTRY
7424 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7427 GET_CURRENT_CONTEXT(ctx
);
7429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7430 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7435 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7437 if (ctx
->ExecuteFlag
) {
7438 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7443 static void GLAPIENTRY
7444 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7447 GET_CURRENT_CONTEXT(ctx
);
7449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7450 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7455 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7457 if (ctx
->ExecuteFlag
) {
7458 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7462 static void GLAPIENTRY
7463 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7466 GET_CURRENT_CONTEXT(ctx
);
7468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7469 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7474 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7476 if (ctx
->ExecuteFlag
) {
7477 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7482 static void GLAPIENTRY
7483 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7486 GET_CURRENT_CONTEXT(ctx
);
7488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7489 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7494 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7496 if (ctx
->ExecuteFlag
) {
7497 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7501 static void GLAPIENTRY
7502 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7505 GET_CURRENT_CONTEXT(ctx
);
7507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7508 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7513 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7515 if (ctx
->ExecuteFlag
) {
7516 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7521 static void GLAPIENTRY
7522 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7525 GET_CURRENT_CONTEXT(ctx
);
7527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7528 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7533 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7535 if (ctx
->ExecuteFlag
) {
7536 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7540 static void GLAPIENTRY
7541 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7544 GET_CURRENT_CONTEXT(ctx
);
7546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7547 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7552 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7554 if (ctx
->ExecuteFlag
) {
7555 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7560 static void GLAPIENTRY
7561 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7564 GET_CURRENT_CONTEXT(ctx
);
7566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7567 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7572 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7574 if (ctx
->ExecuteFlag
) {
7575 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7579 static void GLAPIENTRY
7580 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7583 GET_CURRENT_CONTEXT(ctx
);
7585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7586 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7591 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7593 if (ctx
->ExecuteFlag
) {
7594 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7598 static void GLAPIENTRY
7599 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7602 GET_CURRENT_CONTEXT(ctx
);
7604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7605 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7610 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7612 if (ctx
->ExecuteFlag
) {
7613 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7618 static void GLAPIENTRY
7619 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7622 GET_CURRENT_CONTEXT(ctx
);
7624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7625 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7630 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7632 if (ctx
->ExecuteFlag
) {
7633 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7638 static void GLAPIENTRY
7639 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7642 GET_CURRENT_CONTEXT(ctx
);
7644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7645 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7650 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7652 if (ctx
->ExecuteFlag
) {
7653 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7658 static void GLAPIENTRY
7659 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7662 GET_CURRENT_CONTEXT(ctx
);
7664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7665 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7670 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7672 if (ctx
->ExecuteFlag
) {
7673 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7677 static void GLAPIENTRY
7678 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7681 GET_CURRENT_CONTEXT(ctx
);
7683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7684 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7689 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7691 if (ctx
->ExecuteFlag
) {
7692 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7697 static void GLAPIENTRY
7698 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7701 GET_CURRENT_CONTEXT(ctx
);
7703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7704 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7709 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7711 if (ctx
->ExecuteFlag
) {
7712 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7717 static void GLAPIENTRY
7718 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7721 GET_CURRENT_CONTEXT(ctx
);
7723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7724 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7729 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7731 if (ctx
->ExecuteFlag
) {
7732 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7737 static void GLAPIENTRY
7738 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7740 GET_CURRENT_CONTEXT(ctx
);
7742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7743 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7749 if (ctx
->ExecuteFlag
) {
7750 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7754 static void GLAPIENTRY
7755 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7757 GET_CURRENT_CONTEXT(ctx
);
7759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7760 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7766 if (ctx
->ExecuteFlag
) {
7767 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7771 static void GLAPIENTRY
7772 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7774 GET_CURRENT_CONTEXT(ctx
);
7776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7777 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7784 if (ctx
->ExecuteFlag
) {
7785 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7789 static void GLAPIENTRY
7790 save_ProgramUniform3f(GLuint program
, GLint location
,
7791 GLfloat x
, GLfloat y
, GLfloat z
)
7793 GET_CURRENT_CONTEXT(ctx
);
7795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7796 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7804 if (ctx
->ExecuteFlag
) {
7805 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7809 static void GLAPIENTRY
7810 save_ProgramUniform4f(GLuint program
, GLint location
,
7811 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7813 GET_CURRENT_CONTEXT(ctx
);
7815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7816 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7825 if (ctx
->ExecuteFlag
) {
7826 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7830 static void GLAPIENTRY
7831 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7834 GET_CURRENT_CONTEXT(ctx
);
7836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7837 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7842 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7844 if (ctx
->ExecuteFlag
) {
7845 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7849 static void GLAPIENTRY
7850 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7853 GET_CURRENT_CONTEXT(ctx
);
7855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7856 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7861 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7863 if (ctx
->ExecuteFlag
) {
7864 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7868 static void GLAPIENTRY
7869 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7872 GET_CURRENT_CONTEXT(ctx
);
7874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7875 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7880 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7882 if (ctx
->ExecuteFlag
) {
7883 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7887 static void GLAPIENTRY
7888 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7891 GET_CURRENT_CONTEXT(ctx
);
7893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7894 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7899 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7901 if (ctx
->ExecuteFlag
) {
7902 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7906 static void GLAPIENTRY
7907 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7909 GET_CURRENT_CONTEXT(ctx
);
7911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7912 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7916 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7918 if (ctx
->ExecuteFlag
) {
7919 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7923 static void GLAPIENTRY
7924 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7926 GET_CURRENT_CONTEXT(ctx
);
7928 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7929 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7933 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7934 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7936 if (ctx
->ExecuteFlag
) {
7937 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7941 static void GLAPIENTRY
7942 save_ProgramUniform3d(GLuint program
, GLint location
,
7943 GLdouble x
, GLdouble y
, GLdouble z
)
7945 GET_CURRENT_CONTEXT(ctx
);
7947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7948 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
7952 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7953 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7954 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7956 if (ctx
->ExecuteFlag
) {
7957 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
7961 static void GLAPIENTRY
7962 save_ProgramUniform4d(GLuint program
, GLint location
,
7963 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7965 GET_CURRENT_CONTEXT(ctx
);
7967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7968 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
7972 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7973 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7974 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
7975 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
7977 if (ctx
->ExecuteFlag
) {
7978 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7982 static void GLAPIENTRY
7983 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
7986 GET_CURRENT_CONTEXT(ctx
);
7988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7989 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
7994 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7996 if (ctx
->ExecuteFlag
) {
7997 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8001 static void GLAPIENTRY
8002 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8005 GET_CURRENT_CONTEXT(ctx
);
8007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8008 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8013 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8015 if (ctx
->ExecuteFlag
) {
8016 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8020 static void GLAPIENTRY
8021 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8024 GET_CURRENT_CONTEXT(ctx
);
8026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8027 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8032 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8034 if (ctx
->ExecuteFlag
) {
8035 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8039 static void GLAPIENTRY
8040 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8043 GET_CURRENT_CONTEXT(ctx
);
8045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8046 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8051 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8053 if (ctx
->ExecuteFlag
) {
8054 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8058 static void GLAPIENTRY
8059 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8061 GET_CURRENT_CONTEXT(ctx
);
8063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8064 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8070 if (ctx
->ExecuteFlag
) {
8071 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8075 static void GLAPIENTRY
8076 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8078 GET_CURRENT_CONTEXT(ctx
);
8080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8081 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8088 if (ctx
->ExecuteFlag
) {
8089 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8093 static void GLAPIENTRY
8094 save_ProgramUniform3i(GLuint program
, GLint location
,
8095 GLint x
, GLint y
, GLint z
)
8097 GET_CURRENT_CONTEXT(ctx
);
8099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8100 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8108 if (ctx
->ExecuteFlag
) {
8109 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8113 static void GLAPIENTRY
8114 save_ProgramUniform4i(GLuint program
, GLint location
,
8115 GLint x
, GLint y
, GLint z
, GLint w
)
8117 GET_CURRENT_CONTEXT(ctx
);
8119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8120 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8129 if (ctx
->ExecuteFlag
) {
8130 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8134 static void GLAPIENTRY
8135 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8138 GET_CURRENT_CONTEXT(ctx
);
8140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8141 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8146 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8148 if (ctx
->ExecuteFlag
) {
8149 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8153 static void GLAPIENTRY
8154 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8157 GET_CURRENT_CONTEXT(ctx
);
8159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8160 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8165 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8167 if (ctx
->ExecuteFlag
) {
8168 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8172 static void GLAPIENTRY
8173 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8176 GET_CURRENT_CONTEXT(ctx
);
8178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8179 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8184 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8186 if (ctx
->ExecuteFlag
) {
8187 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8191 static void GLAPIENTRY
8192 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8195 GET_CURRENT_CONTEXT(ctx
);
8197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8198 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8203 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8205 if (ctx
->ExecuteFlag
) {
8206 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8210 static void GLAPIENTRY
8211 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8213 GET_CURRENT_CONTEXT(ctx
);
8215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8216 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8222 if (ctx
->ExecuteFlag
) {
8223 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8227 static void GLAPIENTRY
8228 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8230 GET_CURRENT_CONTEXT(ctx
);
8232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8233 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8240 if (ctx
->ExecuteFlag
) {
8241 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8245 static void GLAPIENTRY
8246 save_ProgramUniform3ui(GLuint program
, GLint location
,
8247 GLuint x
, GLuint y
, GLuint z
)
8249 GET_CURRENT_CONTEXT(ctx
);
8251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8252 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8260 if (ctx
->ExecuteFlag
) {
8261 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8265 static void GLAPIENTRY
8266 save_ProgramUniform4ui(GLuint program
, GLint location
,
8267 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8269 GET_CURRENT_CONTEXT(ctx
);
8271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8272 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8281 if (ctx
->ExecuteFlag
) {
8282 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8286 static void GLAPIENTRY
8287 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8290 GET_CURRENT_CONTEXT(ctx
);
8292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8293 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8298 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8300 if (ctx
->ExecuteFlag
) {
8301 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8305 static void GLAPIENTRY
8306 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8309 GET_CURRENT_CONTEXT(ctx
);
8311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8312 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8317 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8319 if (ctx
->ExecuteFlag
) {
8320 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8324 static void GLAPIENTRY
8325 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8328 GET_CURRENT_CONTEXT(ctx
);
8330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8331 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8336 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8338 if (ctx
->ExecuteFlag
) {
8339 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8343 static void GLAPIENTRY
8344 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8347 GET_CURRENT_CONTEXT(ctx
);
8349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8350 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8355 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8357 if (ctx
->ExecuteFlag
) {
8358 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8362 static void GLAPIENTRY
8363 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8364 GLboolean transpose
, const GLfloat
*v
)
8366 GET_CURRENT_CONTEXT(ctx
);
8368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8369 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8370 4 + POINTER_DWORDS
);
8376 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8378 if (ctx
->ExecuteFlag
) {
8379 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8380 (program
, location
, count
, transpose
, v
));
8384 static void GLAPIENTRY
8385 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8386 GLboolean transpose
, const GLfloat
*v
)
8388 GET_CURRENT_CONTEXT(ctx
);
8390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8391 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8392 4 + POINTER_DWORDS
);
8398 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8400 if (ctx
->ExecuteFlag
) {
8401 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8402 (program
, location
, count
, transpose
, v
));
8406 static void GLAPIENTRY
8407 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8408 GLboolean transpose
, const GLfloat
*v
)
8410 GET_CURRENT_CONTEXT(ctx
);
8412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8413 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8414 4 + POINTER_DWORDS
);
8420 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8422 if (ctx
->ExecuteFlag
) {
8423 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8424 (program
, location
, count
, transpose
, v
));
8428 static void GLAPIENTRY
8429 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8430 GLboolean transpose
, const GLfloat
*v
)
8432 GET_CURRENT_CONTEXT(ctx
);
8434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8435 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8436 4 + POINTER_DWORDS
);
8442 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8444 if (ctx
->ExecuteFlag
) {
8445 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8446 (program
, location
, count
, transpose
, v
));
8450 static void GLAPIENTRY
8451 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8452 GLboolean transpose
, const GLfloat
*v
)
8454 GET_CURRENT_CONTEXT(ctx
);
8456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8457 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8458 4 + POINTER_DWORDS
);
8464 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8466 if (ctx
->ExecuteFlag
) {
8467 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8468 (program
, location
, count
, transpose
, v
));
8472 static void GLAPIENTRY
8473 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8474 GLboolean transpose
, const GLfloat
*v
)
8476 GET_CURRENT_CONTEXT(ctx
);
8478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8479 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8480 4 + POINTER_DWORDS
);
8486 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8488 if (ctx
->ExecuteFlag
) {
8489 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8490 (program
, location
, count
, transpose
, v
));
8494 static void GLAPIENTRY
8495 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8496 GLboolean transpose
, const GLfloat
*v
)
8498 GET_CURRENT_CONTEXT(ctx
);
8500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8501 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8502 4 + POINTER_DWORDS
);
8508 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8510 if (ctx
->ExecuteFlag
) {
8511 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8512 (program
, location
, count
, transpose
, v
));
8516 static void GLAPIENTRY
8517 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8518 GLboolean transpose
, const GLfloat
*v
)
8520 GET_CURRENT_CONTEXT(ctx
);
8522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8523 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8524 4 + POINTER_DWORDS
);
8530 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8532 if (ctx
->ExecuteFlag
) {
8533 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8534 (program
, location
, count
, transpose
, v
));
8538 static void GLAPIENTRY
8539 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8540 GLboolean transpose
, const GLfloat
*v
)
8542 GET_CURRENT_CONTEXT(ctx
);
8544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8545 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8546 4 + POINTER_DWORDS
);
8552 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8554 if (ctx
->ExecuteFlag
) {
8555 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8556 (program
, location
, count
, transpose
, v
));
8560 static void GLAPIENTRY
8561 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8562 GLboolean transpose
, const GLdouble
*v
)
8564 GET_CURRENT_CONTEXT(ctx
);
8566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8567 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8568 4 + POINTER_DWORDS
);
8574 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8576 if (ctx
->ExecuteFlag
) {
8577 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8578 (program
, location
, count
, transpose
, v
));
8582 static void GLAPIENTRY
8583 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8584 GLboolean transpose
, const GLdouble
*v
)
8586 GET_CURRENT_CONTEXT(ctx
);
8588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8589 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8590 4 + POINTER_DWORDS
);
8596 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8598 if (ctx
->ExecuteFlag
) {
8599 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8600 (program
, location
, count
, transpose
, v
));
8604 static void GLAPIENTRY
8605 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8606 GLboolean transpose
, const GLdouble
*v
)
8608 GET_CURRENT_CONTEXT(ctx
);
8610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8611 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8612 4 + POINTER_DWORDS
);
8618 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8620 if (ctx
->ExecuteFlag
) {
8621 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8622 (program
, location
, count
, transpose
, v
));
8626 static void GLAPIENTRY
8627 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8628 GLboolean transpose
, const GLdouble
*v
)
8630 GET_CURRENT_CONTEXT(ctx
);
8632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8633 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8634 4 + POINTER_DWORDS
);
8640 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8642 if (ctx
->ExecuteFlag
) {
8643 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8644 (program
, location
, count
, transpose
, v
));
8648 static void GLAPIENTRY
8649 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8650 GLboolean transpose
, const GLdouble
*v
)
8652 GET_CURRENT_CONTEXT(ctx
);
8654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8655 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8656 4 + POINTER_DWORDS
);
8662 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8664 if (ctx
->ExecuteFlag
) {
8665 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8666 (program
, location
, count
, transpose
, v
));
8670 static void GLAPIENTRY
8671 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8672 GLboolean transpose
, const GLdouble
*v
)
8674 GET_CURRENT_CONTEXT(ctx
);
8676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8677 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8678 4 + POINTER_DWORDS
);
8684 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8686 if (ctx
->ExecuteFlag
) {
8687 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8688 (program
, location
, count
, transpose
, v
));
8692 static void GLAPIENTRY
8693 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8694 GLboolean transpose
, const GLdouble
*v
)
8696 GET_CURRENT_CONTEXT(ctx
);
8698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8699 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8700 4 + POINTER_DWORDS
);
8706 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8708 if (ctx
->ExecuteFlag
) {
8709 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8710 (program
, location
, count
, transpose
, v
));
8714 static void GLAPIENTRY
8715 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8716 GLboolean transpose
, const GLdouble
*v
)
8718 GET_CURRENT_CONTEXT(ctx
);
8720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8721 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8722 4 + POINTER_DWORDS
);
8728 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8730 if (ctx
->ExecuteFlag
) {
8731 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8732 (program
, location
, count
, transpose
, v
));
8736 static void GLAPIENTRY
8737 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8738 GLboolean transpose
, const GLdouble
*v
)
8740 GET_CURRENT_CONTEXT(ctx
);
8742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8743 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8744 4 + POINTER_DWORDS
);
8750 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8752 if (ctx
->ExecuteFlag
) {
8753 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8754 (program
, location
, count
, transpose
, v
));
8758 static void GLAPIENTRY
8759 save_ClipControl(GLenum origin
, GLenum depth
)
8761 GET_CURRENT_CONTEXT(ctx
);
8763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8764 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8769 if (ctx
->ExecuteFlag
) {
8770 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8774 static void GLAPIENTRY
8775 save_ClampColorARB(GLenum target
, GLenum clamp
)
8777 GET_CURRENT_CONTEXT(ctx
);
8779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8780 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8785 if (ctx
->ExecuteFlag
) {
8786 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8790 /** GL_EXT_texture_integer */
8791 static void GLAPIENTRY
8792 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8794 GET_CURRENT_CONTEXT(ctx
);
8796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8797 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8804 if (ctx
->ExecuteFlag
) {
8805 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8809 /** GL_EXT_texture_integer */
8810 static void GLAPIENTRY
8811 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8813 GET_CURRENT_CONTEXT(ctx
);
8815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8816 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8823 if (ctx
->ExecuteFlag
) {
8824 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8828 /** GL_EXT_texture_integer */
8829 static void GLAPIENTRY
8830 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8832 GET_CURRENT_CONTEXT(ctx
);
8834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8835 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8844 if (ctx
->ExecuteFlag
) {
8845 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8849 /** GL_EXT_texture_integer */
8850 static void GLAPIENTRY
8851 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8853 GET_CURRENT_CONTEXT(ctx
);
8855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8856 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8860 n
[3].ui
= params
[0];
8861 n
[4].ui
= params
[1];
8862 n
[5].ui
= params
[2];
8863 n
[6].ui
= params
[3];
8865 if (ctx
->ExecuteFlag
) {
8866 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8870 /* GL_ARB_instanced_arrays */
8871 static void GLAPIENTRY
8872 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8874 GET_CURRENT_CONTEXT(ctx
);
8876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8877 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8882 if (ctx
->ExecuteFlag
) {
8883 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8888 /* GL_NV_texture_barrier */
8889 static void GLAPIENTRY
8890 save_TextureBarrierNV(void)
8892 GET_CURRENT_CONTEXT(ctx
);
8893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8894 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8895 if (ctx
->ExecuteFlag
) {
8896 CALL_TextureBarrierNV(ctx
->Exec
, ());
8901 /* GL_ARB_sampler_objects */
8902 static void GLAPIENTRY
8903 save_BindSampler(GLuint unit
, GLuint sampler
)
8906 GET_CURRENT_CONTEXT(ctx
);
8907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8908 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8913 if (ctx
->ExecuteFlag
) {
8914 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8918 static void GLAPIENTRY
8919 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8922 GET_CURRENT_CONTEXT(ctx
);
8923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8924 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8929 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8935 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8938 if (ctx
->ExecuteFlag
) {
8939 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8943 static void GLAPIENTRY
8944 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8948 parray
[1] = parray
[2] = parray
[3] = 0;
8949 save_SamplerParameteriv(sampler
, pname
, parray
);
8952 static void GLAPIENTRY
8953 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
8956 GET_CURRENT_CONTEXT(ctx
);
8957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8958 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
8963 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8969 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
8972 if (ctx
->ExecuteFlag
) {
8973 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
8977 static void GLAPIENTRY
8978 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
8982 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
8983 save_SamplerParameterfv(sampler
, pname
, parray
);
8986 static void GLAPIENTRY
8987 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8990 GET_CURRENT_CONTEXT(ctx
);
8991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8992 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
8997 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9003 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9006 if (ctx
->ExecuteFlag
) {
9007 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9011 static void GLAPIENTRY
9012 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9015 GET_CURRENT_CONTEXT(ctx
);
9016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9017 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9021 n
[3].ui
= params
[0];
9022 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9023 n
[4].ui
= params
[1];
9024 n
[5].ui
= params
[2];
9025 n
[6].ui
= params
[3];
9028 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9031 if (ctx
->ExecuteFlag
) {
9032 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9036 static void GLAPIENTRY
9037 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9040 GET_CURRENT_CONTEXT(ctx
);
9041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9042 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9044 union uint64_pair p
;
9047 n
[2].ui
= p
.uint32
[0];
9048 n
[3].ui
= p
.uint32
[1];
9049 save_pointer(&n
[4], sync
);
9051 if (ctx
->ExecuteFlag
) {
9052 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9057 /** GL_NV_conditional_render */
9058 static void GLAPIENTRY
9059 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9061 GET_CURRENT_CONTEXT(ctx
);
9063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9064 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9069 if (ctx
->ExecuteFlag
) {
9070 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9074 static void GLAPIENTRY
9075 save_EndConditionalRender(void)
9077 GET_CURRENT_CONTEXT(ctx
);
9078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9079 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9080 if (ctx
->ExecuteFlag
) {
9081 CALL_EndConditionalRender(ctx
->Exec
, ());
9085 static void GLAPIENTRY
9086 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9088 GET_CURRENT_CONTEXT(ctx
);
9090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9091 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9097 if (ctx
->ExecuteFlag
) {
9098 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9102 static void GLAPIENTRY
9103 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9104 const GLuint
*indices
)
9106 GET_CURRENT_CONTEXT(ctx
);
9108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9109 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9111 GLint
*indices_copy
= NULL
;
9114 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9115 n
[1].e
= shadertype
;
9117 save_pointer(&n
[3], indices_copy
);
9119 if (ctx
->ExecuteFlag
) {
9120 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9124 /** GL_EXT_window_rectangles */
9125 static void GLAPIENTRY
9126 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9128 GET_CURRENT_CONTEXT(ctx
);
9130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9131 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9133 GLint
*box_copy
= NULL
;
9136 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9139 save_pointer(&n
[3], box_copy
);
9141 if (ctx
->ExecuteFlag
) {
9142 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9147 /** GL_NV_conservative_raster */
9148 static void GLAPIENTRY
9149 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9151 GET_CURRENT_CONTEXT(ctx
);
9153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9154 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9159 if (ctx
->ExecuteFlag
) {
9160 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9164 /** GL_NV_conservative_raster_dilate */
9165 static void GLAPIENTRY
9166 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9168 GET_CURRENT_CONTEXT(ctx
);
9170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9171 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9176 if (ctx
->ExecuteFlag
) {
9177 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9181 /** GL_NV_conservative_raster_pre_snap_triangles */
9182 static void GLAPIENTRY
9183 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9185 GET_CURRENT_CONTEXT(ctx
);
9187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9188 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9193 if (ctx
->ExecuteFlag
) {
9194 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9200 * Save an error-generating command into display list.
9202 * KW: Will appear in the list before the vertex buffer containing the
9203 * command that provoked the error. I don't see this as a problem.
9206 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9209 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
9212 save_pointer(&n
[2], (void *) s
);
9213 /* note: the data/string here doesn't have to be freed in
9214 * _mesa_delete_list() since the string is never dynamically
9222 * Compile an error into current display list.
9225 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9227 if (ctx
->CompileFlag
)
9228 save_error(ctx
, error
, s
);
9229 if (ctx
->ExecuteFlag
)
9230 _mesa_error(ctx
, error
, "%s", s
);
9235 * Test if ID names a display list.
9238 islist(struct gl_context
*ctx
, GLuint list
)
9240 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
9250 /**********************************************************************/
9251 /* Display list execution */
9252 /**********************************************************************/
9256 * Execute a display list. Note that the ListBase offset must have already
9257 * been added before calling this function. I.e. the list argument is
9258 * the absolute list number, not relative to ListBase.
9259 * \param list - display list number
9262 execute_list(struct gl_context
*ctx
, GLuint list
)
9264 struct gl_display_list
*dlist
;
9268 if (list
== 0 || !islist(ctx
, list
))
9271 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
9272 /* raise an error? */
9276 dlist
= _mesa_lookup_list(ctx
, list
);
9280 ctx
->ListState
.CallDepth
++;
9282 vbo_save_BeginCallList(ctx
, dlist
);
9288 const OpCode opcode
= n
[0].opcode
;
9290 if (is_ext_opcode(opcode
)) {
9291 n
+= ext_opcode_execute(ctx
, n
);
9296 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
9299 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9301 case OPCODE_ALPHA_FUNC
:
9302 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9304 case OPCODE_BIND_TEXTURE
:
9305 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9309 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9310 ctx
->Unpack
= ctx
->DefaultPacking
;
9311 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
9312 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
9313 get_pointer(&n
[7])));
9314 ctx
->Unpack
= save
; /* restore */
9317 case OPCODE_BLEND_COLOR
:
9318 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9320 case OPCODE_BLEND_EQUATION
:
9321 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
9323 case OPCODE_BLEND_EQUATION_SEPARATE
:
9324 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9326 case OPCODE_BLEND_FUNC_SEPARATE
:
9327 CALL_BlendFuncSeparate(ctx
->Exec
,
9328 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
9331 case OPCODE_BLEND_FUNC_I
:
9332 /* GL_ARB_draw_buffers_blend */
9333 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
9335 case OPCODE_BLEND_FUNC_SEPARATE_I
:
9336 /* GL_ARB_draw_buffers_blend */
9337 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
9340 case OPCODE_BLEND_EQUATION_I
:
9341 /* GL_ARB_draw_buffers_blend */
9342 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9344 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
9345 /* GL_ARB_draw_buffers_blend */
9346 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
9347 (n
[1].ui
, n
[2].e
, n
[3].e
));
9350 case OPCODE_CALL_LIST
:
9351 /* Generated by glCallList(), don't add ListBase */
9352 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9353 execute_list(ctx
, n
[1].ui
);
9356 case OPCODE_CALL_LISTS
:
9357 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
9358 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
9362 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
9364 case OPCODE_CLEAR_BUFFER_IV
:
9371 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9374 case OPCODE_CLEAR_BUFFER_UIV
:
9381 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9384 case OPCODE_CLEAR_BUFFER_FV
:
9391 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
9394 case OPCODE_CLEAR_BUFFER_FI
:
9395 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
9397 case OPCODE_CLEAR_COLOR
:
9398 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9400 case OPCODE_CLEAR_ACCUM
:
9401 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9403 case OPCODE_CLEAR_DEPTH
:
9404 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
9406 case OPCODE_CLEAR_INDEX
:
9407 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
9409 case OPCODE_CLEAR_STENCIL
:
9410 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
9412 case OPCODE_CLIP_PLANE
:
9419 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
9422 case OPCODE_COLOR_MASK
:
9423 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
9425 case OPCODE_COLOR_MASK_INDEXED
:
9426 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
9429 case OPCODE_COLOR_MATERIAL
:
9430 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9432 case OPCODE_COPY_PIXELS
:
9433 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
9434 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
9437 case OPCODE_COPY_TEX_IMAGE1D
:
9438 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9439 n
[5].i
, n
[6].i
, n
[7].i
));
9441 case OPCODE_COPY_TEX_IMAGE2D
:
9442 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
9443 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
9445 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
9446 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9447 n
[4].i
, n
[5].i
, n
[6].i
));
9449 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
9450 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9451 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9454 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
9455 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9456 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9459 case OPCODE_CULL_FACE
:
9460 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
9462 case OPCODE_DEPTH_FUNC
:
9463 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
9465 case OPCODE_DEPTH_MASK
:
9466 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
9468 case OPCODE_DEPTH_RANGE
:
9469 CALL_DepthRange(ctx
->Exec
,
9470 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
9472 case OPCODE_DISABLE
:
9473 CALL_Disable(ctx
->Exec
, (n
[1].e
));
9475 case OPCODE_DISABLE_INDEXED
:
9476 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9478 case OPCODE_DRAW_BUFFER
:
9479 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
9481 case OPCODE_DRAW_PIXELS
:
9483 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9484 ctx
->Unpack
= ctx
->DefaultPacking
;
9485 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
9486 get_pointer(&n
[5])));
9487 ctx
->Unpack
= save
; /* restore */
9491 CALL_Enable(ctx
->Exec
, (n
[1].e
));
9493 case OPCODE_ENABLE_INDEXED
:
9494 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9496 case OPCODE_EVALMESH1
:
9497 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
9499 case OPCODE_EVALMESH2
:
9500 CALL_EvalMesh2(ctx
->Exec
,
9501 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
9510 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
9513 case OPCODE_FRONT_FACE
:
9514 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
9516 case OPCODE_FRUSTUM
:
9517 CALL_Frustum(ctx
->Exec
,
9518 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9521 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9523 case OPCODE_INDEX_MASK
:
9524 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
9526 case OPCODE_INIT_NAMES
:
9527 CALL_InitNames(ctx
->Exec
, ());
9536 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
9539 case OPCODE_LIGHT_MODEL
:
9546 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
9549 case OPCODE_LINE_STIPPLE
:
9550 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
9552 case OPCODE_LINE_WIDTH
:
9553 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
9555 case OPCODE_LIST_BASE
:
9556 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
9558 case OPCODE_LOAD_IDENTITY
:
9559 CALL_LoadIdentity(ctx
->Exec
, ());
9561 case OPCODE_LOAD_MATRIX
:
9562 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
9563 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
9565 case OPCODE_LOAD_NAME
:
9566 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
9568 case OPCODE_LOGIC_OP
:
9569 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
9573 GLenum target
= n
[1].e
;
9574 GLint ustride
= _mesa_evaluator_components(target
);
9575 GLint uorder
= n
[5].i
;
9576 GLfloat u1
= n
[2].f
;
9577 GLfloat u2
= n
[3].f
;
9578 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9579 (GLfloat
*) get_pointer(&n
[6])));
9584 GLenum target
= n
[1].e
;
9585 GLfloat u1
= n
[2].f
;
9586 GLfloat u2
= n
[3].f
;
9587 GLfloat v1
= n
[4].f
;
9588 GLfloat v2
= n
[5].f
;
9589 GLint ustride
= n
[6].i
;
9590 GLint vstride
= n
[7].i
;
9591 GLint uorder
= n
[8].i
;
9592 GLint vorder
= n
[9].i
;
9593 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
9594 v1
, v2
, vstride
, vorder
,
9595 (GLfloat
*) get_pointer(&n
[10])));
9598 case OPCODE_MAPGRID1
:
9599 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
9601 case OPCODE_MAPGRID2
:
9602 CALL_MapGrid2f(ctx
->Exec
,
9603 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
9605 case OPCODE_MATRIX_MODE
:
9606 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
9608 case OPCODE_MULT_MATRIX
:
9609 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
9612 CALL_Ortho(ctx
->Exec
,
9613 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
9615 case OPCODE_PASSTHROUGH
:
9616 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
9618 case OPCODE_PATCH_PARAMETER_I
:
9619 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
9621 case OPCODE_PATCH_PARAMETER_FV_INNER
:
9626 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9629 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
9636 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9639 case OPCODE_PIXEL_MAP
:
9640 CALL_PixelMapfv(ctx
->Exec
,
9641 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
9643 case OPCODE_PIXEL_TRANSFER
:
9644 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
9646 case OPCODE_PIXEL_ZOOM
:
9647 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9649 case OPCODE_POINT_SIZE
:
9650 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
9652 case OPCODE_POINT_PARAMETERS
:
9658 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
9661 case OPCODE_POLYGON_MODE
:
9662 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
9664 case OPCODE_POLYGON_STIPPLE
:
9666 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9667 ctx
->Unpack
= ctx
->DefaultPacking
;
9668 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
9669 ctx
->Unpack
= save
; /* restore */
9672 case OPCODE_POLYGON_OFFSET
:
9673 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9675 case OPCODE_POLYGON_OFFSET_CLAMP
:
9676 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9678 case OPCODE_POP_ATTRIB
:
9679 CALL_PopAttrib(ctx
->Exec
, ());
9681 case OPCODE_POP_MATRIX
:
9682 CALL_PopMatrix(ctx
->Exec
, ());
9684 case OPCODE_POP_NAME
:
9685 CALL_PopName(ctx
->Exec
, ());
9687 case OPCODE_PRIORITIZE_TEXTURE
:
9688 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
9690 case OPCODE_PUSH_ATTRIB
:
9691 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
9693 case OPCODE_PUSH_MATRIX
:
9694 CALL_PushMatrix(ctx
->Exec
, ());
9696 case OPCODE_PUSH_NAME
:
9697 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
9699 case OPCODE_RASTER_POS
:
9700 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9702 case OPCODE_READ_BUFFER
:
9703 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
9706 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9709 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9711 case OPCODE_SCISSOR
:
9712 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
9714 case OPCODE_SHADE_MODEL
:
9715 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
9717 case OPCODE_PROVOKING_VERTEX
:
9718 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
9720 case OPCODE_STENCIL_FUNC
:
9721 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
9723 case OPCODE_STENCIL_MASK
:
9724 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
9726 case OPCODE_STENCIL_OP
:
9727 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
9729 case OPCODE_STENCIL_FUNC_SEPARATE
:
9730 CALL_StencilFuncSeparate(ctx
->Exec
,
9731 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
9733 case OPCODE_STENCIL_MASK_SEPARATE
:
9734 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9736 case OPCODE_STENCIL_OP_SEPARATE
:
9737 CALL_StencilOpSeparate(ctx
->Exec
,
9738 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
9747 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9757 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9760 case OPCODE_TEXPARAMETER
:
9767 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
9770 case OPCODE_TEX_IMAGE1D
:
9772 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9773 ctx
->Unpack
= ctx
->DefaultPacking
;
9774 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
9776 n
[3].i
, /* components */
9778 n
[5].e
, /* border */
9779 n
[6].e
, /* format */
9781 get_pointer(&n
[8])));
9782 ctx
->Unpack
= save
; /* restore */
9785 case OPCODE_TEX_IMAGE2D
:
9787 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9788 ctx
->Unpack
= ctx
->DefaultPacking
;
9789 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
9791 n
[3].i
, /* components */
9793 n
[5].i
, /* height */
9794 n
[6].e
, /* border */
9795 n
[7].e
, /* format */
9797 get_pointer(&n
[9])));
9798 ctx
->Unpack
= save
; /* restore */
9801 case OPCODE_TEX_IMAGE3D
:
9803 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9804 ctx
->Unpack
= ctx
->DefaultPacking
;
9805 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
9807 n
[3].i
, /* components */
9809 n
[5].i
, /* height */
9811 n
[7].e
, /* border */
9812 n
[8].e
, /* format */
9814 get_pointer(&n
[10])));
9815 ctx
->Unpack
= save
; /* restore */
9818 case OPCODE_TEX_SUB_IMAGE1D
:
9820 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9821 ctx
->Unpack
= ctx
->DefaultPacking
;
9822 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9824 n
[6].e
, get_pointer(&n
[7])));
9825 ctx
->Unpack
= save
; /* restore */
9828 case OPCODE_TEX_SUB_IMAGE2D
:
9830 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9831 ctx
->Unpack
= ctx
->DefaultPacking
;
9832 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9834 n
[6].i
, n
[7].e
, n
[8].e
,
9835 get_pointer(&n
[9])));
9836 ctx
->Unpack
= save
; /* restore */
9839 case OPCODE_TEX_SUB_IMAGE3D
:
9841 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
9842 ctx
->Unpack
= ctx
->DefaultPacking
;
9843 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
9844 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
9845 n
[8].i
, n
[9].e
, n
[10].e
,
9846 get_pointer(&n
[11])));
9847 ctx
->Unpack
= save
; /* restore */
9850 case OPCODE_TRANSLATE
:
9851 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9853 case OPCODE_VIEWPORT
:
9854 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
9855 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
9857 case OPCODE_WINDOW_POS
:
9858 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
9860 case OPCODE_VIEWPORT_ARRAY_V
:
9861 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9862 get_pointer(&n
[3])));
9864 case OPCODE_VIEWPORT_INDEXED_F
:
9865 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
9868 case OPCODE_VIEWPORT_INDEXED_FV
: {
9874 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
9877 case OPCODE_SCISSOR_ARRAY_V
:
9878 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9879 get_pointer(&n
[3])));
9881 case OPCODE_SCISSOR_INDEXED
:
9882 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
9885 case OPCODE_SCISSOR_INDEXED_V
: {
9891 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
9894 case OPCODE_DEPTH_ARRAY_V
:
9895 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
9896 get_pointer(&n
[3])));
9898 case OPCODE_DEPTH_INDEXED
:
9899 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
9901 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
9902 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
9904 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
9905 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9906 n
[4].i
, n
[5].i
, n
[6].i
,
9907 get_pointer(&n
[7])));
9909 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
9910 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9911 n
[4].i
, n
[5].i
, n
[6].i
,
9912 n
[7].i
, get_pointer(&n
[8])));
9914 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
9915 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
9916 n
[4].i
, n
[5].i
, n
[6].i
,
9918 get_pointer(&n
[9])));
9920 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
9921 CALL_CompressedTexSubImage1D(ctx
->Exec
,
9922 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9924 get_pointer(&n
[7])));
9926 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
9927 CALL_CompressedTexSubImage2D(ctx
->Exec
,
9928 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9929 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
9930 get_pointer(&n
[9])));
9932 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
9933 CALL_CompressedTexSubImage3D(ctx
->Exec
,
9934 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
9935 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
9937 get_pointer(&n
[11])));
9939 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
9940 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
9942 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
9943 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
9945 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
9946 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9948 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
9949 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
9950 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
9953 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
9954 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
9956 case OPCODE_DEPTH_BOUNDS_EXT
:
9957 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
9959 case OPCODE_PROGRAM_STRING_ARB
:
9960 CALL_ProgramStringARB(ctx
->Exec
,
9961 (n
[1].e
, n
[2].e
, n
[3].i
,
9962 get_pointer(&n
[4])));
9964 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
9965 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
9969 case OPCODE_BEGIN_QUERY_ARB
:
9970 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9972 case OPCODE_END_QUERY_ARB
:
9973 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
9975 case OPCODE_QUERY_COUNTER
:
9976 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
9978 case OPCODE_BEGIN_QUERY_INDEXED
:
9979 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
9981 case OPCODE_END_QUERY_INDEXED
:
9982 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
9984 case OPCODE_DRAW_BUFFERS_ARB
:
9986 GLenum buffers
[MAX_DRAW_BUFFERS
];
9987 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
9988 for (i
= 0; i
< count
; i
++)
9989 buffers
[i
] = n
[2 + i
].e
;
9990 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
9993 case OPCODE_BLIT_FRAMEBUFFER
:
9994 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
9995 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
9998 case OPCODE_PRIMITIVE_RESTART_NV
:
9999 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10002 case OPCODE_USE_PROGRAM
:
10003 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10005 case OPCODE_UNIFORM_1F
:
10006 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10008 case OPCODE_UNIFORM_2F
:
10009 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10011 case OPCODE_UNIFORM_3F
:
10012 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10014 case OPCODE_UNIFORM_4F
:
10015 CALL_Uniform4f(ctx
->Exec
,
10016 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10018 case OPCODE_UNIFORM_1FV
:
10019 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10021 case OPCODE_UNIFORM_2FV
:
10022 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10024 case OPCODE_UNIFORM_3FV
:
10025 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10027 case OPCODE_UNIFORM_4FV
:
10028 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10030 case OPCODE_UNIFORM_1D
: {
10031 union float64_pair x
;
10033 x
.uint32
[0] = n
[2].ui
;
10034 x
.uint32
[1] = n
[3].ui
;
10036 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10039 case OPCODE_UNIFORM_2D
: {
10040 union float64_pair x
;
10041 union float64_pair y
;
10043 x
.uint32
[0] = n
[2].ui
;
10044 x
.uint32
[1] = n
[3].ui
;
10045 y
.uint32
[0] = n
[4].ui
;
10046 y
.uint32
[1] = n
[5].ui
;
10048 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10051 case OPCODE_UNIFORM_3D
: {
10052 union float64_pair x
;
10053 union float64_pair y
;
10054 union float64_pair z
;
10056 x
.uint32
[0] = n
[2].ui
;
10057 x
.uint32
[1] = n
[3].ui
;
10058 y
.uint32
[0] = n
[4].ui
;
10059 y
.uint32
[1] = n
[5].ui
;
10060 z
.uint32
[0] = n
[6].ui
;
10061 z
.uint32
[1] = n
[7].ui
;
10063 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10066 case OPCODE_UNIFORM_4D
: {
10067 union float64_pair x
;
10068 union float64_pair y
;
10069 union float64_pair z
;
10070 union float64_pair w
;
10072 x
.uint32
[0] = n
[2].ui
;
10073 x
.uint32
[1] = n
[3].ui
;
10074 y
.uint32
[0] = n
[4].ui
;
10075 y
.uint32
[1] = n
[5].ui
;
10076 z
.uint32
[0] = n
[6].ui
;
10077 z
.uint32
[1] = n
[7].ui
;
10078 w
.uint32
[0] = n
[8].ui
;
10079 w
.uint32
[1] = n
[9].ui
;
10081 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10084 case OPCODE_UNIFORM_1DV
:
10085 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10087 case OPCODE_UNIFORM_2DV
:
10088 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10090 case OPCODE_UNIFORM_3DV
:
10091 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10093 case OPCODE_UNIFORM_4DV
:
10094 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10096 case OPCODE_UNIFORM_1I
:
10097 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10099 case OPCODE_UNIFORM_2I
:
10100 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10102 case OPCODE_UNIFORM_3I
:
10103 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10105 case OPCODE_UNIFORM_4I
:
10106 CALL_Uniform4i(ctx
->Exec
,
10107 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10109 case OPCODE_UNIFORM_1IV
:
10110 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10112 case OPCODE_UNIFORM_2IV
:
10113 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10115 case OPCODE_UNIFORM_3IV
:
10116 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10118 case OPCODE_UNIFORM_4IV
:
10119 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10121 case OPCODE_UNIFORM_1UI
:
10122 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10124 case OPCODE_UNIFORM_2UI
:
10125 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10127 case OPCODE_UNIFORM_3UI
:
10128 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10130 case OPCODE_UNIFORM_4UI
:
10131 CALL_Uniform4ui(ctx
->Exec
,
10132 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10134 case OPCODE_UNIFORM_1UIV
:
10135 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10137 case OPCODE_UNIFORM_2UIV
:
10138 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10140 case OPCODE_UNIFORM_3UIV
:
10141 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10143 case OPCODE_UNIFORM_4UIV
:
10144 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10146 case OPCODE_UNIFORM_MATRIX22
:
10147 CALL_UniformMatrix2fv(ctx
->Exec
,
10148 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10150 case OPCODE_UNIFORM_MATRIX33
:
10151 CALL_UniformMatrix3fv(ctx
->Exec
,
10152 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10154 case OPCODE_UNIFORM_MATRIX44
:
10155 CALL_UniformMatrix4fv(ctx
->Exec
,
10156 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10158 case OPCODE_UNIFORM_MATRIX23
:
10159 CALL_UniformMatrix2x3fv(ctx
->Exec
,
10160 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10162 case OPCODE_UNIFORM_MATRIX32
:
10163 CALL_UniformMatrix3x2fv(ctx
->Exec
,
10164 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10166 case OPCODE_UNIFORM_MATRIX24
:
10167 CALL_UniformMatrix2x4fv(ctx
->Exec
,
10168 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10170 case OPCODE_UNIFORM_MATRIX42
:
10171 CALL_UniformMatrix4x2fv(ctx
->Exec
,
10172 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10174 case OPCODE_UNIFORM_MATRIX34
:
10175 CALL_UniformMatrix3x4fv(ctx
->Exec
,
10176 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10178 case OPCODE_UNIFORM_MATRIX43
:
10179 CALL_UniformMatrix4x3fv(ctx
->Exec
,
10180 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10182 case OPCODE_UNIFORM_MATRIX22D
:
10183 CALL_UniformMatrix2dv(ctx
->Exec
,
10184 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10186 case OPCODE_UNIFORM_MATRIX33D
:
10187 CALL_UniformMatrix3dv(ctx
->Exec
,
10188 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10190 case OPCODE_UNIFORM_MATRIX44D
:
10191 CALL_UniformMatrix4dv(ctx
->Exec
,
10192 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10194 case OPCODE_UNIFORM_MATRIX23D
:
10195 CALL_UniformMatrix2x3dv(ctx
->Exec
,
10196 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10198 case OPCODE_UNIFORM_MATRIX32D
:
10199 CALL_UniformMatrix3x2dv(ctx
->Exec
,
10200 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10202 case OPCODE_UNIFORM_MATRIX24D
:
10203 CALL_UniformMatrix2x4dv(ctx
->Exec
,
10204 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10206 case OPCODE_UNIFORM_MATRIX42D
:
10207 CALL_UniformMatrix4x2dv(ctx
->Exec
,
10208 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10210 case OPCODE_UNIFORM_MATRIX34D
:
10211 CALL_UniformMatrix3x4dv(ctx
->Exec
,
10212 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10214 case OPCODE_UNIFORM_MATRIX43D
:
10215 CALL_UniformMatrix4x3dv(ctx
->Exec
,
10216 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10219 case OPCODE_USE_PROGRAM_STAGES
:
10220 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10222 case OPCODE_PROGRAM_UNIFORM_1F
:
10223 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
10225 case OPCODE_PROGRAM_UNIFORM_2F
:
10226 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
10228 case OPCODE_PROGRAM_UNIFORM_3F
:
10229 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10230 n
[3].f
, n
[4].f
, n
[5].f
));
10232 case OPCODE_PROGRAM_UNIFORM_4F
:
10233 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10234 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10236 case OPCODE_PROGRAM_UNIFORM_1FV
:
10237 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10238 get_pointer(&n
[4])));
10240 case OPCODE_PROGRAM_UNIFORM_2FV
:
10241 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10242 get_pointer(&n
[4])));
10244 case OPCODE_PROGRAM_UNIFORM_3FV
:
10245 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10246 get_pointer(&n
[4])));
10248 case OPCODE_PROGRAM_UNIFORM_4FV
:
10249 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10250 get_pointer(&n
[4])));
10252 case OPCODE_PROGRAM_UNIFORM_1D
: {
10253 union float64_pair x
;
10255 x
.uint32
[0] = n
[3].ui
;
10256 x
.uint32
[1] = n
[4].ui
;
10258 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
10261 case OPCODE_PROGRAM_UNIFORM_2D
: {
10262 union float64_pair x
;
10263 union float64_pair y
;
10265 x
.uint32
[0] = n
[3].ui
;
10266 x
.uint32
[1] = n
[4].ui
;
10267 y
.uint32
[0] = n
[5].ui
;
10268 y
.uint32
[1] = n
[6].ui
;
10270 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
10273 case OPCODE_PROGRAM_UNIFORM_3D
: {
10274 union float64_pair x
;
10275 union float64_pair y
;
10276 union float64_pair z
;
10278 x
.uint32
[0] = n
[3].ui
;
10279 x
.uint32
[1] = n
[4].ui
;
10280 y
.uint32
[0] = n
[5].ui
;
10281 y
.uint32
[1] = n
[6].ui
;
10282 z
.uint32
[0] = n
[7].ui
;
10283 z
.uint32
[1] = n
[8].ui
;
10285 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10289 case OPCODE_PROGRAM_UNIFORM_4D
: {
10290 union float64_pair x
;
10291 union float64_pair y
;
10292 union float64_pair z
;
10293 union float64_pair w
;
10295 x
.uint32
[0] = n
[3].ui
;
10296 x
.uint32
[1] = n
[4].ui
;
10297 y
.uint32
[0] = n
[5].ui
;
10298 y
.uint32
[1] = n
[6].ui
;
10299 z
.uint32
[0] = n
[7].ui
;
10300 z
.uint32
[1] = n
[8].ui
;
10301 w
.uint32
[0] = n
[9].ui
;
10302 w
.uint32
[1] = n
[10].ui
;
10304 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10305 x
.d
, y
.d
, z
.d
, w
.d
));
10308 case OPCODE_PROGRAM_UNIFORM_1DV
:
10309 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10310 get_pointer(&n
[4])));
10312 case OPCODE_PROGRAM_UNIFORM_2DV
:
10313 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10314 get_pointer(&n
[4])));
10316 case OPCODE_PROGRAM_UNIFORM_3DV
:
10317 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10318 get_pointer(&n
[4])));
10320 case OPCODE_PROGRAM_UNIFORM_4DV
:
10321 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10322 get_pointer(&n
[4])));
10324 case OPCODE_PROGRAM_UNIFORM_1I
:
10325 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
10327 case OPCODE_PROGRAM_UNIFORM_2I
:
10328 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
10330 case OPCODE_PROGRAM_UNIFORM_3I
:
10331 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10332 n
[3].i
, n
[4].i
, n
[5].i
));
10334 case OPCODE_PROGRAM_UNIFORM_4I
:
10335 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10336 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
10338 case OPCODE_PROGRAM_UNIFORM_1IV
:
10339 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10340 get_pointer(&n
[4])));
10342 case OPCODE_PROGRAM_UNIFORM_2IV
:
10343 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10344 get_pointer(&n
[4])));
10346 case OPCODE_PROGRAM_UNIFORM_3IV
:
10347 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10348 get_pointer(&n
[4])));
10350 case OPCODE_PROGRAM_UNIFORM_4IV
:
10351 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10352 get_pointer(&n
[4])));
10354 case OPCODE_PROGRAM_UNIFORM_1UI
:
10355 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
10357 case OPCODE_PROGRAM_UNIFORM_2UI
:
10358 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10359 n
[3].ui
, n
[4].ui
));
10361 case OPCODE_PROGRAM_UNIFORM_3UI
:
10362 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10363 n
[3].ui
, n
[4].ui
, n
[5].ui
));
10365 case OPCODE_PROGRAM_UNIFORM_4UI
:
10366 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10368 n
[4].ui
, n
[5].ui
, n
[6].ui
));
10370 case OPCODE_PROGRAM_UNIFORM_1UIV
:
10371 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10372 get_pointer(&n
[4])));
10374 case OPCODE_PROGRAM_UNIFORM_2UIV
:
10375 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10376 get_pointer(&n
[4])));
10378 case OPCODE_PROGRAM_UNIFORM_3UIV
:
10379 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10380 get_pointer(&n
[4])));
10382 case OPCODE_PROGRAM_UNIFORM_4UIV
:
10383 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10384 get_pointer(&n
[4])));
10386 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
10387 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
10388 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10389 get_pointer(&n
[5])));
10391 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
10392 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
10393 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10394 get_pointer(&n
[5])));
10396 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
10397 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
10398 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10399 get_pointer(&n
[5])));
10401 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
10402 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
10403 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10404 get_pointer(&n
[5])));
10406 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
10407 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
10408 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10409 get_pointer(&n
[5])));
10411 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
10412 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
10413 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10414 get_pointer(&n
[5])));
10416 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
10417 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
10418 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10419 get_pointer(&n
[5])));
10421 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
10422 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
10423 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10424 get_pointer(&n
[5])));
10426 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
10427 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
10428 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10429 get_pointer(&n
[5])));
10431 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
10432 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
10433 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10434 get_pointer(&n
[5])));
10436 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
10437 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
10438 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10439 get_pointer(&n
[5])));
10441 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
10442 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
10443 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10444 get_pointer(&n
[5])));
10446 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
10447 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
10448 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10449 get_pointer(&n
[5])));
10451 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
10452 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
10453 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10454 get_pointer(&n
[5])));
10456 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
10457 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
10458 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10459 get_pointer(&n
[5])));
10461 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
10462 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
10463 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10464 get_pointer(&n
[5])));
10466 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
10467 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
10468 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10469 get_pointer(&n
[5])));
10471 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
10472 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
10473 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
10474 get_pointer(&n
[5])));
10477 case OPCODE_CLIP_CONTROL
:
10478 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10481 case OPCODE_CLAMP_COLOR
:
10482 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10485 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
10486 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
10488 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
10489 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
10491 case OPCODE_ATTR_1F_NV
:
10492 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10494 case OPCODE_ATTR_2F_NV
:
10495 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10497 case OPCODE_ATTR_3F_NV
:
10498 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10500 case OPCODE_ATTR_4F_NV
:
10501 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10503 case OPCODE_ATTR_1F_ARB
:
10504 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10506 case OPCODE_ATTR_2F_ARB
:
10507 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10509 case OPCODE_ATTR_3F_ARB
:
10510 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10512 case OPCODE_ATTR_4F_ARB
:
10513 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
10515 case OPCODE_ATTR_1D
: {
10516 GLdouble
*d
= (GLdouble
*) &n
[2];
10517 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
10520 case OPCODE_ATTR_2D
: {
10521 GLdouble
*d
= (GLdouble
*) &n
[2];
10522 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
10525 case OPCODE_ATTR_3D
: {
10526 GLdouble
*d
= (GLdouble
*) &n
[2];
10527 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
10530 case OPCODE_ATTR_4D
: {
10531 GLdouble
*d
= (GLdouble
*) &n
[2];
10532 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
10535 case OPCODE_MATERIAL
:
10536 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
10539 CALL_Begin(ctx
->Exec
, (n
[1].e
));
10542 CALL_End(ctx
->Exec
, ());
10545 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10547 case OPCODE_EVAL_C1
:
10548 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
10550 case OPCODE_EVAL_C2
:
10551 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10553 case OPCODE_EVAL_P1
:
10554 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
10556 case OPCODE_EVAL_P2
:
10557 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10560 /* GL_EXT_texture_integer */
10561 case OPCODE_CLEARCOLOR_I
:
10562 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10564 case OPCODE_CLEARCOLOR_UI
:
10565 CALL_ClearColorIuiEXT(ctx
->Exec
,
10566 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
10568 case OPCODE_TEXPARAMETER_I
:
10571 params
[0] = n
[3].i
;
10572 params
[1] = n
[4].i
;
10573 params
[2] = n
[5].i
;
10574 params
[3] = n
[6].i
;
10575 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10578 case OPCODE_TEXPARAMETER_UI
:
10581 params
[0] = n
[3].ui
;
10582 params
[1] = n
[4].ui
;
10583 params
[2] = n
[5].ui
;
10584 params
[3] = n
[6].ui
;
10585 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10589 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
10590 /* GL_ARB_instanced_arrays */
10591 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10594 case OPCODE_TEXTURE_BARRIER_NV
:
10595 CALL_TextureBarrierNV(ctx
->Exec
, ());
10598 /* GL_EXT/ARB_transform_feedback */
10599 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
10600 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
10602 case OPCODE_END_TRANSFORM_FEEDBACK
:
10603 CALL_EndTransformFeedback(ctx
->Exec
, ());
10605 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
10606 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10608 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
10609 CALL_PauseTransformFeedback(ctx
->Exec
, ());
10611 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
10612 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
10614 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
10615 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10617 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
10618 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
10619 (n
[1].e
, n
[2].ui
, n
[3].ui
));
10621 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
10622 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
10623 (n
[1].e
, n
[2].ui
, n
[3].si
));
10625 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
10626 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
10627 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
10631 case OPCODE_BIND_SAMPLER
:
10632 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10634 case OPCODE_SAMPLER_PARAMETERIV
:
10637 params
[0] = n
[3].i
;
10638 params
[1] = n
[4].i
;
10639 params
[2] = n
[5].i
;
10640 params
[3] = n
[6].i
;
10641 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10644 case OPCODE_SAMPLER_PARAMETERFV
:
10647 params
[0] = n
[3].f
;
10648 params
[1] = n
[4].f
;
10649 params
[2] = n
[5].f
;
10650 params
[3] = n
[6].f
;
10651 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10654 case OPCODE_SAMPLER_PARAMETERIIV
:
10657 params
[0] = n
[3].i
;
10658 params
[1] = n
[4].i
;
10659 params
[2] = n
[5].i
;
10660 params
[3] = n
[6].i
;
10661 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10664 case OPCODE_SAMPLER_PARAMETERUIV
:
10667 params
[0] = n
[3].ui
;
10668 params
[1] = n
[4].ui
;
10669 params
[2] = n
[5].ui
;
10670 params
[3] = n
[6].ui
;
10671 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
10675 /* ARB_compute_shader */
10676 case OPCODE_DISPATCH_COMPUTE
:
10677 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10681 case OPCODE_WAIT_SYNC
:
10683 union uint64_pair p
;
10684 p
.uint32
[0] = n
[2].ui
;
10685 p
.uint32
[1] = n
[3].ui
;
10686 CALL_WaitSync(ctx
->Exec
,
10687 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
10691 /* GL_NV_conditional_render */
10692 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
10693 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
10695 case OPCODE_END_CONDITIONAL_RENDER
:
10696 CALL_EndConditionalRender(ctx
->Exec
, ());
10699 case OPCODE_UNIFORM_BLOCK_BINDING
:
10700 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10703 case OPCODE_UNIFORM_SUBROUTINES
:
10704 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
10705 get_pointer(&n
[3])));
10708 /* GL_EXT_window_rectangles */
10709 case OPCODE_WINDOW_RECTANGLES
:
10710 CALL_WindowRectanglesEXT(
10711 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
10714 /* GL_NV_conservative_raster */
10715 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
10716 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
10719 /* GL_NV_conservative_raster_dilate */
10720 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
10721 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10724 /* GL_NV_conservative_raster_pre_snap_triangles */
10725 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
10726 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10729 case OPCODE_CONTINUE
:
10730 n
= (Node
*) get_pointer(&n
[1]);
10735 case OPCODE_END_OF_LIST
:
10741 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
10743 _mesa_problem(ctx
, "%s", msg
);
10748 /* increment n to point to next compiled command */
10749 if (opcode
!= OPCODE_CONTINUE
) {
10750 assert(InstSize
[opcode
] > 0);
10751 n
+= InstSize
[opcode
];
10756 vbo_save_EndCallList(ctx
);
10758 ctx
->ListState
.CallDepth
--;
10763 /**********************************************************************/
10765 /**********************************************************************/
10768 * Test if a display list number is valid.
10770 GLboolean GLAPIENTRY
10771 _mesa_IsList(GLuint list
)
10773 GET_CURRENT_CONTEXT(ctx
);
10774 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10775 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
10776 return islist(ctx
, list
);
10781 * Delete a sequence of consecutive display lists.
10784 _mesa_DeleteLists(GLuint list
, GLsizei range
)
10786 GET_CURRENT_CONTEXT(ctx
);
10788 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10789 ASSERT_OUTSIDE_BEGIN_END(ctx
);
10792 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
10797 /* We may be deleting a set of bitmap lists. See if there's a
10798 * bitmap atlas to free.
10800 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
10802 _mesa_delete_bitmap_atlas(ctx
, atlas
);
10803 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
10807 for (i
= list
; i
< list
+ range
; i
++) {
10808 destroy_list(ctx
, i
);
10814 * Return a display list number, n, such that lists n through n+range-1
10818 _mesa_GenLists(GLsizei range
)
10820 GET_CURRENT_CONTEXT(ctx
);
10822 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
10823 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
10826 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
10834 * Make this an atomic operation
10836 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
10838 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
10840 /* reserve the list IDs by with empty/dummy lists */
10842 for (i
= 0; i
< range
; i
++) {
10843 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
10844 make_list(base
+ i
, 1));
10848 if (USE_BITMAP_ATLAS
&&
10850 ctx
->Driver
.DrawAtlasBitmaps
) {
10851 /* "range > 16" is a rough heuristic to guess when glGenLists might be
10852 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
10853 * Create the empty atlas now.
10855 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
10857 atlas
= alloc_bitmap_atlas(ctx
, base
);
10860 /* Atlas _should_ be new/empty now, but clobbering is OK */
10861 assert(atlas
->numBitmaps
== 0);
10862 atlas
->numBitmaps
= range
;
10866 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
10873 * Begin a new display list.
10876 _mesa_NewList(GLuint name
, GLenum mode
)
10878 GET_CURRENT_CONTEXT(ctx
);
10880 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
10881 ASSERT_OUTSIDE_BEGIN_END(ctx
);
10883 if (MESA_VERBOSE
& VERBOSE_API
)
10884 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
10885 _mesa_enum_to_string(mode
));
10888 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
10892 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
10893 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
10897 if (ctx
->ListState
.CurrentList
) {
10898 /* already compiling a display list */
10899 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
10903 ctx
->CompileFlag
= GL_TRUE
;
10904 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
10906 /* Reset accumulated list state */
10907 invalidate_saved_current_state( ctx
);
10909 /* Allocate new display list */
10910 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
10911 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
10912 ctx
->ListState
.CurrentPos
= 0;
10914 vbo_save_NewList(ctx
, name
, mode
);
10916 ctx
->CurrentServerDispatch
= ctx
->Save
;
10917 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
10918 if (ctx
->MarshalExec
== NULL
) {
10919 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
10925 * End definition of current display list.
10928 _mesa_EndList(void)
10930 GET_CURRENT_CONTEXT(ctx
);
10931 SAVE_FLUSH_VERTICES(ctx
);
10932 FLUSH_VERTICES(ctx
, 0);
10934 if (MESA_VERBOSE
& VERBOSE_API
)
10935 _mesa_debug(ctx
, "glEndList\n");
10937 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
10938 _mesa_error(ctx
, GL_INVALID_OPERATION
,
10939 "glEndList() called inside glBegin/End");
10942 /* Check that a list is under construction */
10943 if (!ctx
->ListState
.CurrentList
) {
10944 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
10948 /* Call before emitting END_OF_LIST, in case the driver wants to
10949 * emit opcodes itself.
10951 vbo_save_EndList(ctx
);
10953 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
10957 /* Destroy old list, if any */
10958 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
10960 /* Install the new list */
10961 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
10962 ctx
->ListState
.CurrentList
->Name
,
10963 ctx
->ListState
.CurrentList
);
10966 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
10967 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
10969 ctx
->ListState
.CurrentList
= NULL
;
10970 ctx
->ListState
.CurrentBlock
= NULL
;
10971 ctx
->ListState
.CurrentPos
= 0;
10972 ctx
->ExecuteFlag
= GL_TRUE
;
10973 ctx
->CompileFlag
= GL_FALSE
;
10975 ctx
->CurrentServerDispatch
= ctx
->Exec
;
10976 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
10977 if (ctx
->MarshalExec
== NULL
) {
10978 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
10984 _mesa_CallList(GLuint list
)
10986 GLboolean save_compile_flag
;
10987 GET_CURRENT_CONTEXT(ctx
);
10988 FLUSH_CURRENT(ctx
, 0);
10990 if (MESA_VERBOSE
& VERBOSE_API
)
10991 _mesa_debug(ctx
, "glCallList %d\n", list
);
10994 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
10999 mesa_print_display_list( list
);
11001 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
11002 * execute the display list, and restore the CompileFlag.
11004 save_compile_flag
= ctx
->CompileFlag
;
11005 if (save_compile_flag
) {
11006 ctx
->CompileFlag
= GL_FALSE
;
11009 execute_list(ctx
, list
);
11010 ctx
->CompileFlag
= save_compile_flag
;
11012 /* also restore API function pointers to point to "save" versions */
11013 if (save_compile_flag
) {
11014 ctx
->CurrentServerDispatch
= ctx
->Save
;
11015 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11016 if (ctx
->MarshalExec
== NULL
) {
11017 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11024 * Try to execute a glCallLists() command where the display lists contain
11025 * glBitmap commands with a texture atlas.
11026 * \return true for success, false otherwise
11029 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
11032 struct gl_bitmap_atlas
*atlas
;
11035 if (!USE_BITMAP_ATLAS
||
11036 !ctx
->Current
.RasterPosValid
||
11037 ctx
->List
.ListBase
== 0 ||
11038 type
!= GL_UNSIGNED_BYTE
||
11039 !ctx
->Driver
.DrawAtlasBitmaps
) {
11044 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11047 /* Even if glGenLists wasn't called, we can still try to create
11050 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11053 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
11054 /* Try to build the bitmap atlas now.
11055 * If the atlas was created in glGenLists, we'll have recorded the
11056 * number of lists (bitmaps). Otherwise, take a guess at 256.
11058 if (atlas
->numBitmaps
== 0)
11059 atlas
->numBitmaps
= 256;
11060 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
11063 if (!atlas
|| !atlas
->complete
) {
11067 /* check that all display list IDs are in the atlas */
11068 for (i
= 0; i
< n
; i
++) {
11069 const GLubyte
*ids
= (const GLubyte
*) lists
;
11071 if (ids
[i
] >= atlas
->numBitmaps
) {
11076 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
11083 * Execute glCallLists: call multiple display lists.
11086 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
11088 GET_CURRENT_CONTEXT(ctx
);
11090 GLboolean save_compile_flag
;
11092 if (MESA_VERBOSE
& VERBOSE_API
)
11093 _mesa_debug(ctx
, "glCallLists %d\n", n
);
11097 case GL_UNSIGNED_BYTE
:
11099 case GL_UNSIGNED_SHORT
:
11101 case GL_UNSIGNED_INT
:
11109 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
11114 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
11116 } else if (n
== 0 || lists
== NULL
) {
11117 /* nothing to do */
11121 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
11125 /* Save the CompileFlag status, turn it off, execute display list,
11126 * and restore the CompileFlag.
11128 save_compile_flag
= ctx
->CompileFlag
;
11129 ctx
->CompileFlag
= GL_FALSE
;
11131 for (i
= 0; i
< n
; i
++) {
11132 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
11133 execute_list(ctx
, list
);
11136 ctx
->CompileFlag
= save_compile_flag
;
11138 /* also restore API function pointers to point to "save" versions */
11139 if (save_compile_flag
) {
11140 ctx
->CurrentServerDispatch
= ctx
->Save
;
11141 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11142 if (ctx
->MarshalExec
== NULL
) {
11143 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11150 * Set the offset added to list numbers in glCallLists.
11153 _mesa_ListBase(GLuint base
)
11155 GET_CURRENT_CONTEXT(ctx
);
11156 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11157 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11158 ctx
->List
.ListBase
= base
;
11162 * Setup the given dispatch table to point to Mesa's display list
11163 * building functions.
11165 * This does not include any of the tnl functions - they are
11166 * initialized from _mesa_init_api_defaults and from the active vtxfmt
11170 _mesa_initialize_save_table(const struct gl_context
*ctx
)
11172 struct _glapi_table
*table
= ctx
->Save
;
11173 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
11175 /* Initially populate the dispatch table with the contents of the
11176 * normal-execution dispatch table. This lets us skip populating functions
11177 * that should be called directly instead of compiled into display lists.
11179 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
11181 _mesa_loopback_init_api_table(ctx
, table
);
11183 /* VBO functions */
11184 vbo_initialize_save_dispatch(ctx
, table
);
11187 SET_Accum(table
, save_Accum
);
11188 SET_AlphaFunc(table
, save_AlphaFunc
);
11189 SET_Bitmap(table
, save_Bitmap
);
11190 SET_BlendFunc(table
, save_BlendFunc
);
11191 SET_CallList(table
, save_CallList
);
11192 SET_CallLists(table
, save_CallLists
);
11193 SET_Clear(table
, save_Clear
);
11194 SET_ClearAccum(table
, save_ClearAccum
);
11195 SET_ClearColor(table
, save_ClearColor
);
11196 SET_ClearDepth(table
, save_ClearDepth
);
11197 SET_ClearIndex(table
, save_ClearIndex
);
11198 SET_ClearStencil(table
, save_ClearStencil
);
11199 SET_ClipPlane(table
, save_ClipPlane
);
11200 SET_ColorMask(table
, save_ColorMask
);
11201 SET_ColorMaski(table
, save_ColorMaskIndexed
);
11202 SET_ColorMaterial(table
, save_ColorMaterial
);
11203 SET_CopyPixels(table
, save_CopyPixels
);
11204 SET_CullFace(table
, save_CullFace
);
11205 SET_DepthFunc(table
, save_DepthFunc
);
11206 SET_DepthMask(table
, save_DepthMask
);
11207 SET_DepthRange(table
, save_DepthRange
);
11208 SET_Disable(table
, save_Disable
);
11209 SET_Disablei(table
, save_DisableIndexed
);
11210 SET_DrawBuffer(table
, save_DrawBuffer
);
11211 SET_DrawPixels(table
, save_DrawPixels
);
11212 SET_Enable(table
, save_Enable
);
11213 SET_Enablei(table
, save_EnableIndexed
);
11214 SET_EvalMesh1(table
, save_EvalMesh1
);
11215 SET_EvalMesh2(table
, save_EvalMesh2
);
11216 SET_Fogf(table
, save_Fogf
);
11217 SET_Fogfv(table
, save_Fogfv
);
11218 SET_Fogi(table
, save_Fogi
);
11219 SET_Fogiv(table
, save_Fogiv
);
11220 SET_FrontFace(table
, save_FrontFace
);
11221 SET_Frustum(table
, save_Frustum
);
11222 SET_Hint(table
, save_Hint
);
11223 SET_IndexMask(table
, save_IndexMask
);
11224 SET_InitNames(table
, save_InitNames
);
11225 SET_LightModelf(table
, save_LightModelf
);
11226 SET_LightModelfv(table
, save_LightModelfv
);
11227 SET_LightModeli(table
, save_LightModeli
);
11228 SET_LightModeliv(table
, save_LightModeliv
);
11229 SET_Lightf(table
, save_Lightf
);
11230 SET_Lightfv(table
, save_Lightfv
);
11231 SET_Lighti(table
, save_Lighti
);
11232 SET_Lightiv(table
, save_Lightiv
);
11233 SET_LineStipple(table
, save_LineStipple
);
11234 SET_LineWidth(table
, save_LineWidth
);
11235 SET_ListBase(table
, save_ListBase
);
11236 SET_LoadIdentity(table
, save_LoadIdentity
);
11237 SET_LoadMatrixd(table
, save_LoadMatrixd
);
11238 SET_LoadMatrixf(table
, save_LoadMatrixf
);
11239 SET_LoadName(table
, save_LoadName
);
11240 SET_LogicOp(table
, save_LogicOp
);
11241 SET_Map1d(table
, save_Map1d
);
11242 SET_Map1f(table
, save_Map1f
);
11243 SET_Map2d(table
, save_Map2d
);
11244 SET_Map2f(table
, save_Map2f
);
11245 SET_MapGrid1d(table
, save_MapGrid1d
);
11246 SET_MapGrid1f(table
, save_MapGrid1f
);
11247 SET_MapGrid2d(table
, save_MapGrid2d
);
11248 SET_MapGrid2f(table
, save_MapGrid2f
);
11249 SET_MatrixMode(table
, save_MatrixMode
);
11250 SET_MultMatrixd(table
, save_MultMatrixd
);
11251 SET_MultMatrixf(table
, save_MultMatrixf
);
11252 SET_NewList(table
, save_NewList
);
11253 SET_Ortho(table
, save_Ortho
);
11254 SET_PassThrough(table
, save_PassThrough
);
11255 SET_PixelMapfv(table
, save_PixelMapfv
);
11256 SET_PixelMapuiv(table
, save_PixelMapuiv
);
11257 SET_PixelMapusv(table
, save_PixelMapusv
);
11258 SET_PixelTransferf(table
, save_PixelTransferf
);
11259 SET_PixelTransferi(table
, save_PixelTransferi
);
11260 SET_PixelZoom(table
, save_PixelZoom
);
11261 SET_PointSize(table
, save_PointSize
);
11262 SET_PolygonMode(table
, save_PolygonMode
);
11263 SET_PolygonOffset(table
, save_PolygonOffset
);
11264 SET_PolygonStipple(table
, save_PolygonStipple
);
11265 SET_PopAttrib(table
, save_PopAttrib
);
11266 SET_PopMatrix(table
, save_PopMatrix
);
11267 SET_PopName(table
, save_PopName
);
11268 SET_PushAttrib(table
, save_PushAttrib
);
11269 SET_PushMatrix(table
, save_PushMatrix
);
11270 SET_PushName(table
, save_PushName
);
11271 SET_RasterPos2d(table
, save_RasterPos2d
);
11272 SET_RasterPos2dv(table
, save_RasterPos2dv
);
11273 SET_RasterPos2f(table
, save_RasterPos2f
);
11274 SET_RasterPos2fv(table
, save_RasterPos2fv
);
11275 SET_RasterPos2i(table
, save_RasterPos2i
);
11276 SET_RasterPos2iv(table
, save_RasterPos2iv
);
11277 SET_RasterPos2s(table
, save_RasterPos2s
);
11278 SET_RasterPos2sv(table
, save_RasterPos2sv
);
11279 SET_RasterPos3d(table
, save_RasterPos3d
);
11280 SET_RasterPos3dv(table
, save_RasterPos3dv
);
11281 SET_RasterPos3f(table
, save_RasterPos3f
);
11282 SET_RasterPos3fv(table
, save_RasterPos3fv
);
11283 SET_RasterPos3i(table
, save_RasterPos3i
);
11284 SET_RasterPos3iv(table
, save_RasterPos3iv
);
11285 SET_RasterPos3s(table
, save_RasterPos3s
);
11286 SET_RasterPos3sv(table
, save_RasterPos3sv
);
11287 SET_RasterPos4d(table
, save_RasterPos4d
);
11288 SET_RasterPos4dv(table
, save_RasterPos4dv
);
11289 SET_RasterPos4f(table
, save_RasterPos4f
);
11290 SET_RasterPos4fv(table
, save_RasterPos4fv
);
11291 SET_RasterPos4i(table
, save_RasterPos4i
);
11292 SET_RasterPos4iv(table
, save_RasterPos4iv
);
11293 SET_RasterPos4s(table
, save_RasterPos4s
);
11294 SET_RasterPos4sv(table
, save_RasterPos4sv
);
11295 SET_ReadBuffer(table
, save_ReadBuffer
);
11296 SET_Rectf(table
, save_Rectf
);
11297 SET_Rotated(table
, save_Rotated
);
11298 SET_Rotatef(table
, save_Rotatef
);
11299 SET_Scaled(table
, save_Scaled
);
11300 SET_Scalef(table
, save_Scalef
);
11301 SET_Scissor(table
, save_Scissor
);
11302 SET_ShadeModel(table
, save_ShadeModel
);
11303 SET_StencilFunc(table
, save_StencilFunc
);
11304 SET_StencilMask(table
, save_StencilMask
);
11305 SET_StencilOp(table
, save_StencilOp
);
11306 SET_TexEnvf(table
, save_TexEnvf
);
11307 SET_TexEnvfv(table
, save_TexEnvfv
);
11308 SET_TexEnvi(table
, save_TexEnvi
);
11309 SET_TexEnviv(table
, save_TexEnviv
);
11310 SET_TexGend(table
, save_TexGend
);
11311 SET_TexGendv(table
, save_TexGendv
);
11312 SET_TexGenf(table
, save_TexGenf
);
11313 SET_TexGenfv(table
, save_TexGenfv
);
11314 SET_TexGeni(table
, save_TexGeni
);
11315 SET_TexGeniv(table
, save_TexGeniv
);
11316 SET_TexImage1D(table
, save_TexImage1D
);
11317 SET_TexImage2D(table
, save_TexImage2D
);
11318 SET_TexParameterf(table
, save_TexParameterf
);
11319 SET_TexParameterfv(table
, save_TexParameterfv
);
11320 SET_TexParameteri(table
, save_TexParameteri
);
11321 SET_TexParameteriv(table
, save_TexParameteriv
);
11322 SET_Translated(table
, save_Translated
);
11323 SET_Translatef(table
, save_Translatef
);
11324 SET_Viewport(table
, save_Viewport
);
11327 SET_BindTexture(table
, save_BindTexture
);
11328 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
11329 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
11330 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
11331 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
11332 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
11333 SET_TexSubImage1D(table
, save_TexSubImage1D
);
11334 SET_TexSubImage2D(table
, save_TexSubImage2D
);
11337 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
11338 SET_TexImage3D(table
, save_TexImage3D
);
11339 SET_TexSubImage3D(table
, save_TexSubImage3D
);
11342 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
11343 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
11344 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
11346 /* ATI_separate_stencil */
11347 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
11349 /* GL_ARB_imaging */
11350 /* Not all are supported */
11351 SET_BlendColor(table
, save_BlendColor
);
11352 SET_BlendEquation(table
, save_BlendEquation
);
11354 /* 2. GL_EXT_blend_color */
11356 SET_BlendColorEXT(table
, save_BlendColorEXT
);
11359 /* 6. GL_EXT_texture3d */
11361 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
11362 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
11363 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
11366 /* 37. GL_EXT_blend_minmax */
11368 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
11371 /* 54. GL_EXT_point_parameters */
11372 SET_PointParameterf(table
, save_PointParameterfEXT
);
11373 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
11375 /* 91. GL_ARB_tessellation_shader */
11376 SET_PatchParameteri(table
, save_PatchParameteri
);
11377 SET_PatchParameterfv(table
, save_PatchParameterfv
);
11379 /* 100. ARB_viewport_array */
11380 SET_ViewportArrayv(table
, save_ViewportArrayv
);
11381 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
11382 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
11383 SET_ScissorArrayv(table
, save_ScissorArrayv
);
11384 SET_ScissorIndexed(table
, save_ScissorIndexed
);
11385 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
11386 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
11387 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
11389 /* 122. ARB_compute_shader */
11390 SET_DispatchCompute(table
, save_DispatchCompute
);
11391 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
11393 /* 173. GL_EXT_blend_func_separate */
11394 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
11396 /* 197. GL_MESA_window_pos */
11397 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
11398 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
11399 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
11400 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
11401 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
11402 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
11403 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
11404 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
11405 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
11406 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
11407 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
11408 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
11409 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
11410 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
11411 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
11412 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
11413 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
11414 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
11415 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
11416 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
11417 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
11418 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
11419 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
11420 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
11422 /* 245. GL_ATI_fragment_shader */
11423 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
11424 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
11426 /* 262. GL_NV_point_sprite */
11427 SET_PointParameteri(table
, save_PointParameteriNV
);
11428 SET_PointParameteriv(table
, save_PointParameterivNV
);
11430 /* 268. GL_EXT_stencil_two_side */
11431 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
11433 /* ???. GL_EXT_depth_bounds_test */
11434 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
11436 /* ARB 1. GL_ARB_multitexture */
11437 SET_ActiveTexture(table
, save_ActiveTextureARB
);
11439 /* ARB 3. GL_ARB_transpose_matrix */
11440 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
11441 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
11442 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
11443 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
11445 /* ARB 5. GL_ARB_multisample */
11446 SET_SampleCoverage(table
, save_SampleCoverageARB
);
11448 /* ARB 12. GL_ARB_texture_compression */
11449 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
11450 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
11451 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
11452 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
11453 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
11454 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
11456 /* ARB 14. GL_ARB_point_parameters */
11457 /* aliased with EXT_point_parameters functions */
11459 /* ARB 25. GL_ARB_window_pos */
11460 /* aliased with MESA_window_pos functions */
11462 /* ARB 26. GL_ARB_vertex_program */
11463 /* ARB 27. GL_ARB_fragment_program */
11464 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
11465 SET_ProgramStringARB(table
, save_ProgramStringARB
);
11466 SET_BindProgramARB(table
, save_BindProgramARB
);
11467 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
11468 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
11469 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
11470 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
11471 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
11472 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
11473 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
11474 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
11476 SET_BeginQuery(table
, save_BeginQueryARB
);
11477 SET_EndQuery(table
, save_EndQueryARB
);
11478 SET_QueryCounter(table
, save_QueryCounter
);
11480 SET_DrawBuffers(table
, save_DrawBuffersARB
);
11482 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
11484 SET_UseProgram(table
, save_UseProgram
);
11485 SET_Uniform1f(table
, save_Uniform1fARB
);
11486 SET_Uniform2f(table
, save_Uniform2fARB
);
11487 SET_Uniform3f(table
, save_Uniform3fARB
);
11488 SET_Uniform4f(table
, save_Uniform4fARB
);
11489 SET_Uniform1fv(table
, save_Uniform1fvARB
);
11490 SET_Uniform2fv(table
, save_Uniform2fvARB
);
11491 SET_Uniform3fv(table
, save_Uniform3fvARB
);
11492 SET_Uniform4fv(table
, save_Uniform4fvARB
);
11493 SET_Uniform1i(table
, save_Uniform1iARB
);
11494 SET_Uniform2i(table
, save_Uniform2iARB
);
11495 SET_Uniform3i(table
, save_Uniform3iARB
);
11496 SET_Uniform4i(table
, save_Uniform4iARB
);
11497 SET_Uniform1iv(table
, save_Uniform1ivARB
);
11498 SET_Uniform2iv(table
, save_Uniform2ivARB
);
11499 SET_Uniform3iv(table
, save_Uniform3ivARB
);
11500 SET_Uniform4iv(table
, save_Uniform4ivARB
);
11501 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
11502 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
11503 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
11504 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
11505 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
11506 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
11507 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
11508 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
11509 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
11511 /* 299. GL_EXT_blend_equation_separate */
11512 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
11514 /* GL_EXT_gpu_program_parameters */
11515 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
11516 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
11518 /* 364. GL_EXT_provoking_vertex */
11519 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
11521 /* GL_EXT_texture_integer */
11522 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
11523 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
11524 SET_TexParameterIiv(table
, save_TexParameterIiv
);
11525 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
11527 /* GL_ARB_clip_control */
11528 SET_ClipControl(table
, save_ClipControl
);
11530 /* GL_ARB_color_buffer_float */
11531 SET_ClampColor(table
, save_ClampColorARB
);
11534 SET_ClearBufferiv(table
, save_ClearBufferiv
);
11535 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
11536 SET_ClearBufferfv(table
, save_ClearBufferfv
);
11537 SET_ClearBufferfi(table
, save_ClearBufferfi
);
11538 SET_Uniform1ui(table
, save_Uniform1ui
);
11539 SET_Uniform2ui(table
, save_Uniform2ui
);
11540 SET_Uniform3ui(table
, save_Uniform3ui
);
11541 SET_Uniform4ui(table
, save_Uniform4ui
);
11542 SET_Uniform1uiv(table
, save_Uniform1uiv
);
11543 SET_Uniform2uiv(table
, save_Uniform2uiv
);
11544 SET_Uniform3uiv(table
, save_Uniform3uiv
);
11545 SET_Uniform4uiv(table
, save_Uniform4uiv
);
11547 /* GL_ARB_gpu_shader_fp64 */
11548 SET_Uniform1d(table
, save_Uniform1d
);
11549 SET_Uniform2d(table
, save_Uniform2d
);
11550 SET_Uniform3d(table
, save_Uniform3d
);
11551 SET_Uniform4d(table
, save_Uniform4d
);
11552 SET_Uniform1dv(table
, save_Uniform1dv
);
11553 SET_Uniform2dv(table
, save_Uniform2dv
);
11554 SET_Uniform3dv(table
, save_Uniform3dv
);
11555 SET_Uniform4dv(table
, save_Uniform4dv
);
11556 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
11557 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
11558 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
11559 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
11560 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
11561 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
11562 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
11563 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
11564 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
11567 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
11568 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
11569 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
11570 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
11571 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
11572 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
11573 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
11574 SET_DrawTransformFeedbackInstanced(table
,
11575 save_DrawTransformFeedbackInstanced
);
11576 SET_DrawTransformFeedbackStreamInstanced(table
,
11577 save_DrawTransformFeedbackStreamInstanced
);
11578 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
11579 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
11581 /* GL_ARB_instanced_arrays */
11582 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
11584 /* GL_NV_texture_barrier */
11585 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
11587 SET_BindSampler(table
, save_BindSampler
);
11588 SET_SamplerParameteri(table
, save_SamplerParameteri
);
11589 SET_SamplerParameterf(table
, save_SamplerParameterf
);
11590 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
11591 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
11592 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
11593 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
11595 /* GL_ARB_draw_buffer_blend */
11596 SET_BlendFunciARB(table
, save_BlendFunci
);
11597 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
11598 SET_BlendEquationiARB(table
, save_BlendEquationi
);
11599 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
11601 /* GL_NV_conditional_render */
11602 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
11603 SET_EndConditionalRender(table
, save_EndConditionalRender
);
11606 SET_WaitSync(table
, save_WaitSync
);
11608 /* GL_ARB_uniform_buffer_object */
11609 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
11611 /* GL_ARB_shader_subroutines */
11612 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
11614 /* GL_ARB_draw_instanced */
11615 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
11616 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
11618 /* GL_ARB_draw_elements_base_vertex */
11619 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
11621 /* GL_ARB_base_instance */
11622 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
11623 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
11624 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
11626 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
11627 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
11628 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
11629 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
11630 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
11632 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
11633 SET_UseProgramStages(table
, save_UseProgramStages
);
11634 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
11635 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
11636 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
11637 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
11638 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
11639 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
11640 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
11641 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
11642 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
11643 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
11644 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
11645 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
11646 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
11647 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
11648 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
11649 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
11650 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
11651 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
11652 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
11653 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
11654 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
11655 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
11656 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
11657 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
11658 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
11659 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
11660 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
11661 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
11662 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
11663 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
11664 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
11665 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
11666 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
11667 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
11668 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
11669 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
11670 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
11671 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
11672 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
11673 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
11674 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
11675 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
11676 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
11677 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
11678 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
11679 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
11680 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
11681 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
11682 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
11683 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
11685 /* GL_{ARB,EXT}_polygon_offset_clamp */
11686 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
11688 /* GL_EXT_window_rectangles */
11689 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
11691 /* GL_NV_conservative_raster */
11692 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
11694 /* GL_NV_conservative_raster_dilate */
11695 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
11697 /* GL_NV_conservative_raster_pre_snap_triangles */
11698 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
11703 static const char *
11704 enum_string(GLenum k
)
11706 return _mesa_enum_to_string(k
);
11711 * Print the commands in a display list. For debugging only.
11712 * TODO: many commands aren't handled yet.
11713 * \param fname filename to write display list to. If null, use stdout.
11715 static void GLAPIENTRY
11716 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
11718 struct gl_display_list
*dlist
;
11724 f
= fopen(fname
, "w");
11729 if (!islist(ctx
, list
)) {
11730 fprintf(f
, "%u is not a display list ID\n", list
);
11734 dlist
= _mesa_lookup_list(ctx
, list
);
11741 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
11743 done
= n
? GL_FALSE
: GL_TRUE
;
11745 const OpCode opcode
= n
[0].opcode
;
11747 if (is_ext_opcode(opcode
)) {
11748 n
+= ext_opcode_print(ctx
, n
, f
);
11753 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
11755 case OPCODE_ACTIVE_TEXTURE
:
11756 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
11758 case OPCODE_BITMAP
:
11759 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
11760 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11761 get_pointer(&n
[7]));
11763 case OPCODE_BLEND_COLOR
:
11764 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
11765 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11767 case OPCODE_BLEND_EQUATION
:
11768 fprintf(f
, "BlendEquation %s\n",
11769 enum_string(n
[1].e
));
11771 case OPCODE_BLEND_EQUATION_SEPARATE
:
11772 fprintf(f
, "BlendEquationSeparate %s, %s\n",
11773 enum_string(n
[1].e
),
11774 enum_string(n
[2].e
));
11776 case OPCODE_BLEND_FUNC_SEPARATE
:
11777 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
11778 enum_string(n
[1].e
),
11779 enum_string(n
[2].e
),
11780 enum_string(n
[3].e
),
11781 enum_string(n
[4].e
));
11783 case OPCODE_BLEND_EQUATION_I
:
11784 fprintf(f
, "BlendEquationi %u, %s\n",
11785 n
[1].ui
, enum_string(n
[2].e
));
11787 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11788 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
11789 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
11791 case OPCODE_BLEND_FUNC_I
:
11792 fprintf(f
, "BlendFunci %u, %s, %s\n",
11793 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
11795 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11796 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
11798 enum_string(n
[2].e
),
11799 enum_string(n
[3].e
),
11800 enum_string(n
[4].e
),
11801 enum_string(n
[5].e
));
11803 case OPCODE_CALL_LIST
:
11804 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
11806 case OPCODE_CALL_LISTS
:
11807 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
11809 case OPCODE_DISABLE
:
11810 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
11812 case OPCODE_ENABLE
:
11813 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
11815 case OPCODE_FRUSTUM
:
11816 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
11817 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11819 case OPCODE_LINE_STIPPLE
:
11820 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
11822 case OPCODE_LINE_WIDTH
:
11823 fprintf(f
, "LineWidth %f\n", n
[1].f
);
11825 case OPCODE_LOAD_IDENTITY
:
11826 fprintf(f
, "LoadIdentity\n");
11828 case OPCODE_LOAD_MATRIX
:
11829 fprintf(f
, "LoadMatrix\n");
11830 fprintf(f
, " %8f %8f %8f %8f\n",
11831 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
11832 fprintf(f
, " %8f %8f %8f %8f\n",
11833 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
11834 fprintf(f
, " %8f %8f %8f %8f\n",
11835 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
11836 fprintf(f
, " %8f %8f %8f %8f\n",
11837 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
11839 case OPCODE_MULT_MATRIX
:
11840 fprintf(f
, "MultMatrix (or Rotate)\n");
11841 fprintf(f
, " %8f %8f %8f %8f\n",
11842 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
11843 fprintf(f
, " %8f %8f %8f %8f\n",
11844 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
11845 fprintf(f
, " %8f %8f %8f %8f\n",
11846 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
11847 fprintf(f
, " %8f %8f %8f %8f\n",
11848 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
11851 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
11852 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11854 case OPCODE_POINT_SIZE
:
11855 fprintf(f
, "PointSize %f\n", n
[1].f
);
11857 case OPCODE_POP_ATTRIB
:
11858 fprintf(f
, "PopAttrib\n");
11860 case OPCODE_POP_MATRIX
:
11861 fprintf(f
, "PopMatrix\n");
11863 case OPCODE_POP_NAME
:
11864 fprintf(f
, "PopName\n");
11866 case OPCODE_PUSH_ATTRIB
:
11867 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
11869 case OPCODE_PUSH_MATRIX
:
11870 fprintf(f
, "PushMatrix\n");
11872 case OPCODE_PUSH_NAME
:
11873 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
11875 case OPCODE_RASTER_POS
:
11876 fprintf(f
, "RasterPos %g %g %g %g\n",
11877 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11879 case OPCODE_ROTATE
:
11880 fprintf(f
, "Rotate %g %g %g %g\n",
11881 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
11884 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
11886 case OPCODE_TRANSLATE
:
11887 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
11889 case OPCODE_BIND_TEXTURE
:
11890 fprintf(f
, "BindTexture %s %d\n",
11891 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
11893 case OPCODE_SHADE_MODEL
:
11894 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
11897 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
11898 _mesa_enum_to_string(n
[1].ui
),
11899 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
11902 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
11903 _mesa_enum_to_string(n
[1].ui
),
11904 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
11905 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
11907 case OPCODE_MAPGRID1
:
11908 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
11910 case OPCODE_MAPGRID2
:
11911 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
11912 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
11914 case OPCODE_EVALMESH1
:
11915 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
11917 case OPCODE_EVALMESH2
:
11918 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
11919 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
11922 case OPCODE_ATTR_1F_NV
:
11923 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
11925 case OPCODE_ATTR_2F_NV
:
11926 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
11927 n
[1].i
, n
[2].f
, n
[3].f
);
11929 case OPCODE_ATTR_3F_NV
:
11930 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
11931 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
11933 case OPCODE_ATTR_4F_NV
:
11934 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
11935 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
11937 case OPCODE_ATTR_1F_ARB
:
11938 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
11940 case OPCODE_ATTR_2F_ARB
:
11941 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
11942 n
[1].i
, n
[2].f
, n
[3].f
);
11944 case OPCODE_ATTR_3F_ARB
:
11945 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
11946 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
11948 case OPCODE_ATTR_4F_ARB
:
11949 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
11950 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
11953 case OPCODE_MATERIAL
:
11954 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
11955 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
11958 fprintf(f
, "BEGIN %x\n", n
[1].i
);
11961 fprintf(f
, "END\n");
11964 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
11967 case OPCODE_EVAL_C1
:
11968 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
11970 case OPCODE_EVAL_C2
:
11971 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
11973 case OPCODE_EVAL_P1
:
11974 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
11976 case OPCODE_EVAL_P2
:
11977 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
11980 case OPCODE_PROVOKING_VERTEX
:
11981 fprintf(f
, "ProvokingVertex %s\n",
11982 _mesa_enum_to_string(n
[1].ui
));
11986 * meta opcodes/commands
11989 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
11990 (const char *) get_pointer(&n
[2]));
11992 case OPCODE_CONTINUE
:
11993 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
11994 n
= (Node
*) get_pointer(&n
[1]);
11997 fprintf(f
, "NOP\n");
11999 case OPCODE_END_OF_LIST
:
12000 fprintf(f
, "END-LIST %u\n", list
);
12004 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
12006 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
12007 opcode
, (void *) n
);
12011 fprintf(f
, "command %d, %u operands\n", opcode
,
12015 /* increment n to point to next compiled command */
12016 if (opcode
!= OPCODE_CONTINUE
) {
12017 assert(InstSize
[opcode
] > 0);
12018 n
+= InstSize
[opcode
];
12032 * Clients may call this function to help debug display list problems.
12033 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
12034 * changed, or break in the future without notice.
12037 mesa_print_display_list(GLuint list
)
12039 GET_CURRENT_CONTEXT(ctx
);
12040 print_list(ctx
, list
, NULL
);
12044 /**********************************************************************/
12045 /***** Initialization *****/
12046 /**********************************************************************/
12049 save_vtxfmt_init(GLvertexformat
* vfmt
)
12051 vfmt
->ArrayElement
= _ae_ArrayElement
;
12053 vfmt
->Begin
= save_Begin
;
12055 vfmt
->CallList
= save_CallList
;
12056 vfmt
->CallLists
= save_CallLists
;
12058 vfmt
->Color3f
= save_Color3f
;
12059 vfmt
->Color3fv
= save_Color3fv
;
12060 vfmt
->Color4f
= save_Color4f
;
12061 vfmt
->Color4fv
= save_Color4fv
;
12062 vfmt
->EdgeFlag
= save_EdgeFlag
;
12063 vfmt
->End
= save_End
;
12065 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
12066 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
12067 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
12068 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
12069 vfmt
->EvalPoint1
= save_EvalPoint1
;
12070 vfmt
->EvalPoint2
= save_EvalPoint2
;
12072 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
12073 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
12074 vfmt
->Indexf
= save_Indexf
;
12075 vfmt
->Indexfv
= save_Indexfv
;
12076 vfmt
->Materialfv
= save_Materialfv
;
12077 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
12078 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
12079 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
12080 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
12081 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
12082 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
12083 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
12084 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
12085 vfmt
->Normal3f
= save_Normal3f
;
12086 vfmt
->Normal3fv
= save_Normal3fv
;
12087 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
12088 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
12089 vfmt
->TexCoord1f
= save_TexCoord1f
;
12090 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
12091 vfmt
->TexCoord2f
= save_TexCoord2f
;
12092 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
12093 vfmt
->TexCoord3f
= save_TexCoord3f
;
12094 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
12095 vfmt
->TexCoord4f
= save_TexCoord4f
;
12096 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
12097 vfmt
->Vertex2f
= save_Vertex2f
;
12098 vfmt
->Vertex2fv
= save_Vertex2fv
;
12099 vfmt
->Vertex3f
= save_Vertex3f
;
12100 vfmt
->Vertex3fv
= save_Vertex3fv
;
12101 vfmt
->Vertex4f
= save_Vertex4f
;
12102 vfmt
->Vertex4fv
= save_Vertex4fv
;
12103 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
12104 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
12105 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
12106 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
12107 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
12108 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
12109 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
12110 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
12111 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
12112 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
12113 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
12114 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
12115 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
12116 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
12117 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
12118 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
12120 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
12125 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
12126 const GLvertexformat
*vfmt
)
12128 SET_CallList(disp
, vfmt
->CallList
);
12129 SET_CallLists(disp
, vfmt
->CallLists
);
12134 * Initialize display list state for given context.
12137 _mesa_init_display_list(struct gl_context
*ctx
)
12139 static GLboolean tableInitialized
= GL_FALSE
;
12141 /* zero-out the instruction size table, just once */
12142 if (!tableInitialized
) {
12143 memset(InstSize
, 0, sizeof(InstSize
));
12144 tableInitialized
= GL_TRUE
;
12147 /* extension info */
12148 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
12151 ctx
->ListState
.CallDepth
= 0;
12152 ctx
->ExecuteFlag
= GL_TRUE
;
12153 ctx
->CompileFlag
= GL_FALSE
;
12154 ctx
->ListState
.CurrentBlock
= NULL
;
12155 ctx
->ListState
.CurrentPos
= 0;
12157 /* Display List group */
12158 ctx
->List
.ListBase
= 0;
12160 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
12162 InstSize
[OPCODE_NOP
] = 1;
12167 _mesa_free_display_list_data(struct gl_context
*ctx
)
12169 free(ctx
->ListExt
);
12170 ctx
->ListExt
= NULL
;