2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_BIND_MULTITEXTURE
,
585 OPCODE_MULTITEXPARAMETER_F
,
586 OPCODE_MULTITEXPARAMETER_I
,
587 OPCODE_MULTITEX_IMAGE1D
,
588 OPCODE_MULTITEX_IMAGE2D
,
589 OPCODE_MULTITEX_IMAGE3D
,
590 OPCODE_MULTITEX_SUB_IMAGE1D
,
591 OPCODE_MULTITEX_SUB_IMAGE2D
,
592 OPCODE_MULTITEX_SUB_IMAGE3D
,
594 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
596 /* The following three are meta instructions */
597 OPCODE_ERROR
, /* raise compiled-in error */
599 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
609 * Display list instructions are stored as sequences of "nodes". Nodes
610 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
611 * are linked together with a pointer.
613 * Each instruction in the display list is stored as a sequence of
614 * contiguous nodes in memory.
615 * Each node is the union of a variety of data types.
617 * Note, all of these members should be 4 bytes in size or less for the
618 * sake of compact display lists. We store 8-byte pointers in a pair of
619 * these nodes using the save/get_pointer() functions below.
637 typedef union gl_dlist_node Node
;
640 /** How many 4-byte dwords to store a pointer */
641 #define POINTER_DWORDS (sizeof(void *) / 4)
643 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
644 * space for display lists. The following types and functions are
645 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
650 GLuint dwords
[POINTER_DWORDS
];
655 * Save a 4 or 8-byte pointer at dest (and dest+1).
658 save_pointer(Node
*dest
, void *src
)
663 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
664 STATIC_ASSERT(sizeof(Node
) == 4);
668 for (i
= 0; i
< POINTER_DWORDS
; i
++)
669 dest
[i
].ui
= p
.dwords
[i
];
674 * Retrieve a 4 or 8-byte pointer from node (node+1).
677 get_pointer(const Node
*node
)
682 for (i
= 0; i
< POINTER_DWORDS
; i
++)
683 p
.dwords
[i
] = node
[i
].ui
;
690 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
707 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
709 union float64_pair tmp; \
711 n[idx].ui = tmp.uint32[0]; \
712 n[idx+1].ui = tmp.uint32[1]; \
717 * How many nodes to allocate at a time. Note that bulk vertex data
718 * from glBegin/glVertex/glEnd primitives will typically wind up in
719 * a VBO, and not directly in the display list itself.
721 #define BLOCK_SIZE 256
726 * Number of nodes of storage needed for each instruction.
727 * Sizes for dynamically allocated opcodes are stored in the context struct.
729 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
732 void mesa_print_display_list(GLuint list
);
736 * Does the given display list only contain a single glBitmap call?
739 is_bitmap_list(const struct gl_display_list
*dlist
)
741 const Node
*n
= dlist
->Head
;
742 if (n
[0].opcode
== OPCODE_BITMAP
) {
743 n
+= InstSize
[OPCODE_BITMAP
];
744 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
752 * Is the given display list an empty list?
755 is_empty_list(const struct gl_display_list
*dlist
)
757 const Node
*n
= dlist
->Head
;
758 return n
[0].opcode
== OPCODE_END_OF_LIST
;
763 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
766 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
769 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
777 * Lookup a gl_bitmap_atlas by listBase ID.
779 static struct gl_bitmap_atlas
*
780 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
782 struct gl_bitmap_atlas
*atlas
;
784 assert(listBase
> 0);
785 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
791 * Create new bitmap atlas and insert into hash table.
793 static struct gl_bitmap_atlas
*
794 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
796 struct gl_bitmap_atlas
*atlas
;
798 assert(listBase
> 0);
799 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
801 atlas
= calloc(1, sizeof(*atlas
));
803 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
811 * Try to build a bitmap atlas. This involves examining a sequence of
812 * display lists which contain glBitmap commands and putting the bitmap
813 * images into a texture map (the atlas).
814 * If we succeed, gl_bitmap_atlas::complete will be set to true.
815 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
818 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
821 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
826 assert(!atlas
->complete
);
827 assert(atlas
->numBitmaps
> 0);
829 /* We use a rectangle texture (non-normalized coords) for the atlas */
830 assert(ctx
->Extensions
.NV_texture_rectangle
);
831 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
833 atlas
->texWidth
= 1024;
834 atlas
->texHeight
= 0; /* determined below */
836 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
837 if (!atlas
->glyphs
) {
839 atlas
->incomplete
= true;
843 /* Loop over the display lists. They should all contain a single glBitmap
844 * call. If not, bail out. Also, compute the position and sizes of each
845 * bitmap in the atlas to determine the texture atlas size.
847 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
848 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
850 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
851 unsigned bitmap_width
, bitmap_height
;
852 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
854 if (!list
|| is_empty_list(list
)) {
856 atlas
->numBitmaps
= i
;
860 if (!is_bitmap_list(list
)) {
861 /* This list does not contain exactly one glBitmap command. Give up. */
862 atlas
->incomplete
= true;
866 /* get bitmap info from the display list command */
868 assert(n
[0].opcode
== OPCODE_BITMAP
);
869 bitmap_width
= n
[1].i
;
870 bitmap_height
= n
[2].i
;
871 bitmap_xorig
= n
[3].f
;
872 bitmap_yorig
= n
[4].f
;
873 bitmap_xmove
= n
[5].f
;
874 bitmap_ymove
= n
[6].f
;
876 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
877 /* advance to the next row of the texture */
883 /* save the bitmap's position in the atlas */
887 g
->h
= bitmap_height
;
888 g
->xorig
= bitmap_xorig
;
889 g
->yorig
= bitmap_yorig
;
890 g
->xmove
= bitmap_xmove
;
891 g
->ymove
= bitmap_ymove
;
893 xpos
+= bitmap_width
;
895 /* keep track of tallest bitmap in the row */
896 row_height
= MAX2(row_height
, bitmap_height
);
899 /* Now we know the texture height */
900 atlas
->texHeight
= ypos
+ row_height
;
902 if (atlas
->texHeight
== 0) {
903 /* no glyphs found, give up */
906 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
907 /* too large, give up */
911 /* Create atlas texture (texture ID is irrelevant) */
912 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
913 if (!atlas
->texObj
) {
917 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
918 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
919 atlas
->texObj
->MaxLevel
= 0;
920 atlas
->texObj
->Immutable
= GL_TRUE
;
922 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
923 GL_TEXTURE_RECTANGLE
, 0);
924 if (!atlas
->texImage
) {
928 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
929 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
930 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
932 /* alloc image storage */
933 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
937 /* map teximage, load with bitmap glyphs */
938 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
939 0, 0, atlas
->texWidth
, atlas
->texHeight
,
940 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
945 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
946 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
948 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
949 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
950 const Node
*n
= list
->Head
;
952 assert(n
[0].opcode
== OPCODE_BITMAP
||
953 n
[0].opcode
== OPCODE_END_OF_LIST
);
955 if (n
[0].opcode
== OPCODE_BITMAP
) {
956 unsigned bitmap_width
= n
[1].i
;
957 unsigned bitmap_height
= n
[2].i
;
958 unsigned xpos
= atlas
->glyphs
[i
].x
;
959 unsigned ypos
= atlas
->glyphs
[i
].y
;
960 const void *bitmap_image
= get_pointer(&n
[7]);
962 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
963 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
965 /* put the bitmap image into the texture image */
966 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
967 &ctx
->DefaultPacking
, bitmap_image
,
968 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
973 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
975 atlas
->complete
= true;
980 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
983 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
986 atlas
->glyphs
= NULL
;
987 atlas
->incomplete
= true;
992 * Allocate a gl_display_list object with an initial block of storage.
993 * \param count how many display list nodes/tokens to allocate
995 static struct gl_display_list
*
996 make_list(GLuint name
, GLuint count
)
998 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1000 dlist
->Head
= malloc(sizeof(Node
) * count
);
1001 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1002 /* All InstSize[] entries must be non-zero */
1003 InstSize
[OPCODE_END_OF_LIST
] = 1;
1009 * Lookup function to just encapsulate casting.
1011 struct gl_display_list
*
1012 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1014 return (struct gl_display_list
*)
1015 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1019 /** Is the given opcode an extension code? */
1020 static inline GLboolean
1021 is_ext_opcode(OpCode opcode
)
1023 return (opcode
>= OPCODE_EXT_0
);
1027 /** Destroy an extended opcode instruction */
1029 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1031 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1033 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1034 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1039 /** Execute an extended opcode instruction */
1041 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1043 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1045 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1046 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1051 /** Print an extended opcode instruction */
1053 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1055 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1057 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1058 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1064 * Delete the named display list, but don't remove from hash table.
1065 * \param dlist - display list pointer
1068 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1073 n
= block
= dlist
->Head
;
1075 done
= block
? GL_FALSE
: GL_TRUE
;
1077 const OpCode opcode
= n
[0].opcode
;
1079 /* check for extension opcodes first */
1080 if (is_ext_opcode(opcode
)) {
1081 n
+= ext_opcode_destroy(ctx
, n
);
1085 /* for some commands, we need to free malloc'd memory */
1087 free(get_pointer(&n
[6]));
1090 free(get_pointer(&n
[10]));
1092 case OPCODE_CALL_LISTS
:
1093 free(get_pointer(&n
[3]));
1095 case OPCODE_DRAW_PIXELS
:
1096 free(get_pointer(&n
[5]));
1099 free(get_pointer(&n
[7]));
1101 case OPCODE_POLYGON_STIPPLE
:
1102 free(get_pointer(&n
[1]));
1104 case OPCODE_TEX_IMAGE1D
:
1105 free(get_pointer(&n
[8]));
1107 case OPCODE_TEX_IMAGE2D
:
1108 free(get_pointer(&n
[9]));
1110 case OPCODE_TEX_IMAGE3D
:
1111 free(get_pointer(&n
[10]));
1113 case OPCODE_TEX_SUB_IMAGE1D
:
1114 free(get_pointer(&n
[7]));
1116 case OPCODE_TEX_SUB_IMAGE2D
:
1117 free(get_pointer(&n
[9]));
1119 case OPCODE_TEX_SUB_IMAGE3D
:
1120 free(get_pointer(&n
[11]));
1122 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1123 free(get_pointer(&n
[7]));
1125 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1126 free(get_pointer(&n
[8]));
1128 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1129 free(get_pointer(&n
[9]));
1131 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1132 free(get_pointer(&n
[7]));
1134 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1135 free(get_pointer(&n
[9]));
1137 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1138 free(get_pointer(&n
[11]));
1140 case OPCODE_PROGRAM_STRING_ARB
:
1141 free(get_pointer(&n
[4])); /* program string */
1143 case OPCODE_UNIFORM_1FV
:
1144 case OPCODE_UNIFORM_2FV
:
1145 case OPCODE_UNIFORM_3FV
:
1146 case OPCODE_UNIFORM_4FV
:
1147 case OPCODE_UNIFORM_1DV
:
1148 case OPCODE_UNIFORM_2DV
:
1149 case OPCODE_UNIFORM_3DV
:
1150 case OPCODE_UNIFORM_4DV
:
1151 case OPCODE_UNIFORM_1IV
:
1152 case OPCODE_UNIFORM_2IV
:
1153 case OPCODE_UNIFORM_3IV
:
1154 case OPCODE_UNIFORM_4IV
:
1155 case OPCODE_UNIFORM_1UIV
:
1156 case OPCODE_UNIFORM_2UIV
:
1157 case OPCODE_UNIFORM_3UIV
:
1158 case OPCODE_UNIFORM_4UIV
:
1159 free(get_pointer(&n
[3]));
1161 case OPCODE_UNIFORM_MATRIX22
:
1162 case OPCODE_UNIFORM_MATRIX33
:
1163 case OPCODE_UNIFORM_MATRIX44
:
1164 case OPCODE_UNIFORM_MATRIX24
:
1165 case OPCODE_UNIFORM_MATRIX42
:
1166 case OPCODE_UNIFORM_MATRIX23
:
1167 case OPCODE_UNIFORM_MATRIX32
:
1168 case OPCODE_UNIFORM_MATRIX34
:
1169 case OPCODE_UNIFORM_MATRIX43
:
1170 case OPCODE_UNIFORM_MATRIX22D
:
1171 case OPCODE_UNIFORM_MATRIX33D
:
1172 case OPCODE_UNIFORM_MATRIX44D
:
1173 case OPCODE_UNIFORM_MATRIX24D
:
1174 case OPCODE_UNIFORM_MATRIX42D
:
1175 case OPCODE_UNIFORM_MATRIX23D
:
1176 case OPCODE_UNIFORM_MATRIX32D
:
1177 case OPCODE_UNIFORM_MATRIX34D
:
1178 case OPCODE_UNIFORM_MATRIX43D
:
1179 free(get_pointer(&n
[4]));
1181 case OPCODE_PROGRAM_UNIFORM_1FV
:
1182 case OPCODE_PROGRAM_UNIFORM_2FV
:
1183 case OPCODE_PROGRAM_UNIFORM_3FV
:
1184 case OPCODE_PROGRAM_UNIFORM_4FV
:
1185 case OPCODE_PROGRAM_UNIFORM_1DV
:
1186 case OPCODE_PROGRAM_UNIFORM_2DV
:
1187 case OPCODE_PROGRAM_UNIFORM_3DV
:
1188 case OPCODE_PROGRAM_UNIFORM_4DV
:
1189 case OPCODE_PROGRAM_UNIFORM_1IV
:
1190 case OPCODE_PROGRAM_UNIFORM_2IV
:
1191 case OPCODE_PROGRAM_UNIFORM_3IV
:
1192 case OPCODE_PROGRAM_UNIFORM_4IV
:
1193 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1194 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1195 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1196 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1197 free(get_pointer(&n
[4]));
1199 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1200 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1201 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1202 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1203 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1206 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1207 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1208 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1209 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1210 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1211 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1212 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1213 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1214 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1215 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1216 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1217 free(get_pointer(&n
[5]));
1219 case OPCODE_PIXEL_MAP
:
1220 free(get_pointer(&n
[3]));
1222 case OPCODE_VIEWPORT_ARRAY_V
:
1223 case OPCODE_SCISSOR_ARRAY_V
:
1224 case OPCODE_DEPTH_ARRAY_V
:
1225 case OPCODE_UNIFORM_SUBROUTINES
:
1226 case OPCODE_WINDOW_RECTANGLES
:
1227 free(get_pointer(&n
[3]));
1229 case OPCODE_TEXTURE_IMAGE1D
:
1230 case OPCODE_MULTITEX_IMAGE1D
:
1231 free(get_pointer(&n
[9]));
1233 case OPCODE_TEXTURE_IMAGE2D
:
1234 case OPCODE_MULTITEX_IMAGE2D
:
1235 free(get_pointer(&n
[10]));
1237 case OPCODE_TEXTURE_IMAGE3D
:
1238 case OPCODE_MULTITEX_IMAGE3D
:
1239 free(get_pointer(&n
[11]));
1241 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1242 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1243 free(get_pointer(&n
[8]));
1245 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1246 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1247 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1248 free(get_pointer(&n
[10]));
1250 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1251 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1252 free(get_pointer(&n
[12]));
1254 case OPCODE_CONTINUE
:
1255 n
= (Node
*) get_pointer(&n
[1]);
1259 case OPCODE_END_OF_LIST
:
1264 /* just increment 'n' pointer, below */
1268 if (opcode
!= OPCODE_CONTINUE
) {
1269 assert(InstSize
[opcode
] > 0);
1270 n
+= InstSize
[opcode
];
1281 * Called by _mesa_HashWalk() to check if a display list which is being
1282 * deleted belongs to a bitmap texture atlas.
1285 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1287 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1288 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1290 /* See if the list_id falls in the range contained in this texture atlas */
1291 if (atlas
->complete
&&
1292 list_id
>= atlas_id
&&
1293 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1294 /* Mark the atlas as incomplete so it doesn't get used. But don't
1295 * delete it yet since we don't want to try to recreate it in the next
1298 atlas
->complete
= false;
1299 atlas
->incomplete
= true;
1305 * Destroy a display list and remove from hash table.
1306 * \param list - display list number
1309 destroy_list(struct gl_context
*ctx
, GLuint list
)
1311 struct gl_display_list
*dlist
;
1316 dlist
= _mesa_lookup_list(ctx
, list
);
1320 if (is_bitmap_list(dlist
)) {
1321 /* If we're destroying a simple glBitmap display list, there's a
1322 * chance that we're destroying a bitmap image that's in a texture
1323 * atlas. Examine all atlases to see if that's the case. There's
1324 * usually few (if any) atlases so this isn't expensive.
1326 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1327 check_atlas_for_deleted_list
, &list
);
1330 _mesa_delete_list(ctx
, dlist
);
1331 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1336 * Translate the nth element of list from <type> to GLint.
1339 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1351 bptr
= (GLbyte
*) list
;
1352 return (GLint
) bptr
[n
];
1353 case GL_UNSIGNED_BYTE
:
1354 ubptr
= (GLubyte
*) list
;
1355 return (GLint
) ubptr
[n
];
1357 sptr
= (GLshort
*) list
;
1358 return (GLint
) sptr
[n
];
1359 case GL_UNSIGNED_SHORT
:
1360 usptr
= (GLushort
*) list
;
1361 return (GLint
) usptr
[n
];
1363 iptr
= (GLint
*) list
;
1365 case GL_UNSIGNED_INT
:
1366 uiptr
= (GLuint
*) list
;
1367 return (GLint
) uiptr
[n
];
1369 fptr
= (GLfloat
*) list
;
1370 return (GLint
) floorf(fptr
[n
]);
1372 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1373 return (GLint
) ubptr
[0] * 256
1376 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1377 return (GLint
) ubptr
[0] * 65536
1378 + (GLint
) ubptr
[1] * 256
1381 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1382 return (GLint
) ubptr
[0] * 16777216
1383 + (GLint
) ubptr
[1] * 65536
1384 + (GLint
) ubptr
[2] * 256
1393 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1394 * If width < 0 or height < 0 or format or type are invalid we'll just
1395 * return NULL. We will not generate an error since OpenGL command
1396 * arguments aren't error-checked until the command is actually executed
1397 * (not when they're compiled).
1398 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1401 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1402 GLsizei width
, GLsizei height
, GLsizei depth
,
1403 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1404 const struct gl_pixelstore_attrib
*unpack
)
1406 if (width
<= 0 || height
<= 0) {
1410 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1411 /* bad format and/or type */
1415 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1419 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1420 format
, type
, pixels
, unpack
);
1421 if (pixels
&& !image
) {
1422 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1426 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1427 depth
, format
, type
, INT_MAX
, pixels
)) {
1428 const GLubyte
*map
, *src
;
1432 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1433 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1436 /* unable to map src buffer! */
1437 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1441 src
= ADD_POINTERS(map
, pixels
);
1442 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1443 format
, type
, src
, unpack
);
1445 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1448 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1454 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1459 /** Return copy of memory */
1461 memdup(const void *src
, GLsizei bytes
)
1463 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1465 memcpy(b
, src
, bytes
);
1471 * Allocate space for a display list instruction (opcode + payload space).
1472 * \param opcode the instruction opcode (OPCODE_* value)
1473 * \param bytes instruction payload size (not counting opcode)
1474 * \param align8 does the payload need to be 8-byte aligned?
1475 * This is only relevant in 64-bit environments.
1476 * \return pointer to allocated memory (the payload will be at pointer+1)
1479 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1481 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1482 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1486 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1488 if (opcode
< OPCODE_EXT_0
) {
1489 if (InstSize
[opcode
] == 0) {
1490 /* save instruction size now */
1491 InstSize
[opcode
] = numNodes
;
1494 /* make sure instruction size agrees */
1495 assert(numNodes
== InstSize
[opcode
]);
1499 if (sizeof(void *) > sizeof(Node
) && align8
1500 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1501 /* The opcode would get placed at node[0] and the payload would start
1502 * at node[1]. But the payload needs to be at an even offset (8-byte
1511 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1513 /* This block is full. Allocate a new block and chain to it */
1515 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1516 n
[0].opcode
= OPCODE_CONTINUE
;
1517 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1519 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1523 /* a fresh block should be 8-byte aligned on 64-bit systems */
1524 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1526 save_pointer(&n
[1], newblock
);
1527 ctx
->ListState
.CurrentBlock
= newblock
;
1528 ctx
->ListState
.CurrentPos
= 0;
1530 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1531 * we have to insert a NOP so that the payload of the real opcode lands
1532 * on an even location:
1533 * node[0] = OPCODE_NOP
1534 * node[1] = OPCODE_x;
1535 * node[2] = start of payload
1537 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1540 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1542 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1543 n
[0].opcode
= OPCODE_NOP
;
1545 /* The "real" opcode will now be at an odd location and the payload
1546 * will be at an even location.
1549 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1551 n
[0].opcode
= opcode
;
1559 * Allocate space for a display list instruction. Used by callers outside
1560 * this file for things like VBO vertex data.
1562 * \param opcode the instruction opcode (OPCODE_* value)
1563 * \param bytes instruction size in bytes, not counting opcode.
1564 * \return pointer to the usable data area (not including the internal
1568 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1570 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1572 return n
+ 1; /* return pointer to payload area, after opcode */
1579 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1580 * aligned in 64-bit environments, 4-byte aligned otherwise.
1583 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1585 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1587 return n
+ 1; /* return pointer to payload area, after opcode */
1594 * This function allows modules and drivers to get their own opcodes
1595 * for extending display list functionality.
1596 * \param ctx the rendering context
1597 * \param size number of bytes for storing the new display list command
1598 * \param execute function to execute the new display list command
1599 * \param destroy function to destroy the new display list command
1600 * \param print function to print the new display list command
1601 * \return the new opcode number or -1 if error
1604 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1606 void (*execute
) (struct gl_context
*, void *),
1607 void (*destroy
) (struct gl_context
*, void *),
1608 void (*print
) (struct gl_context
*, void *, FILE *))
1610 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1611 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1612 ctx
->ListExt
->Opcode
[i
].Size
=
1613 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1614 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1615 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1616 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1617 return i
+ OPCODE_EXT_0
;
1624 * Allocate space for a display list instruction. The space is basically
1625 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1626 * function parameter, node[2] is the second parameter, etc.
1628 * \param opcode one of OPCODE_x
1629 * \param nparams number of function parameters
1630 * \return pointer to start of instruction space
1632 static inline Node
*
1633 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1635 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1640 * Called by EndList to try to reduce memory used for the list.
1643 trim_list(struct gl_context
*ctx
)
1645 /* If the list we're ending only has one allocated block of nodes/tokens
1646 * and its size isn't a full block size, realloc the block to use less
1647 * memory. This is important for apps that create many small display
1648 * lists and apps that use glXUseXFont (many lists each containing one
1650 * Note: we currently only trim display lists that allocated one block
1651 * of tokens. That hits the short list case which is what we're mainly
1652 * concerned with. Trimming longer lists would involve traversing the
1653 * linked list of blocks.
1655 struct gl_dlist_state
*list
= &ctx
->ListState
;
1657 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1658 (list
->CurrentPos
< BLOCK_SIZE
)) {
1659 /* There's only one block and it's not full, so realloc */
1660 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1661 list
->CurrentList
->Head
=
1662 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1663 if (!list
->CurrentBlock
) {
1664 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1672 * Display List compilation functions
1674 static void GLAPIENTRY
1675 save_Accum(GLenum op
, GLfloat value
)
1677 GET_CURRENT_CONTEXT(ctx
);
1679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1680 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1685 if (ctx
->ExecuteFlag
) {
1686 CALL_Accum(ctx
->Exec
, (op
, value
));
1691 static void GLAPIENTRY
1692 save_AlphaFunc(GLenum func
, GLclampf ref
)
1694 GET_CURRENT_CONTEXT(ctx
);
1696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1697 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1700 n
[2].f
= (GLfloat
) ref
;
1702 if (ctx
->ExecuteFlag
) {
1703 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1708 static void GLAPIENTRY
1709 save_BindTexture(GLenum target
, GLuint texture
)
1711 GET_CURRENT_CONTEXT(ctx
);
1713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1714 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1719 if (ctx
->ExecuteFlag
) {
1720 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1725 static void GLAPIENTRY
1726 save_Bitmap(GLsizei width
, GLsizei height
,
1727 GLfloat xorig
, GLfloat yorig
,
1728 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1730 GET_CURRENT_CONTEXT(ctx
);
1732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1733 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1735 n
[1].i
= (GLint
) width
;
1736 n
[2].i
= (GLint
) height
;
1742 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1743 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1745 if (ctx
->ExecuteFlag
) {
1746 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1747 xorig
, yorig
, xmove
, ymove
, pixels
));
1752 static void GLAPIENTRY
1753 save_BlendEquation(GLenum mode
)
1755 GET_CURRENT_CONTEXT(ctx
);
1757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1758 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_BlendEquation(ctx
->Exec
, (mode
));
1768 static void GLAPIENTRY
1769 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1779 if (ctx
->ExecuteFlag
) {
1780 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1785 static void GLAPIENTRY
1786 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1787 GLenum sfactorA
, GLenum dfactorA
)
1789 GET_CURRENT_CONTEXT(ctx
);
1791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1792 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1794 n
[1].e
= sfactorRGB
;
1795 n
[2].e
= dfactorRGB
;
1799 if (ctx
->ExecuteFlag
) {
1800 CALL_BlendFuncSeparate(ctx
->Exec
,
1801 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1806 static void GLAPIENTRY
1807 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1809 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1813 static void GLAPIENTRY
1814 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1816 GET_CURRENT_CONTEXT(ctx
);
1818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1819 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1826 if (ctx
->ExecuteFlag
) {
1827 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1831 /* GL_ARB_draw_buffers_blend */
1832 static void GLAPIENTRY
1833 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1834 GLenum sfactorA
, GLenum dfactorA
)
1836 GET_CURRENT_CONTEXT(ctx
);
1838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1839 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1842 n
[2].e
= sfactorRGB
;
1843 n
[3].e
= dfactorRGB
;
1847 if (ctx
->ExecuteFlag
) {
1848 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1849 sfactorA
, dfactorA
));
1853 /* GL_ARB_draw_buffers_blend */
1854 static void GLAPIENTRY
1855 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1857 GET_CURRENT_CONTEXT(ctx
);
1859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1860 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1866 if (ctx
->ExecuteFlag
) {
1867 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1871 /* GL_ARB_draw_buffers_blend */
1872 static void GLAPIENTRY
1873 save_BlendEquationi(GLuint buf
, GLenum mode
)
1875 GET_CURRENT_CONTEXT(ctx
);
1877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1878 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1883 if (ctx
->ExecuteFlag
) {
1884 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1888 /* GL_ARB_draw_buffers_blend */
1889 static void GLAPIENTRY
1890 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1892 GET_CURRENT_CONTEXT(ctx
);
1894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1895 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1901 if (ctx
->ExecuteFlag
) {
1902 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1907 /* GL_ARB_draw_instanced. */
1908 static void GLAPIENTRY
1909 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1911 UNUSED GLsizei count
,
1912 UNUSED GLsizei primcount
)
1914 GET_CURRENT_CONTEXT(ctx
);
1915 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1916 "glDrawArraysInstanced() during display list compile");
1919 static void GLAPIENTRY
1920 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1921 UNUSED GLsizei count
,
1923 UNUSED
const GLvoid
*indices
,
1924 UNUSED GLsizei primcount
)
1926 GET_CURRENT_CONTEXT(ctx
);
1927 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1928 "glDrawElementsInstanced() during display list compile");
1931 static void GLAPIENTRY
1932 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1933 UNUSED GLsizei count
,
1935 UNUSED
const GLvoid
*indices
,
1936 UNUSED GLsizei primcount
,
1937 UNUSED GLint basevertex
)
1939 GET_CURRENT_CONTEXT(ctx
);
1940 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1941 "glDrawElementsInstancedBaseVertex() during display list compile");
1944 /* GL_ARB_base_instance. */
1945 static void GLAPIENTRY
1946 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1948 UNUSED GLsizei count
,
1949 UNUSED GLsizei primcount
,
1950 UNUSED GLuint baseinstance
)
1952 GET_CURRENT_CONTEXT(ctx
);
1953 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1954 "glDrawArraysInstancedBaseInstance() during display list compile");
1957 static void APIENTRY
1958 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1959 UNUSED GLsizei count
,
1961 UNUSED
const void *indices
,
1962 UNUSED GLsizei primcount
,
1963 UNUSED GLuint baseinstance
)
1965 GET_CURRENT_CONTEXT(ctx
);
1966 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1967 "glDrawElementsInstancedBaseInstance() during display list compile");
1970 static void APIENTRY
1971 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1972 UNUSED GLsizei count
,
1974 UNUSED
const void *indices
,
1975 UNUSED GLsizei primcount
,
1976 UNUSED GLint basevertex
,
1977 UNUSED GLuint baseinstance
)
1979 GET_CURRENT_CONTEXT(ctx
);
1980 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1981 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1984 static void APIENTRY
1985 save_DrawArraysIndirect(UNUSED GLenum mode
,
1986 UNUSED
const void *indirect
)
1988 GET_CURRENT_CONTEXT(ctx
);
1989 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1990 "glDrawArraysIndirect() during display list compile");
1993 static void APIENTRY
1994 save_DrawElementsIndirect(UNUSED GLenum mode
,
1996 UNUSED
const void *indirect
)
1998 GET_CURRENT_CONTEXT(ctx
);
1999 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2000 "glDrawElementsIndirect() during display list compile");
2003 static void APIENTRY
2004 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2005 UNUSED
const void *indirect
,
2006 UNUSED GLsizei primcount
,
2007 UNUSED GLsizei stride
)
2009 GET_CURRENT_CONTEXT(ctx
);
2010 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2011 "glMultiDrawArraysIndirect() during display list compile");
2014 static void APIENTRY
2015 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2017 UNUSED
const void *indirect
,
2018 UNUSED GLsizei primcount
,
2019 UNUSED GLsizei stride
)
2021 GET_CURRENT_CONTEXT(ctx
);
2022 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2023 "glMultiDrawElementsIndirect() during display list compile");
2027 * While building a display list we cache some OpenGL state.
2028 * Under some circumstances we need to invalidate that state (immediately
2029 * when we start compiling a list, or after glCallList(s)).
2032 invalidate_saved_current_state(struct gl_context
*ctx
)
2036 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2037 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2039 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2040 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2042 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2044 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2048 static void GLAPIENTRY
2049 save_CallList(GLuint list
)
2051 GET_CURRENT_CONTEXT(ctx
);
2053 SAVE_FLUSH_VERTICES(ctx
);
2055 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2060 /* After this, we don't know what state we're in. Invalidate all
2061 * cached information previously gathered:
2063 invalidate_saved_current_state( ctx
);
2065 if (ctx
->ExecuteFlag
) {
2066 _mesa_CallList(list
);
2071 static void GLAPIENTRY
2072 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2074 GET_CURRENT_CONTEXT(ctx
);
2079 SAVE_FLUSH_VERTICES(ctx
);
2083 case GL_UNSIGNED_BYTE
:
2087 case GL_UNSIGNED_SHORT
:
2095 case GL_UNSIGNED_INT
:
2104 if (num
> 0 && type_size
> 0) {
2105 /* create a copy of the array of list IDs to save in the display list */
2106 lists_copy
= memdup(lists
, num
* type_size
);
2111 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2115 save_pointer(&n
[3], lists_copy
);
2118 /* After this, we don't know what state we're in. Invalidate all
2119 * cached information previously gathered:
2121 invalidate_saved_current_state( ctx
);
2123 if (ctx
->ExecuteFlag
) {
2124 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2129 static void GLAPIENTRY
2130 save_Clear(GLbitfield mask
)
2132 GET_CURRENT_CONTEXT(ctx
);
2134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2135 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2139 if (ctx
->ExecuteFlag
) {
2140 CALL_Clear(ctx
->Exec
, (mask
));
2145 static void GLAPIENTRY
2146 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2148 GET_CURRENT_CONTEXT(ctx
);
2150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2151 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2154 n
[2].i
= drawbuffer
;
2156 if (buffer
== GL_COLOR
) {
2167 if (ctx
->ExecuteFlag
) {
2168 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2173 static void GLAPIENTRY
2174 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2176 GET_CURRENT_CONTEXT(ctx
);
2178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2179 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2182 n
[2].i
= drawbuffer
;
2184 if (buffer
== GL_COLOR
) {
2195 if (ctx
->ExecuteFlag
) {
2196 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2201 static void GLAPIENTRY
2202 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2204 GET_CURRENT_CONTEXT(ctx
);
2206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2207 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2210 n
[2].i
= drawbuffer
;
2212 if (buffer
== GL_COLOR
) {
2223 if (ctx
->ExecuteFlag
) {
2224 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2229 static void GLAPIENTRY
2230 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2231 GLfloat depth
, GLint stencil
)
2233 GET_CURRENT_CONTEXT(ctx
);
2235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2236 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2239 n
[2].i
= drawbuffer
;
2243 if (ctx
->ExecuteFlag
) {
2244 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2249 static void GLAPIENTRY
2250 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2252 GET_CURRENT_CONTEXT(ctx
);
2254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2255 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2262 if (ctx
->ExecuteFlag
) {
2263 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2268 static void GLAPIENTRY
2269 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2271 GET_CURRENT_CONTEXT(ctx
);
2273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2274 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2281 if (ctx
->ExecuteFlag
) {
2282 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2287 static void GLAPIENTRY
2288 save_ClearDepth(GLclampd depth
)
2290 GET_CURRENT_CONTEXT(ctx
);
2292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2293 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2295 n
[1].f
= (GLfloat
) depth
;
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_ClearDepth(ctx
->Exec
, (depth
));
2303 static void GLAPIENTRY
2304 save_ClearIndex(GLfloat c
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2313 if (ctx
->ExecuteFlag
) {
2314 CALL_ClearIndex(ctx
->Exec
, (c
));
2319 static void GLAPIENTRY
2320 save_ClearStencil(GLint s
)
2322 GET_CURRENT_CONTEXT(ctx
);
2324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2325 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2329 if (ctx
->ExecuteFlag
) {
2330 CALL_ClearStencil(ctx
->Exec
, (s
));
2335 static void GLAPIENTRY
2336 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2338 GET_CURRENT_CONTEXT(ctx
);
2340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2341 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2344 n
[2].f
= (GLfloat
) equ
[0];
2345 n
[3].f
= (GLfloat
) equ
[1];
2346 n
[4].f
= (GLfloat
) equ
[2];
2347 n
[5].f
= (GLfloat
) equ
[3];
2349 if (ctx
->ExecuteFlag
) {
2350 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2356 static void GLAPIENTRY
2357 save_ColorMask(GLboolean red
, GLboolean green
,
2358 GLboolean blue
, GLboolean alpha
)
2360 GET_CURRENT_CONTEXT(ctx
);
2362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2363 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2370 if (ctx
->ExecuteFlag
) {
2371 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2376 static void GLAPIENTRY
2377 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2378 GLboolean blue
, GLboolean alpha
)
2380 GET_CURRENT_CONTEXT(ctx
);
2382 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2383 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2391 if (ctx
->ExecuteFlag
) {
2392 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2397 static void GLAPIENTRY
2398 save_ColorMaterial(GLenum face
, GLenum mode
)
2400 GET_CURRENT_CONTEXT(ctx
);
2402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2404 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2409 if (ctx
->ExecuteFlag
) {
2410 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2415 static void GLAPIENTRY
2416 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2418 GET_CURRENT_CONTEXT(ctx
);
2420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2421 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2425 n
[3].i
= (GLint
) width
;
2426 n
[4].i
= (GLint
) height
;
2429 if (ctx
->ExecuteFlag
) {
2430 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2436 static void GLAPIENTRY
2437 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2438 GLint x
, GLint y
, GLsizei width
, GLint border
)
2440 GET_CURRENT_CONTEXT(ctx
);
2442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2443 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2447 n
[3].e
= internalformat
;
2453 if (ctx
->ExecuteFlag
) {
2454 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2455 x
, y
, width
, border
));
2460 static void GLAPIENTRY
2461 save_CopyTexImage2D(GLenum target
, GLint level
,
2462 GLenum internalformat
,
2463 GLint x
, GLint y
, GLsizei width
,
2464 GLsizei height
, GLint border
)
2466 GET_CURRENT_CONTEXT(ctx
);
2468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2469 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2473 n
[3].e
= internalformat
;
2480 if (ctx
->ExecuteFlag
) {
2481 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2482 x
, y
, width
, height
, border
));
2488 static void GLAPIENTRY
2489 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2490 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2492 GET_CURRENT_CONTEXT(ctx
);
2494 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2495 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2504 if (ctx
->ExecuteFlag
) {
2505 CALL_CopyTexSubImage1D(ctx
->Exec
,
2506 (target
, level
, xoffset
, x
, y
, width
));
2511 static void GLAPIENTRY
2512 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2513 GLint xoffset
, GLint yoffset
,
2514 GLint x
, GLint y
, GLsizei width
, GLint height
)
2516 GET_CURRENT_CONTEXT(ctx
);
2518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2519 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2530 if (ctx
->ExecuteFlag
) {
2531 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2532 x
, y
, width
, height
));
2537 static void GLAPIENTRY
2538 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2539 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2540 GLint x
, GLint y
, GLsizei width
, GLint height
)
2542 GET_CURRENT_CONTEXT(ctx
);
2544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2545 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2557 if (ctx
->ExecuteFlag
) {
2558 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2559 xoffset
, yoffset
, zoffset
,
2560 x
, y
, width
, height
));
2565 static void GLAPIENTRY
2566 save_CullFace(GLenum mode
)
2568 GET_CURRENT_CONTEXT(ctx
);
2570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2571 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2575 if (ctx
->ExecuteFlag
) {
2576 CALL_CullFace(ctx
->Exec
, (mode
));
2581 static void GLAPIENTRY
2582 save_DepthFunc(GLenum func
)
2584 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2591 if (ctx
->ExecuteFlag
) {
2592 CALL_DepthFunc(ctx
->Exec
, (func
));
2597 static void GLAPIENTRY
2598 save_DepthMask(GLboolean mask
)
2600 GET_CURRENT_CONTEXT(ctx
);
2602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2603 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2607 if (ctx
->ExecuteFlag
) {
2608 CALL_DepthMask(ctx
->Exec
, (mask
));
2613 static void GLAPIENTRY
2614 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2616 GET_CURRENT_CONTEXT(ctx
);
2618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2619 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2621 n
[1].f
= (GLfloat
) nearval
;
2622 n
[2].f
= (GLfloat
) farval
;
2624 if (ctx
->ExecuteFlag
) {
2625 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2630 static void GLAPIENTRY
2631 save_Disable(GLenum cap
)
2633 GET_CURRENT_CONTEXT(ctx
);
2635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2636 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2640 if (ctx
->ExecuteFlag
) {
2641 CALL_Disable(ctx
->Exec
, (cap
));
2646 static void GLAPIENTRY
2647 save_DisableIndexed(GLuint index
, GLenum cap
)
2649 GET_CURRENT_CONTEXT(ctx
);
2651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2652 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2657 if (ctx
->ExecuteFlag
) {
2658 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2663 static void GLAPIENTRY
2664 save_DrawBuffer(GLenum mode
)
2666 GET_CURRENT_CONTEXT(ctx
);
2668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2669 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2673 if (ctx
->ExecuteFlag
) {
2674 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2679 static void GLAPIENTRY
2680 save_DrawPixels(GLsizei width
, GLsizei height
,
2681 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2683 GET_CURRENT_CONTEXT(ctx
);
2686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2688 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2695 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2696 pixels
, &ctx
->Unpack
));
2698 if (ctx
->ExecuteFlag
) {
2699 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2705 static void GLAPIENTRY
2706 save_Enable(GLenum cap
)
2708 GET_CURRENT_CONTEXT(ctx
);
2710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2711 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2715 if (ctx
->ExecuteFlag
) {
2716 CALL_Enable(ctx
->Exec
, (cap
));
2722 static void GLAPIENTRY
2723 save_EnableIndexed(GLuint index
, GLenum cap
)
2725 GET_CURRENT_CONTEXT(ctx
);
2727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2728 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2733 if (ctx
->ExecuteFlag
) {
2734 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2740 static void GLAPIENTRY
2741 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2743 GET_CURRENT_CONTEXT(ctx
);
2745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2746 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2752 if (ctx
->ExecuteFlag
) {
2753 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2758 static void GLAPIENTRY
2759 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2761 GET_CURRENT_CONTEXT(ctx
);
2763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2764 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2772 if (ctx
->ExecuteFlag
) {
2773 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2780 static void GLAPIENTRY
2781 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2783 GET_CURRENT_CONTEXT(ctx
);
2785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2786 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2794 if (ctx
->ExecuteFlag
) {
2795 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2800 static void GLAPIENTRY
2801 save_Fogf(GLenum pname
, GLfloat param
)
2805 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2806 save_Fogfv(pname
, parray
);
2810 static void GLAPIENTRY
2811 save_Fogiv(GLenum pname
, const GLint
*params
)
2816 case GL_FOG_DENSITY
:
2820 case GL_FOG_COORDINATE_SOURCE
:
2821 p
[0] = (GLfloat
) *params
;
2827 p
[0] = INT_TO_FLOAT(params
[0]);
2828 p
[1] = INT_TO_FLOAT(params
[1]);
2829 p
[2] = INT_TO_FLOAT(params
[2]);
2830 p
[3] = INT_TO_FLOAT(params
[3]);
2833 /* Error will be caught later in gl_Fogfv */
2834 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2836 save_Fogfv(pname
, p
);
2840 static void GLAPIENTRY
2841 save_Fogi(GLenum pname
, GLint param
)
2845 parray
[1] = parray
[2] = parray
[3] = 0;
2846 save_Fogiv(pname
, parray
);
2850 static void GLAPIENTRY
2851 save_FrontFace(GLenum mode
)
2853 GET_CURRENT_CONTEXT(ctx
);
2855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2856 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2860 if (ctx
->ExecuteFlag
) {
2861 CALL_FrontFace(ctx
->Exec
, (mode
));
2866 static void GLAPIENTRY
2867 save_Frustum(GLdouble left
, GLdouble right
,
2868 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2870 GET_CURRENT_CONTEXT(ctx
);
2872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2873 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2875 n
[1].f
= (GLfloat
) left
;
2876 n
[2].f
= (GLfloat
) right
;
2877 n
[3].f
= (GLfloat
) bottom
;
2878 n
[4].f
= (GLfloat
) top
;
2879 n
[5].f
= (GLfloat
) nearval
;
2880 n
[6].f
= (GLfloat
) farval
;
2882 if (ctx
->ExecuteFlag
) {
2883 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2888 static void GLAPIENTRY
2889 save_Hint(GLenum target
, GLenum mode
)
2891 GET_CURRENT_CONTEXT(ctx
);
2893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2894 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2899 if (ctx
->ExecuteFlag
) {
2900 CALL_Hint(ctx
->Exec
, (target
, mode
));
2905 static void GLAPIENTRY
2906 save_IndexMask(GLuint mask
)
2908 GET_CURRENT_CONTEXT(ctx
);
2910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2911 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2915 if (ctx
->ExecuteFlag
) {
2916 CALL_IndexMask(ctx
->Exec
, (mask
));
2921 static void GLAPIENTRY
2922 save_InitNames(void)
2924 GET_CURRENT_CONTEXT(ctx
);
2925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2926 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2927 if (ctx
->ExecuteFlag
) {
2928 CALL_InitNames(ctx
->Exec
, ());
2933 static void GLAPIENTRY
2934 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2936 GET_CURRENT_CONTEXT(ctx
);
2938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2939 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2957 case GL_SPOT_DIRECTION
:
2960 case GL_SPOT_EXPONENT
:
2963 case GL_SPOT_CUTOFF
:
2966 case GL_CONSTANT_ATTENUATION
:
2969 case GL_LINEAR_ATTENUATION
:
2972 case GL_QUADRATIC_ATTENUATION
:
2978 for (i
= 0; i
< nParams
; i
++) {
2979 n
[3 + i
].f
= params
[i
];
2982 if (ctx
->ExecuteFlag
) {
2983 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2988 static void GLAPIENTRY
2989 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2993 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2994 save_Lightfv(light
, pname
, parray
);
2998 static void GLAPIENTRY
2999 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3006 fparam
[0] = INT_TO_FLOAT(params
[0]);
3007 fparam
[1] = INT_TO_FLOAT(params
[1]);
3008 fparam
[2] = INT_TO_FLOAT(params
[2]);
3009 fparam
[3] = INT_TO_FLOAT(params
[3]);
3012 fparam
[0] = (GLfloat
) params
[0];
3013 fparam
[1] = (GLfloat
) params
[1];
3014 fparam
[2] = (GLfloat
) params
[2];
3015 fparam
[3] = (GLfloat
) params
[3];
3017 case GL_SPOT_DIRECTION
:
3018 fparam
[0] = (GLfloat
) params
[0];
3019 fparam
[1] = (GLfloat
) params
[1];
3020 fparam
[2] = (GLfloat
) params
[2];
3022 case GL_SPOT_EXPONENT
:
3023 case GL_SPOT_CUTOFF
:
3024 case GL_CONSTANT_ATTENUATION
:
3025 case GL_LINEAR_ATTENUATION
:
3026 case GL_QUADRATIC_ATTENUATION
:
3027 fparam
[0] = (GLfloat
) params
[0];
3030 /* error will be caught later in gl_Lightfv */
3033 save_Lightfv(light
, pname
, fparam
);
3037 static void GLAPIENTRY
3038 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3042 parray
[1] = parray
[2] = parray
[3] = 0;
3043 save_Lightiv(light
, pname
, parray
);
3047 static void GLAPIENTRY
3048 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3050 GET_CURRENT_CONTEXT(ctx
);
3052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3053 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3061 if (ctx
->ExecuteFlag
) {
3062 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3067 static void GLAPIENTRY
3068 save_LightModelf(GLenum pname
, GLfloat param
)
3072 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3073 save_LightModelfv(pname
, parray
);
3077 static void GLAPIENTRY
3078 save_LightModeliv(GLenum pname
, const GLint
*params
)
3082 case GL_LIGHT_MODEL_AMBIENT
:
3083 fparam
[0] = INT_TO_FLOAT(params
[0]);
3084 fparam
[1] = INT_TO_FLOAT(params
[1]);
3085 fparam
[2] = INT_TO_FLOAT(params
[2]);
3086 fparam
[3] = INT_TO_FLOAT(params
[3]);
3088 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3089 case GL_LIGHT_MODEL_TWO_SIDE
:
3090 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3091 fparam
[0] = (GLfloat
) params
[0];
3097 /* Error will be caught later in gl_LightModelfv */
3098 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3100 save_LightModelfv(pname
, fparam
);
3104 static void GLAPIENTRY
3105 save_LightModeli(GLenum pname
, GLint param
)
3109 parray
[1] = parray
[2] = parray
[3] = 0;
3110 save_LightModeliv(pname
, parray
);
3114 static void GLAPIENTRY
3115 save_LineStipple(GLint factor
, GLushort pattern
)
3117 GET_CURRENT_CONTEXT(ctx
);
3119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3120 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3125 if (ctx
->ExecuteFlag
) {
3126 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3131 static void GLAPIENTRY
3132 save_LineWidth(GLfloat width
)
3134 GET_CURRENT_CONTEXT(ctx
);
3136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3137 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3141 if (ctx
->ExecuteFlag
) {
3142 CALL_LineWidth(ctx
->Exec
, (width
));
3147 static void GLAPIENTRY
3148 save_ListBase(GLuint base
)
3150 GET_CURRENT_CONTEXT(ctx
);
3152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3153 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3157 if (ctx
->ExecuteFlag
) {
3158 CALL_ListBase(ctx
->Exec
, (base
));
3163 static void GLAPIENTRY
3164 save_LoadIdentity(void)
3166 GET_CURRENT_CONTEXT(ctx
);
3167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3168 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3169 if (ctx
->ExecuteFlag
) {
3170 CALL_LoadIdentity(ctx
->Exec
, ());
3175 static void GLAPIENTRY
3176 save_LoadMatrixf(const GLfloat
* m
)
3178 GET_CURRENT_CONTEXT(ctx
);
3180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3181 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3184 for (i
= 0; i
< 16; i
++) {
3188 if (ctx
->ExecuteFlag
) {
3189 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3194 static void GLAPIENTRY
3195 save_LoadMatrixd(const GLdouble
* m
)
3199 for (i
= 0; i
< 16; i
++) {
3200 f
[i
] = (GLfloat
) m
[i
];
3202 save_LoadMatrixf(f
);
3206 static void GLAPIENTRY
3207 save_LoadName(GLuint name
)
3209 GET_CURRENT_CONTEXT(ctx
);
3211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3212 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3216 if (ctx
->ExecuteFlag
) {
3217 CALL_LoadName(ctx
->Exec
, (name
));
3222 static void GLAPIENTRY
3223 save_LogicOp(GLenum opcode
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3232 if (ctx
->ExecuteFlag
) {
3233 CALL_LogicOp(ctx
->Exec
, (opcode
));
3238 static void GLAPIENTRY
3239 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3240 GLint order
, const GLdouble
* points
)
3242 GET_CURRENT_CONTEXT(ctx
);
3244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3245 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3247 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3249 n
[2].f
= (GLfloat
) u1
;
3250 n
[3].f
= (GLfloat
) u2
;
3251 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3253 save_pointer(&n
[6], pnts
);
3255 if (ctx
->ExecuteFlag
) {
3256 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3260 static void GLAPIENTRY
3261 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3262 GLint order
, const GLfloat
* points
)
3264 GET_CURRENT_CONTEXT(ctx
);
3266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3267 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3269 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3273 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3275 save_pointer(&n
[6], pnts
);
3277 if (ctx
->ExecuteFlag
) {
3278 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3283 static void GLAPIENTRY
3284 save_Map2d(GLenum target
,
3285 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3286 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3287 const GLdouble
* points
)
3289 GET_CURRENT_CONTEXT(ctx
);
3291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3292 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3294 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3295 vstride
, vorder
, points
);
3297 n
[2].f
= (GLfloat
) u1
;
3298 n
[3].f
= (GLfloat
) u2
;
3299 n
[4].f
= (GLfloat
) v1
;
3300 n
[5].f
= (GLfloat
) v2
;
3301 /* XXX verify these strides are correct */
3302 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3303 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3306 save_pointer(&n
[10], pnts
);
3308 if (ctx
->ExecuteFlag
) {
3309 CALL_Map2d(ctx
->Exec
, (target
,
3310 u1
, u2
, ustride
, uorder
,
3311 v1
, v2
, vstride
, vorder
, points
));
3316 static void GLAPIENTRY
3317 save_Map2f(GLenum target
,
3318 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3319 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3320 const GLfloat
* points
)
3322 GET_CURRENT_CONTEXT(ctx
);
3324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3325 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3327 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3328 vstride
, vorder
, points
);
3334 /* XXX verify these strides are correct */
3335 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3336 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3339 save_pointer(&n
[10], pnts
);
3341 if (ctx
->ExecuteFlag
) {
3342 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3343 v1
, v2
, vstride
, vorder
, points
));
3348 static void GLAPIENTRY
3349 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3351 GET_CURRENT_CONTEXT(ctx
);
3353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3354 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3360 if (ctx
->ExecuteFlag
) {
3361 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3366 static void GLAPIENTRY
3367 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3369 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3373 static void GLAPIENTRY
3374 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3375 GLint vn
, GLfloat v1
, GLfloat v2
)
3377 GET_CURRENT_CONTEXT(ctx
);
3379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3380 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3389 if (ctx
->ExecuteFlag
) {
3390 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3396 static void GLAPIENTRY
3397 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3398 GLint vn
, GLdouble v1
, GLdouble v2
)
3400 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3401 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3405 static void GLAPIENTRY
3406 save_MatrixMode(GLenum mode
)
3408 GET_CURRENT_CONTEXT(ctx
);
3410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3411 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3415 if (ctx
->ExecuteFlag
) {
3416 CALL_MatrixMode(ctx
->Exec
, (mode
));
3421 static void GLAPIENTRY
3422 save_MultMatrixf(const GLfloat
* m
)
3424 GET_CURRENT_CONTEXT(ctx
);
3426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3427 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3430 for (i
= 0; i
< 16; i
++) {
3434 if (ctx
->ExecuteFlag
) {
3435 CALL_MultMatrixf(ctx
->Exec
, (m
));
3440 static void GLAPIENTRY
3441 save_MultMatrixd(const GLdouble
* m
)
3445 for (i
= 0; i
< 16; i
++) {
3446 f
[i
] = (GLfloat
) m
[i
];
3448 save_MultMatrixf(f
);
3452 static void GLAPIENTRY
3453 save_NewList(GLuint name
, GLenum mode
)
3455 GET_CURRENT_CONTEXT(ctx
);
3456 /* It's an error to call this function while building a display list */
3457 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3464 static void GLAPIENTRY
3465 save_Ortho(GLdouble left
, GLdouble right
,
3466 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3468 GET_CURRENT_CONTEXT(ctx
);
3470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3471 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3473 n
[1].f
= (GLfloat
) left
;
3474 n
[2].f
= (GLfloat
) right
;
3475 n
[3].f
= (GLfloat
) bottom
;
3476 n
[4].f
= (GLfloat
) top
;
3477 n
[5].f
= (GLfloat
) nearval
;
3478 n
[6].f
= (GLfloat
) farval
;
3480 if (ctx
->ExecuteFlag
) {
3481 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3486 static void GLAPIENTRY
3487 save_PatchParameteri(GLenum pname
, const GLint value
)
3489 GET_CURRENT_CONTEXT(ctx
);
3491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3492 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3497 if (ctx
->ExecuteFlag
) {
3498 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3503 static void GLAPIENTRY
3504 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3506 GET_CURRENT_CONTEXT(ctx
);
3508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3510 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3511 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3513 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3514 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3518 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3528 if (ctx
->ExecuteFlag
) {
3529 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3534 static void GLAPIENTRY
3535 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3537 GET_CURRENT_CONTEXT(ctx
);
3539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3540 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3544 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3546 if (ctx
->ExecuteFlag
) {
3547 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3552 static void GLAPIENTRY
3553 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3555 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3557 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3558 for (i
= 0; i
< mapsize
; i
++) {
3559 fvalues
[i
] = (GLfloat
) values
[i
];
3563 for (i
= 0; i
< mapsize
; i
++) {
3564 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3567 save_PixelMapfv(map
, mapsize
, fvalues
);
3571 static void GLAPIENTRY
3572 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3574 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3576 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3577 for (i
= 0; i
< mapsize
; i
++) {
3578 fvalues
[i
] = (GLfloat
) values
[i
];
3582 for (i
= 0; i
< mapsize
; i
++) {
3583 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3586 save_PixelMapfv(map
, mapsize
, fvalues
);
3590 static void GLAPIENTRY
3591 save_PixelTransferf(GLenum pname
, GLfloat param
)
3593 GET_CURRENT_CONTEXT(ctx
);
3595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3596 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3601 if (ctx
->ExecuteFlag
) {
3602 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3607 static void GLAPIENTRY
3608 save_PixelTransferi(GLenum pname
, GLint param
)
3610 save_PixelTransferf(pname
, (GLfloat
) param
);
3614 static void GLAPIENTRY
3615 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3617 GET_CURRENT_CONTEXT(ctx
);
3619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3620 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3625 if (ctx
->ExecuteFlag
) {
3626 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3631 static void GLAPIENTRY
3632 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3634 GET_CURRENT_CONTEXT(ctx
);
3636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3637 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3644 if (ctx
->ExecuteFlag
) {
3645 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3650 static void GLAPIENTRY
3651 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3655 parray
[1] = parray
[2] = 0.0F
;
3656 save_PointParameterfvEXT(pname
, parray
);
3659 static void GLAPIENTRY
3660 save_PointParameteriNV(GLenum pname
, GLint param
)
3663 parray
[0] = (GLfloat
) param
;
3664 parray
[1] = parray
[2] = 0.0F
;
3665 save_PointParameterfvEXT(pname
, parray
);
3668 static void GLAPIENTRY
3669 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3672 parray
[0] = (GLfloat
) param
[0];
3673 parray
[1] = parray
[2] = 0.0F
;
3674 save_PointParameterfvEXT(pname
, parray
);
3678 static void GLAPIENTRY
3679 save_PointSize(GLfloat size
)
3681 GET_CURRENT_CONTEXT(ctx
);
3683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3684 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3688 if (ctx
->ExecuteFlag
) {
3689 CALL_PointSize(ctx
->Exec
, (size
));
3694 static void GLAPIENTRY
3695 save_PolygonMode(GLenum face
, GLenum mode
)
3697 GET_CURRENT_CONTEXT(ctx
);
3699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3700 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3705 if (ctx
->ExecuteFlag
) {
3706 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3711 static void GLAPIENTRY
3712 save_PolygonStipple(const GLubyte
* pattern
)
3714 GET_CURRENT_CONTEXT(ctx
);
3717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3719 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3722 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3723 pattern
, &ctx
->Unpack
));
3725 if (ctx
->ExecuteFlag
) {
3726 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3731 static void GLAPIENTRY
3732 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3734 GET_CURRENT_CONTEXT(ctx
);
3736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3737 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3742 if (ctx
->ExecuteFlag
) {
3743 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3748 static void GLAPIENTRY
3749 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3751 GET_CURRENT_CONTEXT(ctx
);
3753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3754 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3760 if (ctx
->ExecuteFlag
) {
3761 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3765 static void GLAPIENTRY
3766 save_PopAttrib(void)
3768 GET_CURRENT_CONTEXT(ctx
);
3769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3770 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3771 if (ctx
->ExecuteFlag
) {
3772 CALL_PopAttrib(ctx
->Exec
, ());
3777 static void GLAPIENTRY
3778 save_PopMatrix(void)
3780 GET_CURRENT_CONTEXT(ctx
);
3781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3782 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3783 if (ctx
->ExecuteFlag
) {
3784 CALL_PopMatrix(ctx
->Exec
, ());
3789 static void GLAPIENTRY
3792 GET_CURRENT_CONTEXT(ctx
);
3793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3794 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3795 if (ctx
->ExecuteFlag
) {
3796 CALL_PopName(ctx
->Exec
, ());
3801 static void GLAPIENTRY
3802 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3803 const GLclampf
* priorities
)
3805 GET_CURRENT_CONTEXT(ctx
);
3807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3809 for (i
= 0; i
< num
; i
++) {
3811 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3813 n
[1].ui
= textures
[i
];
3814 n
[2].f
= priorities
[i
];
3817 if (ctx
->ExecuteFlag
) {
3818 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3823 static void GLAPIENTRY
3824 save_PushAttrib(GLbitfield mask
)
3826 GET_CURRENT_CONTEXT(ctx
);
3828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3829 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3833 if (ctx
->ExecuteFlag
) {
3834 CALL_PushAttrib(ctx
->Exec
, (mask
));
3839 static void GLAPIENTRY
3840 save_PushMatrix(void)
3842 GET_CURRENT_CONTEXT(ctx
);
3843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3844 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3845 if (ctx
->ExecuteFlag
) {
3846 CALL_PushMatrix(ctx
->Exec
, ());
3851 static void GLAPIENTRY
3852 save_PushName(GLuint name
)
3854 GET_CURRENT_CONTEXT(ctx
);
3856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3857 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3861 if (ctx
->ExecuteFlag
) {
3862 CALL_PushName(ctx
->Exec
, (name
));
3867 static void GLAPIENTRY
3868 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3870 GET_CURRENT_CONTEXT(ctx
);
3872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3873 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3880 if (ctx
->ExecuteFlag
) {
3881 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3885 static void GLAPIENTRY
3886 save_RasterPos2d(GLdouble x
, GLdouble y
)
3888 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3891 static void GLAPIENTRY
3892 save_RasterPos2f(GLfloat x
, GLfloat y
)
3894 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3897 static void GLAPIENTRY
3898 save_RasterPos2i(GLint x
, GLint y
)
3900 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3903 static void GLAPIENTRY
3904 save_RasterPos2s(GLshort x
, GLshort y
)
3906 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3909 static void GLAPIENTRY
3910 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3912 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3915 static void GLAPIENTRY
3916 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3918 save_RasterPos4f(x
, y
, z
, 1.0F
);
3921 static void GLAPIENTRY
3922 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3924 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3927 static void GLAPIENTRY
3928 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3930 save_RasterPos4f(x
, y
, z
, 1.0F
);
3933 static void GLAPIENTRY
3934 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3936 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3939 static void GLAPIENTRY
3940 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3942 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3945 static void GLAPIENTRY
3946 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3948 save_RasterPos4f(x
, y
, z
, w
);
3951 static void GLAPIENTRY
3952 save_RasterPos2dv(const GLdouble
* v
)
3954 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3957 static void GLAPIENTRY
3958 save_RasterPos2fv(const GLfloat
* v
)
3960 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3963 static void GLAPIENTRY
3964 save_RasterPos2iv(const GLint
* v
)
3966 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3969 static void GLAPIENTRY
3970 save_RasterPos2sv(const GLshort
* v
)
3972 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3975 static void GLAPIENTRY
3976 save_RasterPos3dv(const GLdouble
* v
)
3978 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3981 static void GLAPIENTRY
3982 save_RasterPos3fv(const GLfloat
* v
)
3984 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3987 static void GLAPIENTRY
3988 save_RasterPos3iv(const GLint
* v
)
3990 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3993 static void GLAPIENTRY
3994 save_RasterPos3sv(const GLshort
* v
)
3996 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3999 static void GLAPIENTRY
4000 save_RasterPos4dv(const GLdouble
* v
)
4002 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4003 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4006 static void GLAPIENTRY
4007 save_RasterPos4fv(const GLfloat
* v
)
4009 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4012 static void GLAPIENTRY
4013 save_RasterPos4iv(const GLint
* v
)
4015 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4016 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4019 static void GLAPIENTRY
4020 save_RasterPos4sv(const GLshort
* v
)
4022 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4026 static void GLAPIENTRY
4027 save_PassThrough(GLfloat token
)
4029 GET_CURRENT_CONTEXT(ctx
);
4031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4032 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4036 if (ctx
->ExecuteFlag
) {
4037 CALL_PassThrough(ctx
->Exec
, (token
));
4042 static void GLAPIENTRY
4043 save_ReadBuffer(GLenum mode
)
4045 GET_CURRENT_CONTEXT(ctx
);
4047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4048 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4052 if (ctx
->ExecuteFlag
) {
4053 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4058 static void GLAPIENTRY
4059 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4061 GET_CURRENT_CONTEXT(ctx
);
4063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4064 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4071 if (ctx
->ExecuteFlag
) {
4072 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4077 static void GLAPIENTRY
4078 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4080 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4084 static void GLAPIENTRY
4085 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4087 GET_CURRENT_CONTEXT(ctx
);
4089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4090 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4096 if (ctx
->ExecuteFlag
) {
4097 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4102 static void GLAPIENTRY
4103 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4105 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4109 static void GLAPIENTRY
4110 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4112 GET_CURRENT_CONTEXT(ctx
);
4114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4115 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4122 if (ctx
->ExecuteFlag
) {
4123 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4128 static void GLAPIENTRY
4129 save_ShadeModel(GLenum mode
)
4131 GET_CURRENT_CONTEXT(ctx
);
4133 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4135 if (ctx
->ExecuteFlag
) {
4136 CALL_ShadeModel(ctx
->Exec
, (mode
));
4139 /* Don't compile this call if it's a no-op.
4140 * By avoiding this state change we have a better chance of
4141 * coalescing subsequent drawing commands into one batch.
4143 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4146 SAVE_FLUSH_VERTICES(ctx
);
4148 ctx
->ListState
.Current
.ShadeModel
= mode
;
4150 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4157 static void GLAPIENTRY
4158 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4160 GET_CURRENT_CONTEXT(ctx
);
4162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4163 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4169 if (ctx
->ExecuteFlag
) {
4170 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4175 static void GLAPIENTRY
4176 save_StencilMask(GLuint mask
)
4178 GET_CURRENT_CONTEXT(ctx
);
4180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4181 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4185 if (ctx
->ExecuteFlag
) {
4186 CALL_StencilMask(ctx
->Exec
, (mask
));
4191 static void GLAPIENTRY
4192 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4194 GET_CURRENT_CONTEXT(ctx
);
4196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4197 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4203 if (ctx
->ExecuteFlag
) {
4204 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4209 static void GLAPIENTRY
4210 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4212 GET_CURRENT_CONTEXT(ctx
);
4214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4215 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4222 if (ctx
->ExecuteFlag
) {
4223 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4228 static void GLAPIENTRY
4229 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4232 GET_CURRENT_CONTEXT(ctx
);
4234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4236 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4244 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4251 if (ctx
->ExecuteFlag
) {
4252 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4253 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4258 static void GLAPIENTRY
4259 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4261 GET_CURRENT_CONTEXT(ctx
);
4263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4264 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4269 if (ctx
->ExecuteFlag
) {
4270 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4275 static void GLAPIENTRY
4276 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4278 GET_CURRENT_CONTEXT(ctx
);
4280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4281 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4288 if (ctx
->ExecuteFlag
) {
4289 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4294 static void GLAPIENTRY
4295 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4297 GET_CURRENT_CONTEXT(ctx
);
4299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4300 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4304 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4312 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4315 if (ctx
->ExecuteFlag
) {
4316 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4321 static void GLAPIENTRY
4322 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4325 parray
[0] = (GLfloat
) param
;
4326 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4327 save_TexEnvfv(target
, pname
, parray
);
4331 static void GLAPIENTRY
4332 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4335 p
[0] = (GLfloat
) param
;
4336 p
[1] = p
[2] = p
[3] = 0.0F
;
4337 save_TexEnvfv(target
, pname
, p
);
4341 static void GLAPIENTRY
4342 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4345 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4346 p
[0] = INT_TO_FLOAT(param
[0]);
4347 p
[1] = INT_TO_FLOAT(param
[1]);
4348 p
[2] = INT_TO_FLOAT(param
[2]);
4349 p
[3] = INT_TO_FLOAT(param
[3]);
4352 p
[0] = (GLfloat
) param
[0];
4353 p
[1] = p
[2] = p
[3] = 0.0F
;
4355 save_TexEnvfv(target
, pname
, p
);
4359 static void GLAPIENTRY
4360 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4362 GET_CURRENT_CONTEXT(ctx
);
4364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4365 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4374 if (ctx
->ExecuteFlag
) {
4375 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4380 static void GLAPIENTRY
4381 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4384 p
[0] = (GLfloat
) params
[0];
4385 p
[1] = (GLfloat
) params
[1];
4386 p
[2] = (GLfloat
) params
[2];
4387 p
[3] = (GLfloat
) params
[3];
4388 save_TexGenfv(coord
, pname
, p
);
4392 static void GLAPIENTRY
4393 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4396 parray
[0] = (GLfloat
) param
;
4397 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4398 save_TexGenfv(coord
, pname
, parray
);
4402 static void GLAPIENTRY
4403 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4406 p
[0] = (GLfloat
) params
[0];
4407 p
[1] = (GLfloat
) params
[1];
4408 p
[2] = (GLfloat
) params
[2];
4409 p
[3] = (GLfloat
) params
[3];
4410 save_TexGenfv(coord
, pname
, p
);
4414 static void GLAPIENTRY
4415 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4419 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4420 save_TexGenfv(coord
, pname
, parray
);
4424 static void GLAPIENTRY
4425 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4429 parray
[1] = parray
[2] = parray
[3] = 0;
4430 save_TexGeniv(coord
, pname
, parray
);
4434 static void GLAPIENTRY
4435 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4437 GET_CURRENT_CONTEXT(ctx
);
4439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4440 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4449 if (ctx
->ExecuteFlag
) {
4450 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4455 static void GLAPIENTRY
4456 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4460 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4461 save_TexParameterfv(target
, pname
, parray
);
4465 static void GLAPIENTRY
4466 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4469 fparam
[0] = (GLfloat
) param
;
4470 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4471 save_TexParameterfv(target
, pname
, fparam
);
4475 static void GLAPIENTRY
4476 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4479 fparam
[0] = (GLfloat
) params
[0];
4480 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4481 save_TexParameterfv(target
, pname
, fparam
);
4485 static void GLAPIENTRY
4486 save_TexImage1D(GLenum target
,
4487 GLint level
, GLint components
,
4488 GLsizei width
, GLint border
,
4489 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4491 GET_CURRENT_CONTEXT(ctx
);
4492 if (target
== GL_PROXY_TEXTURE_1D
) {
4493 /* don't compile, execute immediately */
4494 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4495 border
, format
, type
, pixels
));
4499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4500 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4504 n
[3].i
= components
;
4505 n
[4].i
= (GLint
) width
;
4510 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4511 pixels
, &ctx
->Unpack
));
4513 if (ctx
->ExecuteFlag
) {
4514 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4515 border
, format
, type
, pixels
));
4521 static void GLAPIENTRY
4522 save_TexImage2D(GLenum target
,
4523 GLint level
, GLint components
,
4524 GLsizei width
, GLsizei height
, GLint border
,
4525 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4527 GET_CURRENT_CONTEXT(ctx
);
4528 if (target
== GL_PROXY_TEXTURE_2D
) {
4529 /* don't compile, execute immediately */
4530 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4531 height
, border
, format
, type
, pixels
));
4535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4536 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4540 n
[3].i
= components
;
4541 n
[4].i
= (GLint
) width
;
4542 n
[5].i
= (GLint
) height
;
4547 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4548 pixels
, &ctx
->Unpack
));
4550 if (ctx
->ExecuteFlag
) {
4551 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4552 height
, border
, format
, type
, pixels
));
4558 static void GLAPIENTRY
4559 save_TexImage3D(GLenum target
,
4560 GLint level
, GLint internalFormat
,
4561 GLsizei width
, GLsizei height
, GLsizei depth
,
4563 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4565 GET_CURRENT_CONTEXT(ctx
);
4566 if (target
== GL_PROXY_TEXTURE_3D
) {
4567 /* don't compile, execute immediately */
4568 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4569 height
, depth
, border
, format
, type
,
4574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4575 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4579 n
[3].i
= (GLint
) internalFormat
;
4580 n
[4].i
= (GLint
) width
;
4581 n
[5].i
= (GLint
) height
;
4582 n
[6].i
= (GLint
) depth
;
4586 save_pointer(&n
[10],
4587 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4588 pixels
, &ctx
->Unpack
));
4590 if (ctx
->ExecuteFlag
) {
4591 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4592 height
, depth
, border
, format
, type
,
4599 static void GLAPIENTRY
4600 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4601 GLsizei width
, GLenum format
, GLenum type
,
4602 const GLvoid
* pixels
)
4604 GET_CURRENT_CONTEXT(ctx
);
4607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4609 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4614 n
[4].i
= (GLint
) width
;
4618 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4619 pixels
, &ctx
->Unpack
));
4621 if (ctx
->ExecuteFlag
) {
4622 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4623 format
, type
, pixels
));
4628 static void GLAPIENTRY
4629 save_TexSubImage2D(GLenum target
, GLint level
,
4630 GLint xoffset
, GLint yoffset
,
4631 GLsizei width
, GLsizei height
,
4632 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4634 GET_CURRENT_CONTEXT(ctx
);
4637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4639 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4645 n
[5].i
= (GLint
) width
;
4646 n
[6].i
= (GLint
) height
;
4650 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4651 pixels
, &ctx
->Unpack
));
4653 if (ctx
->ExecuteFlag
) {
4654 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4655 width
, height
, format
, type
, pixels
));
4660 static void GLAPIENTRY
4661 save_TexSubImage3D(GLenum target
, GLint level
,
4662 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4663 GLsizei width
, GLsizei height
, GLsizei depth
,
4664 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4666 GET_CURRENT_CONTEXT(ctx
);
4669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4671 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4678 n
[6].i
= (GLint
) width
;
4679 n
[7].i
= (GLint
) height
;
4680 n
[8].i
= (GLint
) depth
;
4683 save_pointer(&n
[11],
4684 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4685 pixels
, &ctx
->Unpack
));
4687 if (ctx
->ExecuteFlag
) {
4688 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4689 xoffset
, yoffset
, zoffset
,
4690 width
, height
, depth
, format
, type
,
4696 static void GLAPIENTRY
4697 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4699 GET_CURRENT_CONTEXT(ctx
);
4701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4702 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4708 if (ctx
->ExecuteFlag
) {
4709 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4714 static void GLAPIENTRY
4715 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4717 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4722 static void GLAPIENTRY
4723 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4725 GET_CURRENT_CONTEXT(ctx
);
4727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4728 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4732 n
[3].i
= (GLint
) width
;
4733 n
[4].i
= (GLint
) height
;
4735 if (ctx
->ExecuteFlag
) {
4736 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4740 static void GLAPIENTRY
4741 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4744 GET_CURRENT_CONTEXT(ctx
);
4746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4747 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4755 if (ctx
->ExecuteFlag
) {
4756 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4760 static void GLAPIENTRY
4761 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4763 GET_CURRENT_CONTEXT(ctx
);
4765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4766 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4774 if (ctx
->ExecuteFlag
) {
4775 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4779 static void GLAPIENTRY
4780 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4782 GET_CURRENT_CONTEXT(ctx
);
4784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4785 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4789 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4791 if (ctx
->ExecuteFlag
) {
4792 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4796 static void GLAPIENTRY
4797 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4800 GET_CURRENT_CONTEXT(ctx
);
4802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4803 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4811 if (ctx
->ExecuteFlag
) {
4812 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4816 static void GLAPIENTRY
4817 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4819 GET_CURRENT_CONTEXT(ctx
);
4821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4822 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4830 if (ctx
->ExecuteFlag
) {
4831 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4835 static void GLAPIENTRY
4836 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4838 GET_CURRENT_CONTEXT(ctx
);
4840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4841 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4845 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4847 if (ctx
->ExecuteFlag
) {
4848 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4852 static void GLAPIENTRY
4853 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4855 GET_CURRENT_CONTEXT(ctx
);
4857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4858 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4861 /* Mesa stores these as floats internally so we deliberately convert
4862 * them to a float here.
4867 if (ctx
->ExecuteFlag
) {
4868 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4872 static void GLAPIENTRY
4873 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4878 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4882 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4884 if (ctx
->ExecuteFlag
) {
4885 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4889 static void GLAPIENTRY
4890 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4892 GET_CURRENT_CONTEXT(ctx
);
4894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4895 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4902 if (ctx
->ExecuteFlag
) {
4903 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4907 static void GLAPIENTRY
4908 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4910 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4913 static void GLAPIENTRY
4914 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4916 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4919 static void GLAPIENTRY
4920 save_WindowPos2iMESA(GLint x
, GLint y
)
4922 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4925 static void GLAPIENTRY
4926 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4928 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4931 static void GLAPIENTRY
4932 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4934 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4937 static void GLAPIENTRY
4938 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4940 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4943 static void GLAPIENTRY
4944 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4946 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4949 static void GLAPIENTRY
4950 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4952 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4955 static void GLAPIENTRY
4956 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4958 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4961 static void GLAPIENTRY
4962 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4964 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4967 static void GLAPIENTRY
4968 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4970 save_WindowPos4fMESA(x
, y
, z
, w
);
4973 static void GLAPIENTRY
4974 save_WindowPos2dvMESA(const GLdouble
* v
)
4976 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4979 static void GLAPIENTRY
4980 save_WindowPos2fvMESA(const GLfloat
* v
)
4982 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4985 static void GLAPIENTRY
4986 save_WindowPos2ivMESA(const GLint
* v
)
4988 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4991 static void GLAPIENTRY
4992 save_WindowPos2svMESA(const GLshort
* v
)
4994 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4997 static void GLAPIENTRY
4998 save_WindowPos3dvMESA(const GLdouble
* v
)
5000 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5003 static void GLAPIENTRY
5004 save_WindowPos3fvMESA(const GLfloat
* v
)
5006 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5009 static void GLAPIENTRY
5010 save_WindowPos3ivMESA(const GLint
* v
)
5012 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5015 static void GLAPIENTRY
5016 save_WindowPos3svMESA(const GLshort
* v
)
5018 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5021 static void GLAPIENTRY
5022 save_WindowPos4dvMESA(const GLdouble
* v
)
5024 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5025 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5028 static void GLAPIENTRY
5029 save_WindowPos4fvMESA(const GLfloat
* v
)
5031 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5034 static void GLAPIENTRY
5035 save_WindowPos4ivMESA(const GLint
* v
)
5037 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5038 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5041 static void GLAPIENTRY
5042 save_WindowPos4svMESA(const GLshort
* v
)
5044 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5049 /* GL_ARB_multitexture */
5050 static void GLAPIENTRY
5051 save_ActiveTextureARB(GLenum target
)
5053 GET_CURRENT_CONTEXT(ctx
);
5055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5056 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5060 if (ctx
->ExecuteFlag
) {
5061 CALL_ActiveTexture(ctx
->Exec
, (target
));
5066 /* GL_ARB_transpose_matrix */
5068 static void GLAPIENTRY
5069 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5072 _math_transposefd(tm
, m
);
5073 save_LoadMatrixf(tm
);
5077 static void GLAPIENTRY
5078 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5081 _math_transposef(tm
, m
);
5082 save_LoadMatrixf(tm
);
5086 static void GLAPIENTRY
5087 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5090 _math_transposefd(tm
, m
);
5091 save_MultMatrixf(tm
);
5095 static void GLAPIENTRY
5096 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5099 _math_transposef(tm
, m
);
5100 save_MultMatrixf(tm
);
5103 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5105 GET_CURRENT_CONTEXT(ctx
);
5111 image
= malloc(size
);
5113 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5116 memcpy(image
, data
, size
);
5122 /* GL_ARB_texture_compression */
5123 static void GLAPIENTRY
5124 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5125 GLenum internalFormat
, GLsizei width
,
5126 GLint border
, GLsizei imageSize
,
5127 const GLvoid
* data
)
5129 GET_CURRENT_CONTEXT(ctx
);
5130 if (target
== GL_PROXY_TEXTURE_1D
) {
5131 /* don't compile, execute immediately */
5132 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5133 width
, border
, imageSize
,
5138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5140 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5141 6 + POINTER_DWORDS
);
5145 n
[3].e
= internalFormat
;
5146 n
[4].i
= (GLint
) width
;
5150 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5152 if (ctx
->ExecuteFlag
) {
5153 CALL_CompressedTexImage1D(ctx
->Exec
,
5154 (target
, level
, internalFormat
, width
,
5155 border
, imageSize
, data
));
5161 static void GLAPIENTRY
5162 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5163 GLenum internalFormat
, GLsizei width
,
5164 GLsizei height
, GLint border
, GLsizei imageSize
,
5165 const GLvoid
* data
)
5167 GET_CURRENT_CONTEXT(ctx
);
5168 if (target
== GL_PROXY_TEXTURE_2D
) {
5169 /* don't compile, execute immediately */
5170 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5171 width
, height
, border
,
5176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5178 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5179 7 + POINTER_DWORDS
);
5183 n
[3].e
= internalFormat
;
5184 n
[4].i
= (GLint
) width
;
5185 n
[5].i
= (GLint
) height
;
5189 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5191 if (ctx
->ExecuteFlag
) {
5192 CALL_CompressedTexImage2D(ctx
->Exec
,
5193 (target
, level
, internalFormat
, width
,
5194 height
, border
, imageSize
, data
));
5200 static void GLAPIENTRY
5201 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5202 GLenum internalFormat
, GLsizei width
,
5203 GLsizei height
, GLsizei depth
, GLint border
,
5204 GLsizei imageSize
, const GLvoid
* data
)
5206 GET_CURRENT_CONTEXT(ctx
);
5207 if (target
== GL_PROXY_TEXTURE_3D
) {
5208 /* don't compile, execute immediately */
5209 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5210 width
, height
, depth
, border
,
5215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5217 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5218 8 + POINTER_DWORDS
);
5222 n
[3].e
= internalFormat
;
5223 n
[4].i
= (GLint
) width
;
5224 n
[5].i
= (GLint
) height
;
5225 n
[6].i
= (GLint
) depth
;
5229 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5231 if (ctx
->ExecuteFlag
) {
5232 CALL_CompressedTexImage3D(ctx
->Exec
,
5233 (target
, level
, internalFormat
, width
,
5234 height
, depth
, border
, imageSize
,
5241 static void GLAPIENTRY
5242 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5243 GLsizei width
, GLenum format
,
5244 GLsizei imageSize
, const GLvoid
* data
)
5247 GET_CURRENT_CONTEXT(ctx
);
5248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5250 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5251 6 + POINTER_DWORDS
);
5256 n
[4].i
= (GLint
) width
;
5260 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5262 if (ctx
->ExecuteFlag
) {
5263 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5264 width
, format
, imageSize
,
5270 static void GLAPIENTRY
5271 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5272 GLint yoffset
, GLsizei width
, GLsizei height
,
5273 GLenum format
, GLsizei imageSize
,
5274 const GLvoid
* data
)
5277 GET_CURRENT_CONTEXT(ctx
);
5278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5280 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5281 8 + POINTER_DWORDS
);
5287 n
[5].i
= (GLint
) width
;
5288 n
[6].i
= (GLint
) height
;
5292 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5294 if (ctx
->ExecuteFlag
) {
5295 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5296 (target
, level
, xoffset
, yoffset
, width
,
5297 height
, format
, imageSize
, data
));
5302 static void GLAPIENTRY
5303 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5304 GLint yoffset
, GLint zoffset
, GLsizei width
,
5305 GLsizei height
, GLsizei depth
, GLenum format
,
5306 GLsizei imageSize
, const GLvoid
* data
)
5309 GET_CURRENT_CONTEXT(ctx
);
5310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5312 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5313 10 + POINTER_DWORDS
);
5320 n
[6].i
= (GLint
) width
;
5321 n
[7].i
= (GLint
) height
;
5322 n
[8].i
= (GLint
) depth
;
5324 n
[10].i
= imageSize
;
5325 save_pointer(&n
[11],
5326 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5328 if (ctx
->ExecuteFlag
) {
5329 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5330 (target
, level
, xoffset
, yoffset
,
5331 zoffset
, width
, height
, depth
, format
,
5337 /* GL_ARB_multisample */
5338 static void GLAPIENTRY
5339 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5341 GET_CURRENT_CONTEXT(ctx
);
5343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5344 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5349 if (ctx
->ExecuteFlag
) {
5350 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5356 * GL_ARB_vertex_program
5358 static void GLAPIENTRY
5359 save_BindProgramARB(GLenum target
, GLuint id
)
5361 GET_CURRENT_CONTEXT(ctx
);
5363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5364 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5369 if (ctx
->ExecuteFlag
) {
5370 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5374 static void GLAPIENTRY
5375 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5376 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5378 GET_CURRENT_CONTEXT(ctx
);
5380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5381 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5390 if (ctx
->ExecuteFlag
) {
5391 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5396 static void GLAPIENTRY
5397 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5398 const GLfloat
*params
)
5400 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5401 params
[2], params
[3]);
5405 static void GLAPIENTRY
5406 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5407 const GLfloat
* params
)
5409 GET_CURRENT_CONTEXT(ctx
);
5411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5415 const GLfloat
* p
= params
;
5417 for (i
= 0 ; i
< count
; i
++) {
5418 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5431 if (ctx
->ExecuteFlag
) {
5432 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5437 static void GLAPIENTRY
5438 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5439 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5441 save_ProgramEnvParameter4fARB(target
, index
,
5443 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5447 static void GLAPIENTRY
5448 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5449 const GLdouble
*params
)
5451 save_ProgramEnvParameter4fARB(target
, index
,
5452 (GLfloat
) params
[0],
5453 (GLfloat
) params
[1],
5454 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5458 static void GLAPIENTRY
5459 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5460 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5462 GET_CURRENT_CONTEXT(ctx
);
5464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5465 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5474 if (ctx
->ExecuteFlag
) {
5475 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5480 static void GLAPIENTRY
5481 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5482 const GLfloat
*params
)
5484 GET_CURRENT_CONTEXT(ctx
);
5486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5487 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5496 if (ctx
->ExecuteFlag
) {
5497 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5502 static void GLAPIENTRY
5503 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5504 const GLfloat
*params
)
5506 GET_CURRENT_CONTEXT(ctx
);
5508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5512 const GLfloat
* p
= params
;
5514 for (i
= 0 ; i
< count
; i
++) {
5515 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5528 if (ctx
->ExecuteFlag
) {
5529 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5534 static void GLAPIENTRY
5535 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5536 GLdouble x
, GLdouble y
,
5537 GLdouble z
, GLdouble w
)
5539 GET_CURRENT_CONTEXT(ctx
);
5541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5542 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5546 n
[3].f
= (GLfloat
) x
;
5547 n
[4].f
= (GLfloat
) y
;
5548 n
[5].f
= (GLfloat
) z
;
5549 n
[6].f
= (GLfloat
) w
;
5551 if (ctx
->ExecuteFlag
) {
5552 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5557 static void GLAPIENTRY
5558 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5559 const GLdouble
*params
)
5561 GET_CURRENT_CONTEXT(ctx
);
5563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5564 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5568 n
[3].f
= (GLfloat
) params
[0];
5569 n
[4].f
= (GLfloat
) params
[1];
5570 n
[5].f
= (GLfloat
) params
[2];
5571 n
[6].f
= (GLfloat
) params
[3];
5573 if (ctx
->ExecuteFlag
) {
5574 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5579 /* GL_EXT_stencil_two_side */
5580 static void GLAPIENTRY
5581 save_ActiveStencilFaceEXT(GLenum face
)
5583 GET_CURRENT_CONTEXT(ctx
);
5585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5586 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5590 if (ctx
->ExecuteFlag
) {
5591 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5596 /* GL_EXT_depth_bounds_test */
5597 static void GLAPIENTRY
5598 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5600 GET_CURRENT_CONTEXT(ctx
);
5602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5603 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5605 n
[1].f
= (GLfloat
) zmin
;
5606 n
[2].f
= (GLfloat
) zmax
;
5608 if (ctx
->ExecuteFlag
) {
5609 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5615 static void GLAPIENTRY
5616 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5617 const GLvoid
* string
)
5619 GET_CURRENT_CONTEXT(ctx
);
5622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5624 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5626 GLubyte
*programCopy
= malloc(len
);
5628 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5631 memcpy(programCopy
, string
, len
);
5635 save_pointer(&n
[4], programCopy
);
5637 if (ctx
->ExecuteFlag
) {
5638 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5643 static void GLAPIENTRY
5644 save_BeginQueryARB(GLenum target
, GLuint id
)
5646 GET_CURRENT_CONTEXT(ctx
);
5648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5649 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5654 if (ctx
->ExecuteFlag
) {
5655 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5659 static void GLAPIENTRY
5660 save_EndQueryARB(GLenum target
)
5662 GET_CURRENT_CONTEXT(ctx
);
5664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5665 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5669 if (ctx
->ExecuteFlag
) {
5670 CALL_EndQuery(ctx
->Exec
, (target
));
5674 static void GLAPIENTRY
5675 save_QueryCounter(GLuint id
, GLenum target
)
5677 GET_CURRENT_CONTEXT(ctx
);
5679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5680 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5685 if (ctx
->ExecuteFlag
) {
5686 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5690 static void GLAPIENTRY
5691 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5693 GET_CURRENT_CONTEXT(ctx
);
5695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5696 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5702 if (ctx
->ExecuteFlag
) {
5703 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5707 static void GLAPIENTRY
5708 save_EndQueryIndexed(GLenum target
, GLuint index
)
5710 GET_CURRENT_CONTEXT(ctx
);
5712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5713 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5718 if (ctx
->ExecuteFlag
) {
5719 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5724 static void GLAPIENTRY
5725 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5727 GET_CURRENT_CONTEXT(ctx
);
5729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5730 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5734 if (count
> MAX_DRAW_BUFFERS
)
5735 count
= MAX_DRAW_BUFFERS
;
5736 for (i
= 0; i
< count
; i
++) {
5737 n
[2 + i
].e
= buffers
[i
];
5740 if (ctx
->ExecuteFlag
) {
5741 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5745 static void GLAPIENTRY
5746 save_BindFragmentShaderATI(GLuint id
)
5748 GET_CURRENT_CONTEXT(ctx
);
5751 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5755 if (ctx
->ExecuteFlag
) {
5756 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5760 static void GLAPIENTRY
5761 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5763 GET_CURRENT_CONTEXT(ctx
);
5766 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5774 if (ctx
->ExecuteFlag
) {
5775 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5779 static void GLAPIENTRY
5780 save_Attr1fNV(GLenum attr
, GLfloat x
)
5782 GET_CURRENT_CONTEXT(ctx
);
5784 SAVE_FLUSH_VERTICES(ctx
);
5785 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5791 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5792 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5793 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5795 if (ctx
->ExecuteFlag
) {
5796 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5800 static void GLAPIENTRY
5801 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5803 GET_CURRENT_CONTEXT(ctx
);
5805 SAVE_FLUSH_VERTICES(ctx
);
5806 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5813 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5814 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5815 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5817 if (ctx
->ExecuteFlag
) {
5818 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5822 static void GLAPIENTRY
5823 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5825 GET_CURRENT_CONTEXT(ctx
);
5827 SAVE_FLUSH_VERTICES(ctx
);
5828 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5836 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5837 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5838 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5840 if (ctx
->ExecuteFlag
) {
5841 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5845 static void GLAPIENTRY
5846 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5848 GET_CURRENT_CONTEXT(ctx
);
5850 SAVE_FLUSH_VERTICES(ctx
);
5851 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5860 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5861 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5862 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5864 if (ctx
->ExecuteFlag
) {
5865 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5870 static void GLAPIENTRY
5871 save_Attr1fARB(GLenum attr
, GLfloat x
)
5873 GET_CURRENT_CONTEXT(ctx
);
5875 SAVE_FLUSH_VERTICES(ctx
);
5876 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5882 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5883 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5884 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5886 if (ctx
->ExecuteFlag
) {
5887 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5891 static void GLAPIENTRY
5892 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5894 GET_CURRENT_CONTEXT(ctx
);
5896 SAVE_FLUSH_VERTICES(ctx
);
5897 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5904 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5905 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5906 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5908 if (ctx
->ExecuteFlag
) {
5909 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5913 static void GLAPIENTRY
5914 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5916 GET_CURRENT_CONTEXT(ctx
);
5918 SAVE_FLUSH_VERTICES(ctx
);
5919 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5927 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5928 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5929 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5931 if (ctx
->ExecuteFlag
) {
5932 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5936 static void GLAPIENTRY
5937 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5939 GET_CURRENT_CONTEXT(ctx
);
5941 SAVE_FLUSH_VERTICES(ctx
);
5942 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5951 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5952 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5953 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5955 if (ctx
->ExecuteFlag
) {
5956 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5961 static void GLAPIENTRY
5962 save_EvalCoord1f(GLfloat x
)
5964 GET_CURRENT_CONTEXT(ctx
);
5966 SAVE_FLUSH_VERTICES(ctx
);
5967 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5971 if (ctx
->ExecuteFlag
) {
5972 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5976 static void GLAPIENTRY
5977 save_EvalCoord1fv(const GLfloat
* v
)
5979 save_EvalCoord1f(v
[0]);
5982 static void GLAPIENTRY
5983 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5985 GET_CURRENT_CONTEXT(ctx
);
5987 SAVE_FLUSH_VERTICES(ctx
);
5988 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5993 if (ctx
->ExecuteFlag
) {
5994 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5998 static void GLAPIENTRY
5999 save_EvalCoord2fv(const GLfloat
* v
)
6001 save_EvalCoord2f(v
[0], v
[1]);
6005 static void GLAPIENTRY
6006 save_EvalPoint1(GLint x
)
6008 GET_CURRENT_CONTEXT(ctx
);
6010 SAVE_FLUSH_VERTICES(ctx
);
6011 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6015 if (ctx
->ExecuteFlag
) {
6016 CALL_EvalPoint1(ctx
->Exec
, (x
));
6020 static void GLAPIENTRY
6021 save_EvalPoint2(GLint x
, GLint y
)
6023 GET_CURRENT_CONTEXT(ctx
);
6025 SAVE_FLUSH_VERTICES(ctx
);
6026 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6031 if (ctx
->ExecuteFlag
) {
6032 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6036 static void GLAPIENTRY
6037 save_Indexf(GLfloat x
)
6039 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6042 static void GLAPIENTRY
6043 save_Indexfv(const GLfloat
* v
)
6045 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6048 static void GLAPIENTRY
6049 save_EdgeFlag(GLboolean x
)
6051 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6056 * Compare 'count' elements of vectors 'a' and 'b'.
6057 * \return GL_TRUE if equal, GL_FALSE if different.
6059 static inline GLboolean
6060 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6062 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6067 * This glMaterial function is used for glMaterial calls that are outside
6068 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6070 static void GLAPIENTRY
6071 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6073 GET_CURRENT_CONTEXT(ctx
);
6081 case GL_FRONT_AND_BACK
:
6084 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6093 case GL_AMBIENT_AND_DIFFUSE
:
6099 case GL_COLOR_INDEXES
:
6103 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6107 if (ctx
->ExecuteFlag
) {
6108 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6111 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6113 /* Try to eliminate redundant statechanges. Because it is legal to
6114 * call glMaterial even inside begin/end calls, don't need to worry
6115 * about ctx->Driver.CurrentSavePrimitive here.
6117 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6118 if (bitmask
& (1 << i
)) {
6119 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6120 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6121 /* no change in material value */
6122 bitmask
&= ~(1 << i
);
6125 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6126 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6131 /* If this call has no effect, return early */
6135 SAVE_FLUSH_VERTICES(ctx
);
6137 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6141 for (i
= 0; i
< args
; i
++)
6142 n
[3 + i
].f
= param
[i
];
6146 static void GLAPIENTRY
6147 save_Begin(GLenum mode
)
6149 GET_CURRENT_CONTEXT(ctx
);
6151 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6152 /* compile this error into the display list */
6153 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6155 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6156 /* compile this error into the display list */
6157 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6160 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6162 vbo_save_NotifyBegin(ctx
, mode
, false);
6166 static void GLAPIENTRY
6169 GET_CURRENT_CONTEXT(ctx
);
6170 SAVE_FLUSH_VERTICES(ctx
);
6171 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6172 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6173 if (ctx
->ExecuteFlag
) {
6174 CALL_End(ctx
->Exec
, ());
6178 static void GLAPIENTRY
6179 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6181 GET_CURRENT_CONTEXT(ctx
);
6183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6184 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6191 if (ctx
->ExecuteFlag
) {
6192 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6197 static void GLAPIENTRY
6198 save_Vertex2f(GLfloat x
, GLfloat y
)
6200 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6203 static void GLAPIENTRY
6204 save_Vertex2fv(const GLfloat
* v
)
6206 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6209 static void GLAPIENTRY
6210 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6212 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6215 static void GLAPIENTRY
6216 save_Vertex3fv(const GLfloat
* v
)
6218 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6221 static void GLAPIENTRY
6222 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6224 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6227 static void GLAPIENTRY
6228 save_Vertex4fv(const GLfloat
* v
)
6230 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6233 static void GLAPIENTRY
6234 save_TexCoord1f(GLfloat x
)
6236 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6239 static void GLAPIENTRY
6240 save_TexCoord1fv(const GLfloat
* v
)
6242 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6245 static void GLAPIENTRY
6246 save_TexCoord2f(GLfloat x
, GLfloat y
)
6248 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6251 static void GLAPIENTRY
6252 save_TexCoord2fv(const GLfloat
* v
)
6254 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6257 static void GLAPIENTRY
6258 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6260 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6263 static void GLAPIENTRY
6264 save_TexCoord3fv(const GLfloat
* v
)
6266 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6269 static void GLAPIENTRY
6270 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6272 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6275 static void GLAPIENTRY
6276 save_TexCoord4fv(const GLfloat
* v
)
6278 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6281 static void GLAPIENTRY
6282 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6284 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6287 static void GLAPIENTRY
6288 save_Normal3fv(const GLfloat
* v
)
6290 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6293 static void GLAPIENTRY
6294 save_FogCoordfEXT(GLfloat x
)
6296 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6299 static void GLAPIENTRY
6300 save_FogCoordfvEXT(const GLfloat
* v
)
6302 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6305 static void GLAPIENTRY
6306 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6308 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6311 static void GLAPIENTRY
6312 save_Color3fv(const GLfloat
* v
)
6314 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6317 static void GLAPIENTRY
6318 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6320 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6323 static void GLAPIENTRY
6324 save_Color4fv(const GLfloat
* v
)
6326 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6329 static void GLAPIENTRY
6330 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6332 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6335 static void GLAPIENTRY
6336 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6338 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6342 /* Just call the respective ATTR for texcoord
6344 static void GLAPIENTRY
6345 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6347 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6348 save_Attr1fNV(attr
, x
);
6351 static void GLAPIENTRY
6352 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6354 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6355 save_Attr1fNV(attr
, v
[0]);
6358 static void GLAPIENTRY
6359 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6361 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6362 save_Attr2fNV(attr
, x
, y
);
6365 static void GLAPIENTRY
6366 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6368 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6369 save_Attr2fNV(attr
, v
[0], v
[1]);
6372 static void GLAPIENTRY
6373 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6375 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6376 save_Attr3fNV(attr
, x
, y
, z
);
6379 static void GLAPIENTRY
6380 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6382 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6383 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6386 static void GLAPIENTRY
6387 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6388 GLfloat z
, GLfloat w
)
6390 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6391 save_Attr4fNV(attr
, x
, y
, z
, w
);
6394 static void GLAPIENTRY
6395 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6397 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6398 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6403 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6409 GET_CURRENT_CONTEXT(ctx
);
6410 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6415 static void GLAPIENTRY
6416 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6418 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6419 save_Attr1fARB(index
, x
);
6424 static void GLAPIENTRY
6425 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6427 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6428 save_Attr1fARB(index
, v
[0]);
6433 static void GLAPIENTRY
6434 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6436 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6437 save_Attr2fARB(index
, x
, y
);
6442 static void GLAPIENTRY
6443 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6445 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6446 save_Attr2fARB(index
, v
[0], v
[1]);
6451 static void GLAPIENTRY
6452 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6454 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6455 save_Attr3fARB(index
, x
, y
, z
);
6460 static void GLAPIENTRY
6461 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6463 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6464 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6469 static void GLAPIENTRY
6470 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6473 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6474 save_Attr4fARB(index
, x
, y
, z
, w
);
6479 static void GLAPIENTRY
6480 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6482 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6483 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6488 static void GLAPIENTRY
6489 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6491 GET_CURRENT_CONTEXT(ctx
);
6493 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6495 SAVE_FLUSH_VERTICES(ctx
);
6496 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6499 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6502 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6503 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6505 if (ctx
->ExecuteFlag
) {
6506 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6513 static void GLAPIENTRY
6514 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6516 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6517 save_VertexAttribL1d(index
, v
[0]);
6522 static void GLAPIENTRY
6523 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6525 GET_CURRENT_CONTEXT(ctx
);
6527 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6529 SAVE_FLUSH_VERTICES(ctx
);
6530 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6533 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6534 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6537 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6538 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6539 2 * sizeof(GLdouble
));
6541 if (ctx
->ExecuteFlag
) {
6542 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6549 static void GLAPIENTRY
6550 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6552 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6553 save_VertexAttribL2d(index
, v
[0], v
[1]);
6558 static void GLAPIENTRY
6559 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6561 GET_CURRENT_CONTEXT(ctx
);
6563 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6565 SAVE_FLUSH_VERTICES(ctx
);
6566 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6569 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6570 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6571 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6574 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6575 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6576 3 * sizeof(GLdouble
));
6578 if (ctx
->ExecuteFlag
) {
6579 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6586 static void GLAPIENTRY
6587 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6589 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6590 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6595 static void GLAPIENTRY
6596 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6599 GET_CURRENT_CONTEXT(ctx
);
6601 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6603 SAVE_FLUSH_VERTICES(ctx
);
6604 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6607 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6608 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6609 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6610 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6613 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6614 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6615 4 * sizeof(GLdouble
));
6617 if (ctx
->ExecuteFlag
) {
6618 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6625 static void GLAPIENTRY
6626 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6628 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6629 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6634 static void GLAPIENTRY
6635 save_PrimitiveRestartNV(void)
6637 /* Note: this is used when outside a glBegin/End pair in a display list */
6638 GET_CURRENT_CONTEXT(ctx
);
6639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6640 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6641 if (ctx
->ExecuteFlag
) {
6642 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6647 static void GLAPIENTRY
6648 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6649 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6650 GLbitfield mask
, GLenum filter
)
6652 GET_CURRENT_CONTEXT(ctx
);
6654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6655 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6668 if (ctx
->ExecuteFlag
) {
6669 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6670 dstX0
, dstY0
, dstX1
, dstY1
,
6676 /** GL_EXT_provoking_vertex */
6677 static void GLAPIENTRY
6678 save_ProvokingVertexEXT(GLenum mode
)
6680 GET_CURRENT_CONTEXT(ctx
);
6682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6683 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6687 if (ctx
->ExecuteFlag
) {
6688 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6689 _mesa_ProvokingVertex(mode
);
6694 /** GL_EXT_transform_feedback */
6695 static void GLAPIENTRY
6696 save_BeginTransformFeedback(GLenum mode
)
6698 GET_CURRENT_CONTEXT(ctx
);
6700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6701 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6705 if (ctx
->ExecuteFlag
) {
6706 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6711 /** GL_EXT_transform_feedback */
6712 static void GLAPIENTRY
6713 save_EndTransformFeedback(void)
6715 GET_CURRENT_CONTEXT(ctx
);
6716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6717 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6718 if (ctx
->ExecuteFlag
) {
6719 CALL_EndTransformFeedback(ctx
->Exec
, ());
6723 static void GLAPIENTRY
6724 save_BindTransformFeedback(GLenum target
, GLuint name
)
6726 GET_CURRENT_CONTEXT(ctx
);
6728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6729 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6734 if (ctx
->ExecuteFlag
) {
6735 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6739 static void GLAPIENTRY
6740 save_PauseTransformFeedback(void)
6742 GET_CURRENT_CONTEXT(ctx
);
6743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6744 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6745 if (ctx
->ExecuteFlag
) {
6746 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6750 static void GLAPIENTRY
6751 save_ResumeTransformFeedback(void)
6753 GET_CURRENT_CONTEXT(ctx
);
6754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6755 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6756 if (ctx
->ExecuteFlag
) {
6757 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6761 static void GLAPIENTRY
6762 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6764 GET_CURRENT_CONTEXT(ctx
);
6766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6767 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6772 if (ctx
->ExecuteFlag
) {
6773 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6777 static void GLAPIENTRY
6778 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6780 GET_CURRENT_CONTEXT(ctx
);
6782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6783 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6789 if (ctx
->ExecuteFlag
) {
6790 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6794 static void GLAPIENTRY
6795 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6798 GET_CURRENT_CONTEXT(ctx
);
6800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6801 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6805 n
[3].si
= primcount
;
6807 if (ctx
->ExecuteFlag
) {
6808 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6812 static void GLAPIENTRY
6813 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6814 GLuint stream
, GLsizei primcount
)
6816 GET_CURRENT_CONTEXT(ctx
);
6818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6819 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6824 n
[4].si
= primcount
;
6826 if (ctx
->ExecuteFlag
) {
6827 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6832 static void GLAPIENTRY
6833 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6834 GLuint num_groups_z
)
6836 GET_CURRENT_CONTEXT(ctx
);
6838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6839 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6841 n
[1].ui
= num_groups_x
;
6842 n
[2].ui
= num_groups_y
;
6843 n
[3].ui
= num_groups_z
;
6845 if (ctx
->ExecuteFlag
) {
6846 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6851 static void GLAPIENTRY
6852 save_DispatchComputeIndirect(GLintptr indirect
)
6854 GET_CURRENT_CONTEXT(ctx
);
6855 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6856 "glDispatchComputeIndirect() during display list compile");
6859 static void GLAPIENTRY
6860 save_UseProgram(GLuint program
)
6862 GET_CURRENT_CONTEXT(ctx
);
6864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6865 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6869 if (ctx
->ExecuteFlag
) {
6870 CALL_UseProgram(ctx
->Exec
, (program
));
6875 static void GLAPIENTRY
6876 save_Uniform1fARB(GLint location
, GLfloat x
)
6878 GET_CURRENT_CONTEXT(ctx
);
6880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6881 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6886 if (ctx
->ExecuteFlag
) {
6887 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6892 static void GLAPIENTRY
6893 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6895 GET_CURRENT_CONTEXT(ctx
);
6897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6898 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6904 if (ctx
->ExecuteFlag
) {
6905 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6910 static void GLAPIENTRY
6911 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6913 GET_CURRENT_CONTEXT(ctx
);
6915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6916 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6923 if (ctx
->ExecuteFlag
) {
6924 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6929 static void GLAPIENTRY
6930 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6932 GET_CURRENT_CONTEXT(ctx
);
6934 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6935 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6943 if (ctx
->ExecuteFlag
) {
6944 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6949 static void GLAPIENTRY
6950 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6952 GET_CURRENT_CONTEXT(ctx
);
6954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6955 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6959 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6961 if (ctx
->ExecuteFlag
) {
6962 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6966 static void GLAPIENTRY
6967 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6969 GET_CURRENT_CONTEXT(ctx
);
6971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6972 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6976 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6978 if (ctx
->ExecuteFlag
) {
6979 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6983 static void GLAPIENTRY
6984 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6986 GET_CURRENT_CONTEXT(ctx
);
6988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6989 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6993 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6995 if (ctx
->ExecuteFlag
) {
6996 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7000 static void GLAPIENTRY
7001 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7003 GET_CURRENT_CONTEXT(ctx
);
7005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7006 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7010 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7012 if (ctx
->ExecuteFlag
) {
7013 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7018 static void GLAPIENTRY
7019 save_Uniform1d(GLint location
, GLdouble x
)
7021 GET_CURRENT_CONTEXT(ctx
);
7023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7024 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7027 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7029 if (ctx
->ExecuteFlag
) {
7030 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7035 static void GLAPIENTRY
7036 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7038 GET_CURRENT_CONTEXT(ctx
);
7040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7041 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7044 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7045 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7047 if (ctx
->ExecuteFlag
) {
7048 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7053 static void GLAPIENTRY
7054 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7056 GET_CURRENT_CONTEXT(ctx
);
7058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7059 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7062 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7063 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7064 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7066 if (ctx
->ExecuteFlag
) {
7067 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7072 static void GLAPIENTRY
7073 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7075 GET_CURRENT_CONTEXT(ctx
);
7077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7078 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7081 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7082 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7083 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7084 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7086 if (ctx
->ExecuteFlag
) {
7087 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7092 static void GLAPIENTRY
7093 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7095 GET_CURRENT_CONTEXT(ctx
);
7097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7098 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7102 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7104 if (ctx
->ExecuteFlag
) {
7105 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7110 static void GLAPIENTRY
7111 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7113 GET_CURRENT_CONTEXT(ctx
);
7115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7116 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7120 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7122 if (ctx
->ExecuteFlag
) {
7123 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7128 static void GLAPIENTRY
7129 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7131 GET_CURRENT_CONTEXT(ctx
);
7133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7134 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7138 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7140 if (ctx
->ExecuteFlag
) {
7141 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7146 static void GLAPIENTRY
7147 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7149 GET_CURRENT_CONTEXT(ctx
);
7151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7152 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7156 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7158 if (ctx
->ExecuteFlag
) {
7159 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7164 static void GLAPIENTRY
7165 save_Uniform1iARB(GLint location
, GLint x
)
7167 GET_CURRENT_CONTEXT(ctx
);
7169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7170 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7175 if (ctx
->ExecuteFlag
) {
7176 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7180 static void GLAPIENTRY
7181 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7183 GET_CURRENT_CONTEXT(ctx
);
7185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7186 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7192 if (ctx
->ExecuteFlag
) {
7193 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7197 static void GLAPIENTRY
7198 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7200 GET_CURRENT_CONTEXT(ctx
);
7202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7203 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7210 if (ctx
->ExecuteFlag
) {
7211 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7215 static void GLAPIENTRY
7216 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7218 GET_CURRENT_CONTEXT(ctx
);
7220 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7221 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7229 if (ctx
->ExecuteFlag
) {
7230 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7236 static void GLAPIENTRY
7237 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7239 GET_CURRENT_CONTEXT(ctx
);
7241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7242 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7246 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7248 if (ctx
->ExecuteFlag
) {
7249 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7253 static void GLAPIENTRY
7254 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7256 GET_CURRENT_CONTEXT(ctx
);
7258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7259 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7263 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7265 if (ctx
->ExecuteFlag
) {
7266 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7270 static void GLAPIENTRY
7271 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7273 GET_CURRENT_CONTEXT(ctx
);
7275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7276 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7280 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7282 if (ctx
->ExecuteFlag
) {
7283 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7287 static void GLAPIENTRY
7288 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7290 GET_CURRENT_CONTEXT(ctx
);
7292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7293 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7297 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7299 if (ctx
->ExecuteFlag
) {
7300 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7306 static void GLAPIENTRY
7307 save_Uniform1ui(GLint location
, GLuint x
)
7309 GET_CURRENT_CONTEXT(ctx
);
7311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7312 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7317 if (ctx
->ExecuteFlag
) {
7318 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7322 static void GLAPIENTRY
7323 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7325 GET_CURRENT_CONTEXT(ctx
);
7327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7328 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7334 if (ctx
->ExecuteFlag
) {
7335 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7339 static void GLAPIENTRY
7340 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7342 GET_CURRENT_CONTEXT(ctx
);
7344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7345 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7352 if (ctx
->ExecuteFlag
) {
7353 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7357 static void GLAPIENTRY
7358 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7360 GET_CURRENT_CONTEXT(ctx
);
7362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7363 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7371 if (ctx
->ExecuteFlag
) {
7372 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7378 static void GLAPIENTRY
7379 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7381 GET_CURRENT_CONTEXT(ctx
);
7383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7384 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7388 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7390 if (ctx
->ExecuteFlag
) {
7391 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7395 static void GLAPIENTRY
7396 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7398 GET_CURRENT_CONTEXT(ctx
);
7400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7401 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7405 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7407 if (ctx
->ExecuteFlag
) {
7408 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7412 static void GLAPIENTRY
7413 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7415 GET_CURRENT_CONTEXT(ctx
);
7417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7418 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7422 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7424 if (ctx
->ExecuteFlag
) {
7425 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7429 static void GLAPIENTRY
7430 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7432 GET_CURRENT_CONTEXT(ctx
);
7434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7435 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7439 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7441 if (ctx
->ExecuteFlag
) {
7442 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7448 static void GLAPIENTRY
7449 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7452 GET_CURRENT_CONTEXT(ctx
);
7454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7455 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7460 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7462 if (ctx
->ExecuteFlag
) {
7463 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7467 static void GLAPIENTRY
7468 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7471 GET_CURRENT_CONTEXT(ctx
);
7473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7474 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7479 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7481 if (ctx
->ExecuteFlag
) {
7482 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7486 static void GLAPIENTRY
7487 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7490 GET_CURRENT_CONTEXT(ctx
);
7492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7493 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7498 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7500 if (ctx
->ExecuteFlag
) {
7501 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7506 static void GLAPIENTRY
7507 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7510 GET_CURRENT_CONTEXT(ctx
);
7512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7513 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7518 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7520 if (ctx
->ExecuteFlag
) {
7521 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7525 static void GLAPIENTRY
7526 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7529 GET_CURRENT_CONTEXT(ctx
);
7531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7532 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7537 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7539 if (ctx
->ExecuteFlag
) {
7540 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7545 static void GLAPIENTRY
7546 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7549 GET_CURRENT_CONTEXT(ctx
);
7551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7552 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7557 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7559 if (ctx
->ExecuteFlag
) {
7560 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7564 static void GLAPIENTRY
7565 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7568 GET_CURRENT_CONTEXT(ctx
);
7570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7571 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7576 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7578 if (ctx
->ExecuteFlag
) {
7579 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7584 static void GLAPIENTRY
7585 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7588 GET_CURRENT_CONTEXT(ctx
);
7590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7591 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7596 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7598 if (ctx
->ExecuteFlag
) {
7599 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7603 static void GLAPIENTRY
7604 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7607 GET_CURRENT_CONTEXT(ctx
);
7609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7610 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7615 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7617 if (ctx
->ExecuteFlag
) {
7618 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7623 static void GLAPIENTRY
7624 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7627 GET_CURRENT_CONTEXT(ctx
);
7629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7630 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7635 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7637 if (ctx
->ExecuteFlag
) {
7638 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7642 static void GLAPIENTRY
7643 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7646 GET_CURRENT_CONTEXT(ctx
);
7648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7649 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7654 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7656 if (ctx
->ExecuteFlag
) {
7657 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7661 static void GLAPIENTRY
7662 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7665 GET_CURRENT_CONTEXT(ctx
);
7667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7668 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7673 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7675 if (ctx
->ExecuteFlag
) {
7676 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7681 static void GLAPIENTRY
7682 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7685 GET_CURRENT_CONTEXT(ctx
);
7687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7688 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7693 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7695 if (ctx
->ExecuteFlag
) {
7696 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7701 static void GLAPIENTRY
7702 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7705 GET_CURRENT_CONTEXT(ctx
);
7707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7708 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7713 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7715 if (ctx
->ExecuteFlag
) {
7716 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7721 static void GLAPIENTRY
7722 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7725 GET_CURRENT_CONTEXT(ctx
);
7727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7728 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7733 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7735 if (ctx
->ExecuteFlag
) {
7736 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7740 static void GLAPIENTRY
7741 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7744 GET_CURRENT_CONTEXT(ctx
);
7746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7747 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7752 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7754 if (ctx
->ExecuteFlag
) {
7755 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7760 static void GLAPIENTRY
7761 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7764 GET_CURRENT_CONTEXT(ctx
);
7766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7767 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7772 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7774 if (ctx
->ExecuteFlag
) {
7775 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7780 static void GLAPIENTRY
7781 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7784 GET_CURRENT_CONTEXT(ctx
);
7786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7787 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7792 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7794 if (ctx
->ExecuteFlag
) {
7795 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7800 static void GLAPIENTRY
7801 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7803 GET_CURRENT_CONTEXT(ctx
);
7805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7806 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7812 if (ctx
->ExecuteFlag
) {
7813 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7817 static void GLAPIENTRY
7818 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7820 GET_CURRENT_CONTEXT(ctx
);
7822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7823 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7829 if (ctx
->ExecuteFlag
) {
7830 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7834 static void GLAPIENTRY
7835 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7837 GET_CURRENT_CONTEXT(ctx
);
7839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7840 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7847 if (ctx
->ExecuteFlag
) {
7848 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7852 static void GLAPIENTRY
7853 save_ProgramUniform3f(GLuint program
, GLint location
,
7854 GLfloat x
, GLfloat y
, GLfloat z
)
7856 GET_CURRENT_CONTEXT(ctx
);
7858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7859 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7867 if (ctx
->ExecuteFlag
) {
7868 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7872 static void GLAPIENTRY
7873 save_ProgramUniform4f(GLuint program
, GLint location
,
7874 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7876 GET_CURRENT_CONTEXT(ctx
);
7878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7879 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7888 if (ctx
->ExecuteFlag
) {
7889 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7893 static void GLAPIENTRY
7894 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7897 GET_CURRENT_CONTEXT(ctx
);
7899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7900 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7905 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7907 if (ctx
->ExecuteFlag
) {
7908 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7912 static void GLAPIENTRY
7913 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7916 GET_CURRENT_CONTEXT(ctx
);
7918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7919 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7924 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7926 if (ctx
->ExecuteFlag
) {
7927 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7931 static void GLAPIENTRY
7932 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7935 GET_CURRENT_CONTEXT(ctx
);
7937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7938 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7943 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7945 if (ctx
->ExecuteFlag
) {
7946 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7950 static void GLAPIENTRY
7951 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7954 GET_CURRENT_CONTEXT(ctx
);
7956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7957 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7962 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7964 if (ctx
->ExecuteFlag
) {
7965 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7969 static void GLAPIENTRY
7970 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7972 GET_CURRENT_CONTEXT(ctx
);
7974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7975 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7979 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7981 if (ctx
->ExecuteFlag
) {
7982 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7986 static void GLAPIENTRY
7987 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7989 GET_CURRENT_CONTEXT(ctx
);
7991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7992 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7996 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7997 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7999 if (ctx
->ExecuteFlag
) {
8000 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8004 static void GLAPIENTRY
8005 save_ProgramUniform3d(GLuint program
, GLint location
,
8006 GLdouble x
, GLdouble y
, GLdouble z
)
8008 GET_CURRENT_CONTEXT(ctx
);
8010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8011 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8015 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8016 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8017 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8019 if (ctx
->ExecuteFlag
) {
8020 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8024 static void GLAPIENTRY
8025 save_ProgramUniform4d(GLuint program
, GLint location
,
8026 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8028 GET_CURRENT_CONTEXT(ctx
);
8030 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8031 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8035 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8036 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8037 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8038 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8040 if (ctx
->ExecuteFlag
) {
8041 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8045 static void GLAPIENTRY
8046 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8049 GET_CURRENT_CONTEXT(ctx
);
8051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8052 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8057 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8059 if (ctx
->ExecuteFlag
) {
8060 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8064 static void GLAPIENTRY
8065 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8068 GET_CURRENT_CONTEXT(ctx
);
8070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8071 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8076 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8078 if (ctx
->ExecuteFlag
) {
8079 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8083 static void GLAPIENTRY
8084 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8087 GET_CURRENT_CONTEXT(ctx
);
8089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8090 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8095 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8097 if (ctx
->ExecuteFlag
) {
8098 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8102 static void GLAPIENTRY
8103 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8106 GET_CURRENT_CONTEXT(ctx
);
8108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8109 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8114 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8116 if (ctx
->ExecuteFlag
) {
8117 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8121 static void GLAPIENTRY
8122 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8124 GET_CURRENT_CONTEXT(ctx
);
8126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8127 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8133 if (ctx
->ExecuteFlag
) {
8134 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8138 static void GLAPIENTRY
8139 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8141 GET_CURRENT_CONTEXT(ctx
);
8143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8144 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8151 if (ctx
->ExecuteFlag
) {
8152 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8156 static void GLAPIENTRY
8157 save_ProgramUniform3i(GLuint program
, GLint location
,
8158 GLint x
, GLint y
, GLint z
)
8160 GET_CURRENT_CONTEXT(ctx
);
8162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8163 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8171 if (ctx
->ExecuteFlag
) {
8172 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8176 static void GLAPIENTRY
8177 save_ProgramUniform4i(GLuint program
, GLint location
,
8178 GLint x
, GLint y
, GLint z
, GLint w
)
8180 GET_CURRENT_CONTEXT(ctx
);
8182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8183 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8192 if (ctx
->ExecuteFlag
) {
8193 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8197 static void GLAPIENTRY
8198 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8201 GET_CURRENT_CONTEXT(ctx
);
8203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8204 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8209 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8211 if (ctx
->ExecuteFlag
) {
8212 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8216 static void GLAPIENTRY
8217 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8220 GET_CURRENT_CONTEXT(ctx
);
8222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8223 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8228 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8230 if (ctx
->ExecuteFlag
) {
8231 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8235 static void GLAPIENTRY
8236 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8239 GET_CURRENT_CONTEXT(ctx
);
8241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8242 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8247 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8249 if (ctx
->ExecuteFlag
) {
8250 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8254 static void GLAPIENTRY
8255 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8258 GET_CURRENT_CONTEXT(ctx
);
8260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8261 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8266 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8268 if (ctx
->ExecuteFlag
) {
8269 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8273 static void GLAPIENTRY
8274 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8276 GET_CURRENT_CONTEXT(ctx
);
8278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8279 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8285 if (ctx
->ExecuteFlag
) {
8286 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8290 static void GLAPIENTRY
8291 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8293 GET_CURRENT_CONTEXT(ctx
);
8295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8296 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8303 if (ctx
->ExecuteFlag
) {
8304 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8308 static void GLAPIENTRY
8309 save_ProgramUniform3ui(GLuint program
, GLint location
,
8310 GLuint x
, GLuint y
, GLuint z
)
8312 GET_CURRENT_CONTEXT(ctx
);
8314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8315 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8323 if (ctx
->ExecuteFlag
) {
8324 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8328 static void GLAPIENTRY
8329 save_ProgramUniform4ui(GLuint program
, GLint location
,
8330 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8332 GET_CURRENT_CONTEXT(ctx
);
8334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8335 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8344 if (ctx
->ExecuteFlag
) {
8345 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8349 static void GLAPIENTRY
8350 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8353 GET_CURRENT_CONTEXT(ctx
);
8355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8356 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8361 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8363 if (ctx
->ExecuteFlag
) {
8364 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8368 static void GLAPIENTRY
8369 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8372 GET_CURRENT_CONTEXT(ctx
);
8374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8375 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8380 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8382 if (ctx
->ExecuteFlag
) {
8383 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8387 static void GLAPIENTRY
8388 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8391 GET_CURRENT_CONTEXT(ctx
);
8393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8394 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8399 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8401 if (ctx
->ExecuteFlag
) {
8402 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8406 static void GLAPIENTRY
8407 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8410 GET_CURRENT_CONTEXT(ctx
);
8412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8413 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8418 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8420 if (ctx
->ExecuteFlag
) {
8421 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8425 static void GLAPIENTRY
8426 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8427 GLboolean transpose
, const GLfloat
*v
)
8429 GET_CURRENT_CONTEXT(ctx
);
8431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8432 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8433 4 + POINTER_DWORDS
);
8439 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8441 if (ctx
->ExecuteFlag
) {
8442 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8443 (program
, location
, count
, transpose
, v
));
8447 static void GLAPIENTRY
8448 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8449 GLboolean transpose
, const GLfloat
*v
)
8451 GET_CURRENT_CONTEXT(ctx
);
8453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8454 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8455 4 + POINTER_DWORDS
);
8461 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8463 if (ctx
->ExecuteFlag
) {
8464 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8465 (program
, location
, count
, transpose
, v
));
8469 static void GLAPIENTRY
8470 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8471 GLboolean transpose
, const GLfloat
*v
)
8473 GET_CURRENT_CONTEXT(ctx
);
8475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8476 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8477 4 + POINTER_DWORDS
);
8483 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8485 if (ctx
->ExecuteFlag
) {
8486 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8487 (program
, location
, count
, transpose
, v
));
8491 static void GLAPIENTRY
8492 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8493 GLboolean transpose
, const GLfloat
*v
)
8495 GET_CURRENT_CONTEXT(ctx
);
8497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8498 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8499 4 + POINTER_DWORDS
);
8505 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8507 if (ctx
->ExecuteFlag
) {
8508 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8509 (program
, location
, count
, transpose
, v
));
8513 static void GLAPIENTRY
8514 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8515 GLboolean transpose
, const GLfloat
*v
)
8517 GET_CURRENT_CONTEXT(ctx
);
8519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8520 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8521 4 + POINTER_DWORDS
);
8527 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8529 if (ctx
->ExecuteFlag
) {
8530 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8531 (program
, location
, count
, transpose
, v
));
8535 static void GLAPIENTRY
8536 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8537 GLboolean transpose
, const GLfloat
*v
)
8539 GET_CURRENT_CONTEXT(ctx
);
8541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8542 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8543 4 + POINTER_DWORDS
);
8549 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8551 if (ctx
->ExecuteFlag
) {
8552 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8553 (program
, location
, count
, transpose
, v
));
8557 static void GLAPIENTRY
8558 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8559 GLboolean transpose
, const GLfloat
*v
)
8561 GET_CURRENT_CONTEXT(ctx
);
8563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8564 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8565 4 + POINTER_DWORDS
);
8571 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8573 if (ctx
->ExecuteFlag
) {
8574 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8575 (program
, location
, count
, transpose
, v
));
8579 static void GLAPIENTRY
8580 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8581 GLboolean transpose
, const GLfloat
*v
)
8583 GET_CURRENT_CONTEXT(ctx
);
8585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8586 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8587 4 + POINTER_DWORDS
);
8593 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8595 if (ctx
->ExecuteFlag
) {
8596 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8597 (program
, location
, count
, transpose
, v
));
8601 static void GLAPIENTRY
8602 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8603 GLboolean transpose
, const GLfloat
*v
)
8605 GET_CURRENT_CONTEXT(ctx
);
8607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8608 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8609 4 + POINTER_DWORDS
);
8615 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8617 if (ctx
->ExecuteFlag
) {
8618 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8619 (program
, location
, count
, transpose
, v
));
8623 static void GLAPIENTRY
8624 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8625 GLboolean transpose
, const GLdouble
*v
)
8627 GET_CURRENT_CONTEXT(ctx
);
8629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8630 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8631 4 + POINTER_DWORDS
);
8637 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8639 if (ctx
->ExecuteFlag
) {
8640 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8641 (program
, location
, count
, transpose
, v
));
8645 static void GLAPIENTRY
8646 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8647 GLboolean transpose
, const GLdouble
*v
)
8649 GET_CURRENT_CONTEXT(ctx
);
8651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8652 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8653 4 + POINTER_DWORDS
);
8659 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8661 if (ctx
->ExecuteFlag
) {
8662 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8663 (program
, location
, count
, transpose
, v
));
8667 static void GLAPIENTRY
8668 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8669 GLboolean transpose
, const GLdouble
*v
)
8671 GET_CURRENT_CONTEXT(ctx
);
8673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8674 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8675 4 + POINTER_DWORDS
);
8681 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8683 if (ctx
->ExecuteFlag
) {
8684 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8685 (program
, location
, count
, transpose
, v
));
8689 static void GLAPIENTRY
8690 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8691 GLboolean transpose
, const GLdouble
*v
)
8693 GET_CURRENT_CONTEXT(ctx
);
8695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8696 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8697 4 + POINTER_DWORDS
);
8703 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8705 if (ctx
->ExecuteFlag
) {
8706 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8707 (program
, location
, count
, transpose
, v
));
8711 static void GLAPIENTRY
8712 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8713 GLboolean transpose
, const GLdouble
*v
)
8715 GET_CURRENT_CONTEXT(ctx
);
8717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8718 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8719 4 + POINTER_DWORDS
);
8725 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8727 if (ctx
->ExecuteFlag
) {
8728 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8729 (program
, location
, count
, transpose
, v
));
8733 static void GLAPIENTRY
8734 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8735 GLboolean transpose
, const GLdouble
*v
)
8737 GET_CURRENT_CONTEXT(ctx
);
8739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8740 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8741 4 + POINTER_DWORDS
);
8747 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8749 if (ctx
->ExecuteFlag
) {
8750 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8751 (program
, location
, count
, transpose
, v
));
8755 static void GLAPIENTRY
8756 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8757 GLboolean transpose
, const GLdouble
*v
)
8759 GET_CURRENT_CONTEXT(ctx
);
8761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8762 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8763 4 + POINTER_DWORDS
);
8769 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8771 if (ctx
->ExecuteFlag
) {
8772 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8773 (program
, location
, count
, transpose
, v
));
8777 static void GLAPIENTRY
8778 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8779 GLboolean transpose
, const GLdouble
*v
)
8781 GET_CURRENT_CONTEXT(ctx
);
8783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8784 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8785 4 + POINTER_DWORDS
);
8791 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8793 if (ctx
->ExecuteFlag
) {
8794 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8795 (program
, location
, count
, transpose
, v
));
8799 static void GLAPIENTRY
8800 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8801 GLboolean transpose
, const GLdouble
*v
)
8803 GET_CURRENT_CONTEXT(ctx
);
8805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8806 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8807 4 + POINTER_DWORDS
);
8813 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8815 if (ctx
->ExecuteFlag
) {
8816 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8817 (program
, location
, count
, transpose
, v
));
8821 static void GLAPIENTRY
8822 save_ClipControl(GLenum origin
, GLenum depth
)
8824 GET_CURRENT_CONTEXT(ctx
);
8826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8827 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8832 if (ctx
->ExecuteFlag
) {
8833 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8837 static void GLAPIENTRY
8838 save_ClampColorARB(GLenum target
, GLenum clamp
)
8840 GET_CURRENT_CONTEXT(ctx
);
8842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8843 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8848 if (ctx
->ExecuteFlag
) {
8849 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8853 /** GL_EXT_texture_integer */
8854 static void GLAPIENTRY
8855 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8857 GET_CURRENT_CONTEXT(ctx
);
8859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8860 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8867 if (ctx
->ExecuteFlag
) {
8868 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8872 /** GL_EXT_texture_integer */
8873 static void GLAPIENTRY
8874 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8876 GET_CURRENT_CONTEXT(ctx
);
8878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8879 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8886 if (ctx
->ExecuteFlag
) {
8887 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8891 /** GL_EXT_texture_integer */
8892 static void GLAPIENTRY
8893 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8895 GET_CURRENT_CONTEXT(ctx
);
8897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8898 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8907 if (ctx
->ExecuteFlag
) {
8908 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8912 /** GL_EXT_texture_integer */
8913 static void GLAPIENTRY
8914 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8916 GET_CURRENT_CONTEXT(ctx
);
8918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8919 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8923 n
[3].ui
= params
[0];
8924 n
[4].ui
= params
[1];
8925 n
[5].ui
= params
[2];
8926 n
[6].ui
= params
[3];
8928 if (ctx
->ExecuteFlag
) {
8929 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8933 /* GL_ARB_instanced_arrays */
8934 static void GLAPIENTRY
8935 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8937 GET_CURRENT_CONTEXT(ctx
);
8939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8940 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8945 if (ctx
->ExecuteFlag
) {
8946 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8951 /* GL_NV_texture_barrier */
8952 static void GLAPIENTRY
8953 save_TextureBarrierNV(void)
8955 GET_CURRENT_CONTEXT(ctx
);
8956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8957 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8958 if (ctx
->ExecuteFlag
) {
8959 CALL_TextureBarrierNV(ctx
->Exec
, ());
8964 /* GL_ARB_sampler_objects */
8965 static void GLAPIENTRY
8966 save_BindSampler(GLuint unit
, GLuint sampler
)
8969 GET_CURRENT_CONTEXT(ctx
);
8970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8971 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8976 if (ctx
->ExecuteFlag
) {
8977 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8981 static void GLAPIENTRY
8982 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8985 GET_CURRENT_CONTEXT(ctx
);
8986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8987 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8992 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8998 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9001 if (ctx
->ExecuteFlag
) {
9002 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9006 static void GLAPIENTRY
9007 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9011 parray
[1] = parray
[2] = parray
[3] = 0;
9012 save_SamplerParameteriv(sampler
, pname
, parray
);
9015 static void GLAPIENTRY
9016 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9019 GET_CURRENT_CONTEXT(ctx
);
9020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9021 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9026 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9032 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9035 if (ctx
->ExecuteFlag
) {
9036 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9040 static void GLAPIENTRY
9041 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9045 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9046 save_SamplerParameterfv(sampler
, pname
, parray
);
9049 static void GLAPIENTRY
9050 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9053 GET_CURRENT_CONTEXT(ctx
);
9054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9055 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9060 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9066 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9069 if (ctx
->ExecuteFlag
) {
9070 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9074 static void GLAPIENTRY
9075 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9078 GET_CURRENT_CONTEXT(ctx
);
9079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9080 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9084 n
[3].ui
= params
[0];
9085 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9086 n
[4].ui
= params
[1];
9087 n
[5].ui
= params
[2];
9088 n
[6].ui
= params
[3];
9091 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9094 if (ctx
->ExecuteFlag
) {
9095 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9099 static void GLAPIENTRY
9100 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9103 GET_CURRENT_CONTEXT(ctx
);
9104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9105 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9107 union uint64_pair p
;
9110 n
[2].ui
= p
.uint32
[0];
9111 n
[3].ui
= p
.uint32
[1];
9112 save_pointer(&n
[4], sync
);
9114 if (ctx
->ExecuteFlag
) {
9115 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9120 /** GL_NV_conditional_render */
9121 static void GLAPIENTRY
9122 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9124 GET_CURRENT_CONTEXT(ctx
);
9126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9127 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9132 if (ctx
->ExecuteFlag
) {
9133 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9137 static void GLAPIENTRY
9138 save_EndConditionalRender(void)
9140 GET_CURRENT_CONTEXT(ctx
);
9141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9142 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9143 if (ctx
->ExecuteFlag
) {
9144 CALL_EndConditionalRender(ctx
->Exec
, ());
9148 static void GLAPIENTRY
9149 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9151 GET_CURRENT_CONTEXT(ctx
);
9153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9154 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9160 if (ctx
->ExecuteFlag
) {
9161 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9165 static void GLAPIENTRY
9166 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9167 const GLuint
*indices
)
9169 GET_CURRENT_CONTEXT(ctx
);
9171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9172 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9174 GLint
*indices_copy
= NULL
;
9177 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9178 n
[1].e
= shadertype
;
9180 save_pointer(&n
[3], indices_copy
);
9182 if (ctx
->ExecuteFlag
) {
9183 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9187 /** GL_EXT_window_rectangles */
9188 static void GLAPIENTRY
9189 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9191 GET_CURRENT_CONTEXT(ctx
);
9193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9194 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9196 GLint
*box_copy
= NULL
;
9199 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9202 save_pointer(&n
[3], box_copy
);
9204 if (ctx
->ExecuteFlag
) {
9205 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9210 /** GL_NV_conservative_raster */
9211 static void GLAPIENTRY
9212 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9214 GET_CURRENT_CONTEXT(ctx
);
9216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9217 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9222 if (ctx
->ExecuteFlag
) {
9223 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9227 /** GL_NV_conservative_raster_dilate */
9228 static void GLAPIENTRY
9229 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9231 GET_CURRENT_CONTEXT(ctx
);
9233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9234 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9239 if (ctx
->ExecuteFlag
) {
9240 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9244 /** GL_NV_conservative_raster_pre_snap_triangles */
9245 static void GLAPIENTRY
9246 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9248 GET_CURRENT_CONTEXT(ctx
);
9250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9251 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9256 if (ctx
->ExecuteFlag
) {
9257 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9261 /** GL_EXT_direct_state_access */
9263 static void GLAPIENTRY
9264 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9266 GET_CURRENT_CONTEXT(ctx
);
9268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9269 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9271 n
[1].e
= matrixMode
;
9272 for (unsigned i
= 0; i
< 16; i
++) {
9276 if (ctx
->ExecuteFlag
) {
9277 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9281 static void GLAPIENTRY
9282 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9285 for (unsigned i
= 0; i
< 16; i
++) {
9286 f
[i
] = (GLfloat
) m
[i
];
9288 save_MatrixLoadfEXT(matrixMode
, f
);
9291 static void GLAPIENTRY
9292 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9294 GET_CURRENT_CONTEXT(ctx
);
9296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9297 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9299 n
[1].e
= matrixMode
;
9300 for (unsigned i
= 0; i
< 16; i
++) {
9304 if (ctx
->ExecuteFlag
) {
9305 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9309 static void GLAPIENTRY
9310 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9313 for (unsigned i
= 0; i
< 16; i
++) {
9314 f
[i
] = (GLfloat
) m
[i
];
9316 save_MatrixMultfEXT(matrixMode
, f
);
9319 static void GLAPIENTRY
9320 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9322 GET_CURRENT_CONTEXT(ctx
);
9324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9325 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9327 n
[1].e
= matrixMode
;
9333 if (ctx
->ExecuteFlag
) {
9334 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9338 static void GLAPIENTRY
9339 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9341 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9344 static void GLAPIENTRY
9345 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9347 GET_CURRENT_CONTEXT(ctx
);
9349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9350 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9352 n
[1].e
= matrixMode
;
9357 if (ctx
->ExecuteFlag
) {
9358 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9362 static void GLAPIENTRY
9363 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9365 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9368 static void GLAPIENTRY
9369 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9371 GET_CURRENT_CONTEXT(ctx
);
9373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9374 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9376 n
[1].e
= matrixMode
;
9381 if (ctx
->ExecuteFlag
) {
9382 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9386 static void GLAPIENTRY
9387 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9389 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9392 static void GLAPIENTRY
9393 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9395 GET_CURRENT_CONTEXT(ctx
);
9397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9398 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9400 n
[1].e
= matrixMode
;
9402 if (ctx
->ExecuteFlag
) {
9403 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9407 static void GLAPIENTRY
9408 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9409 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9411 GET_CURRENT_CONTEXT(ctx
);
9413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9414 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9416 n
[1].e
= matrixMode
;
9417 n
[2].f
= (GLfloat
) left
;
9418 n
[3].f
= (GLfloat
) right
;
9419 n
[4].f
= (GLfloat
) bottom
;
9420 n
[5].f
= (GLfloat
) top
;
9421 n
[6].f
= (GLfloat
) nearval
;
9422 n
[7].f
= (GLfloat
) farval
;
9424 if (ctx
->ExecuteFlag
) {
9425 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9430 static void GLAPIENTRY
9431 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9432 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9434 GET_CURRENT_CONTEXT(ctx
);
9436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9437 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9439 n
[1].e
= matrixMode
;
9440 n
[2].f
= (GLfloat
) left
;
9441 n
[3].f
= (GLfloat
) right
;
9442 n
[4].f
= (GLfloat
) bottom
;
9443 n
[5].f
= (GLfloat
) top
;
9444 n
[6].f
= (GLfloat
) nearval
;
9445 n
[7].f
= (GLfloat
) farval
;
9447 if (ctx
->ExecuteFlag
) {
9448 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9452 static void GLAPIENTRY
9453 save_MatrixPushEXT(GLenum matrixMode
)
9455 GET_CURRENT_CONTEXT(ctx
);
9457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9458 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9460 n
[1].e
= matrixMode
;
9462 if (ctx
->ExecuteFlag
) {
9463 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9467 static void GLAPIENTRY
9468 save_MatrixPopEXT(GLenum matrixMode
)
9470 GET_CURRENT_CONTEXT(ctx
);
9472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9473 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9475 n
[1].e
= matrixMode
;
9477 if (ctx
->ExecuteFlag
) {
9478 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9482 static void GLAPIENTRY
9483 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9486 _math_transposef(tm
, m
);
9487 save_MatrixLoadfEXT(matrixMode
, tm
);
9490 static void GLAPIENTRY
9491 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9494 _math_transposefd(tm
, m
);
9495 save_MatrixLoadfEXT(matrixMode
, tm
);
9498 static void GLAPIENTRY
9499 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9502 _math_transposef(tm
, m
);
9503 save_MatrixMultfEXT(matrixMode
, tm
);
9506 static void GLAPIENTRY
9507 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9510 _math_transposefd(tm
, m
);
9511 save_MatrixMultfEXT(matrixMode
, tm
);
9514 static void GLAPIENTRY
9515 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9516 const GLfloat
*params
)
9518 GET_CURRENT_CONTEXT(ctx
);
9520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9521 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9531 if (ctx
->ExecuteFlag
) {
9532 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9537 static void GLAPIENTRY
9538 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9542 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9543 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9546 static void GLAPIENTRY
9547 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9549 GET_CURRENT_CONTEXT(ctx
);
9551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9552 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9562 if (ctx
->ExecuteFlag
) {
9563 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9567 static void GLAPIENTRY
9568 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9572 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9573 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9576 static void GLAPIENTRY
9577 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9578 GLint level
, GLint components
,
9579 GLsizei width
, GLint border
,
9580 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9582 GET_CURRENT_CONTEXT(ctx
);
9583 if (target
== GL_PROXY_TEXTURE_1D
) {
9584 /* don't compile, execute immediately */
9585 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9586 border
, format
, type
, pixels
));
9590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9591 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9596 n
[4].i
= components
;
9597 n
[5].i
= (GLint
) width
;
9602 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9603 pixels
, &ctx
->Unpack
));
9605 if (ctx
->ExecuteFlag
) {
9606 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9607 border
, format
, type
, pixels
));
9613 static void GLAPIENTRY
9614 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9615 GLint level
, GLint components
,
9616 GLsizei width
, GLsizei height
, GLint border
,
9617 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9619 GET_CURRENT_CONTEXT(ctx
);
9620 if (target
== GL_PROXY_TEXTURE_2D
) {
9621 /* don't compile, execute immediately */
9622 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9623 height
, border
, format
, type
, pixels
));
9627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9628 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9633 n
[4].i
= components
;
9634 n
[5].i
= (GLint
) width
;
9635 n
[6].i
= (GLint
) height
;
9639 save_pointer(&n
[10],
9640 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9641 pixels
, &ctx
->Unpack
));
9643 if (ctx
->ExecuteFlag
) {
9644 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9645 height
, border
, format
, type
, pixels
));
9651 static void GLAPIENTRY
9652 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9653 GLint level
, GLint internalFormat
,
9654 GLsizei width
, GLsizei height
, GLsizei depth
,
9656 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9658 GET_CURRENT_CONTEXT(ctx
);
9659 if (target
== GL_PROXY_TEXTURE_3D
) {
9660 /* don't compile, execute immediately */
9661 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9662 height
, depth
, border
, format
, type
,
9667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9668 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9673 n
[4].i
= (GLint
) internalFormat
;
9674 n
[5].i
= (GLint
) width
;
9675 n
[6].i
= (GLint
) height
;
9676 n
[7].i
= (GLint
) depth
;
9680 save_pointer(&n
[11],
9681 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9682 pixels
, &ctx
->Unpack
));
9684 if (ctx
->ExecuteFlag
) {
9685 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9686 width
, height
, depth
, border
, format
,
9693 static void GLAPIENTRY
9694 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9695 GLsizei width
, GLenum format
, GLenum type
,
9696 const GLvoid
* pixels
)
9698 GET_CURRENT_CONTEXT(ctx
);
9701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9703 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9709 n
[5].i
= (GLint
) width
;
9713 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9714 pixels
, &ctx
->Unpack
));
9716 if (ctx
->ExecuteFlag
) {
9717 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9718 format
, type
, pixels
));
9723 static void GLAPIENTRY
9724 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9725 GLint xoffset
, GLint yoffset
,
9726 GLsizei width
, GLsizei height
,
9727 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9729 GET_CURRENT_CONTEXT(ctx
);
9732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9734 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9741 n
[6].i
= (GLint
) width
;
9742 n
[7].i
= (GLint
) height
;
9745 save_pointer(&n
[10],
9746 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9747 pixels
, &ctx
->Unpack
));
9749 if (ctx
->ExecuteFlag
) {
9750 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9751 width
, height
, format
, type
, pixels
));
9756 static void GLAPIENTRY
9757 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9758 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9759 GLsizei width
, GLsizei height
, GLsizei depth
,
9760 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9762 GET_CURRENT_CONTEXT(ctx
);
9765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9767 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9775 n
[7].i
= (GLint
) width
;
9776 n
[8].i
= (GLint
) height
;
9777 n
[9].i
= (GLint
) depth
;
9780 save_pointer(&n
[12],
9781 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9782 pixels
, &ctx
->Unpack
));
9784 if (ctx
->ExecuteFlag
) {
9785 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9786 xoffset
, yoffset
, zoffset
,
9787 width
, height
, depth
, format
, type
,
9792 static void GLAPIENTRY
9793 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9794 GLenum internalformat
, GLint x
, GLint y
,
9795 GLsizei width
, GLint border
)
9797 GET_CURRENT_CONTEXT(ctx
);
9799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9800 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9805 n
[4].e
= internalformat
;
9811 if (ctx
->ExecuteFlag
) {
9812 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9813 internalformat
, x
, y
,
9818 static void GLAPIENTRY
9819 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9820 GLenum internalformat
,
9821 GLint x
, GLint y
, GLsizei width
,
9822 GLsizei height
, GLint border
)
9824 GET_CURRENT_CONTEXT(ctx
);
9826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9827 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9832 n
[4].e
= internalformat
;
9839 if (ctx
->ExecuteFlag
) {
9840 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9841 internalformat
, x
, y
,
9842 width
, height
, border
));
9846 static void GLAPIENTRY
9847 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9848 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9850 GET_CURRENT_CONTEXT(ctx
);
9852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9853 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9863 if (ctx
->ExecuteFlag
) {
9864 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9865 (texture
, target
, level
, xoffset
, x
, y
, width
));
9869 static void GLAPIENTRY
9870 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9871 GLint xoffset
, GLint yoffset
,
9872 GLint x
, GLint y
, GLsizei width
, GLint height
)
9874 GET_CURRENT_CONTEXT(ctx
);
9876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9877 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9889 if (ctx
->ExecuteFlag
) {
9890 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9892 x
, y
, width
, height
));
9897 static void GLAPIENTRY
9898 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9899 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9900 GLint x
, GLint y
, GLsizei width
, GLint height
)
9902 GET_CURRENT_CONTEXT(ctx
);
9904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9905 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9918 if (ctx
->ExecuteFlag
) {
9919 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9920 xoffset
, yoffset
, zoffset
,
9921 x
, y
, width
, height
));
9926 static void GLAPIENTRY
9927 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9929 GET_CURRENT_CONTEXT(ctx
);
9931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9932 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9938 if (ctx
->ExecuteFlag
) {
9939 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9944 static void GLAPIENTRY
9945 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9946 const GLfloat
*params
)
9948 GET_CURRENT_CONTEXT(ctx
);
9950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9951 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
9961 if (ctx
->ExecuteFlag
) {
9962 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9967 static void GLAPIENTRY
9968 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
9972 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9973 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
9976 static void GLAPIENTRY
9977 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
9979 GET_CURRENT_CONTEXT(ctx
);
9981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9982 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
9992 if (ctx
->ExecuteFlag
) {
9993 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9997 static void GLAPIENTRY
9998 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10002 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10003 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10007 static void GLAPIENTRY
10008 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10009 GLint level
, GLint components
,
10010 GLsizei width
, GLint border
,
10011 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10013 GET_CURRENT_CONTEXT(ctx
);
10014 if (target
== GL_PROXY_TEXTURE_1D
) {
10015 /* don't compile, execute immediately */
10016 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10017 border
, format
, type
, pixels
));
10021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10022 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10027 n
[4].i
= components
;
10028 n
[5].i
= (GLint
) width
;
10032 save_pointer(&n
[9],
10033 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10034 pixels
, &ctx
->Unpack
));
10036 if (ctx
->ExecuteFlag
) {
10037 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10038 border
, format
, type
, pixels
));
10044 static void GLAPIENTRY
10045 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10046 GLint level
, GLint components
,
10047 GLsizei width
, GLsizei height
, GLint border
,
10048 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10050 GET_CURRENT_CONTEXT(ctx
);
10051 if (target
== GL_PROXY_TEXTURE_2D
) {
10052 /* don't compile, execute immediately */
10053 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10054 height
, border
, format
, type
, pixels
));
10058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10059 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10064 n
[4].i
= components
;
10065 n
[5].i
= (GLint
) width
;
10066 n
[6].i
= (GLint
) height
;
10070 save_pointer(&n
[10],
10071 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10072 pixels
, &ctx
->Unpack
));
10074 if (ctx
->ExecuteFlag
) {
10075 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10076 height
, border
, format
, type
, pixels
));
10082 static void GLAPIENTRY
10083 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10084 GLint level
, GLint internalFormat
,
10085 GLsizei width
, GLsizei height
, GLsizei depth
,
10087 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10089 GET_CURRENT_CONTEXT(ctx
);
10090 if (target
== GL_PROXY_TEXTURE_3D
) {
10091 /* don't compile, execute immediately */
10092 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10093 height
, depth
, border
, format
, type
,
10098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10099 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10104 n
[4].i
= (GLint
) internalFormat
;
10105 n
[5].i
= (GLint
) width
;
10106 n
[6].i
= (GLint
) height
;
10107 n
[7].i
= (GLint
) depth
;
10111 save_pointer(&n
[11],
10112 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10113 pixels
, &ctx
->Unpack
));
10115 if (ctx
->ExecuteFlag
) {
10116 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10117 width
, height
, depth
, border
, format
,
10124 static void GLAPIENTRY
10125 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10126 GLsizei width
, GLenum format
, GLenum type
,
10127 const GLvoid
* pixels
)
10129 GET_CURRENT_CONTEXT(ctx
);
10132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10134 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10140 n
[5].i
= (GLint
) width
;
10143 save_pointer(&n
[8],
10144 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10145 pixels
, &ctx
->Unpack
));
10147 if (ctx
->ExecuteFlag
) {
10148 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10149 format
, type
, pixels
));
10154 static void GLAPIENTRY
10155 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10156 GLint xoffset
, GLint yoffset
,
10157 GLsizei width
, GLsizei height
,
10158 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10160 GET_CURRENT_CONTEXT(ctx
);
10163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10165 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10172 n
[6].i
= (GLint
) width
;
10173 n
[7].i
= (GLint
) height
;
10176 save_pointer(&n
[10],
10177 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10178 pixels
, &ctx
->Unpack
));
10180 if (ctx
->ExecuteFlag
) {
10181 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10182 width
, height
, format
, type
, pixels
));
10187 static void GLAPIENTRY
10188 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10189 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10190 GLsizei width
, GLsizei height
, GLsizei depth
,
10191 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10193 GET_CURRENT_CONTEXT(ctx
);
10196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10198 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10206 n
[7].i
= (GLint
) width
;
10207 n
[8].i
= (GLint
) height
;
10208 n
[9].i
= (GLint
) depth
;
10211 save_pointer(&n
[12],
10212 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10213 pixels
, &ctx
->Unpack
));
10215 if (ctx
->ExecuteFlag
) {
10216 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10217 xoffset
, yoffset
, zoffset
,
10218 width
, height
, depth
, format
, type
,
10224 static void GLAPIENTRY
10225 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10227 GET_CURRENT_CONTEXT(ctx
);
10229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10230 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10235 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10236 n
[4].f
= params
[0];
10237 n
[5].f
= params
[1];
10238 n
[6].f
= params
[2];
10239 n
[7].f
= params
[3];
10242 n
[4].f
= params
[0];
10243 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10246 if (ctx
->ExecuteFlag
) {
10247 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10252 static void GLAPIENTRY
10253 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10256 parray
[0] = (GLfloat
) param
;
10257 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10258 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10262 static void GLAPIENTRY
10263 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10266 p
[0] = (GLfloat
) param
;
10267 p
[1] = p
[2] = p
[3] = 0.0F
;
10268 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10272 static void GLAPIENTRY
10273 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10276 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10277 p
[0] = INT_TO_FLOAT(param
[0]);
10278 p
[1] = INT_TO_FLOAT(param
[1]);
10279 p
[2] = INT_TO_FLOAT(param
[2]);
10280 p
[3] = INT_TO_FLOAT(param
[3]);
10283 p
[0] = (GLfloat
) param
[0];
10284 p
[1] = p
[2] = p
[3] = 0.0F
;
10286 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10290 static void GLAPIENTRY
10291 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10292 GLint yoffset
, GLsizei width
, GLsizei height
,
10293 GLenum format
, GLsizei imageSize
,
10294 const GLvoid
* data
)
10297 GET_CURRENT_CONTEXT(ctx
);
10298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10300 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10301 9 + POINTER_DWORDS
);
10308 n
[6].i
= (GLint
) width
;
10309 n
[7].i
= (GLint
) height
;
10311 n
[9].i
= imageSize
;
10312 save_pointer(&n
[10],
10313 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10315 if (ctx
->ExecuteFlag
) {
10316 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10317 (texture
, target
, level
, xoffset
, yoffset
,
10318 width
, height
, format
, imageSize
, data
));
10324 * Save an error-generating command into display list.
10326 * KW: Will appear in the list before the vertex buffer containing the
10327 * command that provoked the error. I don't see this as a problem.
10330 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10333 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
10336 save_pointer(&n
[2], (void *) s
);
10337 /* note: the data/string here doesn't have to be freed in
10338 * _mesa_delete_list() since the string is never dynamically
10346 * Compile an error into current display list.
10349 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10351 if (ctx
->CompileFlag
)
10352 save_error(ctx
, error
, s
);
10353 if (ctx
->ExecuteFlag
)
10354 _mesa_error(ctx
, error
, "%s", s
);
10359 * Test if ID names a display list.
10362 islist(struct gl_context
*ctx
, GLuint list
)
10364 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
10374 /**********************************************************************/
10375 /* Display list execution */
10376 /**********************************************************************/
10380 * Execute a display list. Note that the ListBase offset must have already
10381 * been added before calling this function. I.e. the list argument is
10382 * the absolute list number, not relative to ListBase.
10383 * \param list - display list number
10386 execute_list(struct gl_context
*ctx
, GLuint list
)
10388 struct gl_display_list
*dlist
;
10392 if (list
== 0 || !islist(ctx
, list
))
10395 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10396 /* raise an error? */
10400 dlist
= _mesa_lookup_list(ctx
, list
);
10404 ctx
->ListState
.CallDepth
++;
10406 vbo_save_BeginCallList(ctx
, dlist
);
10412 const OpCode opcode
= n
[0].opcode
;
10414 if (is_ext_opcode(opcode
)) {
10415 n
+= ext_opcode_execute(ctx
, n
);
10420 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10423 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10425 case OPCODE_ALPHA_FUNC
:
10426 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10428 case OPCODE_BIND_TEXTURE
:
10429 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10431 case OPCODE_BITMAP
:
10433 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10434 ctx
->Unpack
= ctx
->DefaultPacking
;
10435 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10436 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10437 get_pointer(&n
[7])));
10438 ctx
->Unpack
= save
; /* restore */
10441 case OPCODE_BLEND_COLOR
:
10442 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10444 case OPCODE_BLEND_EQUATION
:
10445 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10447 case OPCODE_BLEND_EQUATION_SEPARATE
:
10448 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10450 case OPCODE_BLEND_FUNC_SEPARATE
:
10451 CALL_BlendFuncSeparate(ctx
->Exec
,
10452 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10455 case OPCODE_BLEND_FUNC_I
:
10456 /* GL_ARB_draw_buffers_blend */
10457 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10459 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10460 /* GL_ARB_draw_buffers_blend */
10461 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10464 case OPCODE_BLEND_EQUATION_I
:
10465 /* GL_ARB_draw_buffers_blend */
10466 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10468 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10469 /* GL_ARB_draw_buffers_blend */
10470 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10471 (n
[1].ui
, n
[2].e
, n
[3].e
));
10474 case OPCODE_CALL_LIST
:
10475 /* Generated by glCallList(), don't add ListBase */
10476 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10477 execute_list(ctx
, n
[1].ui
);
10480 case OPCODE_CALL_LISTS
:
10481 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10482 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10486 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10488 case OPCODE_CLEAR_BUFFER_IV
:
10495 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10498 case OPCODE_CLEAR_BUFFER_UIV
:
10501 value
[0] = n
[3].ui
;
10502 value
[1] = n
[4].ui
;
10503 value
[2] = n
[5].ui
;
10504 value
[3] = n
[6].ui
;
10505 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10508 case OPCODE_CLEAR_BUFFER_FV
:
10515 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10518 case OPCODE_CLEAR_BUFFER_FI
:
10519 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10521 case OPCODE_CLEAR_COLOR
:
10522 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10524 case OPCODE_CLEAR_ACCUM
:
10525 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10527 case OPCODE_CLEAR_DEPTH
:
10528 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10530 case OPCODE_CLEAR_INDEX
:
10531 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10533 case OPCODE_CLEAR_STENCIL
:
10534 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10536 case OPCODE_CLIP_PLANE
:
10543 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10546 case OPCODE_COLOR_MASK
:
10547 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10549 case OPCODE_COLOR_MASK_INDEXED
:
10550 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10553 case OPCODE_COLOR_MATERIAL
:
10554 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10556 case OPCODE_COPY_PIXELS
:
10557 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10558 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10561 case OPCODE_COPY_TEX_IMAGE1D
:
10562 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10563 n
[5].i
, n
[6].i
, n
[7].i
));
10565 case OPCODE_COPY_TEX_IMAGE2D
:
10566 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10567 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10569 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10570 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10571 n
[4].i
, n
[5].i
, n
[6].i
));
10573 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10574 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10575 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10578 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10579 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10580 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10583 case OPCODE_CULL_FACE
:
10584 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10586 case OPCODE_DEPTH_FUNC
:
10587 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10589 case OPCODE_DEPTH_MASK
:
10590 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10592 case OPCODE_DEPTH_RANGE
:
10593 CALL_DepthRange(ctx
->Exec
,
10594 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10596 case OPCODE_DISABLE
:
10597 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10599 case OPCODE_DISABLE_INDEXED
:
10600 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10602 case OPCODE_DRAW_BUFFER
:
10603 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10605 case OPCODE_DRAW_PIXELS
:
10607 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10608 ctx
->Unpack
= ctx
->DefaultPacking
;
10609 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10610 get_pointer(&n
[5])));
10611 ctx
->Unpack
= save
; /* restore */
10614 case OPCODE_ENABLE
:
10615 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10617 case OPCODE_ENABLE_INDEXED
:
10618 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10620 case OPCODE_EVALMESH1
:
10621 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10623 case OPCODE_EVALMESH2
:
10624 CALL_EvalMesh2(ctx
->Exec
,
10625 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10634 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10637 case OPCODE_FRONT_FACE
:
10638 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10640 case OPCODE_FRUSTUM
:
10641 CALL_Frustum(ctx
->Exec
,
10642 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10645 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10647 case OPCODE_INDEX_MASK
:
10648 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10650 case OPCODE_INIT_NAMES
:
10651 CALL_InitNames(ctx
->Exec
, ());
10660 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10663 case OPCODE_LIGHT_MODEL
:
10670 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10673 case OPCODE_LINE_STIPPLE
:
10674 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10676 case OPCODE_LINE_WIDTH
:
10677 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10679 case OPCODE_LIST_BASE
:
10680 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10682 case OPCODE_LOAD_IDENTITY
:
10683 CALL_LoadIdentity(ctx
->Exec
, ());
10685 case OPCODE_LOAD_MATRIX
:
10686 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10687 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10689 case OPCODE_LOAD_NAME
:
10690 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10692 case OPCODE_LOGIC_OP
:
10693 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10697 GLenum target
= n
[1].e
;
10698 GLint ustride
= _mesa_evaluator_components(target
);
10699 GLint uorder
= n
[5].i
;
10700 GLfloat u1
= n
[2].f
;
10701 GLfloat u2
= n
[3].f
;
10702 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10703 (GLfloat
*) get_pointer(&n
[6])));
10708 GLenum target
= n
[1].e
;
10709 GLfloat u1
= n
[2].f
;
10710 GLfloat u2
= n
[3].f
;
10711 GLfloat v1
= n
[4].f
;
10712 GLfloat v2
= n
[5].f
;
10713 GLint ustride
= n
[6].i
;
10714 GLint vstride
= n
[7].i
;
10715 GLint uorder
= n
[8].i
;
10716 GLint vorder
= n
[9].i
;
10717 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10718 v1
, v2
, vstride
, vorder
,
10719 (GLfloat
*) get_pointer(&n
[10])));
10722 case OPCODE_MAPGRID1
:
10723 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10725 case OPCODE_MAPGRID2
:
10726 CALL_MapGrid2f(ctx
->Exec
,
10727 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10729 case OPCODE_MATRIX_MODE
:
10730 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10732 case OPCODE_MULT_MATRIX
:
10733 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10736 CALL_Ortho(ctx
->Exec
,
10737 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10739 case OPCODE_PASSTHROUGH
:
10740 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10742 case OPCODE_PATCH_PARAMETER_I
:
10743 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10745 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10748 params
[0] = n
[2].f
;
10749 params
[1] = n
[3].f
;
10750 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10753 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10756 params
[0] = n
[2].f
;
10757 params
[1] = n
[3].f
;
10758 params
[2] = n
[4].f
;
10759 params
[3] = n
[5].f
;
10760 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10763 case OPCODE_PIXEL_MAP
:
10764 CALL_PixelMapfv(ctx
->Exec
,
10765 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10767 case OPCODE_PIXEL_TRANSFER
:
10768 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10770 case OPCODE_PIXEL_ZOOM
:
10771 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10773 case OPCODE_POINT_SIZE
:
10774 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10776 case OPCODE_POINT_PARAMETERS
:
10779 params
[0] = n
[2].f
;
10780 params
[1] = n
[3].f
;
10781 params
[2] = n
[4].f
;
10782 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10785 case OPCODE_POLYGON_MODE
:
10786 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10788 case OPCODE_POLYGON_STIPPLE
:
10790 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10791 ctx
->Unpack
= ctx
->DefaultPacking
;
10792 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10793 ctx
->Unpack
= save
; /* restore */
10796 case OPCODE_POLYGON_OFFSET
:
10797 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10799 case OPCODE_POLYGON_OFFSET_CLAMP
:
10800 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10802 case OPCODE_POP_ATTRIB
:
10803 CALL_PopAttrib(ctx
->Exec
, ());
10805 case OPCODE_POP_MATRIX
:
10806 CALL_PopMatrix(ctx
->Exec
, ());
10808 case OPCODE_POP_NAME
:
10809 CALL_PopName(ctx
->Exec
, ());
10811 case OPCODE_PRIORITIZE_TEXTURE
:
10812 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10814 case OPCODE_PUSH_ATTRIB
:
10815 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10817 case OPCODE_PUSH_MATRIX
:
10818 CALL_PushMatrix(ctx
->Exec
, ());
10820 case OPCODE_PUSH_NAME
:
10821 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10823 case OPCODE_RASTER_POS
:
10824 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10826 case OPCODE_READ_BUFFER
:
10827 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10829 case OPCODE_ROTATE
:
10830 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10833 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10835 case OPCODE_SCISSOR
:
10836 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10838 case OPCODE_SHADE_MODEL
:
10839 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10841 case OPCODE_PROVOKING_VERTEX
:
10842 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10844 case OPCODE_STENCIL_FUNC
:
10845 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10847 case OPCODE_STENCIL_MASK
:
10848 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10850 case OPCODE_STENCIL_OP
:
10851 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10853 case OPCODE_STENCIL_FUNC_SEPARATE
:
10854 CALL_StencilFuncSeparate(ctx
->Exec
,
10855 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10857 case OPCODE_STENCIL_MASK_SEPARATE
:
10858 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10860 case OPCODE_STENCIL_OP_SEPARATE
:
10861 CALL_StencilOpSeparate(ctx
->Exec
,
10862 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10864 case OPCODE_TEXENV
:
10867 params
[0] = n
[3].f
;
10868 params
[1] = n
[4].f
;
10869 params
[2] = n
[5].f
;
10870 params
[3] = n
[6].f
;
10871 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10874 case OPCODE_TEXGEN
:
10877 params
[0] = n
[3].f
;
10878 params
[1] = n
[4].f
;
10879 params
[2] = n
[5].f
;
10880 params
[3] = n
[6].f
;
10881 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10884 case OPCODE_TEXPARAMETER
:
10887 params
[0] = n
[3].f
;
10888 params
[1] = n
[4].f
;
10889 params
[2] = n
[5].f
;
10890 params
[3] = n
[6].f
;
10891 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10894 case OPCODE_TEX_IMAGE1D
:
10896 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10897 ctx
->Unpack
= ctx
->DefaultPacking
;
10898 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10899 n
[2].i
, /* level */
10900 n
[3].i
, /* components */
10901 n
[4].i
, /* width */
10902 n
[5].e
, /* border */
10903 n
[6].e
, /* format */
10905 get_pointer(&n
[8])));
10906 ctx
->Unpack
= save
; /* restore */
10909 case OPCODE_TEX_IMAGE2D
:
10911 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10912 ctx
->Unpack
= ctx
->DefaultPacking
;
10913 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10914 n
[2].i
, /* level */
10915 n
[3].i
, /* components */
10916 n
[4].i
, /* width */
10917 n
[5].i
, /* height */
10918 n
[6].e
, /* border */
10919 n
[7].e
, /* format */
10921 get_pointer(&n
[9])));
10922 ctx
->Unpack
= save
; /* restore */
10925 case OPCODE_TEX_IMAGE3D
:
10927 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10928 ctx
->Unpack
= ctx
->DefaultPacking
;
10929 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10930 n
[2].i
, /* level */
10931 n
[3].i
, /* components */
10932 n
[4].i
, /* width */
10933 n
[5].i
, /* height */
10934 n
[6].i
, /* depth */
10935 n
[7].e
, /* border */
10936 n
[8].e
, /* format */
10938 get_pointer(&n
[10])));
10939 ctx
->Unpack
= save
; /* restore */
10942 case OPCODE_TEX_SUB_IMAGE1D
:
10944 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10945 ctx
->Unpack
= ctx
->DefaultPacking
;
10946 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10948 n
[6].e
, get_pointer(&n
[7])));
10949 ctx
->Unpack
= save
; /* restore */
10952 case OPCODE_TEX_SUB_IMAGE2D
:
10954 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10955 ctx
->Unpack
= ctx
->DefaultPacking
;
10956 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10958 n
[6].i
, n
[7].e
, n
[8].e
,
10959 get_pointer(&n
[9])));
10960 ctx
->Unpack
= save
; /* restore */
10963 case OPCODE_TEX_SUB_IMAGE3D
:
10965 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10966 ctx
->Unpack
= ctx
->DefaultPacking
;
10967 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10968 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10969 n
[8].i
, n
[9].e
, n
[10].e
,
10970 get_pointer(&n
[11])));
10971 ctx
->Unpack
= save
; /* restore */
10974 case OPCODE_TRANSLATE
:
10975 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10977 case OPCODE_VIEWPORT
:
10978 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10979 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10981 case OPCODE_WINDOW_POS
:
10982 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10984 case OPCODE_VIEWPORT_ARRAY_V
:
10985 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10986 get_pointer(&n
[3])));
10988 case OPCODE_VIEWPORT_INDEXED_F
:
10989 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10992 case OPCODE_VIEWPORT_INDEXED_FV
: {
10998 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11001 case OPCODE_SCISSOR_ARRAY_V
:
11002 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11003 get_pointer(&n
[3])));
11005 case OPCODE_SCISSOR_INDEXED
:
11006 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11009 case OPCODE_SCISSOR_INDEXED_V
: {
11015 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11018 case OPCODE_DEPTH_ARRAY_V
:
11019 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11020 get_pointer(&n
[3])));
11022 case OPCODE_DEPTH_INDEXED
:
11023 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11025 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11026 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11028 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11029 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11030 n
[4].i
, n
[5].i
, n
[6].i
,
11031 get_pointer(&n
[7])));
11033 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11034 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11035 n
[4].i
, n
[5].i
, n
[6].i
,
11036 n
[7].i
, get_pointer(&n
[8])));
11038 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11039 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11040 n
[4].i
, n
[5].i
, n
[6].i
,
11042 get_pointer(&n
[9])));
11044 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11045 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11046 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11048 get_pointer(&n
[7])));
11050 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
11051 CALL_CompressedTexSubImage2D(ctx
->Exec
,
11052 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11053 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
11054 get_pointer(&n
[9])));
11056 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
11057 CALL_CompressedTexSubImage3D(ctx
->Exec
,
11058 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11059 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11061 get_pointer(&n
[11])));
11063 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
11064 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
11066 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
11067 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11069 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
11070 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11072 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
11073 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
11074 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
11077 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
11078 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
11080 case OPCODE_DEPTH_BOUNDS_EXT
:
11081 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11083 case OPCODE_PROGRAM_STRING_ARB
:
11084 CALL_ProgramStringARB(ctx
->Exec
,
11085 (n
[1].e
, n
[2].e
, n
[3].i
,
11086 get_pointer(&n
[4])));
11088 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
11089 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
11093 case OPCODE_BEGIN_QUERY_ARB
:
11094 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11096 case OPCODE_END_QUERY_ARB
:
11097 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
11099 case OPCODE_QUERY_COUNTER
:
11100 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11102 case OPCODE_BEGIN_QUERY_INDEXED
:
11103 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11105 case OPCODE_END_QUERY_INDEXED
:
11106 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11108 case OPCODE_DRAW_BUFFERS_ARB
:
11110 GLenum buffers
[MAX_DRAW_BUFFERS
];
11111 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11112 for (i
= 0; i
< count
; i
++)
11113 buffers
[i
] = n
[2 + i
].e
;
11114 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11117 case OPCODE_BLIT_FRAMEBUFFER
:
11118 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11119 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11122 case OPCODE_PRIMITIVE_RESTART_NV
:
11123 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11126 case OPCODE_USE_PROGRAM
:
11127 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11129 case OPCODE_UNIFORM_1F
:
11130 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11132 case OPCODE_UNIFORM_2F
:
11133 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11135 case OPCODE_UNIFORM_3F
:
11136 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11138 case OPCODE_UNIFORM_4F
:
11139 CALL_Uniform4f(ctx
->Exec
,
11140 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11142 case OPCODE_UNIFORM_1FV
:
11143 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11145 case OPCODE_UNIFORM_2FV
:
11146 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11148 case OPCODE_UNIFORM_3FV
:
11149 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11151 case OPCODE_UNIFORM_4FV
:
11152 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11154 case OPCODE_UNIFORM_1D
: {
11155 union float64_pair x
;
11157 x
.uint32
[0] = n
[2].ui
;
11158 x
.uint32
[1] = n
[3].ui
;
11160 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11163 case OPCODE_UNIFORM_2D
: {
11164 union float64_pair x
;
11165 union float64_pair y
;
11167 x
.uint32
[0] = n
[2].ui
;
11168 x
.uint32
[1] = n
[3].ui
;
11169 y
.uint32
[0] = n
[4].ui
;
11170 y
.uint32
[1] = n
[5].ui
;
11172 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11175 case OPCODE_UNIFORM_3D
: {
11176 union float64_pair x
;
11177 union float64_pair y
;
11178 union float64_pair z
;
11180 x
.uint32
[0] = n
[2].ui
;
11181 x
.uint32
[1] = n
[3].ui
;
11182 y
.uint32
[0] = n
[4].ui
;
11183 y
.uint32
[1] = n
[5].ui
;
11184 z
.uint32
[0] = n
[6].ui
;
11185 z
.uint32
[1] = n
[7].ui
;
11187 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11190 case OPCODE_UNIFORM_4D
: {
11191 union float64_pair x
;
11192 union float64_pair y
;
11193 union float64_pair z
;
11194 union float64_pair w
;
11196 x
.uint32
[0] = n
[2].ui
;
11197 x
.uint32
[1] = n
[3].ui
;
11198 y
.uint32
[0] = n
[4].ui
;
11199 y
.uint32
[1] = n
[5].ui
;
11200 z
.uint32
[0] = n
[6].ui
;
11201 z
.uint32
[1] = n
[7].ui
;
11202 w
.uint32
[0] = n
[8].ui
;
11203 w
.uint32
[1] = n
[9].ui
;
11205 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11208 case OPCODE_UNIFORM_1DV
:
11209 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11211 case OPCODE_UNIFORM_2DV
:
11212 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11214 case OPCODE_UNIFORM_3DV
:
11215 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11217 case OPCODE_UNIFORM_4DV
:
11218 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11220 case OPCODE_UNIFORM_1I
:
11221 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11223 case OPCODE_UNIFORM_2I
:
11224 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11226 case OPCODE_UNIFORM_3I
:
11227 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11229 case OPCODE_UNIFORM_4I
:
11230 CALL_Uniform4i(ctx
->Exec
,
11231 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11233 case OPCODE_UNIFORM_1IV
:
11234 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11236 case OPCODE_UNIFORM_2IV
:
11237 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11239 case OPCODE_UNIFORM_3IV
:
11240 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11242 case OPCODE_UNIFORM_4IV
:
11243 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11245 case OPCODE_UNIFORM_1UI
:
11246 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11248 case OPCODE_UNIFORM_2UI
:
11249 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11251 case OPCODE_UNIFORM_3UI
:
11252 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11254 case OPCODE_UNIFORM_4UI
:
11255 CALL_Uniform4ui(ctx
->Exec
,
11256 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11258 case OPCODE_UNIFORM_1UIV
:
11259 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11261 case OPCODE_UNIFORM_2UIV
:
11262 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11264 case OPCODE_UNIFORM_3UIV
:
11265 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11267 case OPCODE_UNIFORM_4UIV
:
11268 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11270 case OPCODE_UNIFORM_MATRIX22
:
11271 CALL_UniformMatrix2fv(ctx
->Exec
,
11272 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11274 case OPCODE_UNIFORM_MATRIX33
:
11275 CALL_UniformMatrix3fv(ctx
->Exec
,
11276 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11278 case OPCODE_UNIFORM_MATRIX44
:
11279 CALL_UniformMatrix4fv(ctx
->Exec
,
11280 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11282 case OPCODE_UNIFORM_MATRIX23
:
11283 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11284 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11286 case OPCODE_UNIFORM_MATRIX32
:
11287 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11288 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11290 case OPCODE_UNIFORM_MATRIX24
:
11291 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11292 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11294 case OPCODE_UNIFORM_MATRIX42
:
11295 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11296 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11298 case OPCODE_UNIFORM_MATRIX34
:
11299 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11300 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11302 case OPCODE_UNIFORM_MATRIX43
:
11303 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11304 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11306 case OPCODE_UNIFORM_MATRIX22D
:
11307 CALL_UniformMatrix2dv(ctx
->Exec
,
11308 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11310 case OPCODE_UNIFORM_MATRIX33D
:
11311 CALL_UniformMatrix3dv(ctx
->Exec
,
11312 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11314 case OPCODE_UNIFORM_MATRIX44D
:
11315 CALL_UniformMatrix4dv(ctx
->Exec
,
11316 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11318 case OPCODE_UNIFORM_MATRIX23D
:
11319 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11320 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11322 case OPCODE_UNIFORM_MATRIX32D
:
11323 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11324 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11326 case OPCODE_UNIFORM_MATRIX24D
:
11327 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11328 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11330 case OPCODE_UNIFORM_MATRIX42D
:
11331 CALL_UniformMatrix4x2dv(ctx
->Exec
,
11332 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11334 case OPCODE_UNIFORM_MATRIX34D
:
11335 CALL_UniformMatrix3x4dv(ctx
->Exec
,
11336 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11338 case OPCODE_UNIFORM_MATRIX43D
:
11339 CALL_UniformMatrix4x3dv(ctx
->Exec
,
11340 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11343 case OPCODE_USE_PROGRAM_STAGES
:
11344 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11346 case OPCODE_PROGRAM_UNIFORM_1F
:
11347 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
11349 case OPCODE_PROGRAM_UNIFORM_2F
:
11350 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
11352 case OPCODE_PROGRAM_UNIFORM_3F
:
11353 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11354 n
[3].f
, n
[4].f
, n
[5].f
));
11356 case OPCODE_PROGRAM_UNIFORM_4F
:
11357 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11358 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11360 case OPCODE_PROGRAM_UNIFORM_1FV
:
11361 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11362 get_pointer(&n
[4])));
11364 case OPCODE_PROGRAM_UNIFORM_2FV
:
11365 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11366 get_pointer(&n
[4])));
11368 case OPCODE_PROGRAM_UNIFORM_3FV
:
11369 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11370 get_pointer(&n
[4])));
11372 case OPCODE_PROGRAM_UNIFORM_4FV
:
11373 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11374 get_pointer(&n
[4])));
11376 case OPCODE_PROGRAM_UNIFORM_1D
: {
11377 union float64_pair x
;
11379 x
.uint32
[0] = n
[3].ui
;
11380 x
.uint32
[1] = n
[4].ui
;
11382 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11385 case OPCODE_PROGRAM_UNIFORM_2D
: {
11386 union float64_pair x
;
11387 union float64_pair y
;
11389 x
.uint32
[0] = n
[3].ui
;
11390 x
.uint32
[1] = n
[4].ui
;
11391 y
.uint32
[0] = n
[5].ui
;
11392 y
.uint32
[1] = n
[6].ui
;
11394 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11397 case OPCODE_PROGRAM_UNIFORM_3D
: {
11398 union float64_pair x
;
11399 union float64_pair y
;
11400 union float64_pair z
;
11402 x
.uint32
[0] = n
[3].ui
;
11403 x
.uint32
[1] = n
[4].ui
;
11404 y
.uint32
[0] = n
[5].ui
;
11405 y
.uint32
[1] = n
[6].ui
;
11406 z
.uint32
[0] = n
[7].ui
;
11407 z
.uint32
[1] = n
[8].ui
;
11409 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11413 case OPCODE_PROGRAM_UNIFORM_4D
: {
11414 union float64_pair x
;
11415 union float64_pair y
;
11416 union float64_pair z
;
11417 union float64_pair w
;
11419 x
.uint32
[0] = n
[3].ui
;
11420 x
.uint32
[1] = n
[4].ui
;
11421 y
.uint32
[0] = n
[5].ui
;
11422 y
.uint32
[1] = n
[6].ui
;
11423 z
.uint32
[0] = n
[7].ui
;
11424 z
.uint32
[1] = n
[8].ui
;
11425 w
.uint32
[0] = n
[9].ui
;
11426 w
.uint32
[1] = n
[10].ui
;
11428 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11429 x
.d
, y
.d
, z
.d
, w
.d
));
11432 case OPCODE_PROGRAM_UNIFORM_1DV
:
11433 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11434 get_pointer(&n
[4])));
11436 case OPCODE_PROGRAM_UNIFORM_2DV
:
11437 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11438 get_pointer(&n
[4])));
11440 case OPCODE_PROGRAM_UNIFORM_3DV
:
11441 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11442 get_pointer(&n
[4])));
11444 case OPCODE_PROGRAM_UNIFORM_4DV
:
11445 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11446 get_pointer(&n
[4])));
11448 case OPCODE_PROGRAM_UNIFORM_1I
:
11449 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11451 case OPCODE_PROGRAM_UNIFORM_2I
:
11452 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11454 case OPCODE_PROGRAM_UNIFORM_3I
:
11455 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11456 n
[3].i
, n
[4].i
, n
[5].i
));
11458 case OPCODE_PROGRAM_UNIFORM_4I
:
11459 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11460 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11462 case OPCODE_PROGRAM_UNIFORM_1IV
:
11463 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11464 get_pointer(&n
[4])));
11466 case OPCODE_PROGRAM_UNIFORM_2IV
:
11467 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11468 get_pointer(&n
[4])));
11470 case OPCODE_PROGRAM_UNIFORM_3IV
:
11471 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11472 get_pointer(&n
[4])));
11474 case OPCODE_PROGRAM_UNIFORM_4IV
:
11475 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11476 get_pointer(&n
[4])));
11478 case OPCODE_PROGRAM_UNIFORM_1UI
:
11479 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11481 case OPCODE_PROGRAM_UNIFORM_2UI
:
11482 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11483 n
[3].ui
, n
[4].ui
));
11485 case OPCODE_PROGRAM_UNIFORM_3UI
:
11486 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11487 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11489 case OPCODE_PROGRAM_UNIFORM_4UI
:
11490 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11492 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11494 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11495 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11496 get_pointer(&n
[4])));
11498 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11499 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11500 get_pointer(&n
[4])));
11502 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11503 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11504 get_pointer(&n
[4])));
11506 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11507 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11508 get_pointer(&n
[4])));
11510 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11511 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11512 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11513 get_pointer(&n
[5])));
11515 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11516 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11517 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11518 get_pointer(&n
[5])));
11520 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11521 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11522 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11523 get_pointer(&n
[5])));
11525 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11526 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11527 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11528 get_pointer(&n
[5])));
11530 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11531 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11532 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11533 get_pointer(&n
[5])));
11535 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11536 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11537 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11538 get_pointer(&n
[5])));
11540 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11541 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11542 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11543 get_pointer(&n
[5])));
11545 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11546 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11547 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11548 get_pointer(&n
[5])));
11550 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11551 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11552 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11553 get_pointer(&n
[5])));
11555 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11556 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11557 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11558 get_pointer(&n
[5])));
11560 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11561 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11562 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11563 get_pointer(&n
[5])));
11565 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11566 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11567 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11568 get_pointer(&n
[5])));
11570 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11571 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11572 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11573 get_pointer(&n
[5])));
11575 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11576 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11577 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11578 get_pointer(&n
[5])));
11580 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11581 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11582 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11583 get_pointer(&n
[5])));
11585 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11586 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11587 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11588 get_pointer(&n
[5])));
11590 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11591 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11592 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11593 get_pointer(&n
[5])));
11595 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11596 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11597 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11598 get_pointer(&n
[5])));
11601 case OPCODE_CLIP_CONTROL
:
11602 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11605 case OPCODE_CLAMP_COLOR
:
11606 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11609 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11610 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11612 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11613 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11615 case OPCODE_ATTR_1F_NV
:
11616 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11618 case OPCODE_ATTR_2F_NV
:
11619 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11621 case OPCODE_ATTR_3F_NV
:
11622 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11624 case OPCODE_ATTR_4F_NV
:
11625 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11627 case OPCODE_ATTR_1F_ARB
:
11628 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11630 case OPCODE_ATTR_2F_ARB
:
11631 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11633 case OPCODE_ATTR_3F_ARB
:
11634 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11636 case OPCODE_ATTR_4F_ARB
:
11637 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11639 case OPCODE_ATTR_1D
: {
11640 GLdouble
*d
= (GLdouble
*) &n
[2];
11641 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11644 case OPCODE_ATTR_2D
: {
11645 GLdouble
*d
= (GLdouble
*) &n
[2];
11646 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11649 case OPCODE_ATTR_3D
: {
11650 GLdouble
*d
= (GLdouble
*) &n
[2];
11651 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11654 case OPCODE_ATTR_4D
: {
11655 GLdouble
*d
= (GLdouble
*) &n
[2];
11656 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11659 case OPCODE_MATERIAL
:
11660 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11663 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11666 CALL_End(ctx
->Exec
, ());
11669 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11671 case OPCODE_EVAL_C1
:
11672 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11674 case OPCODE_EVAL_C2
:
11675 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11677 case OPCODE_EVAL_P1
:
11678 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11680 case OPCODE_EVAL_P2
:
11681 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11684 /* GL_EXT_texture_integer */
11685 case OPCODE_CLEARCOLOR_I
:
11686 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11688 case OPCODE_CLEARCOLOR_UI
:
11689 CALL_ClearColorIuiEXT(ctx
->Exec
,
11690 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11692 case OPCODE_TEXPARAMETER_I
:
11695 params
[0] = n
[3].i
;
11696 params
[1] = n
[4].i
;
11697 params
[2] = n
[5].i
;
11698 params
[3] = n
[6].i
;
11699 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11702 case OPCODE_TEXPARAMETER_UI
:
11705 params
[0] = n
[3].ui
;
11706 params
[1] = n
[4].ui
;
11707 params
[2] = n
[5].ui
;
11708 params
[3] = n
[6].ui
;
11709 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11713 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11714 /* GL_ARB_instanced_arrays */
11715 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11718 case OPCODE_TEXTURE_BARRIER_NV
:
11719 CALL_TextureBarrierNV(ctx
->Exec
, ());
11722 /* GL_EXT/ARB_transform_feedback */
11723 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11724 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11726 case OPCODE_END_TRANSFORM_FEEDBACK
:
11727 CALL_EndTransformFeedback(ctx
->Exec
, ());
11729 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11730 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11732 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11733 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11735 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11736 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11738 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11739 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11741 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11742 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11743 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11745 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11746 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11747 (n
[1].e
, n
[2].ui
, n
[3].si
));
11749 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11750 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11751 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11755 case OPCODE_BIND_SAMPLER
:
11756 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11758 case OPCODE_SAMPLER_PARAMETERIV
:
11761 params
[0] = n
[3].i
;
11762 params
[1] = n
[4].i
;
11763 params
[2] = n
[5].i
;
11764 params
[3] = n
[6].i
;
11765 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11768 case OPCODE_SAMPLER_PARAMETERFV
:
11771 params
[0] = n
[3].f
;
11772 params
[1] = n
[4].f
;
11773 params
[2] = n
[5].f
;
11774 params
[3] = n
[6].f
;
11775 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11778 case OPCODE_SAMPLER_PARAMETERIIV
:
11781 params
[0] = n
[3].i
;
11782 params
[1] = n
[4].i
;
11783 params
[2] = n
[5].i
;
11784 params
[3] = n
[6].i
;
11785 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11788 case OPCODE_SAMPLER_PARAMETERUIV
:
11791 params
[0] = n
[3].ui
;
11792 params
[1] = n
[4].ui
;
11793 params
[2] = n
[5].ui
;
11794 params
[3] = n
[6].ui
;
11795 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11799 /* ARB_compute_shader */
11800 case OPCODE_DISPATCH_COMPUTE
:
11801 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11805 case OPCODE_WAIT_SYNC
:
11807 union uint64_pair p
;
11808 p
.uint32
[0] = n
[2].ui
;
11809 p
.uint32
[1] = n
[3].ui
;
11810 CALL_WaitSync(ctx
->Exec
,
11811 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11815 /* GL_NV_conditional_render */
11816 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11817 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11819 case OPCODE_END_CONDITIONAL_RENDER
:
11820 CALL_EndConditionalRender(ctx
->Exec
, ());
11823 case OPCODE_UNIFORM_BLOCK_BINDING
:
11824 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11827 case OPCODE_UNIFORM_SUBROUTINES
:
11828 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11829 get_pointer(&n
[3])));
11832 /* GL_EXT_window_rectangles */
11833 case OPCODE_WINDOW_RECTANGLES
:
11834 CALL_WindowRectanglesEXT(
11835 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11838 /* GL_NV_conservative_raster */
11839 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11840 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11843 /* GL_NV_conservative_raster_dilate */
11844 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11845 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11848 /* GL_NV_conservative_raster_pre_snap_triangles */
11849 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11850 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11853 /* GL_EXT_direct_state_access */
11854 case OPCODE_MATRIX_LOAD
:
11855 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11857 case OPCODE_MATRIX_MULT
:
11858 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11860 case OPCODE_MATRIX_ROTATE
:
11861 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11863 case OPCODE_MATRIX_SCALE
:
11864 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11866 case OPCODE_MATRIX_TRANSLATE
:
11867 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11869 case OPCODE_MATRIX_LOAD_IDENTITY
:
11870 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11872 case OPCODE_MATRIX_ORTHO
:
11873 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11874 n
[2].f
, n
[3].f
, n
[4].f
,
11875 n
[5].f
, n
[6].f
, n
[7].f
));
11877 case OPCODE_MATRIX_FRUSTUM
:
11878 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11879 n
[2].f
, n
[3].f
, n
[4].f
,
11880 n
[5].f
, n
[6].f
, n
[7].f
));
11882 case OPCODE_MATRIX_PUSH
:
11883 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11885 case OPCODE_MATRIX_POP
:
11886 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11888 case OPCODE_TEXTUREPARAMETER_F
:
11891 params
[0] = n
[4].f
;
11892 params
[1] = n
[5].f
;
11893 params
[2] = n
[6].f
;
11894 params
[3] = n
[7].f
;
11895 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11898 case OPCODE_TEXTUREPARAMETER_I
:
11901 params
[0] = n
[4].i
;
11902 params
[1] = n
[5].i
;
11903 params
[2] = n
[6].i
;
11904 params
[3] = n
[7].i
;
11905 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11908 case OPCODE_TEXTURE_IMAGE1D
:
11910 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11911 ctx
->Unpack
= ctx
->DefaultPacking
;
11912 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11913 n
[2].e
, /* target */
11914 n
[3].i
, /* level */
11915 n
[4].i
, /* components */
11916 n
[5].i
, /* width */
11917 n
[6].e
, /* border */
11918 n
[7].e
, /* format */
11920 get_pointer(&n
[9])));
11921 ctx
->Unpack
= save
; /* restore */
11924 case OPCODE_TEXTURE_IMAGE2D
:
11926 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11927 ctx
->Unpack
= ctx
->DefaultPacking
;
11928 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11929 n
[2].e
, /* target */
11930 n
[3].i
, /* level */
11931 n
[4].i
, /* components */
11932 n
[5].i
, /* width */
11933 n
[6].i
, /* height */
11934 n
[7].e
, /* border */
11935 n
[8].e
, /* format */
11937 get_pointer(&n
[10])));
11938 ctx
->Unpack
= save
; /* restore */
11941 case OPCODE_TEXTURE_IMAGE3D
:
11943 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11944 ctx
->Unpack
= ctx
->DefaultPacking
;
11945 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11946 n
[2].e
, /* target */
11947 n
[3].i
, /* level */
11948 n
[4].i
, /* components */
11949 n
[5].i
, /* width */
11950 n
[6].i
, /* height */
11951 n
[7].i
, /* depth */
11952 n
[8].e
, /* border */
11953 n
[9].e
, /* format */
11954 n
[10].e
, /* type */
11955 get_pointer(&n
[11])));
11956 ctx
->Unpack
= save
; /* restore */
11959 case OPCODE_TEXTURE_SUB_IMAGE1D
:
11961 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11962 ctx
->Unpack
= ctx
->DefaultPacking
;
11963 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11964 n
[4].i
, n
[5].i
, n
[6].e
,
11965 n
[7].e
, get_pointer(&n
[8])));
11966 ctx
->Unpack
= save
; /* restore */
11969 case OPCODE_TEXTURE_SUB_IMAGE2D
:
11971 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11972 ctx
->Unpack
= ctx
->DefaultPacking
;
11973 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11974 n
[4].i
, n
[5].i
, n
[6].e
,
11975 n
[7].i
, n
[8].e
, n
[9].e
,
11976 get_pointer(&n
[10])));
11977 ctx
->Unpack
= save
;
11980 case OPCODE_TEXTURE_SUB_IMAGE3D
:
11982 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11983 ctx
->Unpack
= ctx
->DefaultPacking
;
11984 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11985 n
[4].i
, n
[5].i
, n
[6].i
,
11986 n
[7].i
, n
[8].i
, n
[9].i
,
11988 get_pointer(&n
[12])));
11989 ctx
->Unpack
= save
; /* restore */
11992 case OPCODE_COPY_TEXTURE_IMAGE1D
:
11993 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11994 n
[4].e
, n
[5].i
, n
[6].i
,
11997 case OPCODE_COPY_TEXTURE_IMAGE2D
:
11998 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11999 n
[4].e
, n
[5].i
, n
[6].i
,
12000 n
[7].i
, n
[8].i
, n
[9].i
));
12002 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
12003 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12004 n
[4].i
, n
[5].i
, n
[6].i
,
12007 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
12008 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12009 n
[4].i
, n
[5].i
, n
[6].i
,
12010 n
[7].i
, n
[8].i
, n
[9].i
));
12012 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
12013 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12014 n
[4].i
, n
[5].i
, n
[6].i
,
12015 n
[7].i
, n
[8].i
, n
[9].i
,
12018 case OPCODE_BIND_MULTITEXTURE
:
12019 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
12021 case OPCODE_MULTITEXPARAMETER_F
:
12024 params
[0] = n
[4].f
;
12025 params
[1] = n
[5].f
;
12026 params
[2] = n
[6].f
;
12027 params
[3] = n
[7].f
;
12028 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12031 case OPCODE_MULTITEXPARAMETER_I
:
12034 params
[0] = n
[4].i
;
12035 params
[1] = n
[5].i
;
12036 params
[2] = n
[6].i
;
12037 params
[3] = n
[7].i
;
12038 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12041 case OPCODE_MULTITEX_IMAGE1D
:
12043 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12044 ctx
->Unpack
= ctx
->DefaultPacking
;
12045 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12046 n
[2].e
, /* target */
12047 n
[3].i
, /* level */
12048 n
[4].i
, /* components */
12049 n
[5].i
, /* width */
12050 n
[6].e
, /* border */
12051 n
[7].e
, /* format */
12053 get_pointer(&n
[9])));
12054 ctx
->Unpack
= save
; /* restore */
12057 case OPCODE_MULTITEX_IMAGE2D
:
12059 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12060 ctx
->Unpack
= ctx
->DefaultPacking
;
12061 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12062 n
[2].e
, /* target */
12063 n
[3].i
, /* level */
12064 n
[4].i
, /* components */
12065 n
[5].i
, /* width */
12066 n
[6].i
, /* height */
12067 n
[7].e
, /* border */
12068 n
[8].e
, /* format */
12070 get_pointer(&n
[10])));
12071 ctx
->Unpack
= save
; /* restore */
12074 case OPCODE_MULTITEX_IMAGE3D
:
12076 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12077 ctx
->Unpack
= ctx
->DefaultPacking
;
12078 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12079 n
[2].e
, /* target */
12080 n
[3].i
, /* level */
12081 n
[4].i
, /* components */
12082 n
[5].i
, /* width */
12083 n
[6].i
, /* height */
12084 n
[7].i
, /* depth */
12085 n
[8].e
, /* border */
12086 n
[9].e
, /* format */
12087 n
[10].e
, /* type */
12088 get_pointer(&n
[11])));
12089 ctx
->Unpack
= save
; /* restore */
12092 case OPCODE_MULTITEX_SUB_IMAGE1D
:
12094 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12095 ctx
->Unpack
= ctx
->DefaultPacking
;
12096 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12097 n
[4].i
, n
[5].i
, n
[6].e
,
12098 n
[7].e
, get_pointer(&n
[8])));
12099 ctx
->Unpack
= save
; /* restore */
12102 case OPCODE_MULTITEX_SUB_IMAGE2D
:
12104 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12105 ctx
->Unpack
= ctx
->DefaultPacking
;
12106 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12107 n
[4].i
, n
[5].i
, n
[6].e
,
12108 n
[7].i
, n
[8].e
, n
[9].e
,
12109 get_pointer(&n
[10])));
12110 ctx
->Unpack
= save
; /* restore */
12113 case OPCODE_MULTITEX_SUB_IMAGE3D
:
12115 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12116 ctx
->Unpack
= ctx
->DefaultPacking
;
12117 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12118 n
[4].i
, n
[5].i
, n
[6].i
,
12119 n
[7].i
, n
[8].i
, n
[9].i
,
12121 get_pointer(&n
[12])));
12122 ctx
->Unpack
= save
; /* restore */
12125 case OPCODE_MULTITEXENV
:
12128 params
[0] = n
[4].f
;
12129 params
[1] = n
[5].f
;
12130 params
[2] = n
[6].f
;
12131 params
[3] = n
[7].f
;
12132 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12135 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
12136 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
12137 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12138 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12139 n
[9].i
, get_pointer(&n
[10])));
12142 case OPCODE_CONTINUE
:
12143 n
= (Node
*) get_pointer(&n
[1]);
12148 case OPCODE_END_OF_LIST
:
12154 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
12156 _mesa_problem(ctx
, "%s", msg
);
12161 /* increment n to point to next compiled command */
12162 if (opcode
!= OPCODE_CONTINUE
) {
12163 assert(InstSize
[opcode
] > 0);
12164 n
+= InstSize
[opcode
];
12169 vbo_save_EndCallList(ctx
);
12171 ctx
->ListState
.CallDepth
--;
12176 /**********************************************************************/
12178 /**********************************************************************/
12181 * Test if a display list number is valid.
12183 GLboolean GLAPIENTRY
12184 _mesa_IsList(GLuint list
)
12186 GET_CURRENT_CONTEXT(ctx
);
12187 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12188 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
12189 return islist(ctx
, list
);
12194 * Delete a sequence of consecutive display lists.
12197 _mesa_DeleteLists(GLuint list
, GLsizei range
)
12199 GET_CURRENT_CONTEXT(ctx
);
12201 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12202 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12205 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
12210 /* We may be deleting a set of bitmap lists. See if there's a
12211 * bitmap atlas to free.
12213 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
12215 _mesa_delete_bitmap_atlas(ctx
, atlas
);
12216 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
12220 for (i
= list
; i
< list
+ range
; i
++) {
12221 destroy_list(ctx
, i
);
12227 * Return a display list number, n, such that lists n through n+range-1
12231 _mesa_GenLists(GLsizei range
)
12233 GET_CURRENT_CONTEXT(ctx
);
12235 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12236 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
12239 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
12247 * Make this an atomic operation
12249 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
12251 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
12253 /* reserve the list IDs by with empty/dummy lists */
12255 for (i
= 0; i
< range
; i
++) {
12256 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
12257 make_list(base
+ i
, 1));
12261 if (USE_BITMAP_ATLAS
&&
12263 ctx
->Driver
.DrawAtlasBitmaps
) {
12264 /* "range > 16" is a rough heuristic to guess when glGenLists might be
12265 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
12266 * Create the empty atlas now.
12268 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
12270 atlas
= alloc_bitmap_atlas(ctx
, base
);
12273 /* Atlas _should_ be new/empty now, but clobbering is OK */
12274 assert(atlas
->numBitmaps
== 0);
12275 atlas
->numBitmaps
= range
;
12279 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
12286 * Begin a new display list.
12289 _mesa_NewList(GLuint name
, GLenum mode
)
12291 GET_CURRENT_CONTEXT(ctx
);
12293 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
12294 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12296 if (MESA_VERBOSE
& VERBOSE_API
)
12297 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
12298 _mesa_enum_to_string(mode
));
12301 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
12305 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
12306 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
12310 if (ctx
->ListState
.CurrentList
) {
12311 /* already compiling a display list */
12312 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
12316 ctx
->CompileFlag
= GL_TRUE
;
12317 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
12319 /* Reset accumulated list state */
12320 invalidate_saved_current_state( ctx
);
12322 /* Allocate new display list */
12323 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
12324 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
12325 ctx
->ListState
.CurrentPos
= 0;
12327 vbo_save_NewList(ctx
, name
, mode
);
12329 ctx
->CurrentServerDispatch
= ctx
->Save
;
12330 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12331 if (ctx
->MarshalExec
== NULL
) {
12332 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12338 * End definition of current display list.
12341 _mesa_EndList(void)
12343 GET_CURRENT_CONTEXT(ctx
);
12344 SAVE_FLUSH_VERTICES(ctx
);
12345 FLUSH_VERTICES(ctx
, 0);
12347 if (MESA_VERBOSE
& VERBOSE_API
)
12348 _mesa_debug(ctx
, "glEndList\n");
12350 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
12351 _mesa_error(ctx
, GL_INVALID_OPERATION
,
12352 "glEndList() called inside glBegin/End");
12355 /* Check that a list is under construction */
12356 if (!ctx
->ListState
.CurrentList
) {
12357 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
12361 /* Call before emitting END_OF_LIST, in case the driver wants to
12362 * emit opcodes itself.
12364 vbo_save_EndList(ctx
);
12366 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
12370 /* Destroy old list, if any */
12371 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
12373 /* Install the new list */
12374 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
12375 ctx
->ListState
.CurrentList
->Name
,
12376 ctx
->ListState
.CurrentList
);
12379 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
12380 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
12382 ctx
->ListState
.CurrentList
= NULL
;
12383 ctx
->ListState
.CurrentBlock
= NULL
;
12384 ctx
->ListState
.CurrentPos
= 0;
12385 ctx
->ExecuteFlag
= GL_TRUE
;
12386 ctx
->CompileFlag
= GL_FALSE
;
12388 ctx
->CurrentServerDispatch
= ctx
->Exec
;
12389 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12390 if (ctx
->MarshalExec
== NULL
) {
12391 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12397 _mesa_CallList(GLuint list
)
12399 GLboolean save_compile_flag
;
12400 GET_CURRENT_CONTEXT(ctx
);
12401 FLUSH_CURRENT(ctx
, 0);
12403 if (MESA_VERBOSE
& VERBOSE_API
)
12404 _mesa_debug(ctx
, "glCallList %d\n", list
);
12407 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
12412 mesa_print_display_list( list
);
12414 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
12415 * execute the display list, and restore the CompileFlag.
12417 save_compile_flag
= ctx
->CompileFlag
;
12418 if (save_compile_flag
) {
12419 ctx
->CompileFlag
= GL_FALSE
;
12422 execute_list(ctx
, list
);
12423 ctx
->CompileFlag
= save_compile_flag
;
12425 /* also restore API function pointers to point to "save" versions */
12426 if (save_compile_flag
) {
12427 ctx
->CurrentServerDispatch
= ctx
->Save
;
12428 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12429 if (ctx
->MarshalExec
== NULL
) {
12430 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12437 * Try to execute a glCallLists() command where the display lists contain
12438 * glBitmap commands with a texture atlas.
12439 * \return true for success, false otherwise
12442 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
12445 struct gl_bitmap_atlas
*atlas
;
12448 if (!USE_BITMAP_ATLAS
||
12449 !ctx
->Current
.RasterPosValid
||
12450 ctx
->List
.ListBase
== 0 ||
12451 type
!= GL_UNSIGNED_BYTE
||
12452 !ctx
->Driver
.DrawAtlasBitmaps
) {
12457 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12460 /* Even if glGenLists wasn't called, we can still try to create
12463 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12466 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
12467 /* Try to build the bitmap atlas now.
12468 * If the atlas was created in glGenLists, we'll have recorded the
12469 * number of lists (bitmaps). Otherwise, take a guess at 256.
12471 if (atlas
->numBitmaps
== 0)
12472 atlas
->numBitmaps
= 256;
12473 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
12476 if (!atlas
|| !atlas
->complete
) {
12480 /* check that all display list IDs are in the atlas */
12481 for (i
= 0; i
< n
; i
++) {
12482 const GLubyte
*ids
= (const GLubyte
*) lists
;
12484 if (ids
[i
] >= atlas
->numBitmaps
) {
12489 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
12496 * Execute glCallLists: call multiple display lists.
12499 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12501 GET_CURRENT_CONTEXT(ctx
);
12503 GLboolean save_compile_flag
;
12505 if (MESA_VERBOSE
& VERBOSE_API
)
12506 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12510 case GL_UNSIGNED_BYTE
:
12512 case GL_UNSIGNED_SHORT
:
12514 case GL_UNSIGNED_INT
:
12522 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12527 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12529 } else if (n
== 0 || lists
== NULL
) {
12530 /* nothing to do */
12534 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12538 /* Save the CompileFlag status, turn it off, execute display list,
12539 * and restore the CompileFlag.
12541 save_compile_flag
= ctx
->CompileFlag
;
12542 ctx
->CompileFlag
= GL_FALSE
;
12544 for (i
= 0; i
< n
; i
++) {
12545 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12546 execute_list(ctx
, list
);
12549 ctx
->CompileFlag
= save_compile_flag
;
12551 /* also restore API function pointers to point to "save" versions */
12552 if (save_compile_flag
) {
12553 ctx
->CurrentServerDispatch
= ctx
->Save
;
12554 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12555 if (ctx
->MarshalExec
== NULL
) {
12556 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12563 * Set the offset added to list numbers in glCallLists.
12566 _mesa_ListBase(GLuint base
)
12568 GET_CURRENT_CONTEXT(ctx
);
12569 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12570 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12571 ctx
->List
.ListBase
= base
;
12575 * Setup the given dispatch table to point to Mesa's display list
12576 * building functions.
12578 * This does not include any of the tnl functions - they are
12579 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12583 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12585 struct _glapi_table
*table
= ctx
->Save
;
12586 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12588 /* Initially populate the dispatch table with the contents of the
12589 * normal-execution dispatch table. This lets us skip populating functions
12590 * that should be called directly instead of compiled into display lists.
12592 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12594 _mesa_loopback_init_api_table(ctx
, table
);
12596 /* VBO functions */
12597 vbo_initialize_save_dispatch(ctx
, table
);
12600 SET_Accum(table
, save_Accum
);
12601 SET_AlphaFunc(table
, save_AlphaFunc
);
12602 SET_Bitmap(table
, save_Bitmap
);
12603 SET_BlendFunc(table
, save_BlendFunc
);
12604 SET_CallList(table
, save_CallList
);
12605 SET_CallLists(table
, save_CallLists
);
12606 SET_Clear(table
, save_Clear
);
12607 SET_ClearAccum(table
, save_ClearAccum
);
12608 SET_ClearColor(table
, save_ClearColor
);
12609 SET_ClearDepth(table
, save_ClearDepth
);
12610 SET_ClearIndex(table
, save_ClearIndex
);
12611 SET_ClearStencil(table
, save_ClearStencil
);
12612 SET_ClipPlane(table
, save_ClipPlane
);
12613 SET_ColorMask(table
, save_ColorMask
);
12614 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12615 SET_ColorMaterial(table
, save_ColorMaterial
);
12616 SET_CopyPixels(table
, save_CopyPixels
);
12617 SET_CullFace(table
, save_CullFace
);
12618 SET_DepthFunc(table
, save_DepthFunc
);
12619 SET_DepthMask(table
, save_DepthMask
);
12620 SET_DepthRange(table
, save_DepthRange
);
12621 SET_Disable(table
, save_Disable
);
12622 SET_Disablei(table
, save_DisableIndexed
);
12623 SET_DrawBuffer(table
, save_DrawBuffer
);
12624 SET_DrawPixels(table
, save_DrawPixels
);
12625 SET_Enable(table
, save_Enable
);
12626 SET_Enablei(table
, save_EnableIndexed
);
12627 SET_EvalMesh1(table
, save_EvalMesh1
);
12628 SET_EvalMesh2(table
, save_EvalMesh2
);
12629 SET_Fogf(table
, save_Fogf
);
12630 SET_Fogfv(table
, save_Fogfv
);
12631 SET_Fogi(table
, save_Fogi
);
12632 SET_Fogiv(table
, save_Fogiv
);
12633 SET_FrontFace(table
, save_FrontFace
);
12634 SET_Frustum(table
, save_Frustum
);
12635 SET_Hint(table
, save_Hint
);
12636 SET_IndexMask(table
, save_IndexMask
);
12637 SET_InitNames(table
, save_InitNames
);
12638 SET_LightModelf(table
, save_LightModelf
);
12639 SET_LightModelfv(table
, save_LightModelfv
);
12640 SET_LightModeli(table
, save_LightModeli
);
12641 SET_LightModeliv(table
, save_LightModeliv
);
12642 SET_Lightf(table
, save_Lightf
);
12643 SET_Lightfv(table
, save_Lightfv
);
12644 SET_Lighti(table
, save_Lighti
);
12645 SET_Lightiv(table
, save_Lightiv
);
12646 SET_LineStipple(table
, save_LineStipple
);
12647 SET_LineWidth(table
, save_LineWidth
);
12648 SET_ListBase(table
, save_ListBase
);
12649 SET_LoadIdentity(table
, save_LoadIdentity
);
12650 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12651 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12652 SET_LoadName(table
, save_LoadName
);
12653 SET_LogicOp(table
, save_LogicOp
);
12654 SET_Map1d(table
, save_Map1d
);
12655 SET_Map1f(table
, save_Map1f
);
12656 SET_Map2d(table
, save_Map2d
);
12657 SET_Map2f(table
, save_Map2f
);
12658 SET_MapGrid1d(table
, save_MapGrid1d
);
12659 SET_MapGrid1f(table
, save_MapGrid1f
);
12660 SET_MapGrid2d(table
, save_MapGrid2d
);
12661 SET_MapGrid2f(table
, save_MapGrid2f
);
12662 SET_MatrixMode(table
, save_MatrixMode
);
12663 SET_MultMatrixd(table
, save_MultMatrixd
);
12664 SET_MultMatrixf(table
, save_MultMatrixf
);
12665 SET_NewList(table
, save_NewList
);
12666 SET_Ortho(table
, save_Ortho
);
12667 SET_PassThrough(table
, save_PassThrough
);
12668 SET_PixelMapfv(table
, save_PixelMapfv
);
12669 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12670 SET_PixelMapusv(table
, save_PixelMapusv
);
12671 SET_PixelTransferf(table
, save_PixelTransferf
);
12672 SET_PixelTransferi(table
, save_PixelTransferi
);
12673 SET_PixelZoom(table
, save_PixelZoom
);
12674 SET_PointSize(table
, save_PointSize
);
12675 SET_PolygonMode(table
, save_PolygonMode
);
12676 SET_PolygonOffset(table
, save_PolygonOffset
);
12677 SET_PolygonStipple(table
, save_PolygonStipple
);
12678 SET_PopAttrib(table
, save_PopAttrib
);
12679 SET_PopMatrix(table
, save_PopMatrix
);
12680 SET_PopName(table
, save_PopName
);
12681 SET_PushAttrib(table
, save_PushAttrib
);
12682 SET_PushMatrix(table
, save_PushMatrix
);
12683 SET_PushName(table
, save_PushName
);
12684 SET_RasterPos2d(table
, save_RasterPos2d
);
12685 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12686 SET_RasterPos2f(table
, save_RasterPos2f
);
12687 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12688 SET_RasterPos2i(table
, save_RasterPos2i
);
12689 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12690 SET_RasterPos2s(table
, save_RasterPos2s
);
12691 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12692 SET_RasterPos3d(table
, save_RasterPos3d
);
12693 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12694 SET_RasterPos3f(table
, save_RasterPos3f
);
12695 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12696 SET_RasterPos3i(table
, save_RasterPos3i
);
12697 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12698 SET_RasterPos3s(table
, save_RasterPos3s
);
12699 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12700 SET_RasterPos4d(table
, save_RasterPos4d
);
12701 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12702 SET_RasterPos4f(table
, save_RasterPos4f
);
12703 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12704 SET_RasterPos4i(table
, save_RasterPos4i
);
12705 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12706 SET_RasterPos4s(table
, save_RasterPos4s
);
12707 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12708 SET_ReadBuffer(table
, save_ReadBuffer
);
12709 SET_Rectf(table
, save_Rectf
);
12710 SET_Rotated(table
, save_Rotated
);
12711 SET_Rotatef(table
, save_Rotatef
);
12712 SET_Scaled(table
, save_Scaled
);
12713 SET_Scalef(table
, save_Scalef
);
12714 SET_Scissor(table
, save_Scissor
);
12715 SET_ShadeModel(table
, save_ShadeModel
);
12716 SET_StencilFunc(table
, save_StencilFunc
);
12717 SET_StencilMask(table
, save_StencilMask
);
12718 SET_StencilOp(table
, save_StencilOp
);
12719 SET_TexEnvf(table
, save_TexEnvf
);
12720 SET_TexEnvfv(table
, save_TexEnvfv
);
12721 SET_TexEnvi(table
, save_TexEnvi
);
12722 SET_TexEnviv(table
, save_TexEnviv
);
12723 SET_TexGend(table
, save_TexGend
);
12724 SET_TexGendv(table
, save_TexGendv
);
12725 SET_TexGenf(table
, save_TexGenf
);
12726 SET_TexGenfv(table
, save_TexGenfv
);
12727 SET_TexGeni(table
, save_TexGeni
);
12728 SET_TexGeniv(table
, save_TexGeniv
);
12729 SET_TexImage1D(table
, save_TexImage1D
);
12730 SET_TexImage2D(table
, save_TexImage2D
);
12731 SET_TexParameterf(table
, save_TexParameterf
);
12732 SET_TexParameterfv(table
, save_TexParameterfv
);
12733 SET_TexParameteri(table
, save_TexParameteri
);
12734 SET_TexParameteriv(table
, save_TexParameteriv
);
12735 SET_Translated(table
, save_Translated
);
12736 SET_Translatef(table
, save_Translatef
);
12737 SET_Viewport(table
, save_Viewport
);
12740 SET_BindTexture(table
, save_BindTexture
);
12741 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12742 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12743 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12744 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12745 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12746 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12747 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12750 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12751 SET_TexImage3D(table
, save_TexImage3D
);
12752 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12755 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12756 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12757 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12759 /* ATI_separate_stencil */
12760 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12762 /* GL_ARB_imaging */
12763 /* Not all are supported */
12764 SET_BlendColor(table
, save_BlendColor
);
12765 SET_BlendEquation(table
, save_BlendEquation
);
12767 /* 2. GL_EXT_blend_color */
12769 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12772 /* 6. GL_EXT_texture3d */
12774 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12775 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12776 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12779 /* 37. GL_EXT_blend_minmax */
12781 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12784 /* 54. GL_EXT_point_parameters */
12785 SET_PointParameterf(table
, save_PointParameterfEXT
);
12786 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12788 /* 91. GL_ARB_tessellation_shader */
12789 SET_PatchParameteri(table
, save_PatchParameteri
);
12790 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12792 /* 100. ARB_viewport_array */
12793 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12794 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12795 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12796 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12797 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12798 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12799 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12800 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12802 /* 122. ARB_compute_shader */
12803 SET_DispatchCompute(table
, save_DispatchCompute
);
12804 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12806 /* 173. GL_EXT_blend_func_separate */
12807 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12809 /* 197. GL_MESA_window_pos */
12810 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12811 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12812 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12813 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12814 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12815 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12816 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12817 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12818 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12819 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12820 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12821 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12822 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12823 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12824 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12825 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12826 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12827 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12828 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12829 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12830 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12831 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
12832 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
12833 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
12835 /* 245. GL_ATI_fragment_shader */
12836 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
12837 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
12839 /* 262. GL_NV_point_sprite */
12840 SET_PointParameteri(table
, save_PointParameteriNV
);
12841 SET_PointParameteriv(table
, save_PointParameterivNV
);
12843 /* 268. GL_EXT_stencil_two_side */
12844 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
12846 /* ???. GL_EXT_depth_bounds_test */
12847 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
12849 /* ARB 1. GL_ARB_multitexture */
12850 SET_ActiveTexture(table
, save_ActiveTextureARB
);
12852 /* ARB 3. GL_ARB_transpose_matrix */
12853 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
12854 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
12855 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
12856 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
12858 /* ARB 5. GL_ARB_multisample */
12859 SET_SampleCoverage(table
, save_SampleCoverageARB
);
12861 /* ARB 12. GL_ARB_texture_compression */
12862 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
12863 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
12864 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
12865 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
12866 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
12867 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
12869 /* ARB 14. GL_ARB_point_parameters */
12870 /* aliased with EXT_point_parameters functions */
12872 /* ARB 25. GL_ARB_window_pos */
12873 /* aliased with MESA_window_pos functions */
12875 /* ARB 26. GL_ARB_vertex_program */
12876 /* ARB 27. GL_ARB_fragment_program */
12877 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
12878 SET_ProgramStringARB(table
, save_ProgramStringARB
);
12879 SET_BindProgramARB(table
, save_BindProgramARB
);
12880 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
12881 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
12882 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
12883 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
12884 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
12885 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
12886 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
12887 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
12889 SET_BeginQuery(table
, save_BeginQueryARB
);
12890 SET_EndQuery(table
, save_EndQueryARB
);
12891 SET_QueryCounter(table
, save_QueryCounter
);
12893 SET_DrawBuffers(table
, save_DrawBuffersARB
);
12895 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
12897 SET_UseProgram(table
, save_UseProgram
);
12898 SET_Uniform1f(table
, save_Uniform1fARB
);
12899 SET_Uniform2f(table
, save_Uniform2fARB
);
12900 SET_Uniform3f(table
, save_Uniform3fARB
);
12901 SET_Uniform4f(table
, save_Uniform4fARB
);
12902 SET_Uniform1fv(table
, save_Uniform1fvARB
);
12903 SET_Uniform2fv(table
, save_Uniform2fvARB
);
12904 SET_Uniform3fv(table
, save_Uniform3fvARB
);
12905 SET_Uniform4fv(table
, save_Uniform4fvARB
);
12906 SET_Uniform1i(table
, save_Uniform1iARB
);
12907 SET_Uniform2i(table
, save_Uniform2iARB
);
12908 SET_Uniform3i(table
, save_Uniform3iARB
);
12909 SET_Uniform4i(table
, save_Uniform4iARB
);
12910 SET_Uniform1iv(table
, save_Uniform1ivARB
);
12911 SET_Uniform2iv(table
, save_Uniform2ivARB
);
12912 SET_Uniform3iv(table
, save_Uniform3ivARB
);
12913 SET_Uniform4iv(table
, save_Uniform4ivARB
);
12914 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
12915 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
12916 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
12917 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
12918 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
12919 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
12920 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
12921 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
12922 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
12924 /* 299. GL_EXT_blend_equation_separate */
12925 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
12927 /* GL_EXT_gpu_program_parameters */
12928 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
12929 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
12931 /* 364. GL_EXT_provoking_vertex */
12932 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
12934 /* GL_EXT_texture_integer */
12935 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
12936 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
12937 SET_TexParameterIiv(table
, save_TexParameterIiv
);
12938 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
12940 /* GL_ARB_clip_control */
12941 SET_ClipControl(table
, save_ClipControl
);
12943 /* GL_ARB_color_buffer_float */
12944 SET_ClampColor(table
, save_ClampColorARB
);
12947 SET_ClearBufferiv(table
, save_ClearBufferiv
);
12948 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
12949 SET_ClearBufferfv(table
, save_ClearBufferfv
);
12950 SET_ClearBufferfi(table
, save_ClearBufferfi
);
12951 SET_Uniform1ui(table
, save_Uniform1ui
);
12952 SET_Uniform2ui(table
, save_Uniform2ui
);
12953 SET_Uniform3ui(table
, save_Uniform3ui
);
12954 SET_Uniform4ui(table
, save_Uniform4ui
);
12955 SET_Uniform1uiv(table
, save_Uniform1uiv
);
12956 SET_Uniform2uiv(table
, save_Uniform2uiv
);
12957 SET_Uniform3uiv(table
, save_Uniform3uiv
);
12958 SET_Uniform4uiv(table
, save_Uniform4uiv
);
12960 /* GL_ARB_gpu_shader_fp64 */
12961 SET_Uniform1d(table
, save_Uniform1d
);
12962 SET_Uniform2d(table
, save_Uniform2d
);
12963 SET_Uniform3d(table
, save_Uniform3d
);
12964 SET_Uniform4d(table
, save_Uniform4d
);
12965 SET_Uniform1dv(table
, save_Uniform1dv
);
12966 SET_Uniform2dv(table
, save_Uniform2dv
);
12967 SET_Uniform3dv(table
, save_Uniform3dv
);
12968 SET_Uniform4dv(table
, save_Uniform4dv
);
12969 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
12970 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
12971 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
12972 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
12973 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
12974 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
12975 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
12976 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
12977 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
12980 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
12981 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
12982 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
12983 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
12984 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
12985 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
12986 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
12987 SET_DrawTransformFeedbackInstanced(table
,
12988 save_DrawTransformFeedbackInstanced
);
12989 SET_DrawTransformFeedbackStreamInstanced(table
,
12990 save_DrawTransformFeedbackStreamInstanced
);
12991 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
12992 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
12994 /* GL_ARB_instanced_arrays */
12995 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
12997 /* GL_NV_texture_barrier */
12998 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
13000 SET_BindSampler(table
, save_BindSampler
);
13001 SET_SamplerParameteri(table
, save_SamplerParameteri
);
13002 SET_SamplerParameterf(table
, save_SamplerParameterf
);
13003 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
13004 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
13005 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
13006 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
13008 /* GL_ARB_draw_buffer_blend */
13009 SET_BlendFunciARB(table
, save_BlendFunci
);
13010 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
13011 SET_BlendEquationiARB(table
, save_BlendEquationi
);
13012 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
13014 /* GL_NV_conditional_render */
13015 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
13016 SET_EndConditionalRender(table
, save_EndConditionalRender
);
13019 SET_WaitSync(table
, save_WaitSync
);
13021 /* GL_ARB_uniform_buffer_object */
13022 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
13024 /* GL_ARB_shader_subroutines */
13025 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
13027 /* GL_ARB_draw_instanced */
13028 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
13029 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
13031 /* GL_ARB_draw_elements_base_vertex */
13032 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
13034 /* GL_ARB_base_instance */
13035 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
13036 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
13037 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
13039 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
13040 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
13041 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
13042 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
13043 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
13045 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
13046 SET_UseProgramStages(table
, save_UseProgramStages
);
13047 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
13048 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
13049 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
13050 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
13051 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
13052 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
13053 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
13054 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
13055 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
13056 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
13057 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
13058 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
13059 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
13060 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
13061 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
13062 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
13063 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
13064 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
13065 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
13066 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
13067 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
13068 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
13069 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
13070 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
13071 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
13072 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
13073 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
13074 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
13075 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
13076 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
13077 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
13078 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
13079 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
13080 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
13081 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
13082 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
13083 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
13084 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
13085 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
13086 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
13087 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
13088 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
13089 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
13090 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
13091 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
13092 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
13093 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
13094 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
13095 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
13096 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
13098 /* GL_{ARB,EXT}_polygon_offset_clamp */
13099 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
13101 /* GL_EXT_window_rectangles */
13102 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
13104 /* GL_NV_conservative_raster */
13105 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
13107 /* GL_NV_conservative_raster_dilate */
13108 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
13110 /* GL_NV_conservative_raster_pre_snap_triangles */
13111 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
13113 /* GL_EXT_direct_state_access */
13114 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
13115 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
13116 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
13117 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
13118 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
13119 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
13120 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
13121 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
13122 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
13123 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
13124 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
13125 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
13126 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
13127 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
13128 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
13129 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
13130 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
13131 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
13132 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
13133 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
13134 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
13135 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
13136 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
13137 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
13138 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
13139 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
13140 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
13141 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
13142 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
13143 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
13144 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
13145 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
13146 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
13147 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
13148 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
13149 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
13150 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
13151 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
13152 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
13153 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
13154 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
13155 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
13156 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
13157 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
13158 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
13159 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
13160 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
13161 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
13162 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
13163 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
13168 static const char *
13169 enum_string(GLenum k
)
13171 return _mesa_enum_to_string(k
);
13176 * Print the commands in a display list. For debugging only.
13177 * TODO: many commands aren't handled yet.
13178 * \param fname filename to write display list to. If null, use stdout.
13180 static void GLAPIENTRY
13181 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
13183 struct gl_display_list
*dlist
;
13189 f
= fopen(fname
, "w");
13194 if (!islist(ctx
, list
)) {
13195 fprintf(f
, "%u is not a display list ID\n", list
);
13199 dlist
= _mesa_lookup_list(ctx
, list
);
13206 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
13208 done
= n
? GL_FALSE
: GL_TRUE
;
13210 const OpCode opcode
= n
[0].opcode
;
13212 if (is_ext_opcode(opcode
)) {
13213 n
+= ext_opcode_print(ctx
, n
, f
);
13218 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
13220 case OPCODE_ACTIVE_TEXTURE
:
13221 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
13223 case OPCODE_BITMAP
:
13224 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
13225 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
13226 get_pointer(&n
[7]));
13228 case OPCODE_BLEND_COLOR
:
13229 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
13230 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13232 case OPCODE_BLEND_EQUATION
:
13233 fprintf(f
, "BlendEquation %s\n",
13234 enum_string(n
[1].e
));
13236 case OPCODE_BLEND_EQUATION_SEPARATE
:
13237 fprintf(f
, "BlendEquationSeparate %s, %s\n",
13238 enum_string(n
[1].e
),
13239 enum_string(n
[2].e
));
13241 case OPCODE_BLEND_FUNC_SEPARATE
:
13242 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
13243 enum_string(n
[1].e
),
13244 enum_string(n
[2].e
),
13245 enum_string(n
[3].e
),
13246 enum_string(n
[4].e
));
13248 case OPCODE_BLEND_EQUATION_I
:
13249 fprintf(f
, "BlendEquationi %u, %s\n",
13250 n
[1].ui
, enum_string(n
[2].e
));
13252 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
13253 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
13254 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13256 case OPCODE_BLEND_FUNC_I
:
13257 fprintf(f
, "BlendFunci %u, %s, %s\n",
13258 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13260 case OPCODE_BLEND_FUNC_SEPARATE_I
:
13261 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
13263 enum_string(n
[2].e
),
13264 enum_string(n
[3].e
),
13265 enum_string(n
[4].e
),
13266 enum_string(n
[5].e
));
13268 case OPCODE_CALL_LIST
:
13269 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
13271 case OPCODE_CALL_LISTS
:
13272 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
13274 case OPCODE_DISABLE
:
13275 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
13277 case OPCODE_ENABLE
:
13278 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
13280 case OPCODE_FRUSTUM
:
13281 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
13282 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13284 case OPCODE_LINE_STIPPLE
:
13285 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
13287 case OPCODE_LINE_WIDTH
:
13288 fprintf(f
, "LineWidth %f\n", n
[1].f
);
13290 case OPCODE_LOAD_IDENTITY
:
13291 fprintf(f
, "LoadIdentity\n");
13293 case OPCODE_LOAD_MATRIX
:
13294 fprintf(f
, "LoadMatrix\n");
13295 fprintf(f
, " %8f %8f %8f %8f\n",
13296 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13297 fprintf(f
, " %8f %8f %8f %8f\n",
13298 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13299 fprintf(f
, " %8f %8f %8f %8f\n",
13300 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13301 fprintf(f
, " %8f %8f %8f %8f\n",
13302 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13304 case OPCODE_MULT_MATRIX
:
13305 fprintf(f
, "MultMatrix (or Rotate)\n");
13306 fprintf(f
, " %8f %8f %8f %8f\n",
13307 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13308 fprintf(f
, " %8f %8f %8f %8f\n",
13309 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13310 fprintf(f
, " %8f %8f %8f %8f\n",
13311 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13312 fprintf(f
, " %8f %8f %8f %8f\n",
13313 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13316 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
13317 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13319 case OPCODE_POINT_SIZE
:
13320 fprintf(f
, "PointSize %f\n", n
[1].f
);
13322 case OPCODE_POP_ATTRIB
:
13323 fprintf(f
, "PopAttrib\n");
13325 case OPCODE_POP_MATRIX
:
13326 fprintf(f
, "PopMatrix\n");
13328 case OPCODE_POP_NAME
:
13329 fprintf(f
, "PopName\n");
13331 case OPCODE_PUSH_ATTRIB
:
13332 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
13334 case OPCODE_PUSH_MATRIX
:
13335 fprintf(f
, "PushMatrix\n");
13337 case OPCODE_PUSH_NAME
:
13338 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
13340 case OPCODE_RASTER_POS
:
13341 fprintf(f
, "RasterPos %g %g %g %g\n",
13342 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13344 case OPCODE_ROTATE
:
13345 fprintf(f
, "Rotate %g %g %g %g\n",
13346 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13349 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13351 case OPCODE_TRANSLATE
:
13352 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13354 case OPCODE_BIND_TEXTURE
:
13355 fprintf(f
, "BindTexture %s %d\n",
13356 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
13358 case OPCODE_SHADE_MODEL
:
13359 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
13362 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
13363 _mesa_enum_to_string(n
[1].ui
),
13364 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
13367 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13368 _mesa_enum_to_string(n
[1].ui
),
13369 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
13370 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
13372 case OPCODE_MAPGRID1
:
13373 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
13375 case OPCODE_MAPGRID2
:
13376 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13377 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
13379 case OPCODE_EVALMESH1
:
13380 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
13382 case OPCODE_EVALMESH2
:
13383 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
13384 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
13387 case OPCODE_ATTR_1F_NV
:
13388 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
13390 case OPCODE_ATTR_2F_NV
:
13391 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
13392 n
[1].i
, n
[2].f
, n
[3].f
);
13394 case OPCODE_ATTR_3F_NV
:
13395 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
13396 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13398 case OPCODE_ATTR_4F_NV
:
13399 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13400 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13402 case OPCODE_ATTR_1F_ARB
:
13403 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
13405 case OPCODE_ATTR_2F_ARB
:
13406 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
13407 n
[1].i
, n
[2].f
, n
[3].f
);
13409 case OPCODE_ATTR_3F_ARB
:
13410 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
13411 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13413 case OPCODE_ATTR_4F_ARB
:
13414 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13415 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13418 case OPCODE_MATERIAL
:
13419 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
13420 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13423 fprintf(f
, "BEGIN %x\n", n
[1].i
);
13426 fprintf(f
, "END\n");
13429 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
13432 case OPCODE_EVAL_C1
:
13433 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
13435 case OPCODE_EVAL_C2
:
13436 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
13438 case OPCODE_EVAL_P1
:
13439 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
13441 case OPCODE_EVAL_P2
:
13442 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
13445 case OPCODE_PROVOKING_VERTEX
:
13446 fprintf(f
, "ProvokingVertex %s\n",
13447 _mesa_enum_to_string(n
[1].ui
));
13451 * meta opcodes/commands
13454 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
13455 (const char *) get_pointer(&n
[2]));
13457 case OPCODE_CONTINUE
:
13458 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
13459 n
= (Node
*) get_pointer(&n
[1]);
13462 fprintf(f
, "NOP\n");
13464 case OPCODE_END_OF_LIST
:
13465 fprintf(f
, "END-LIST %u\n", list
);
13469 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
13471 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13472 opcode
, (void *) n
);
13476 fprintf(f
, "command %d, %u operands\n", opcode
,
13480 /* increment n to point to next compiled command */
13481 if (opcode
!= OPCODE_CONTINUE
) {
13482 assert(InstSize
[opcode
] > 0);
13483 n
+= InstSize
[opcode
];
13497 * Clients may call this function to help debug display list problems.
13498 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
13499 * changed, or break in the future without notice.
13502 mesa_print_display_list(GLuint list
)
13504 GET_CURRENT_CONTEXT(ctx
);
13505 print_list(ctx
, list
, NULL
);
13509 /**********************************************************************/
13510 /***** Initialization *****/
13511 /**********************************************************************/
13514 save_vtxfmt_init(GLvertexformat
* vfmt
)
13516 vfmt
->ArrayElement
= _ae_ArrayElement
;
13518 vfmt
->Begin
= save_Begin
;
13520 vfmt
->CallList
= save_CallList
;
13521 vfmt
->CallLists
= save_CallLists
;
13523 vfmt
->Color3f
= save_Color3f
;
13524 vfmt
->Color3fv
= save_Color3fv
;
13525 vfmt
->Color4f
= save_Color4f
;
13526 vfmt
->Color4fv
= save_Color4fv
;
13527 vfmt
->EdgeFlag
= save_EdgeFlag
;
13528 vfmt
->End
= save_End
;
13530 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13531 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13532 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13533 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13534 vfmt
->EvalPoint1
= save_EvalPoint1
;
13535 vfmt
->EvalPoint2
= save_EvalPoint2
;
13537 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13538 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13539 vfmt
->Indexf
= save_Indexf
;
13540 vfmt
->Indexfv
= save_Indexfv
;
13541 vfmt
->Materialfv
= save_Materialfv
;
13542 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13543 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13544 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13545 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13546 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13547 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13548 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13549 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13550 vfmt
->Normal3f
= save_Normal3f
;
13551 vfmt
->Normal3fv
= save_Normal3fv
;
13552 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13553 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13554 vfmt
->TexCoord1f
= save_TexCoord1f
;
13555 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13556 vfmt
->TexCoord2f
= save_TexCoord2f
;
13557 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13558 vfmt
->TexCoord3f
= save_TexCoord3f
;
13559 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13560 vfmt
->TexCoord4f
= save_TexCoord4f
;
13561 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13562 vfmt
->Vertex2f
= save_Vertex2f
;
13563 vfmt
->Vertex2fv
= save_Vertex2fv
;
13564 vfmt
->Vertex3f
= save_Vertex3f
;
13565 vfmt
->Vertex3fv
= save_Vertex3fv
;
13566 vfmt
->Vertex4f
= save_Vertex4f
;
13567 vfmt
->Vertex4fv
= save_Vertex4fv
;
13568 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13569 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13570 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13571 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13572 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13573 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13574 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13575 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13576 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13577 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13578 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13579 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13580 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13581 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13582 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13583 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13585 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13590 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13591 const GLvertexformat
*vfmt
)
13593 SET_CallList(disp
, vfmt
->CallList
);
13594 SET_CallLists(disp
, vfmt
->CallLists
);
13599 * Initialize display list state for given context.
13602 _mesa_init_display_list(struct gl_context
*ctx
)
13604 static GLboolean tableInitialized
= GL_FALSE
;
13606 /* zero-out the instruction size table, just once */
13607 if (!tableInitialized
) {
13608 memset(InstSize
, 0, sizeof(InstSize
));
13609 tableInitialized
= GL_TRUE
;
13612 /* extension info */
13613 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13616 ctx
->ListState
.CallDepth
= 0;
13617 ctx
->ExecuteFlag
= GL_TRUE
;
13618 ctx
->CompileFlag
= GL_FALSE
;
13619 ctx
->ListState
.CurrentBlock
= NULL
;
13620 ctx
->ListState
.CurrentPos
= 0;
13622 /* Display List group */
13623 ctx
->List
.ListBase
= 0;
13625 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13627 InstSize
[OPCODE_NOP
] = 1;
13632 _mesa_free_display_list_data(struct gl_context
*ctx
)
13634 free(ctx
->ListExt
);
13635 ctx
->ListExt
= NULL
;