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
,
591 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
593 /* The following three are meta instructions */
594 OPCODE_ERROR
, /* raise compiled-in error */
596 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
606 * Display list instructions are stored as sequences of "nodes". Nodes
607 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
608 * are linked together with a pointer.
610 * Each instruction in the display list is stored as a sequence of
611 * contiguous nodes in memory.
612 * Each node is the union of a variety of data types.
614 * Note, all of these members should be 4 bytes in size or less for the
615 * sake of compact display lists. We store 8-byte pointers in a pair of
616 * these nodes using the save/get_pointer() functions below.
634 typedef union gl_dlist_node Node
;
637 /** How many 4-byte dwords to store a pointer */
638 #define POINTER_DWORDS (sizeof(void *) / 4)
640 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
641 * space for display lists. The following types and functions are
642 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
647 GLuint dwords
[POINTER_DWORDS
];
652 * Save a 4 or 8-byte pointer at dest (and dest+1).
655 save_pointer(Node
*dest
, void *src
)
660 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
661 STATIC_ASSERT(sizeof(Node
) == 4);
665 for (i
= 0; i
< POINTER_DWORDS
; i
++)
666 dest
[i
].ui
= p
.dwords
[i
];
671 * Retrieve a 4 or 8-byte pointer from node (node+1).
674 get_pointer(const Node
*node
)
679 for (i
= 0; i
< POINTER_DWORDS
; i
++)
680 p
.dwords
[i
] = node
[i
].ui
;
687 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
704 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
706 union float64_pair tmp; \
708 n[idx].ui = tmp.uint32[0]; \
709 n[idx+1].ui = tmp.uint32[1]; \
714 * How many nodes to allocate at a time. Note that bulk vertex data
715 * from glBegin/glVertex/glEnd primitives will typically wind up in
716 * a VBO, and not directly in the display list itself.
718 #define BLOCK_SIZE 256
723 * Number of nodes of storage needed for each instruction.
724 * Sizes for dynamically allocated opcodes are stored in the context struct.
726 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
729 void mesa_print_display_list(GLuint list
);
733 * Does the given display list only contain a single glBitmap call?
736 is_bitmap_list(const struct gl_display_list
*dlist
)
738 const Node
*n
= dlist
->Head
;
739 if (n
[0].opcode
== OPCODE_BITMAP
) {
740 n
+= InstSize
[OPCODE_BITMAP
];
741 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
749 * Is the given display list an empty list?
752 is_empty_list(const struct gl_display_list
*dlist
)
754 const Node
*n
= dlist
->Head
;
755 return n
[0].opcode
== OPCODE_END_OF_LIST
;
760 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
763 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
766 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
774 * Lookup a gl_bitmap_atlas by listBase ID.
776 static struct gl_bitmap_atlas
*
777 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
779 struct gl_bitmap_atlas
*atlas
;
781 assert(listBase
> 0);
782 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
788 * Create new bitmap atlas and insert into hash table.
790 static struct gl_bitmap_atlas
*
791 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
793 struct gl_bitmap_atlas
*atlas
;
795 assert(listBase
> 0);
796 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
798 atlas
= calloc(1, sizeof(*atlas
));
800 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
808 * Try to build a bitmap atlas. This involves examining a sequence of
809 * display lists which contain glBitmap commands and putting the bitmap
810 * images into a texture map (the atlas).
811 * If we succeed, gl_bitmap_atlas::complete will be set to true.
812 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
815 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
818 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
823 assert(!atlas
->complete
);
824 assert(atlas
->numBitmaps
> 0);
826 /* We use a rectangle texture (non-normalized coords) for the atlas */
827 assert(ctx
->Extensions
.NV_texture_rectangle
);
828 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
830 atlas
->texWidth
= 1024;
831 atlas
->texHeight
= 0; /* determined below */
833 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
834 if (!atlas
->glyphs
) {
836 atlas
->incomplete
= true;
840 /* Loop over the display lists. They should all contain a single glBitmap
841 * call. If not, bail out. Also, compute the position and sizes of each
842 * bitmap in the atlas to determine the texture atlas size.
844 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
845 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
847 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
848 unsigned bitmap_width
, bitmap_height
;
849 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
851 if (!list
|| is_empty_list(list
)) {
853 atlas
->numBitmaps
= i
;
857 if (!is_bitmap_list(list
)) {
858 /* This list does not contain exactly one glBitmap command. Give up. */
859 atlas
->incomplete
= true;
863 /* get bitmap info from the display list command */
865 assert(n
[0].opcode
== OPCODE_BITMAP
);
866 bitmap_width
= n
[1].i
;
867 bitmap_height
= n
[2].i
;
868 bitmap_xorig
= n
[3].f
;
869 bitmap_yorig
= n
[4].f
;
870 bitmap_xmove
= n
[5].f
;
871 bitmap_ymove
= n
[6].f
;
873 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
874 /* advance to the next row of the texture */
880 /* save the bitmap's position in the atlas */
884 g
->h
= bitmap_height
;
885 g
->xorig
= bitmap_xorig
;
886 g
->yorig
= bitmap_yorig
;
887 g
->xmove
= bitmap_xmove
;
888 g
->ymove
= bitmap_ymove
;
890 xpos
+= bitmap_width
;
892 /* keep track of tallest bitmap in the row */
893 row_height
= MAX2(row_height
, bitmap_height
);
896 /* Now we know the texture height */
897 atlas
->texHeight
= ypos
+ row_height
;
899 if (atlas
->texHeight
== 0) {
900 /* no glyphs found, give up */
903 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
904 /* too large, give up */
908 /* Create atlas texture (texture ID is irrelevant) */
909 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
910 if (!atlas
->texObj
) {
914 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
915 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
916 atlas
->texObj
->MaxLevel
= 0;
917 atlas
->texObj
->Immutable
= GL_TRUE
;
919 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
920 GL_TEXTURE_RECTANGLE
, 0);
921 if (!atlas
->texImage
) {
925 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
926 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
927 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
929 /* alloc image storage */
930 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
934 /* map teximage, load with bitmap glyphs */
935 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
936 0, 0, atlas
->texWidth
, atlas
->texHeight
,
937 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
942 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
943 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
945 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
946 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
947 const Node
*n
= list
->Head
;
949 assert(n
[0].opcode
== OPCODE_BITMAP
||
950 n
[0].opcode
== OPCODE_END_OF_LIST
);
952 if (n
[0].opcode
== OPCODE_BITMAP
) {
953 unsigned bitmap_width
= n
[1].i
;
954 unsigned bitmap_height
= n
[2].i
;
955 unsigned xpos
= atlas
->glyphs
[i
].x
;
956 unsigned ypos
= atlas
->glyphs
[i
].y
;
957 const void *bitmap_image
= get_pointer(&n
[7]);
959 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
960 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
962 /* put the bitmap image into the texture image */
963 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
964 &ctx
->DefaultPacking
, bitmap_image
,
965 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
970 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
972 atlas
->complete
= true;
977 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
980 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
983 atlas
->glyphs
= NULL
;
984 atlas
->incomplete
= true;
989 * Allocate a gl_display_list object with an initial block of storage.
990 * \param count how many display list nodes/tokens to allocate
992 static struct gl_display_list
*
993 make_list(GLuint name
, GLuint count
)
995 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
997 dlist
->Head
= malloc(sizeof(Node
) * count
);
998 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
999 /* All InstSize[] entries must be non-zero */
1000 InstSize
[OPCODE_END_OF_LIST
] = 1;
1006 * Lookup function to just encapsulate casting.
1008 struct gl_display_list
*
1009 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1011 return (struct gl_display_list
*)
1012 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1016 /** Is the given opcode an extension code? */
1017 static inline GLboolean
1018 is_ext_opcode(OpCode opcode
)
1020 return (opcode
>= OPCODE_EXT_0
);
1024 /** Destroy an extended opcode instruction */
1026 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1028 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1030 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1031 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1036 /** Execute an extended opcode instruction */
1038 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1040 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1042 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1043 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1048 /** Print an extended opcode instruction */
1050 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1052 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1054 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1055 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1061 * Delete the named display list, but don't remove from hash table.
1062 * \param dlist - display list pointer
1065 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1070 n
= block
= dlist
->Head
;
1072 done
= block
? GL_FALSE
: GL_TRUE
;
1074 const OpCode opcode
= n
[0].opcode
;
1076 /* check for extension opcodes first */
1077 if (is_ext_opcode(opcode
)) {
1078 n
+= ext_opcode_destroy(ctx
, n
);
1082 /* for some commands, we need to free malloc'd memory */
1084 free(get_pointer(&n
[6]));
1087 free(get_pointer(&n
[10]));
1089 case OPCODE_CALL_LISTS
:
1090 free(get_pointer(&n
[3]));
1092 case OPCODE_DRAW_PIXELS
:
1093 free(get_pointer(&n
[5]));
1096 free(get_pointer(&n
[7]));
1098 case OPCODE_POLYGON_STIPPLE
:
1099 free(get_pointer(&n
[1]));
1101 case OPCODE_TEX_IMAGE1D
:
1102 free(get_pointer(&n
[8]));
1104 case OPCODE_TEX_IMAGE2D
:
1105 free(get_pointer(&n
[9]));
1107 case OPCODE_TEX_IMAGE3D
:
1108 free(get_pointer(&n
[10]));
1110 case OPCODE_TEX_SUB_IMAGE1D
:
1111 free(get_pointer(&n
[7]));
1113 case OPCODE_TEX_SUB_IMAGE2D
:
1114 free(get_pointer(&n
[9]));
1116 case OPCODE_TEX_SUB_IMAGE3D
:
1117 free(get_pointer(&n
[11]));
1119 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1120 free(get_pointer(&n
[7]));
1122 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1123 free(get_pointer(&n
[8]));
1125 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1126 free(get_pointer(&n
[9]));
1128 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1129 free(get_pointer(&n
[7]));
1131 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1132 free(get_pointer(&n
[9]));
1134 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1135 free(get_pointer(&n
[11]));
1137 case OPCODE_PROGRAM_STRING_ARB
:
1138 free(get_pointer(&n
[4])); /* program string */
1140 case OPCODE_UNIFORM_1FV
:
1141 case OPCODE_UNIFORM_2FV
:
1142 case OPCODE_UNIFORM_3FV
:
1143 case OPCODE_UNIFORM_4FV
:
1144 case OPCODE_UNIFORM_1DV
:
1145 case OPCODE_UNIFORM_2DV
:
1146 case OPCODE_UNIFORM_3DV
:
1147 case OPCODE_UNIFORM_4DV
:
1148 case OPCODE_UNIFORM_1IV
:
1149 case OPCODE_UNIFORM_2IV
:
1150 case OPCODE_UNIFORM_3IV
:
1151 case OPCODE_UNIFORM_4IV
:
1152 case OPCODE_UNIFORM_1UIV
:
1153 case OPCODE_UNIFORM_2UIV
:
1154 case OPCODE_UNIFORM_3UIV
:
1155 case OPCODE_UNIFORM_4UIV
:
1156 free(get_pointer(&n
[3]));
1158 case OPCODE_UNIFORM_MATRIX22
:
1159 case OPCODE_UNIFORM_MATRIX33
:
1160 case OPCODE_UNIFORM_MATRIX44
:
1161 case OPCODE_UNIFORM_MATRIX24
:
1162 case OPCODE_UNIFORM_MATRIX42
:
1163 case OPCODE_UNIFORM_MATRIX23
:
1164 case OPCODE_UNIFORM_MATRIX32
:
1165 case OPCODE_UNIFORM_MATRIX34
:
1166 case OPCODE_UNIFORM_MATRIX43
:
1167 case OPCODE_UNIFORM_MATRIX22D
:
1168 case OPCODE_UNIFORM_MATRIX33D
:
1169 case OPCODE_UNIFORM_MATRIX44D
:
1170 case OPCODE_UNIFORM_MATRIX24D
:
1171 case OPCODE_UNIFORM_MATRIX42D
:
1172 case OPCODE_UNIFORM_MATRIX23D
:
1173 case OPCODE_UNIFORM_MATRIX32D
:
1174 case OPCODE_UNIFORM_MATRIX34D
:
1175 case OPCODE_UNIFORM_MATRIX43D
:
1176 free(get_pointer(&n
[4]));
1178 case OPCODE_PROGRAM_UNIFORM_1FV
:
1179 case OPCODE_PROGRAM_UNIFORM_2FV
:
1180 case OPCODE_PROGRAM_UNIFORM_3FV
:
1181 case OPCODE_PROGRAM_UNIFORM_4FV
:
1182 case OPCODE_PROGRAM_UNIFORM_1DV
:
1183 case OPCODE_PROGRAM_UNIFORM_2DV
:
1184 case OPCODE_PROGRAM_UNIFORM_3DV
:
1185 case OPCODE_PROGRAM_UNIFORM_4DV
:
1186 case OPCODE_PROGRAM_UNIFORM_1IV
:
1187 case OPCODE_PROGRAM_UNIFORM_2IV
:
1188 case OPCODE_PROGRAM_UNIFORM_3IV
:
1189 case OPCODE_PROGRAM_UNIFORM_4IV
:
1190 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1191 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1192 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1193 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1194 free(get_pointer(&n
[4]));
1196 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1197 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1198 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1199 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1200 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1201 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1202 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1203 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1206 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1207 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1208 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1209 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1210 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1211 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1212 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1213 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1214 free(get_pointer(&n
[5]));
1216 case OPCODE_PIXEL_MAP
:
1217 free(get_pointer(&n
[3]));
1219 case OPCODE_VIEWPORT_ARRAY_V
:
1220 case OPCODE_SCISSOR_ARRAY_V
:
1221 case OPCODE_DEPTH_ARRAY_V
:
1222 case OPCODE_UNIFORM_SUBROUTINES
:
1223 case OPCODE_WINDOW_RECTANGLES
:
1224 free(get_pointer(&n
[3]));
1226 case OPCODE_TEXTURE_IMAGE1D
:
1227 case OPCODE_MULTITEX_IMAGE1D
:
1228 free(get_pointer(&n
[9]));
1230 case OPCODE_TEXTURE_IMAGE2D
:
1231 case OPCODE_MULTITEX_IMAGE2D
:
1232 free(get_pointer(&n
[10]));
1234 case OPCODE_TEXTURE_IMAGE3D
:
1235 case OPCODE_MULTITEX_IMAGE3D
:
1236 free(get_pointer(&n
[11]));
1238 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1239 free(get_pointer(&n
[8]));
1241 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1242 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1243 free(get_pointer(&n
[10]));
1245 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1246 free(get_pointer(&n
[12]));
1248 case OPCODE_CONTINUE
:
1249 n
= (Node
*) get_pointer(&n
[1]);
1253 case OPCODE_END_OF_LIST
:
1258 /* just increment 'n' pointer, below */
1262 if (opcode
!= OPCODE_CONTINUE
) {
1263 assert(InstSize
[opcode
] > 0);
1264 n
+= InstSize
[opcode
];
1275 * Called by _mesa_HashWalk() to check if a display list which is being
1276 * deleted belongs to a bitmap texture atlas.
1279 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1281 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1282 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1284 /* See if the list_id falls in the range contained in this texture atlas */
1285 if (atlas
->complete
&&
1286 list_id
>= atlas_id
&&
1287 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1288 /* Mark the atlas as incomplete so it doesn't get used. But don't
1289 * delete it yet since we don't want to try to recreate it in the next
1292 atlas
->complete
= false;
1293 atlas
->incomplete
= true;
1299 * Destroy a display list and remove from hash table.
1300 * \param list - display list number
1303 destroy_list(struct gl_context
*ctx
, GLuint list
)
1305 struct gl_display_list
*dlist
;
1310 dlist
= _mesa_lookup_list(ctx
, list
);
1314 if (is_bitmap_list(dlist
)) {
1315 /* If we're destroying a simple glBitmap display list, there's a
1316 * chance that we're destroying a bitmap image that's in a texture
1317 * atlas. Examine all atlases to see if that's the case. There's
1318 * usually few (if any) atlases so this isn't expensive.
1320 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1321 check_atlas_for_deleted_list
, &list
);
1324 _mesa_delete_list(ctx
, dlist
);
1325 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1330 * Translate the nth element of list from <type> to GLint.
1333 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1345 bptr
= (GLbyte
*) list
;
1346 return (GLint
) bptr
[n
];
1347 case GL_UNSIGNED_BYTE
:
1348 ubptr
= (GLubyte
*) list
;
1349 return (GLint
) ubptr
[n
];
1351 sptr
= (GLshort
*) list
;
1352 return (GLint
) sptr
[n
];
1353 case GL_UNSIGNED_SHORT
:
1354 usptr
= (GLushort
*) list
;
1355 return (GLint
) usptr
[n
];
1357 iptr
= (GLint
*) list
;
1359 case GL_UNSIGNED_INT
:
1360 uiptr
= (GLuint
*) list
;
1361 return (GLint
) uiptr
[n
];
1363 fptr
= (GLfloat
*) list
;
1364 return (GLint
) floorf(fptr
[n
]);
1366 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1367 return (GLint
) ubptr
[0] * 256
1370 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1371 return (GLint
) ubptr
[0] * 65536
1372 + (GLint
) ubptr
[1] * 256
1375 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1376 return (GLint
) ubptr
[0] * 16777216
1377 + (GLint
) ubptr
[1] * 65536
1378 + (GLint
) ubptr
[2] * 256
1387 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1388 * If width < 0 or height < 0 or format or type are invalid we'll just
1389 * return NULL. We will not generate an error since OpenGL command
1390 * arguments aren't error-checked until the command is actually executed
1391 * (not when they're compiled).
1392 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1395 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1396 GLsizei width
, GLsizei height
, GLsizei depth
,
1397 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1398 const struct gl_pixelstore_attrib
*unpack
)
1400 if (width
<= 0 || height
<= 0) {
1404 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1405 /* bad format and/or type */
1409 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1413 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1414 format
, type
, pixels
, unpack
);
1415 if (pixels
&& !image
) {
1416 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1420 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1421 depth
, format
, type
, INT_MAX
, pixels
)) {
1422 const GLubyte
*map
, *src
;
1426 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1427 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1430 /* unable to map src buffer! */
1431 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1435 src
= ADD_POINTERS(map
, pixels
);
1436 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1437 format
, type
, src
, unpack
);
1439 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1442 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1448 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1453 /** Return copy of memory */
1455 memdup(const void *src
, GLsizei bytes
)
1457 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1459 memcpy(b
, src
, bytes
);
1465 * Allocate space for a display list instruction (opcode + payload space).
1466 * \param opcode the instruction opcode (OPCODE_* value)
1467 * \param bytes instruction payload size (not counting opcode)
1468 * \param align8 does the payload need to be 8-byte aligned?
1469 * This is only relevant in 64-bit environments.
1470 * \return pointer to allocated memory (the payload will be at pointer+1)
1473 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1475 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1476 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1480 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1482 if (opcode
< OPCODE_EXT_0
) {
1483 if (InstSize
[opcode
] == 0) {
1484 /* save instruction size now */
1485 InstSize
[opcode
] = numNodes
;
1488 /* make sure instruction size agrees */
1489 assert(numNodes
== InstSize
[opcode
]);
1493 if (sizeof(void *) > sizeof(Node
) && align8
1494 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1495 /* The opcode would get placed at node[0] and the payload would start
1496 * at node[1]. But the payload needs to be at an even offset (8-byte
1505 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1507 /* This block is full. Allocate a new block and chain to it */
1509 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1510 n
[0].opcode
= OPCODE_CONTINUE
;
1511 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1513 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1517 /* a fresh block should be 8-byte aligned on 64-bit systems */
1518 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1520 save_pointer(&n
[1], newblock
);
1521 ctx
->ListState
.CurrentBlock
= newblock
;
1522 ctx
->ListState
.CurrentPos
= 0;
1524 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1525 * we have to insert a NOP so that the payload of the real opcode lands
1526 * on an even location:
1527 * node[0] = OPCODE_NOP
1528 * node[1] = OPCODE_x;
1529 * node[2] = start of payload
1531 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1534 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1536 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1537 n
[0].opcode
= OPCODE_NOP
;
1539 /* The "real" opcode will now be at an odd location and the payload
1540 * will be at an even location.
1543 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1545 n
[0].opcode
= opcode
;
1553 * Allocate space for a display list instruction. Used by callers outside
1554 * this file for things like VBO vertex data.
1556 * \param opcode the instruction opcode (OPCODE_* value)
1557 * \param bytes instruction size in bytes, not counting opcode.
1558 * \return pointer to the usable data area (not including the internal
1562 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1564 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1566 return n
+ 1; /* return pointer to payload area, after opcode */
1573 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1574 * aligned in 64-bit environments, 4-byte aligned otherwise.
1577 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1579 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1581 return n
+ 1; /* return pointer to payload area, after opcode */
1588 * This function allows modules and drivers to get their own opcodes
1589 * for extending display list functionality.
1590 * \param ctx the rendering context
1591 * \param size number of bytes for storing the new display list command
1592 * \param execute function to execute the new display list command
1593 * \param destroy function to destroy the new display list command
1594 * \param print function to print the new display list command
1595 * \return the new opcode number or -1 if error
1598 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1600 void (*execute
) (struct gl_context
*, void *),
1601 void (*destroy
) (struct gl_context
*, void *),
1602 void (*print
) (struct gl_context
*, void *, FILE *))
1604 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1605 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1606 ctx
->ListExt
->Opcode
[i
].Size
=
1607 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1608 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1609 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1610 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1611 return i
+ OPCODE_EXT_0
;
1618 * Allocate space for a display list instruction. The space is basically
1619 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1620 * function parameter, node[2] is the second parameter, etc.
1622 * \param opcode one of OPCODE_x
1623 * \param nparams number of function parameters
1624 * \return pointer to start of instruction space
1626 static inline Node
*
1627 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1629 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1634 * Called by EndList to try to reduce memory used for the list.
1637 trim_list(struct gl_context
*ctx
)
1639 /* If the list we're ending only has one allocated block of nodes/tokens
1640 * and its size isn't a full block size, realloc the block to use less
1641 * memory. This is important for apps that create many small display
1642 * lists and apps that use glXUseXFont (many lists each containing one
1644 * Note: we currently only trim display lists that allocated one block
1645 * of tokens. That hits the short list case which is what we're mainly
1646 * concerned with. Trimming longer lists would involve traversing the
1647 * linked list of blocks.
1649 struct gl_dlist_state
*list
= &ctx
->ListState
;
1651 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1652 (list
->CurrentPos
< BLOCK_SIZE
)) {
1653 /* There's only one block and it's not full, so realloc */
1654 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1655 list
->CurrentList
->Head
=
1656 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1657 if (!list
->CurrentBlock
) {
1658 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1666 * Display List compilation functions
1668 static void GLAPIENTRY
1669 save_Accum(GLenum op
, GLfloat value
)
1671 GET_CURRENT_CONTEXT(ctx
);
1673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1674 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1679 if (ctx
->ExecuteFlag
) {
1680 CALL_Accum(ctx
->Exec
, (op
, value
));
1685 static void GLAPIENTRY
1686 save_AlphaFunc(GLenum func
, GLclampf ref
)
1688 GET_CURRENT_CONTEXT(ctx
);
1690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1691 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1694 n
[2].f
= (GLfloat
) ref
;
1696 if (ctx
->ExecuteFlag
) {
1697 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1702 static void GLAPIENTRY
1703 save_BindTexture(GLenum target
, GLuint texture
)
1705 GET_CURRENT_CONTEXT(ctx
);
1707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1708 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1713 if (ctx
->ExecuteFlag
) {
1714 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1719 static void GLAPIENTRY
1720 save_Bitmap(GLsizei width
, GLsizei height
,
1721 GLfloat xorig
, GLfloat yorig
,
1722 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1724 GET_CURRENT_CONTEXT(ctx
);
1726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1727 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1729 n
[1].i
= (GLint
) width
;
1730 n
[2].i
= (GLint
) height
;
1736 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1737 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1739 if (ctx
->ExecuteFlag
) {
1740 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1741 xorig
, yorig
, xmove
, ymove
, pixels
));
1746 static void GLAPIENTRY
1747 save_BlendEquation(GLenum mode
)
1749 GET_CURRENT_CONTEXT(ctx
);
1751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1752 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1756 if (ctx
->ExecuteFlag
) {
1757 CALL_BlendEquation(ctx
->Exec
, (mode
));
1762 static void GLAPIENTRY
1763 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1765 GET_CURRENT_CONTEXT(ctx
);
1767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1768 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1773 if (ctx
->ExecuteFlag
) {
1774 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1779 static void GLAPIENTRY
1780 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1781 GLenum sfactorA
, GLenum dfactorA
)
1783 GET_CURRENT_CONTEXT(ctx
);
1785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1786 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1788 n
[1].e
= sfactorRGB
;
1789 n
[2].e
= dfactorRGB
;
1793 if (ctx
->ExecuteFlag
) {
1794 CALL_BlendFuncSeparate(ctx
->Exec
,
1795 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1800 static void GLAPIENTRY
1801 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1803 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1807 static void GLAPIENTRY
1808 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1810 GET_CURRENT_CONTEXT(ctx
);
1812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1813 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1820 if (ctx
->ExecuteFlag
) {
1821 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1825 /* GL_ARB_draw_buffers_blend */
1826 static void GLAPIENTRY
1827 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1828 GLenum sfactorA
, GLenum dfactorA
)
1830 GET_CURRENT_CONTEXT(ctx
);
1832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1833 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1836 n
[2].e
= sfactorRGB
;
1837 n
[3].e
= dfactorRGB
;
1841 if (ctx
->ExecuteFlag
) {
1842 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1843 sfactorA
, dfactorA
));
1847 /* GL_ARB_draw_buffers_blend */
1848 static void GLAPIENTRY
1849 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1851 GET_CURRENT_CONTEXT(ctx
);
1853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1854 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1860 if (ctx
->ExecuteFlag
) {
1861 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1865 /* GL_ARB_draw_buffers_blend */
1866 static void GLAPIENTRY
1867 save_BlendEquationi(GLuint buf
, GLenum mode
)
1869 GET_CURRENT_CONTEXT(ctx
);
1871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1872 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1877 if (ctx
->ExecuteFlag
) {
1878 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1882 /* GL_ARB_draw_buffers_blend */
1883 static void GLAPIENTRY
1884 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1886 GET_CURRENT_CONTEXT(ctx
);
1888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1889 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1895 if (ctx
->ExecuteFlag
) {
1896 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1901 /* GL_ARB_draw_instanced. */
1902 static void GLAPIENTRY
1903 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1905 UNUSED GLsizei count
,
1906 UNUSED GLsizei primcount
)
1908 GET_CURRENT_CONTEXT(ctx
);
1909 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1910 "glDrawArraysInstanced() during display list compile");
1913 static void GLAPIENTRY
1914 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1915 UNUSED GLsizei count
,
1917 UNUSED
const GLvoid
*indices
,
1918 UNUSED GLsizei primcount
)
1920 GET_CURRENT_CONTEXT(ctx
);
1921 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1922 "glDrawElementsInstanced() during display list compile");
1925 static void GLAPIENTRY
1926 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1927 UNUSED GLsizei count
,
1929 UNUSED
const GLvoid
*indices
,
1930 UNUSED GLsizei primcount
,
1931 UNUSED GLint basevertex
)
1933 GET_CURRENT_CONTEXT(ctx
);
1934 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1935 "glDrawElementsInstancedBaseVertex() during display list compile");
1938 /* GL_ARB_base_instance. */
1939 static void GLAPIENTRY
1940 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1942 UNUSED GLsizei count
,
1943 UNUSED GLsizei primcount
,
1944 UNUSED GLuint baseinstance
)
1946 GET_CURRENT_CONTEXT(ctx
);
1947 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1948 "glDrawArraysInstancedBaseInstance() during display list compile");
1951 static void APIENTRY
1952 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1953 UNUSED GLsizei count
,
1955 UNUSED
const void *indices
,
1956 UNUSED GLsizei primcount
,
1957 UNUSED GLuint baseinstance
)
1959 GET_CURRENT_CONTEXT(ctx
);
1960 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1961 "glDrawElementsInstancedBaseInstance() during display list compile");
1964 static void APIENTRY
1965 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1966 UNUSED GLsizei count
,
1968 UNUSED
const void *indices
,
1969 UNUSED GLsizei primcount
,
1970 UNUSED GLint basevertex
,
1971 UNUSED GLuint baseinstance
)
1973 GET_CURRENT_CONTEXT(ctx
);
1974 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1975 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1978 static void APIENTRY
1979 save_DrawArraysIndirect(UNUSED GLenum mode
,
1980 UNUSED
const void *indirect
)
1982 GET_CURRENT_CONTEXT(ctx
);
1983 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1984 "glDrawArraysIndirect() during display list compile");
1987 static void APIENTRY
1988 save_DrawElementsIndirect(UNUSED GLenum mode
,
1990 UNUSED
const void *indirect
)
1992 GET_CURRENT_CONTEXT(ctx
);
1993 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1994 "glDrawElementsIndirect() during display list compile");
1997 static void APIENTRY
1998 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1999 UNUSED
const void *indirect
,
2000 UNUSED GLsizei primcount
,
2001 UNUSED GLsizei stride
)
2003 GET_CURRENT_CONTEXT(ctx
);
2004 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2005 "glMultiDrawArraysIndirect() during display list compile");
2008 static void APIENTRY
2009 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2011 UNUSED
const void *indirect
,
2012 UNUSED GLsizei primcount
,
2013 UNUSED GLsizei stride
)
2015 GET_CURRENT_CONTEXT(ctx
);
2016 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2017 "glMultiDrawElementsIndirect() during display list compile");
2021 * While building a display list we cache some OpenGL state.
2022 * Under some circumstances we need to invalidate that state (immediately
2023 * when we start compiling a list, or after glCallList(s)).
2026 invalidate_saved_current_state(struct gl_context
*ctx
)
2030 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2031 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2033 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2034 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2036 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2038 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2042 static void GLAPIENTRY
2043 save_CallList(GLuint list
)
2045 GET_CURRENT_CONTEXT(ctx
);
2047 SAVE_FLUSH_VERTICES(ctx
);
2049 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2054 /* After this, we don't know what state we're in. Invalidate all
2055 * cached information previously gathered:
2057 invalidate_saved_current_state( ctx
);
2059 if (ctx
->ExecuteFlag
) {
2060 _mesa_CallList(list
);
2065 static void GLAPIENTRY
2066 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2068 GET_CURRENT_CONTEXT(ctx
);
2073 SAVE_FLUSH_VERTICES(ctx
);
2077 case GL_UNSIGNED_BYTE
:
2081 case GL_UNSIGNED_SHORT
:
2089 case GL_UNSIGNED_INT
:
2098 if (num
> 0 && type_size
> 0) {
2099 /* create a copy of the array of list IDs to save in the display list */
2100 lists_copy
= memdup(lists
, num
* type_size
);
2105 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2109 save_pointer(&n
[3], lists_copy
);
2112 /* After this, we don't know what state we're in. Invalidate all
2113 * cached information previously gathered:
2115 invalidate_saved_current_state( ctx
);
2117 if (ctx
->ExecuteFlag
) {
2118 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2123 static void GLAPIENTRY
2124 save_Clear(GLbitfield mask
)
2126 GET_CURRENT_CONTEXT(ctx
);
2128 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2129 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2133 if (ctx
->ExecuteFlag
) {
2134 CALL_Clear(ctx
->Exec
, (mask
));
2139 static void GLAPIENTRY
2140 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2142 GET_CURRENT_CONTEXT(ctx
);
2144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2145 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2148 n
[2].i
= drawbuffer
;
2150 if (buffer
== GL_COLOR
) {
2161 if (ctx
->ExecuteFlag
) {
2162 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2167 static void GLAPIENTRY
2168 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2170 GET_CURRENT_CONTEXT(ctx
);
2172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2173 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2176 n
[2].i
= drawbuffer
;
2178 if (buffer
== GL_COLOR
) {
2189 if (ctx
->ExecuteFlag
) {
2190 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2195 static void GLAPIENTRY
2196 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2198 GET_CURRENT_CONTEXT(ctx
);
2200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2201 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2204 n
[2].i
= drawbuffer
;
2206 if (buffer
== GL_COLOR
) {
2217 if (ctx
->ExecuteFlag
) {
2218 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2223 static void GLAPIENTRY
2224 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2225 GLfloat depth
, GLint stencil
)
2227 GET_CURRENT_CONTEXT(ctx
);
2229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2230 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2233 n
[2].i
= drawbuffer
;
2237 if (ctx
->ExecuteFlag
) {
2238 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2243 static void GLAPIENTRY
2244 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2246 GET_CURRENT_CONTEXT(ctx
);
2248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2249 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2256 if (ctx
->ExecuteFlag
) {
2257 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2262 static void GLAPIENTRY
2263 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2265 GET_CURRENT_CONTEXT(ctx
);
2267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2268 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2275 if (ctx
->ExecuteFlag
) {
2276 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2281 static void GLAPIENTRY
2282 save_ClearDepth(GLclampd depth
)
2284 GET_CURRENT_CONTEXT(ctx
);
2286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2287 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2289 n
[1].f
= (GLfloat
) depth
;
2291 if (ctx
->ExecuteFlag
) {
2292 CALL_ClearDepth(ctx
->Exec
, (depth
));
2297 static void GLAPIENTRY
2298 save_ClearIndex(GLfloat c
)
2300 GET_CURRENT_CONTEXT(ctx
);
2302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2303 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2307 if (ctx
->ExecuteFlag
) {
2308 CALL_ClearIndex(ctx
->Exec
, (c
));
2313 static void GLAPIENTRY
2314 save_ClearStencil(GLint s
)
2316 GET_CURRENT_CONTEXT(ctx
);
2318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2319 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2323 if (ctx
->ExecuteFlag
) {
2324 CALL_ClearStencil(ctx
->Exec
, (s
));
2329 static void GLAPIENTRY
2330 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2332 GET_CURRENT_CONTEXT(ctx
);
2334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2335 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2338 n
[2].f
= (GLfloat
) equ
[0];
2339 n
[3].f
= (GLfloat
) equ
[1];
2340 n
[4].f
= (GLfloat
) equ
[2];
2341 n
[5].f
= (GLfloat
) equ
[3];
2343 if (ctx
->ExecuteFlag
) {
2344 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2350 static void GLAPIENTRY
2351 save_ColorMask(GLboolean red
, GLboolean green
,
2352 GLboolean blue
, GLboolean alpha
)
2354 GET_CURRENT_CONTEXT(ctx
);
2356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2357 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2364 if (ctx
->ExecuteFlag
) {
2365 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2370 static void GLAPIENTRY
2371 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2372 GLboolean blue
, GLboolean alpha
)
2374 GET_CURRENT_CONTEXT(ctx
);
2376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2377 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2385 if (ctx
->ExecuteFlag
) {
2386 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2391 static void GLAPIENTRY
2392 save_ColorMaterial(GLenum face
, GLenum mode
)
2394 GET_CURRENT_CONTEXT(ctx
);
2396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2398 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2403 if (ctx
->ExecuteFlag
) {
2404 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2409 static void GLAPIENTRY
2410 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2412 GET_CURRENT_CONTEXT(ctx
);
2414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2415 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2419 n
[3].i
= (GLint
) width
;
2420 n
[4].i
= (GLint
) height
;
2423 if (ctx
->ExecuteFlag
) {
2424 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2430 static void GLAPIENTRY
2431 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2432 GLint x
, GLint y
, GLsizei width
, GLint border
)
2434 GET_CURRENT_CONTEXT(ctx
);
2436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2437 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2441 n
[3].e
= internalformat
;
2447 if (ctx
->ExecuteFlag
) {
2448 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2449 x
, y
, width
, border
));
2454 static void GLAPIENTRY
2455 save_CopyTexImage2D(GLenum target
, GLint level
,
2456 GLenum internalformat
,
2457 GLint x
, GLint y
, GLsizei width
,
2458 GLsizei height
, GLint border
)
2460 GET_CURRENT_CONTEXT(ctx
);
2462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2463 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2467 n
[3].e
= internalformat
;
2474 if (ctx
->ExecuteFlag
) {
2475 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2476 x
, y
, width
, height
, border
));
2482 static void GLAPIENTRY
2483 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2484 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2486 GET_CURRENT_CONTEXT(ctx
);
2488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2489 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2498 if (ctx
->ExecuteFlag
) {
2499 CALL_CopyTexSubImage1D(ctx
->Exec
,
2500 (target
, level
, xoffset
, x
, y
, width
));
2505 static void GLAPIENTRY
2506 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2507 GLint xoffset
, GLint yoffset
,
2508 GLint x
, GLint y
, GLsizei width
, GLint height
)
2510 GET_CURRENT_CONTEXT(ctx
);
2512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2513 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2524 if (ctx
->ExecuteFlag
) {
2525 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2526 x
, y
, width
, height
));
2531 static void GLAPIENTRY
2532 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2533 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2534 GLint x
, GLint y
, GLsizei width
, GLint height
)
2536 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2551 if (ctx
->ExecuteFlag
) {
2552 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2553 xoffset
, yoffset
, zoffset
,
2554 x
, y
, width
, height
));
2559 static void GLAPIENTRY
2560 save_CullFace(GLenum mode
)
2562 GET_CURRENT_CONTEXT(ctx
);
2564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2565 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2569 if (ctx
->ExecuteFlag
) {
2570 CALL_CullFace(ctx
->Exec
, (mode
));
2575 static void GLAPIENTRY
2576 save_DepthFunc(GLenum func
)
2578 GET_CURRENT_CONTEXT(ctx
);
2580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2581 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2585 if (ctx
->ExecuteFlag
) {
2586 CALL_DepthFunc(ctx
->Exec
, (func
));
2591 static void GLAPIENTRY
2592 save_DepthMask(GLboolean mask
)
2594 GET_CURRENT_CONTEXT(ctx
);
2596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2597 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2601 if (ctx
->ExecuteFlag
) {
2602 CALL_DepthMask(ctx
->Exec
, (mask
));
2607 static void GLAPIENTRY
2608 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2610 GET_CURRENT_CONTEXT(ctx
);
2612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2613 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2615 n
[1].f
= (GLfloat
) nearval
;
2616 n
[2].f
= (GLfloat
) farval
;
2618 if (ctx
->ExecuteFlag
) {
2619 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2624 static void GLAPIENTRY
2625 save_Disable(GLenum cap
)
2627 GET_CURRENT_CONTEXT(ctx
);
2629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2630 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2634 if (ctx
->ExecuteFlag
) {
2635 CALL_Disable(ctx
->Exec
, (cap
));
2640 static void GLAPIENTRY
2641 save_DisableIndexed(GLuint index
, GLenum cap
)
2643 GET_CURRENT_CONTEXT(ctx
);
2645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2646 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2651 if (ctx
->ExecuteFlag
) {
2652 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2657 static void GLAPIENTRY
2658 save_DrawBuffer(GLenum mode
)
2660 GET_CURRENT_CONTEXT(ctx
);
2662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2663 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2667 if (ctx
->ExecuteFlag
) {
2668 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2673 static void GLAPIENTRY
2674 save_DrawPixels(GLsizei width
, GLsizei height
,
2675 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2677 GET_CURRENT_CONTEXT(ctx
);
2680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2682 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2689 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2690 pixels
, &ctx
->Unpack
));
2692 if (ctx
->ExecuteFlag
) {
2693 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2699 static void GLAPIENTRY
2700 save_Enable(GLenum cap
)
2702 GET_CURRENT_CONTEXT(ctx
);
2704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2705 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2709 if (ctx
->ExecuteFlag
) {
2710 CALL_Enable(ctx
->Exec
, (cap
));
2716 static void GLAPIENTRY
2717 save_EnableIndexed(GLuint index
, GLenum cap
)
2719 GET_CURRENT_CONTEXT(ctx
);
2721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2722 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2727 if (ctx
->ExecuteFlag
) {
2728 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2734 static void GLAPIENTRY
2735 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2737 GET_CURRENT_CONTEXT(ctx
);
2739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2740 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2746 if (ctx
->ExecuteFlag
) {
2747 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2752 static void GLAPIENTRY
2753 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2755 GET_CURRENT_CONTEXT(ctx
);
2757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2758 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2766 if (ctx
->ExecuteFlag
) {
2767 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2774 static void GLAPIENTRY
2775 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2777 GET_CURRENT_CONTEXT(ctx
);
2779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2780 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2788 if (ctx
->ExecuteFlag
) {
2789 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2794 static void GLAPIENTRY
2795 save_Fogf(GLenum pname
, GLfloat param
)
2799 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2800 save_Fogfv(pname
, parray
);
2804 static void GLAPIENTRY
2805 save_Fogiv(GLenum pname
, const GLint
*params
)
2810 case GL_FOG_DENSITY
:
2814 case GL_FOG_COORDINATE_SOURCE
:
2815 p
[0] = (GLfloat
) *params
;
2821 p
[0] = INT_TO_FLOAT(params
[0]);
2822 p
[1] = INT_TO_FLOAT(params
[1]);
2823 p
[2] = INT_TO_FLOAT(params
[2]);
2824 p
[3] = INT_TO_FLOAT(params
[3]);
2827 /* Error will be caught later in gl_Fogfv */
2828 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2830 save_Fogfv(pname
, p
);
2834 static void GLAPIENTRY
2835 save_Fogi(GLenum pname
, GLint param
)
2839 parray
[1] = parray
[2] = parray
[3] = 0;
2840 save_Fogiv(pname
, parray
);
2844 static void GLAPIENTRY
2845 save_FrontFace(GLenum mode
)
2847 GET_CURRENT_CONTEXT(ctx
);
2849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2850 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2854 if (ctx
->ExecuteFlag
) {
2855 CALL_FrontFace(ctx
->Exec
, (mode
));
2860 static void GLAPIENTRY
2861 save_Frustum(GLdouble left
, GLdouble right
,
2862 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2864 GET_CURRENT_CONTEXT(ctx
);
2866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2867 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2869 n
[1].f
= (GLfloat
) left
;
2870 n
[2].f
= (GLfloat
) right
;
2871 n
[3].f
= (GLfloat
) bottom
;
2872 n
[4].f
= (GLfloat
) top
;
2873 n
[5].f
= (GLfloat
) nearval
;
2874 n
[6].f
= (GLfloat
) farval
;
2876 if (ctx
->ExecuteFlag
) {
2877 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2882 static void GLAPIENTRY
2883 save_Hint(GLenum target
, GLenum mode
)
2885 GET_CURRENT_CONTEXT(ctx
);
2887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2888 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2893 if (ctx
->ExecuteFlag
) {
2894 CALL_Hint(ctx
->Exec
, (target
, mode
));
2899 static void GLAPIENTRY
2900 save_IndexMask(GLuint mask
)
2902 GET_CURRENT_CONTEXT(ctx
);
2904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2905 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2909 if (ctx
->ExecuteFlag
) {
2910 CALL_IndexMask(ctx
->Exec
, (mask
));
2915 static void GLAPIENTRY
2916 save_InitNames(void)
2918 GET_CURRENT_CONTEXT(ctx
);
2919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2920 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2921 if (ctx
->ExecuteFlag
) {
2922 CALL_InitNames(ctx
->Exec
, ());
2927 static void GLAPIENTRY
2928 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2930 GET_CURRENT_CONTEXT(ctx
);
2932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2933 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2951 case GL_SPOT_DIRECTION
:
2954 case GL_SPOT_EXPONENT
:
2957 case GL_SPOT_CUTOFF
:
2960 case GL_CONSTANT_ATTENUATION
:
2963 case GL_LINEAR_ATTENUATION
:
2966 case GL_QUADRATIC_ATTENUATION
:
2972 for (i
= 0; i
< nParams
; i
++) {
2973 n
[3 + i
].f
= params
[i
];
2976 if (ctx
->ExecuteFlag
) {
2977 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2982 static void GLAPIENTRY
2983 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2987 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2988 save_Lightfv(light
, pname
, parray
);
2992 static void GLAPIENTRY
2993 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3000 fparam
[0] = INT_TO_FLOAT(params
[0]);
3001 fparam
[1] = INT_TO_FLOAT(params
[1]);
3002 fparam
[2] = INT_TO_FLOAT(params
[2]);
3003 fparam
[3] = INT_TO_FLOAT(params
[3]);
3006 fparam
[0] = (GLfloat
) params
[0];
3007 fparam
[1] = (GLfloat
) params
[1];
3008 fparam
[2] = (GLfloat
) params
[2];
3009 fparam
[3] = (GLfloat
) params
[3];
3011 case GL_SPOT_DIRECTION
:
3012 fparam
[0] = (GLfloat
) params
[0];
3013 fparam
[1] = (GLfloat
) params
[1];
3014 fparam
[2] = (GLfloat
) params
[2];
3016 case GL_SPOT_EXPONENT
:
3017 case GL_SPOT_CUTOFF
:
3018 case GL_CONSTANT_ATTENUATION
:
3019 case GL_LINEAR_ATTENUATION
:
3020 case GL_QUADRATIC_ATTENUATION
:
3021 fparam
[0] = (GLfloat
) params
[0];
3024 /* error will be caught later in gl_Lightfv */
3027 save_Lightfv(light
, pname
, fparam
);
3031 static void GLAPIENTRY
3032 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3036 parray
[1] = parray
[2] = parray
[3] = 0;
3037 save_Lightiv(light
, pname
, parray
);
3041 static void GLAPIENTRY
3042 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3044 GET_CURRENT_CONTEXT(ctx
);
3046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3047 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3055 if (ctx
->ExecuteFlag
) {
3056 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3061 static void GLAPIENTRY
3062 save_LightModelf(GLenum pname
, GLfloat param
)
3066 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3067 save_LightModelfv(pname
, parray
);
3071 static void GLAPIENTRY
3072 save_LightModeliv(GLenum pname
, const GLint
*params
)
3076 case GL_LIGHT_MODEL_AMBIENT
:
3077 fparam
[0] = INT_TO_FLOAT(params
[0]);
3078 fparam
[1] = INT_TO_FLOAT(params
[1]);
3079 fparam
[2] = INT_TO_FLOAT(params
[2]);
3080 fparam
[3] = INT_TO_FLOAT(params
[3]);
3082 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3083 case GL_LIGHT_MODEL_TWO_SIDE
:
3084 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3085 fparam
[0] = (GLfloat
) params
[0];
3091 /* Error will be caught later in gl_LightModelfv */
3092 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3094 save_LightModelfv(pname
, fparam
);
3098 static void GLAPIENTRY
3099 save_LightModeli(GLenum pname
, GLint param
)
3103 parray
[1] = parray
[2] = parray
[3] = 0;
3104 save_LightModeliv(pname
, parray
);
3108 static void GLAPIENTRY
3109 save_LineStipple(GLint factor
, GLushort pattern
)
3111 GET_CURRENT_CONTEXT(ctx
);
3113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3114 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3119 if (ctx
->ExecuteFlag
) {
3120 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3125 static void GLAPIENTRY
3126 save_LineWidth(GLfloat width
)
3128 GET_CURRENT_CONTEXT(ctx
);
3130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3131 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3135 if (ctx
->ExecuteFlag
) {
3136 CALL_LineWidth(ctx
->Exec
, (width
));
3141 static void GLAPIENTRY
3142 save_ListBase(GLuint base
)
3144 GET_CURRENT_CONTEXT(ctx
);
3146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3147 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3151 if (ctx
->ExecuteFlag
) {
3152 CALL_ListBase(ctx
->Exec
, (base
));
3157 static void GLAPIENTRY
3158 save_LoadIdentity(void)
3160 GET_CURRENT_CONTEXT(ctx
);
3161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3162 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3163 if (ctx
->ExecuteFlag
) {
3164 CALL_LoadIdentity(ctx
->Exec
, ());
3169 static void GLAPIENTRY
3170 save_LoadMatrixf(const GLfloat
* m
)
3172 GET_CURRENT_CONTEXT(ctx
);
3174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3175 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3178 for (i
= 0; i
< 16; i
++) {
3182 if (ctx
->ExecuteFlag
) {
3183 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3188 static void GLAPIENTRY
3189 save_LoadMatrixd(const GLdouble
* m
)
3193 for (i
= 0; i
< 16; i
++) {
3194 f
[i
] = (GLfloat
) m
[i
];
3196 save_LoadMatrixf(f
);
3200 static void GLAPIENTRY
3201 save_LoadName(GLuint name
)
3203 GET_CURRENT_CONTEXT(ctx
);
3205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3206 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3210 if (ctx
->ExecuteFlag
) {
3211 CALL_LoadName(ctx
->Exec
, (name
));
3216 static void GLAPIENTRY
3217 save_LogicOp(GLenum opcode
)
3219 GET_CURRENT_CONTEXT(ctx
);
3221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3222 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3226 if (ctx
->ExecuteFlag
) {
3227 CALL_LogicOp(ctx
->Exec
, (opcode
));
3232 static void GLAPIENTRY
3233 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3234 GLint order
, const GLdouble
* points
)
3236 GET_CURRENT_CONTEXT(ctx
);
3238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3239 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3241 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3243 n
[2].f
= (GLfloat
) u1
;
3244 n
[3].f
= (GLfloat
) u2
;
3245 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3247 save_pointer(&n
[6], pnts
);
3249 if (ctx
->ExecuteFlag
) {
3250 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3254 static void GLAPIENTRY
3255 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3256 GLint order
, const GLfloat
* points
)
3258 GET_CURRENT_CONTEXT(ctx
);
3260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3261 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3263 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3267 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3269 save_pointer(&n
[6], pnts
);
3271 if (ctx
->ExecuteFlag
) {
3272 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3277 static void GLAPIENTRY
3278 save_Map2d(GLenum target
,
3279 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3280 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3281 const GLdouble
* points
)
3283 GET_CURRENT_CONTEXT(ctx
);
3285 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3286 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3288 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3289 vstride
, vorder
, points
);
3291 n
[2].f
= (GLfloat
) u1
;
3292 n
[3].f
= (GLfloat
) u2
;
3293 n
[4].f
= (GLfloat
) v1
;
3294 n
[5].f
= (GLfloat
) v2
;
3295 /* XXX verify these strides are correct */
3296 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3297 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3300 save_pointer(&n
[10], pnts
);
3302 if (ctx
->ExecuteFlag
) {
3303 CALL_Map2d(ctx
->Exec
, (target
,
3304 u1
, u2
, ustride
, uorder
,
3305 v1
, v2
, vstride
, vorder
, points
));
3310 static void GLAPIENTRY
3311 save_Map2f(GLenum target
,
3312 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3313 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3314 const GLfloat
* points
)
3316 GET_CURRENT_CONTEXT(ctx
);
3318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3319 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3321 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3322 vstride
, vorder
, points
);
3328 /* XXX verify these strides are correct */
3329 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3330 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3333 save_pointer(&n
[10], pnts
);
3335 if (ctx
->ExecuteFlag
) {
3336 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3337 v1
, v2
, vstride
, vorder
, points
));
3342 static void GLAPIENTRY
3343 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3345 GET_CURRENT_CONTEXT(ctx
);
3347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3348 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3354 if (ctx
->ExecuteFlag
) {
3355 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3360 static void GLAPIENTRY
3361 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3363 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3367 static void GLAPIENTRY
3368 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3369 GLint vn
, GLfloat v1
, GLfloat v2
)
3371 GET_CURRENT_CONTEXT(ctx
);
3373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3374 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3383 if (ctx
->ExecuteFlag
) {
3384 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3390 static void GLAPIENTRY
3391 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3392 GLint vn
, GLdouble v1
, GLdouble v2
)
3394 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3395 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3399 static void GLAPIENTRY
3400 save_MatrixMode(GLenum mode
)
3402 GET_CURRENT_CONTEXT(ctx
);
3404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3405 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3409 if (ctx
->ExecuteFlag
) {
3410 CALL_MatrixMode(ctx
->Exec
, (mode
));
3415 static void GLAPIENTRY
3416 save_MultMatrixf(const GLfloat
* m
)
3418 GET_CURRENT_CONTEXT(ctx
);
3420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3421 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3424 for (i
= 0; i
< 16; i
++) {
3428 if (ctx
->ExecuteFlag
) {
3429 CALL_MultMatrixf(ctx
->Exec
, (m
));
3434 static void GLAPIENTRY
3435 save_MultMatrixd(const GLdouble
* m
)
3439 for (i
= 0; i
< 16; i
++) {
3440 f
[i
] = (GLfloat
) m
[i
];
3442 save_MultMatrixf(f
);
3446 static void GLAPIENTRY
3447 save_NewList(GLuint name
, GLenum mode
)
3449 GET_CURRENT_CONTEXT(ctx
);
3450 /* It's an error to call this function while building a display list */
3451 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3458 static void GLAPIENTRY
3459 save_Ortho(GLdouble left
, GLdouble right
,
3460 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3462 GET_CURRENT_CONTEXT(ctx
);
3464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3465 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3467 n
[1].f
= (GLfloat
) left
;
3468 n
[2].f
= (GLfloat
) right
;
3469 n
[3].f
= (GLfloat
) bottom
;
3470 n
[4].f
= (GLfloat
) top
;
3471 n
[5].f
= (GLfloat
) nearval
;
3472 n
[6].f
= (GLfloat
) farval
;
3474 if (ctx
->ExecuteFlag
) {
3475 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3480 static void GLAPIENTRY
3481 save_PatchParameteri(GLenum pname
, const GLint value
)
3483 GET_CURRENT_CONTEXT(ctx
);
3485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3486 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3491 if (ctx
->ExecuteFlag
) {
3492 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3497 static void GLAPIENTRY
3498 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3500 GET_CURRENT_CONTEXT(ctx
);
3502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3504 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3505 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3507 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3508 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3512 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3522 if (ctx
->ExecuteFlag
) {
3523 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3528 static void GLAPIENTRY
3529 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3531 GET_CURRENT_CONTEXT(ctx
);
3533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3534 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3538 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3540 if (ctx
->ExecuteFlag
) {
3541 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3546 static void GLAPIENTRY
3547 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3549 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3551 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3552 for (i
= 0; i
< mapsize
; i
++) {
3553 fvalues
[i
] = (GLfloat
) values
[i
];
3557 for (i
= 0; i
< mapsize
; i
++) {
3558 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3561 save_PixelMapfv(map
, mapsize
, fvalues
);
3565 static void GLAPIENTRY
3566 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3568 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3570 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3571 for (i
= 0; i
< mapsize
; i
++) {
3572 fvalues
[i
] = (GLfloat
) values
[i
];
3576 for (i
= 0; i
< mapsize
; i
++) {
3577 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3580 save_PixelMapfv(map
, mapsize
, fvalues
);
3584 static void GLAPIENTRY
3585 save_PixelTransferf(GLenum pname
, GLfloat param
)
3587 GET_CURRENT_CONTEXT(ctx
);
3589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3590 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3595 if (ctx
->ExecuteFlag
) {
3596 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3601 static void GLAPIENTRY
3602 save_PixelTransferi(GLenum pname
, GLint param
)
3604 save_PixelTransferf(pname
, (GLfloat
) param
);
3608 static void GLAPIENTRY
3609 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3611 GET_CURRENT_CONTEXT(ctx
);
3613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3614 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3619 if (ctx
->ExecuteFlag
) {
3620 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3625 static void GLAPIENTRY
3626 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3628 GET_CURRENT_CONTEXT(ctx
);
3630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3631 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3638 if (ctx
->ExecuteFlag
) {
3639 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3644 static void GLAPIENTRY
3645 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3649 parray
[1] = parray
[2] = 0.0F
;
3650 save_PointParameterfvEXT(pname
, parray
);
3653 static void GLAPIENTRY
3654 save_PointParameteriNV(GLenum pname
, GLint param
)
3657 parray
[0] = (GLfloat
) param
;
3658 parray
[1] = parray
[2] = 0.0F
;
3659 save_PointParameterfvEXT(pname
, parray
);
3662 static void GLAPIENTRY
3663 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3666 parray
[0] = (GLfloat
) param
[0];
3667 parray
[1] = parray
[2] = 0.0F
;
3668 save_PointParameterfvEXT(pname
, parray
);
3672 static void GLAPIENTRY
3673 save_PointSize(GLfloat size
)
3675 GET_CURRENT_CONTEXT(ctx
);
3677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3678 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3682 if (ctx
->ExecuteFlag
) {
3683 CALL_PointSize(ctx
->Exec
, (size
));
3688 static void GLAPIENTRY
3689 save_PolygonMode(GLenum face
, GLenum mode
)
3691 GET_CURRENT_CONTEXT(ctx
);
3693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3694 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3699 if (ctx
->ExecuteFlag
) {
3700 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3705 static void GLAPIENTRY
3706 save_PolygonStipple(const GLubyte
* pattern
)
3708 GET_CURRENT_CONTEXT(ctx
);
3711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3713 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3716 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3717 pattern
, &ctx
->Unpack
));
3719 if (ctx
->ExecuteFlag
) {
3720 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3725 static void GLAPIENTRY
3726 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3728 GET_CURRENT_CONTEXT(ctx
);
3730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3731 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3736 if (ctx
->ExecuteFlag
) {
3737 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3742 static void GLAPIENTRY
3743 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3745 GET_CURRENT_CONTEXT(ctx
);
3747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3748 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3754 if (ctx
->ExecuteFlag
) {
3755 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3759 static void GLAPIENTRY
3760 save_PopAttrib(void)
3762 GET_CURRENT_CONTEXT(ctx
);
3763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3764 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3765 if (ctx
->ExecuteFlag
) {
3766 CALL_PopAttrib(ctx
->Exec
, ());
3771 static void GLAPIENTRY
3772 save_PopMatrix(void)
3774 GET_CURRENT_CONTEXT(ctx
);
3775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3776 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3777 if (ctx
->ExecuteFlag
) {
3778 CALL_PopMatrix(ctx
->Exec
, ());
3783 static void GLAPIENTRY
3786 GET_CURRENT_CONTEXT(ctx
);
3787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3788 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3789 if (ctx
->ExecuteFlag
) {
3790 CALL_PopName(ctx
->Exec
, ());
3795 static void GLAPIENTRY
3796 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3797 const GLclampf
* priorities
)
3799 GET_CURRENT_CONTEXT(ctx
);
3801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3803 for (i
= 0; i
< num
; i
++) {
3805 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3807 n
[1].ui
= textures
[i
];
3808 n
[2].f
= priorities
[i
];
3811 if (ctx
->ExecuteFlag
) {
3812 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3817 static void GLAPIENTRY
3818 save_PushAttrib(GLbitfield mask
)
3820 GET_CURRENT_CONTEXT(ctx
);
3822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3823 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3827 if (ctx
->ExecuteFlag
) {
3828 CALL_PushAttrib(ctx
->Exec
, (mask
));
3833 static void GLAPIENTRY
3834 save_PushMatrix(void)
3836 GET_CURRENT_CONTEXT(ctx
);
3837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3838 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3839 if (ctx
->ExecuteFlag
) {
3840 CALL_PushMatrix(ctx
->Exec
, ());
3845 static void GLAPIENTRY
3846 save_PushName(GLuint name
)
3848 GET_CURRENT_CONTEXT(ctx
);
3850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3851 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3855 if (ctx
->ExecuteFlag
) {
3856 CALL_PushName(ctx
->Exec
, (name
));
3861 static void GLAPIENTRY
3862 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3864 GET_CURRENT_CONTEXT(ctx
);
3866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3867 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3874 if (ctx
->ExecuteFlag
) {
3875 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3879 static void GLAPIENTRY
3880 save_RasterPos2d(GLdouble x
, GLdouble y
)
3882 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3885 static void GLAPIENTRY
3886 save_RasterPos2f(GLfloat x
, GLfloat y
)
3888 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3891 static void GLAPIENTRY
3892 save_RasterPos2i(GLint x
, GLint y
)
3894 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3897 static void GLAPIENTRY
3898 save_RasterPos2s(GLshort x
, GLshort y
)
3900 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3903 static void GLAPIENTRY
3904 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3906 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3909 static void GLAPIENTRY
3910 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3912 save_RasterPos4f(x
, y
, z
, 1.0F
);
3915 static void GLAPIENTRY
3916 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3918 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3921 static void GLAPIENTRY
3922 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3924 save_RasterPos4f(x
, y
, z
, 1.0F
);
3927 static void GLAPIENTRY
3928 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3930 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3933 static void GLAPIENTRY
3934 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3936 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3939 static void GLAPIENTRY
3940 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3942 save_RasterPos4f(x
, y
, z
, w
);
3945 static void GLAPIENTRY
3946 save_RasterPos2dv(const GLdouble
* v
)
3948 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3951 static void GLAPIENTRY
3952 save_RasterPos2fv(const GLfloat
* v
)
3954 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3957 static void GLAPIENTRY
3958 save_RasterPos2iv(const GLint
* v
)
3960 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3963 static void GLAPIENTRY
3964 save_RasterPos2sv(const GLshort
* v
)
3966 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3969 static void GLAPIENTRY
3970 save_RasterPos3dv(const GLdouble
* v
)
3972 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3975 static void GLAPIENTRY
3976 save_RasterPos3fv(const GLfloat
* v
)
3978 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3981 static void GLAPIENTRY
3982 save_RasterPos3iv(const GLint
* v
)
3984 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3987 static void GLAPIENTRY
3988 save_RasterPos3sv(const GLshort
* v
)
3990 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3993 static void GLAPIENTRY
3994 save_RasterPos4dv(const GLdouble
* v
)
3996 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3997 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4000 static void GLAPIENTRY
4001 save_RasterPos4fv(const GLfloat
* v
)
4003 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4006 static void GLAPIENTRY
4007 save_RasterPos4iv(const GLint
* v
)
4009 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4010 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4013 static void GLAPIENTRY
4014 save_RasterPos4sv(const GLshort
* v
)
4016 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4020 static void GLAPIENTRY
4021 save_PassThrough(GLfloat token
)
4023 GET_CURRENT_CONTEXT(ctx
);
4025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4026 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4030 if (ctx
->ExecuteFlag
) {
4031 CALL_PassThrough(ctx
->Exec
, (token
));
4036 static void GLAPIENTRY
4037 save_ReadBuffer(GLenum mode
)
4039 GET_CURRENT_CONTEXT(ctx
);
4041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4042 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4046 if (ctx
->ExecuteFlag
) {
4047 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4052 static void GLAPIENTRY
4053 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4055 GET_CURRENT_CONTEXT(ctx
);
4057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4058 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4065 if (ctx
->ExecuteFlag
) {
4066 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4071 static void GLAPIENTRY
4072 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4074 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4078 static void GLAPIENTRY
4079 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4081 GET_CURRENT_CONTEXT(ctx
);
4083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4084 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4090 if (ctx
->ExecuteFlag
) {
4091 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4096 static void GLAPIENTRY
4097 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4099 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4103 static void GLAPIENTRY
4104 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4106 GET_CURRENT_CONTEXT(ctx
);
4108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4109 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4116 if (ctx
->ExecuteFlag
) {
4117 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4122 static void GLAPIENTRY
4123 save_ShadeModel(GLenum mode
)
4125 GET_CURRENT_CONTEXT(ctx
);
4127 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4129 if (ctx
->ExecuteFlag
) {
4130 CALL_ShadeModel(ctx
->Exec
, (mode
));
4133 /* Don't compile this call if it's a no-op.
4134 * By avoiding this state change we have a better chance of
4135 * coalescing subsequent drawing commands into one batch.
4137 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4140 SAVE_FLUSH_VERTICES(ctx
);
4142 ctx
->ListState
.Current
.ShadeModel
= mode
;
4144 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4151 static void GLAPIENTRY
4152 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4154 GET_CURRENT_CONTEXT(ctx
);
4156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4157 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4163 if (ctx
->ExecuteFlag
) {
4164 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4169 static void GLAPIENTRY
4170 save_StencilMask(GLuint mask
)
4172 GET_CURRENT_CONTEXT(ctx
);
4174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4175 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4179 if (ctx
->ExecuteFlag
) {
4180 CALL_StencilMask(ctx
->Exec
, (mask
));
4185 static void GLAPIENTRY
4186 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4188 GET_CURRENT_CONTEXT(ctx
);
4190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4191 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4197 if (ctx
->ExecuteFlag
) {
4198 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4203 static void GLAPIENTRY
4204 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4206 GET_CURRENT_CONTEXT(ctx
);
4208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4209 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4216 if (ctx
->ExecuteFlag
) {
4217 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4222 static void GLAPIENTRY
4223 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4226 GET_CURRENT_CONTEXT(ctx
);
4228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4230 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4238 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4245 if (ctx
->ExecuteFlag
) {
4246 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4247 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4252 static void GLAPIENTRY
4253 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4255 GET_CURRENT_CONTEXT(ctx
);
4257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4258 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4263 if (ctx
->ExecuteFlag
) {
4264 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4269 static void GLAPIENTRY
4270 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4272 GET_CURRENT_CONTEXT(ctx
);
4274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4275 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4282 if (ctx
->ExecuteFlag
) {
4283 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4288 static void GLAPIENTRY
4289 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4291 GET_CURRENT_CONTEXT(ctx
);
4293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4294 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4298 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4306 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4309 if (ctx
->ExecuteFlag
) {
4310 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4315 static void GLAPIENTRY
4316 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4319 parray
[0] = (GLfloat
) param
;
4320 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4321 save_TexEnvfv(target
, pname
, parray
);
4325 static void GLAPIENTRY
4326 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4329 p
[0] = (GLfloat
) param
;
4330 p
[1] = p
[2] = p
[3] = 0.0F
;
4331 save_TexEnvfv(target
, pname
, p
);
4335 static void GLAPIENTRY
4336 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4339 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4340 p
[0] = INT_TO_FLOAT(param
[0]);
4341 p
[1] = INT_TO_FLOAT(param
[1]);
4342 p
[2] = INT_TO_FLOAT(param
[2]);
4343 p
[3] = INT_TO_FLOAT(param
[3]);
4346 p
[0] = (GLfloat
) param
[0];
4347 p
[1] = p
[2] = p
[3] = 0.0F
;
4349 save_TexEnvfv(target
, pname
, p
);
4353 static void GLAPIENTRY
4354 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4356 GET_CURRENT_CONTEXT(ctx
);
4358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4359 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4368 if (ctx
->ExecuteFlag
) {
4369 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4374 static void GLAPIENTRY
4375 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4378 p
[0] = (GLfloat
) params
[0];
4379 p
[1] = (GLfloat
) params
[1];
4380 p
[2] = (GLfloat
) params
[2];
4381 p
[3] = (GLfloat
) params
[3];
4382 save_TexGenfv(coord
, pname
, p
);
4386 static void GLAPIENTRY
4387 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4390 parray
[0] = (GLfloat
) param
;
4391 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4392 save_TexGenfv(coord
, pname
, parray
);
4396 static void GLAPIENTRY
4397 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4400 p
[0] = (GLfloat
) params
[0];
4401 p
[1] = (GLfloat
) params
[1];
4402 p
[2] = (GLfloat
) params
[2];
4403 p
[3] = (GLfloat
) params
[3];
4404 save_TexGenfv(coord
, pname
, p
);
4408 static void GLAPIENTRY
4409 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4413 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4414 save_TexGenfv(coord
, pname
, parray
);
4418 static void GLAPIENTRY
4419 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4423 parray
[1] = parray
[2] = parray
[3] = 0;
4424 save_TexGeniv(coord
, pname
, parray
);
4428 static void GLAPIENTRY
4429 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4431 GET_CURRENT_CONTEXT(ctx
);
4433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4434 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4443 if (ctx
->ExecuteFlag
) {
4444 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4449 static void GLAPIENTRY
4450 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4454 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4455 save_TexParameterfv(target
, pname
, parray
);
4459 static void GLAPIENTRY
4460 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4463 fparam
[0] = (GLfloat
) param
;
4464 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4465 save_TexParameterfv(target
, pname
, fparam
);
4469 static void GLAPIENTRY
4470 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4473 fparam
[0] = (GLfloat
) params
[0];
4474 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4475 save_TexParameterfv(target
, pname
, fparam
);
4479 static void GLAPIENTRY
4480 save_TexImage1D(GLenum target
,
4481 GLint level
, GLint components
,
4482 GLsizei width
, GLint border
,
4483 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4485 GET_CURRENT_CONTEXT(ctx
);
4486 if (target
== GL_PROXY_TEXTURE_1D
) {
4487 /* don't compile, execute immediately */
4488 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4489 border
, format
, type
, pixels
));
4493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4494 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4498 n
[3].i
= components
;
4499 n
[4].i
= (GLint
) width
;
4504 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4505 pixels
, &ctx
->Unpack
));
4507 if (ctx
->ExecuteFlag
) {
4508 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4509 border
, format
, type
, pixels
));
4515 static void GLAPIENTRY
4516 save_TexImage2D(GLenum target
,
4517 GLint level
, GLint components
,
4518 GLsizei width
, GLsizei height
, GLint border
,
4519 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4521 GET_CURRENT_CONTEXT(ctx
);
4522 if (target
== GL_PROXY_TEXTURE_2D
) {
4523 /* don't compile, execute immediately */
4524 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4525 height
, border
, format
, type
, pixels
));
4529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4530 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4534 n
[3].i
= components
;
4535 n
[4].i
= (GLint
) width
;
4536 n
[5].i
= (GLint
) height
;
4541 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4542 pixels
, &ctx
->Unpack
));
4544 if (ctx
->ExecuteFlag
) {
4545 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4546 height
, border
, format
, type
, pixels
));
4552 static void GLAPIENTRY
4553 save_TexImage3D(GLenum target
,
4554 GLint level
, GLint internalFormat
,
4555 GLsizei width
, GLsizei height
, GLsizei depth
,
4557 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4559 GET_CURRENT_CONTEXT(ctx
);
4560 if (target
== GL_PROXY_TEXTURE_3D
) {
4561 /* don't compile, execute immediately */
4562 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4563 height
, depth
, border
, format
, type
,
4568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4569 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4573 n
[3].i
= (GLint
) internalFormat
;
4574 n
[4].i
= (GLint
) width
;
4575 n
[5].i
= (GLint
) height
;
4576 n
[6].i
= (GLint
) depth
;
4580 save_pointer(&n
[10],
4581 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4582 pixels
, &ctx
->Unpack
));
4584 if (ctx
->ExecuteFlag
) {
4585 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4586 height
, depth
, border
, format
, type
,
4593 static void GLAPIENTRY
4594 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4595 GLsizei width
, GLenum format
, GLenum type
,
4596 const GLvoid
* pixels
)
4598 GET_CURRENT_CONTEXT(ctx
);
4601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4603 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4608 n
[4].i
= (GLint
) width
;
4612 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4613 pixels
, &ctx
->Unpack
));
4615 if (ctx
->ExecuteFlag
) {
4616 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4617 format
, type
, pixels
));
4622 static void GLAPIENTRY
4623 save_TexSubImage2D(GLenum target
, GLint level
,
4624 GLint xoffset
, GLint yoffset
,
4625 GLsizei width
, GLsizei height
,
4626 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4628 GET_CURRENT_CONTEXT(ctx
);
4631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4633 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4639 n
[5].i
= (GLint
) width
;
4640 n
[6].i
= (GLint
) height
;
4644 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4645 pixels
, &ctx
->Unpack
));
4647 if (ctx
->ExecuteFlag
) {
4648 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4649 width
, height
, format
, type
, pixels
));
4654 static void GLAPIENTRY
4655 save_TexSubImage3D(GLenum target
, GLint level
,
4656 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4657 GLsizei width
, GLsizei height
, GLsizei depth
,
4658 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4660 GET_CURRENT_CONTEXT(ctx
);
4663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4665 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4672 n
[6].i
= (GLint
) width
;
4673 n
[7].i
= (GLint
) height
;
4674 n
[8].i
= (GLint
) depth
;
4677 save_pointer(&n
[11],
4678 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4679 pixels
, &ctx
->Unpack
));
4681 if (ctx
->ExecuteFlag
) {
4682 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4683 xoffset
, yoffset
, zoffset
,
4684 width
, height
, depth
, format
, type
,
4690 static void GLAPIENTRY
4691 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4693 GET_CURRENT_CONTEXT(ctx
);
4695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4696 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4702 if (ctx
->ExecuteFlag
) {
4703 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4708 static void GLAPIENTRY
4709 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4711 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4716 static void GLAPIENTRY
4717 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4719 GET_CURRENT_CONTEXT(ctx
);
4721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4722 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4726 n
[3].i
= (GLint
) width
;
4727 n
[4].i
= (GLint
) height
;
4729 if (ctx
->ExecuteFlag
) {
4730 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4734 static void GLAPIENTRY
4735 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4738 GET_CURRENT_CONTEXT(ctx
);
4740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4741 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4749 if (ctx
->ExecuteFlag
) {
4750 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4754 static void GLAPIENTRY
4755 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4757 GET_CURRENT_CONTEXT(ctx
);
4759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4760 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4768 if (ctx
->ExecuteFlag
) {
4769 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4773 static void GLAPIENTRY
4774 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4776 GET_CURRENT_CONTEXT(ctx
);
4778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4779 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4783 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4785 if (ctx
->ExecuteFlag
) {
4786 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4790 static void GLAPIENTRY
4791 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4794 GET_CURRENT_CONTEXT(ctx
);
4796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4797 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4805 if (ctx
->ExecuteFlag
) {
4806 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4810 static void GLAPIENTRY
4811 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4813 GET_CURRENT_CONTEXT(ctx
);
4815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4816 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4824 if (ctx
->ExecuteFlag
) {
4825 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4829 static void GLAPIENTRY
4830 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4832 GET_CURRENT_CONTEXT(ctx
);
4834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4835 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4839 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4841 if (ctx
->ExecuteFlag
) {
4842 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4846 static void GLAPIENTRY
4847 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4849 GET_CURRENT_CONTEXT(ctx
);
4851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4852 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4855 /* Mesa stores these as floats internally so we deliberately convert
4856 * them to a float here.
4861 if (ctx
->ExecuteFlag
) {
4862 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4866 static void GLAPIENTRY
4867 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4869 GET_CURRENT_CONTEXT(ctx
);
4871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4872 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4876 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4878 if (ctx
->ExecuteFlag
) {
4879 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4883 static void GLAPIENTRY
4884 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4886 GET_CURRENT_CONTEXT(ctx
);
4888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4889 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4896 if (ctx
->ExecuteFlag
) {
4897 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4901 static void GLAPIENTRY
4902 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4904 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4907 static void GLAPIENTRY
4908 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4910 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4913 static void GLAPIENTRY
4914 save_WindowPos2iMESA(GLint x
, GLint y
)
4916 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4919 static void GLAPIENTRY
4920 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4922 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4925 static void GLAPIENTRY
4926 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4928 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4931 static void GLAPIENTRY
4932 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4934 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4937 static void GLAPIENTRY
4938 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4940 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4943 static void GLAPIENTRY
4944 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4946 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4949 static void GLAPIENTRY
4950 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4952 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4955 static void GLAPIENTRY
4956 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4958 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4961 static void GLAPIENTRY
4962 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4964 save_WindowPos4fMESA(x
, y
, z
, w
);
4967 static void GLAPIENTRY
4968 save_WindowPos2dvMESA(const GLdouble
* v
)
4970 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4973 static void GLAPIENTRY
4974 save_WindowPos2fvMESA(const GLfloat
* v
)
4976 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4979 static void GLAPIENTRY
4980 save_WindowPos2ivMESA(const GLint
* v
)
4982 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4985 static void GLAPIENTRY
4986 save_WindowPos2svMESA(const GLshort
* v
)
4988 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4991 static void GLAPIENTRY
4992 save_WindowPos3dvMESA(const GLdouble
* v
)
4994 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4997 static void GLAPIENTRY
4998 save_WindowPos3fvMESA(const GLfloat
* v
)
5000 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5003 static void GLAPIENTRY
5004 save_WindowPos3ivMESA(const GLint
* v
)
5006 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5009 static void GLAPIENTRY
5010 save_WindowPos3svMESA(const GLshort
* v
)
5012 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5015 static void GLAPIENTRY
5016 save_WindowPos4dvMESA(const GLdouble
* v
)
5018 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5019 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5022 static void GLAPIENTRY
5023 save_WindowPos4fvMESA(const GLfloat
* v
)
5025 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5028 static void GLAPIENTRY
5029 save_WindowPos4ivMESA(const GLint
* v
)
5031 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5032 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5035 static void GLAPIENTRY
5036 save_WindowPos4svMESA(const GLshort
* v
)
5038 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5043 /* GL_ARB_multitexture */
5044 static void GLAPIENTRY
5045 save_ActiveTextureARB(GLenum target
)
5047 GET_CURRENT_CONTEXT(ctx
);
5049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5050 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5054 if (ctx
->ExecuteFlag
) {
5055 CALL_ActiveTexture(ctx
->Exec
, (target
));
5060 /* GL_ARB_transpose_matrix */
5062 static void GLAPIENTRY
5063 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5066 _math_transposefd(tm
, m
);
5067 save_LoadMatrixf(tm
);
5071 static void GLAPIENTRY
5072 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5075 _math_transposef(tm
, m
);
5076 save_LoadMatrixf(tm
);
5080 static void GLAPIENTRY
5081 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5084 _math_transposefd(tm
, m
);
5085 save_MultMatrixf(tm
);
5089 static void GLAPIENTRY
5090 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5093 _math_transposef(tm
, m
);
5094 save_MultMatrixf(tm
);
5097 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5099 GET_CURRENT_CONTEXT(ctx
);
5105 image
= malloc(size
);
5107 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5110 memcpy(image
, data
, size
);
5116 /* GL_ARB_texture_compression */
5117 static void GLAPIENTRY
5118 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5119 GLenum internalFormat
, GLsizei width
,
5120 GLint border
, GLsizei imageSize
,
5121 const GLvoid
* data
)
5123 GET_CURRENT_CONTEXT(ctx
);
5124 if (target
== GL_PROXY_TEXTURE_1D
) {
5125 /* don't compile, execute immediately */
5126 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5127 width
, border
, imageSize
,
5132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5134 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5135 6 + POINTER_DWORDS
);
5139 n
[3].e
= internalFormat
;
5140 n
[4].i
= (GLint
) width
;
5144 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5146 if (ctx
->ExecuteFlag
) {
5147 CALL_CompressedTexImage1D(ctx
->Exec
,
5148 (target
, level
, internalFormat
, width
,
5149 border
, imageSize
, data
));
5155 static void GLAPIENTRY
5156 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5157 GLenum internalFormat
, GLsizei width
,
5158 GLsizei height
, GLint border
, GLsizei imageSize
,
5159 const GLvoid
* data
)
5161 GET_CURRENT_CONTEXT(ctx
);
5162 if (target
== GL_PROXY_TEXTURE_2D
) {
5163 /* don't compile, execute immediately */
5164 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5165 width
, height
, border
,
5170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5172 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5173 7 + POINTER_DWORDS
);
5177 n
[3].e
= internalFormat
;
5178 n
[4].i
= (GLint
) width
;
5179 n
[5].i
= (GLint
) height
;
5183 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5185 if (ctx
->ExecuteFlag
) {
5186 CALL_CompressedTexImage2D(ctx
->Exec
,
5187 (target
, level
, internalFormat
, width
,
5188 height
, border
, imageSize
, data
));
5194 static void GLAPIENTRY
5195 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5196 GLenum internalFormat
, GLsizei width
,
5197 GLsizei height
, GLsizei depth
, GLint border
,
5198 GLsizei imageSize
, const GLvoid
* data
)
5200 GET_CURRENT_CONTEXT(ctx
);
5201 if (target
== GL_PROXY_TEXTURE_3D
) {
5202 /* don't compile, execute immediately */
5203 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5204 width
, height
, depth
, border
,
5209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5211 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5212 8 + POINTER_DWORDS
);
5216 n
[3].e
= internalFormat
;
5217 n
[4].i
= (GLint
) width
;
5218 n
[5].i
= (GLint
) height
;
5219 n
[6].i
= (GLint
) depth
;
5223 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5225 if (ctx
->ExecuteFlag
) {
5226 CALL_CompressedTexImage3D(ctx
->Exec
,
5227 (target
, level
, internalFormat
, width
,
5228 height
, depth
, border
, imageSize
,
5235 static void GLAPIENTRY
5236 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5237 GLsizei width
, GLenum format
,
5238 GLsizei imageSize
, const GLvoid
* data
)
5241 GET_CURRENT_CONTEXT(ctx
);
5242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5244 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5245 6 + POINTER_DWORDS
);
5250 n
[4].i
= (GLint
) width
;
5254 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5256 if (ctx
->ExecuteFlag
) {
5257 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5258 width
, format
, imageSize
,
5264 static void GLAPIENTRY
5265 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5266 GLint yoffset
, GLsizei width
, GLsizei height
,
5267 GLenum format
, GLsizei imageSize
,
5268 const GLvoid
* data
)
5271 GET_CURRENT_CONTEXT(ctx
);
5272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5274 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5275 8 + POINTER_DWORDS
);
5281 n
[5].i
= (GLint
) width
;
5282 n
[6].i
= (GLint
) height
;
5286 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5288 if (ctx
->ExecuteFlag
) {
5289 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5290 (target
, level
, xoffset
, yoffset
, width
,
5291 height
, format
, imageSize
, data
));
5296 static void GLAPIENTRY
5297 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5298 GLint yoffset
, GLint zoffset
, GLsizei width
,
5299 GLsizei height
, GLsizei depth
, GLenum format
,
5300 GLsizei imageSize
, const GLvoid
* data
)
5303 GET_CURRENT_CONTEXT(ctx
);
5304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5306 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5307 10 + POINTER_DWORDS
);
5314 n
[6].i
= (GLint
) width
;
5315 n
[7].i
= (GLint
) height
;
5316 n
[8].i
= (GLint
) depth
;
5318 n
[10].i
= imageSize
;
5319 save_pointer(&n
[11],
5320 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5322 if (ctx
->ExecuteFlag
) {
5323 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5324 (target
, level
, xoffset
, yoffset
,
5325 zoffset
, width
, height
, depth
, format
,
5331 /* GL_ARB_multisample */
5332 static void GLAPIENTRY
5333 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5335 GET_CURRENT_CONTEXT(ctx
);
5337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5338 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5343 if (ctx
->ExecuteFlag
) {
5344 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5350 * GL_ARB_vertex_program
5352 static void GLAPIENTRY
5353 save_BindProgramARB(GLenum target
, GLuint id
)
5355 GET_CURRENT_CONTEXT(ctx
);
5357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5358 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5363 if (ctx
->ExecuteFlag
) {
5364 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5368 static void GLAPIENTRY
5369 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5370 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5372 GET_CURRENT_CONTEXT(ctx
);
5374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5375 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5384 if (ctx
->ExecuteFlag
) {
5385 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5390 static void GLAPIENTRY
5391 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5392 const GLfloat
*params
)
5394 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5395 params
[2], params
[3]);
5399 static void GLAPIENTRY
5400 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5401 const GLfloat
* params
)
5403 GET_CURRENT_CONTEXT(ctx
);
5405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5409 const GLfloat
* p
= params
;
5411 for (i
= 0 ; i
< count
; i
++) {
5412 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5425 if (ctx
->ExecuteFlag
) {
5426 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5431 static void GLAPIENTRY
5432 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5433 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5435 save_ProgramEnvParameter4fARB(target
, index
,
5437 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5441 static void GLAPIENTRY
5442 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5443 const GLdouble
*params
)
5445 save_ProgramEnvParameter4fARB(target
, index
,
5446 (GLfloat
) params
[0],
5447 (GLfloat
) params
[1],
5448 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5452 static void GLAPIENTRY
5453 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5454 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5456 GET_CURRENT_CONTEXT(ctx
);
5458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5459 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5468 if (ctx
->ExecuteFlag
) {
5469 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5474 static void GLAPIENTRY
5475 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5476 const GLfloat
*params
)
5478 GET_CURRENT_CONTEXT(ctx
);
5480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5481 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5490 if (ctx
->ExecuteFlag
) {
5491 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5496 static void GLAPIENTRY
5497 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5498 const GLfloat
*params
)
5500 GET_CURRENT_CONTEXT(ctx
);
5502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5506 const GLfloat
* p
= params
;
5508 for (i
= 0 ; i
< count
; i
++) {
5509 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5522 if (ctx
->ExecuteFlag
) {
5523 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5528 static void GLAPIENTRY
5529 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5530 GLdouble x
, GLdouble y
,
5531 GLdouble z
, GLdouble w
)
5533 GET_CURRENT_CONTEXT(ctx
);
5535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5536 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5540 n
[3].f
= (GLfloat
) x
;
5541 n
[4].f
= (GLfloat
) y
;
5542 n
[5].f
= (GLfloat
) z
;
5543 n
[6].f
= (GLfloat
) w
;
5545 if (ctx
->ExecuteFlag
) {
5546 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5551 static void GLAPIENTRY
5552 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5553 const GLdouble
*params
)
5555 GET_CURRENT_CONTEXT(ctx
);
5557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5558 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5562 n
[3].f
= (GLfloat
) params
[0];
5563 n
[4].f
= (GLfloat
) params
[1];
5564 n
[5].f
= (GLfloat
) params
[2];
5565 n
[6].f
= (GLfloat
) params
[3];
5567 if (ctx
->ExecuteFlag
) {
5568 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5573 /* GL_EXT_stencil_two_side */
5574 static void GLAPIENTRY
5575 save_ActiveStencilFaceEXT(GLenum face
)
5577 GET_CURRENT_CONTEXT(ctx
);
5579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5580 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5584 if (ctx
->ExecuteFlag
) {
5585 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5590 /* GL_EXT_depth_bounds_test */
5591 static void GLAPIENTRY
5592 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5594 GET_CURRENT_CONTEXT(ctx
);
5596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5597 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5599 n
[1].f
= (GLfloat
) zmin
;
5600 n
[2].f
= (GLfloat
) zmax
;
5602 if (ctx
->ExecuteFlag
) {
5603 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5609 static void GLAPIENTRY
5610 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5611 const GLvoid
* string
)
5613 GET_CURRENT_CONTEXT(ctx
);
5616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5618 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5620 GLubyte
*programCopy
= malloc(len
);
5622 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5625 memcpy(programCopy
, string
, len
);
5629 save_pointer(&n
[4], programCopy
);
5631 if (ctx
->ExecuteFlag
) {
5632 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5637 static void GLAPIENTRY
5638 save_BeginQueryARB(GLenum target
, GLuint id
)
5640 GET_CURRENT_CONTEXT(ctx
);
5642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5643 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5648 if (ctx
->ExecuteFlag
) {
5649 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5653 static void GLAPIENTRY
5654 save_EndQueryARB(GLenum target
)
5656 GET_CURRENT_CONTEXT(ctx
);
5658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5659 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5663 if (ctx
->ExecuteFlag
) {
5664 CALL_EndQuery(ctx
->Exec
, (target
));
5668 static void GLAPIENTRY
5669 save_QueryCounter(GLuint id
, GLenum target
)
5671 GET_CURRENT_CONTEXT(ctx
);
5673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5674 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5679 if (ctx
->ExecuteFlag
) {
5680 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5684 static void GLAPIENTRY
5685 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5687 GET_CURRENT_CONTEXT(ctx
);
5689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5690 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5696 if (ctx
->ExecuteFlag
) {
5697 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5701 static void GLAPIENTRY
5702 save_EndQueryIndexed(GLenum target
, GLuint index
)
5704 GET_CURRENT_CONTEXT(ctx
);
5706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5707 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5712 if (ctx
->ExecuteFlag
) {
5713 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5718 static void GLAPIENTRY
5719 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5721 GET_CURRENT_CONTEXT(ctx
);
5723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5724 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5728 if (count
> MAX_DRAW_BUFFERS
)
5729 count
= MAX_DRAW_BUFFERS
;
5730 for (i
= 0; i
< count
; i
++) {
5731 n
[2 + i
].e
= buffers
[i
];
5734 if (ctx
->ExecuteFlag
) {
5735 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5739 static void GLAPIENTRY
5740 save_BindFragmentShaderATI(GLuint id
)
5742 GET_CURRENT_CONTEXT(ctx
);
5745 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5749 if (ctx
->ExecuteFlag
) {
5750 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5754 static void GLAPIENTRY
5755 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5757 GET_CURRENT_CONTEXT(ctx
);
5760 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5768 if (ctx
->ExecuteFlag
) {
5769 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5773 static void GLAPIENTRY
5774 save_Attr1fNV(GLenum attr
, GLfloat x
)
5776 GET_CURRENT_CONTEXT(ctx
);
5778 SAVE_FLUSH_VERTICES(ctx
);
5779 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5785 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5786 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5787 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5789 if (ctx
->ExecuteFlag
) {
5790 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5794 static void GLAPIENTRY
5795 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5797 GET_CURRENT_CONTEXT(ctx
);
5799 SAVE_FLUSH_VERTICES(ctx
);
5800 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5807 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5808 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5809 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5811 if (ctx
->ExecuteFlag
) {
5812 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5816 static void GLAPIENTRY
5817 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5819 GET_CURRENT_CONTEXT(ctx
);
5821 SAVE_FLUSH_VERTICES(ctx
);
5822 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5830 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5831 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5832 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5834 if (ctx
->ExecuteFlag
) {
5835 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5839 static void GLAPIENTRY
5840 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5842 GET_CURRENT_CONTEXT(ctx
);
5844 SAVE_FLUSH_VERTICES(ctx
);
5845 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5854 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5855 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5856 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5858 if (ctx
->ExecuteFlag
) {
5859 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5864 static void GLAPIENTRY
5865 save_Attr1fARB(GLenum attr
, GLfloat x
)
5867 GET_CURRENT_CONTEXT(ctx
);
5869 SAVE_FLUSH_VERTICES(ctx
);
5870 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5876 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5877 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5878 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5880 if (ctx
->ExecuteFlag
) {
5881 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5885 static void GLAPIENTRY
5886 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5888 GET_CURRENT_CONTEXT(ctx
);
5890 SAVE_FLUSH_VERTICES(ctx
);
5891 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5898 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5899 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5900 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5902 if (ctx
->ExecuteFlag
) {
5903 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5907 static void GLAPIENTRY
5908 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5910 GET_CURRENT_CONTEXT(ctx
);
5912 SAVE_FLUSH_VERTICES(ctx
);
5913 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5921 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5922 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5923 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5925 if (ctx
->ExecuteFlag
) {
5926 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5930 static void GLAPIENTRY
5931 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5933 GET_CURRENT_CONTEXT(ctx
);
5935 SAVE_FLUSH_VERTICES(ctx
);
5936 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5945 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5946 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5947 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5949 if (ctx
->ExecuteFlag
) {
5950 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5955 static void GLAPIENTRY
5956 save_EvalCoord1f(GLfloat x
)
5958 GET_CURRENT_CONTEXT(ctx
);
5960 SAVE_FLUSH_VERTICES(ctx
);
5961 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5965 if (ctx
->ExecuteFlag
) {
5966 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5970 static void GLAPIENTRY
5971 save_EvalCoord1fv(const GLfloat
* v
)
5973 save_EvalCoord1f(v
[0]);
5976 static void GLAPIENTRY
5977 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5979 GET_CURRENT_CONTEXT(ctx
);
5981 SAVE_FLUSH_VERTICES(ctx
);
5982 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5987 if (ctx
->ExecuteFlag
) {
5988 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5992 static void GLAPIENTRY
5993 save_EvalCoord2fv(const GLfloat
* v
)
5995 save_EvalCoord2f(v
[0], v
[1]);
5999 static void GLAPIENTRY
6000 save_EvalPoint1(GLint x
)
6002 GET_CURRENT_CONTEXT(ctx
);
6004 SAVE_FLUSH_VERTICES(ctx
);
6005 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6009 if (ctx
->ExecuteFlag
) {
6010 CALL_EvalPoint1(ctx
->Exec
, (x
));
6014 static void GLAPIENTRY
6015 save_EvalPoint2(GLint x
, GLint y
)
6017 GET_CURRENT_CONTEXT(ctx
);
6019 SAVE_FLUSH_VERTICES(ctx
);
6020 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6025 if (ctx
->ExecuteFlag
) {
6026 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6030 static void GLAPIENTRY
6031 save_Indexf(GLfloat x
)
6033 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6036 static void GLAPIENTRY
6037 save_Indexfv(const GLfloat
* v
)
6039 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6042 static void GLAPIENTRY
6043 save_EdgeFlag(GLboolean x
)
6045 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6050 * Compare 'count' elements of vectors 'a' and 'b'.
6051 * \return GL_TRUE if equal, GL_FALSE if different.
6053 static inline GLboolean
6054 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6056 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6061 * This glMaterial function is used for glMaterial calls that are outside
6062 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6064 static void GLAPIENTRY
6065 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6067 GET_CURRENT_CONTEXT(ctx
);
6075 case GL_FRONT_AND_BACK
:
6078 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6087 case GL_AMBIENT_AND_DIFFUSE
:
6093 case GL_COLOR_INDEXES
:
6097 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6101 if (ctx
->ExecuteFlag
) {
6102 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6105 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6107 /* Try to eliminate redundant statechanges. Because it is legal to
6108 * call glMaterial even inside begin/end calls, don't need to worry
6109 * about ctx->Driver.CurrentSavePrimitive here.
6111 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6112 if (bitmask
& (1 << i
)) {
6113 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6114 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6115 /* no change in material value */
6116 bitmask
&= ~(1 << i
);
6119 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6120 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6125 /* If this call has no effect, return early */
6129 SAVE_FLUSH_VERTICES(ctx
);
6131 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6135 for (i
= 0; i
< args
; i
++)
6136 n
[3 + i
].f
= param
[i
];
6140 static void GLAPIENTRY
6141 save_Begin(GLenum mode
)
6143 GET_CURRENT_CONTEXT(ctx
);
6145 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6146 /* compile this error into the display list */
6147 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6149 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6150 /* compile this error into the display list */
6151 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6154 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6156 vbo_save_NotifyBegin(ctx
, mode
, false);
6160 static void GLAPIENTRY
6163 GET_CURRENT_CONTEXT(ctx
);
6164 SAVE_FLUSH_VERTICES(ctx
);
6165 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6166 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6167 if (ctx
->ExecuteFlag
) {
6168 CALL_End(ctx
->Exec
, ());
6172 static void GLAPIENTRY
6173 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6175 GET_CURRENT_CONTEXT(ctx
);
6177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6178 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6185 if (ctx
->ExecuteFlag
) {
6186 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6191 static void GLAPIENTRY
6192 save_Vertex2f(GLfloat x
, GLfloat y
)
6194 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6197 static void GLAPIENTRY
6198 save_Vertex2fv(const GLfloat
* v
)
6200 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6203 static void GLAPIENTRY
6204 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6206 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6209 static void GLAPIENTRY
6210 save_Vertex3fv(const GLfloat
* v
)
6212 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6215 static void GLAPIENTRY
6216 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6218 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6221 static void GLAPIENTRY
6222 save_Vertex4fv(const GLfloat
* v
)
6224 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6227 static void GLAPIENTRY
6228 save_TexCoord1f(GLfloat x
)
6230 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6233 static void GLAPIENTRY
6234 save_TexCoord1fv(const GLfloat
* v
)
6236 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6239 static void GLAPIENTRY
6240 save_TexCoord2f(GLfloat x
, GLfloat y
)
6242 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6245 static void GLAPIENTRY
6246 save_TexCoord2fv(const GLfloat
* v
)
6248 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6251 static void GLAPIENTRY
6252 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6254 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6257 static void GLAPIENTRY
6258 save_TexCoord3fv(const GLfloat
* v
)
6260 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6263 static void GLAPIENTRY
6264 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6266 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6269 static void GLAPIENTRY
6270 save_TexCoord4fv(const GLfloat
* v
)
6272 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6275 static void GLAPIENTRY
6276 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6278 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6281 static void GLAPIENTRY
6282 save_Normal3fv(const GLfloat
* v
)
6284 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6287 static void GLAPIENTRY
6288 save_FogCoordfEXT(GLfloat x
)
6290 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6293 static void GLAPIENTRY
6294 save_FogCoordfvEXT(const GLfloat
* v
)
6296 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6299 static void GLAPIENTRY
6300 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6302 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6305 static void GLAPIENTRY
6306 save_Color3fv(const GLfloat
* v
)
6308 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6311 static void GLAPIENTRY
6312 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6314 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6317 static void GLAPIENTRY
6318 save_Color4fv(const GLfloat
* v
)
6320 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6323 static void GLAPIENTRY
6324 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6326 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6329 static void GLAPIENTRY
6330 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6332 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6336 /* Just call the respective ATTR for texcoord
6338 static void GLAPIENTRY
6339 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6341 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6342 save_Attr1fNV(attr
, x
);
6345 static void GLAPIENTRY
6346 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6348 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6349 save_Attr1fNV(attr
, v
[0]);
6352 static void GLAPIENTRY
6353 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6355 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6356 save_Attr2fNV(attr
, x
, y
);
6359 static void GLAPIENTRY
6360 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6362 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6363 save_Attr2fNV(attr
, v
[0], v
[1]);
6366 static void GLAPIENTRY
6367 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6369 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6370 save_Attr3fNV(attr
, x
, y
, z
);
6373 static void GLAPIENTRY
6374 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6376 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6377 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6380 static void GLAPIENTRY
6381 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6382 GLfloat z
, GLfloat w
)
6384 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6385 save_Attr4fNV(attr
, x
, y
, z
, w
);
6388 static void GLAPIENTRY
6389 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6391 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6392 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6397 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6403 GET_CURRENT_CONTEXT(ctx
);
6404 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6409 static void GLAPIENTRY
6410 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6412 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6413 save_Attr1fARB(index
, x
);
6418 static void GLAPIENTRY
6419 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6421 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6422 save_Attr1fARB(index
, v
[0]);
6427 static void GLAPIENTRY
6428 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6430 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6431 save_Attr2fARB(index
, x
, y
);
6436 static void GLAPIENTRY
6437 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6439 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6440 save_Attr2fARB(index
, v
[0], v
[1]);
6445 static void GLAPIENTRY
6446 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6448 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6449 save_Attr3fARB(index
, x
, y
, z
);
6454 static void GLAPIENTRY
6455 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6457 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6458 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6463 static void GLAPIENTRY
6464 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6467 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6468 save_Attr4fARB(index
, x
, y
, z
, w
);
6473 static void GLAPIENTRY
6474 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6476 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6477 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6482 static void GLAPIENTRY
6483 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6485 GET_CURRENT_CONTEXT(ctx
);
6487 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6489 SAVE_FLUSH_VERTICES(ctx
);
6490 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6493 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6496 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6497 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6499 if (ctx
->ExecuteFlag
) {
6500 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6507 static void GLAPIENTRY
6508 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6510 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6511 save_VertexAttribL1d(index
, v
[0]);
6516 static void GLAPIENTRY
6517 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6519 GET_CURRENT_CONTEXT(ctx
);
6521 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6523 SAVE_FLUSH_VERTICES(ctx
);
6524 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6527 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6528 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6531 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6532 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6533 2 * sizeof(GLdouble
));
6535 if (ctx
->ExecuteFlag
) {
6536 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6543 static void GLAPIENTRY
6544 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6546 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6547 save_VertexAttribL2d(index
, v
[0], v
[1]);
6552 static void GLAPIENTRY
6553 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6555 GET_CURRENT_CONTEXT(ctx
);
6557 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6559 SAVE_FLUSH_VERTICES(ctx
);
6560 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6563 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6564 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6565 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6568 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6569 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6570 3 * sizeof(GLdouble
));
6572 if (ctx
->ExecuteFlag
) {
6573 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6580 static void GLAPIENTRY
6581 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6583 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6584 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6589 static void GLAPIENTRY
6590 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6593 GET_CURRENT_CONTEXT(ctx
);
6595 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6597 SAVE_FLUSH_VERTICES(ctx
);
6598 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6601 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6602 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6603 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6604 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6607 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6608 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6609 4 * sizeof(GLdouble
));
6611 if (ctx
->ExecuteFlag
) {
6612 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6619 static void GLAPIENTRY
6620 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6622 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6623 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6628 static void GLAPIENTRY
6629 save_PrimitiveRestartNV(void)
6631 /* Note: this is used when outside a glBegin/End pair in a display list */
6632 GET_CURRENT_CONTEXT(ctx
);
6633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6634 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6635 if (ctx
->ExecuteFlag
) {
6636 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6641 static void GLAPIENTRY
6642 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6643 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6644 GLbitfield mask
, GLenum filter
)
6646 GET_CURRENT_CONTEXT(ctx
);
6648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6649 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6662 if (ctx
->ExecuteFlag
) {
6663 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6664 dstX0
, dstY0
, dstX1
, dstY1
,
6670 /** GL_EXT_provoking_vertex */
6671 static void GLAPIENTRY
6672 save_ProvokingVertexEXT(GLenum mode
)
6674 GET_CURRENT_CONTEXT(ctx
);
6676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6677 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6681 if (ctx
->ExecuteFlag
) {
6682 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6683 _mesa_ProvokingVertex(mode
);
6688 /** GL_EXT_transform_feedback */
6689 static void GLAPIENTRY
6690 save_BeginTransformFeedback(GLenum mode
)
6692 GET_CURRENT_CONTEXT(ctx
);
6694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6695 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6699 if (ctx
->ExecuteFlag
) {
6700 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6705 /** GL_EXT_transform_feedback */
6706 static void GLAPIENTRY
6707 save_EndTransformFeedback(void)
6709 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6712 if (ctx
->ExecuteFlag
) {
6713 CALL_EndTransformFeedback(ctx
->Exec
, ());
6717 static void GLAPIENTRY
6718 save_BindTransformFeedback(GLenum target
, GLuint name
)
6720 GET_CURRENT_CONTEXT(ctx
);
6722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6723 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6728 if (ctx
->ExecuteFlag
) {
6729 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6733 static void GLAPIENTRY
6734 save_PauseTransformFeedback(void)
6736 GET_CURRENT_CONTEXT(ctx
);
6737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6738 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6739 if (ctx
->ExecuteFlag
) {
6740 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6744 static void GLAPIENTRY
6745 save_ResumeTransformFeedback(void)
6747 GET_CURRENT_CONTEXT(ctx
);
6748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6749 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6750 if (ctx
->ExecuteFlag
) {
6751 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6755 static void GLAPIENTRY
6756 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6758 GET_CURRENT_CONTEXT(ctx
);
6760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6761 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6766 if (ctx
->ExecuteFlag
) {
6767 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6771 static void GLAPIENTRY
6772 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6774 GET_CURRENT_CONTEXT(ctx
);
6776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6777 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6783 if (ctx
->ExecuteFlag
) {
6784 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6788 static void GLAPIENTRY
6789 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6792 GET_CURRENT_CONTEXT(ctx
);
6794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6795 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6799 n
[3].si
= primcount
;
6801 if (ctx
->ExecuteFlag
) {
6802 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6806 static void GLAPIENTRY
6807 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6808 GLuint stream
, GLsizei primcount
)
6810 GET_CURRENT_CONTEXT(ctx
);
6812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6813 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6818 n
[4].si
= primcount
;
6820 if (ctx
->ExecuteFlag
) {
6821 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6826 static void GLAPIENTRY
6827 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6828 GLuint num_groups_z
)
6830 GET_CURRENT_CONTEXT(ctx
);
6832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6833 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6835 n
[1].ui
= num_groups_x
;
6836 n
[2].ui
= num_groups_y
;
6837 n
[3].ui
= num_groups_z
;
6839 if (ctx
->ExecuteFlag
) {
6840 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6845 static void GLAPIENTRY
6846 save_DispatchComputeIndirect(GLintptr indirect
)
6848 GET_CURRENT_CONTEXT(ctx
);
6849 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6850 "glDispatchComputeIndirect() during display list compile");
6853 static void GLAPIENTRY
6854 save_UseProgram(GLuint program
)
6856 GET_CURRENT_CONTEXT(ctx
);
6858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6859 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6863 if (ctx
->ExecuteFlag
) {
6864 CALL_UseProgram(ctx
->Exec
, (program
));
6869 static void GLAPIENTRY
6870 save_Uniform1fARB(GLint location
, GLfloat x
)
6872 GET_CURRENT_CONTEXT(ctx
);
6874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6875 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6880 if (ctx
->ExecuteFlag
) {
6881 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6886 static void GLAPIENTRY
6887 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6889 GET_CURRENT_CONTEXT(ctx
);
6891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6892 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6898 if (ctx
->ExecuteFlag
) {
6899 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6904 static void GLAPIENTRY
6905 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6907 GET_CURRENT_CONTEXT(ctx
);
6909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6910 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6917 if (ctx
->ExecuteFlag
) {
6918 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6923 static void GLAPIENTRY
6924 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6926 GET_CURRENT_CONTEXT(ctx
);
6928 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6929 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6937 if (ctx
->ExecuteFlag
) {
6938 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6943 static void GLAPIENTRY
6944 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6946 GET_CURRENT_CONTEXT(ctx
);
6948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6949 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6953 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6955 if (ctx
->ExecuteFlag
) {
6956 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6960 static void GLAPIENTRY
6961 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6963 GET_CURRENT_CONTEXT(ctx
);
6965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6966 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6970 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6972 if (ctx
->ExecuteFlag
) {
6973 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6977 static void GLAPIENTRY
6978 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6980 GET_CURRENT_CONTEXT(ctx
);
6982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6983 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6987 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6989 if (ctx
->ExecuteFlag
) {
6990 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6994 static void GLAPIENTRY
6995 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6997 GET_CURRENT_CONTEXT(ctx
);
6999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7000 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7004 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7006 if (ctx
->ExecuteFlag
) {
7007 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7012 static void GLAPIENTRY
7013 save_Uniform1d(GLint location
, GLdouble x
)
7015 GET_CURRENT_CONTEXT(ctx
);
7017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7018 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7021 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7023 if (ctx
->ExecuteFlag
) {
7024 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7029 static void GLAPIENTRY
7030 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7032 GET_CURRENT_CONTEXT(ctx
);
7034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7035 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7038 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7039 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7041 if (ctx
->ExecuteFlag
) {
7042 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7047 static void GLAPIENTRY
7048 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7050 GET_CURRENT_CONTEXT(ctx
);
7052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7053 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7056 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7057 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7058 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7060 if (ctx
->ExecuteFlag
) {
7061 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7066 static void GLAPIENTRY
7067 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7069 GET_CURRENT_CONTEXT(ctx
);
7071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7072 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7075 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7076 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7077 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7078 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7080 if (ctx
->ExecuteFlag
) {
7081 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7086 static void GLAPIENTRY
7087 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7089 GET_CURRENT_CONTEXT(ctx
);
7091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7092 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7096 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7098 if (ctx
->ExecuteFlag
) {
7099 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7104 static void GLAPIENTRY
7105 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7107 GET_CURRENT_CONTEXT(ctx
);
7109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7110 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7114 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7116 if (ctx
->ExecuteFlag
) {
7117 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7122 static void GLAPIENTRY
7123 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7125 GET_CURRENT_CONTEXT(ctx
);
7127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7128 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7132 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7134 if (ctx
->ExecuteFlag
) {
7135 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7140 static void GLAPIENTRY
7141 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7143 GET_CURRENT_CONTEXT(ctx
);
7145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7146 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7150 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7152 if (ctx
->ExecuteFlag
) {
7153 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7158 static void GLAPIENTRY
7159 save_Uniform1iARB(GLint location
, GLint x
)
7161 GET_CURRENT_CONTEXT(ctx
);
7163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7164 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7169 if (ctx
->ExecuteFlag
) {
7170 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7174 static void GLAPIENTRY
7175 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7177 GET_CURRENT_CONTEXT(ctx
);
7179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7180 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7186 if (ctx
->ExecuteFlag
) {
7187 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7191 static void GLAPIENTRY
7192 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7194 GET_CURRENT_CONTEXT(ctx
);
7196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7197 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7204 if (ctx
->ExecuteFlag
) {
7205 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7209 static void GLAPIENTRY
7210 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7212 GET_CURRENT_CONTEXT(ctx
);
7214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7215 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7223 if (ctx
->ExecuteFlag
) {
7224 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7230 static void GLAPIENTRY
7231 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7233 GET_CURRENT_CONTEXT(ctx
);
7235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7236 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7240 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7242 if (ctx
->ExecuteFlag
) {
7243 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7247 static void GLAPIENTRY
7248 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7250 GET_CURRENT_CONTEXT(ctx
);
7252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7253 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7257 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7259 if (ctx
->ExecuteFlag
) {
7260 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7264 static void GLAPIENTRY
7265 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7267 GET_CURRENT_CONTEXT(ctx
);
7269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7270 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7274 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7276 if (ctx
->ExecuteFlag
) {
7277 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7281 static void GLAPIENTRY
7282 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7284 GET_CURRENT_CONTEXT(ctx
);
7286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7287 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7291 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7293 if (ctx
->ExecuteFlag
) {
7294 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7300 static void GLAPIENTRY
7301 save_Uniform1ui(GLint location
, GLuint x
)
7303 GET_CURRENT_CONTEXT(ctx
);
7305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7306 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7311 if (ctx
->ExecuteFlag
) {
7312 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7316 static void GLAPIENTRY
7317 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7319 GET_CURRENT_CONTEXT(ctx
);
7321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7322 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7328 if (ctx
->ExecuteFlag
) {
7329 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7333 static void GLAPIENTRY
7334 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7336 GET_CURRENT_CONTEXT(ctx
);
7338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7339 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7346 if (ctx
->ExecuteFlag
) {
7347 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7351 static void GLAPIENTRY
7352 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7354 GET_CURRENT_CONTEXT(ctx
);
7356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7357 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7365 if (ctx
->ExecuteFlag
) {
7366 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7372 static void GLAPIENTRY
7373 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7375 GET_CURRENT_CONTEXT(ctx
);
7377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7378 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7382 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7384 if (ctx
->ExecuteFlag
) {
7385 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7389 static void GLAPIENTRY
7390 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7392 GET_CURRENT_CONTEXT(ctx
);
7394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7395 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7399 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7401 if (ctx
->ExecuteFlag
) {
7402 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7406 static void GLAPIENTRY
7407 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7409 GET_CURRENT_CONTEXT(ctx
);
7411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7412 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7416 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7418 if (ctx
->ExecuteFlag
) {
7419 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7423 static void GLAPIENTRY
7424 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7426 GET_CURRENT_CONTEXT(ctx
);
7428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7429 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7433 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7435 if (ctx
->ExecuteFlag
) {
7436 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7442 static void GLAPIENTRY
7443 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7446 GET_CURRENT_CONTEXT(ctx
);
7448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7449 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7454 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7456 if (ctx
->ExecuteFlag
) {
7457 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7461 static void GLAPIENTRY
7462 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7465 GET_CURRENT_CONTEXT(ctx
);
7467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7468 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7473 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7475 if (ctx
->ExecuteFlag
) {
7476 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7480 static void GLAPIENTRY
7481 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7484 GET_CURRENT_CONTEXT(ctx
);
7486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7487 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7492 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7494 if (ctx
->ExecuteFlag
) {
7495 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7500 static void GLAPIENTRY
7501 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7504 GET_CURRENT_CONTEXT(ctx
);
7506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7507 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7512 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7514 if (ctx
->ExecuteFlag
) {
7515 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7519 static void GLAPIENTRY
7520 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7523 GET_CURRENT_CONTEXT(ctx
);
7525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7531 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7533 if (ctx
->ExecuteFlag
) {
7534 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7539 static void GLAPIENTRY
7540 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7543 GET_CURRENT_CONTEXT(ctx
);
7545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7546 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7551 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7553 if (ctx
->ExecuteFlag
) {
7554 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7558 static void GLAPIENTRY
7559 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7562 GET_CURRENT_CONTEXT(ctx
);
7564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7565 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7570 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7572 if (ctx
->ExecuteFlag
) {
7573 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7578 static void GLAPIENTRY
7579 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7582 GET_CURRENT_CONTEXT(ctx
);
7584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7585 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7590 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7592 if (ctx
->ExecuteFlag
) {
7593 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7597 static void GLAPIENTRY
7598 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7601 GET_CURRENT_CONTEXT(ctx
);
7603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7604 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7609 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7611 if (ctx
->ExecuteFlag
) {
7612 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7617 static void GLAPIENTRY
7618 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7621 GET_CURRENT_CONTEXT(ctx
);
7623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7624 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7629 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7631 if (ctx
->ExecuteFlag
) {
7632 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7636 static void GLAPIENTRY
7637 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7640 GET_CURRENT_CONTEXT(ctx
);
7642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7643 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7648 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7650 if (ctx
->ExecuteFlag
) {
7651 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7655 static void GLAPIENTRY
7656 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7659 GET_CURRENT_CONTEXT(ctx
);
7661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7662 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7667 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7669 if (ctx
->ExecuteFlag
) {
7670 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7675 static void GLAPIENTRY
7676 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7679 GET_CURRENT_CONTEXT(ctx
);
7681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7682 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7687 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7689 if (ctx
->ExecuteFlag
) {
7690 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7695 static void GLAPIENTRY
7696 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7699 GET_CURRENT_CONTEXT(ctx
);
7701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7702 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7707 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7709 if (ctx
->ExecuteFlag
) {
7710 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7715 static void GLAPIENTRY
7716 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7719 GET_CURRENT_CONTEXT(ctx
);
7721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7722 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7727 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7729 if (ctx
->ExecuteFlag
) {
7730 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7734 static void GLAPIENTRY
7735 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7738 GET_CURRENT_CONTEXT(ctx
);
7740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7741 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7746 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7748 if (ctx
->ExecuteFlag
) {
7749 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7754 static void GLAPIENTRY
7755 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7758 GET_CURRENT_CONTEXT(ctx
);
7760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7761 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7766 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7768 if (ctx
->ExecuteFlag
) {
7769 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7774 static void GLAPIENTRY
7775 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7778 GET_CURRENT_CONTEXT(ctx
);
7780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7781 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7786 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7788 if (ctx
->ExecuteFlag
) {
7789 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7794 static void GLAPIENTRY
7795 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7797 GET_CURRENT_CONTEXT(ctx
);
7799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7800 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7806 if (ctx
->ExecuteFlag
) {
7807 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7811 static void GLAPIENTRY
7812 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7814 GET_CURRENT_CONTEXT(ctx
);
7816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7817 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7823 if (ctx
->ExecuteFlag
) {
7824 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7828 static void GLAPIENTRY
7829 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7831 GET_CURRENT_CONTEXT(ctx
);
7833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7834 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7841 if (ctx
->ExecuteFlag
) {
7842 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7846 static void GLAPIENTRY
7847 save_ProgramUniform3f(GLuint program
, GLint location
,
7848 GLfloat x
, GLfloat y
, GLfloat z
)
7850 GET_CURRENT_CONTEXT(ctx
);
7852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7853 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7861 if (ctx
->ExecuteFlag
) {
7862 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7866 static void GLAPIENTRY
7867 save_ProgramUniform4f(GLuint program
, GLint location
,
7868 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7870 GET_CURRENT_CONTEXT(ctx
);
7872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7873 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7882 if (ctx
->ExecuteFlag
) {
7883 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7887 static void GLAPIENTRY
7888 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7891 GET_CURRENT_CONTEXT(ctx
);
7893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7894 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7899 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7901 if (ctx
->ExecuteFlag
) {
7902 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7906 static void GLAPIENTRY
7907 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7910 GET_CURRENT_CONTEXT(ctx
);
7912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7913 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7918 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7920 if (ctx
->ExecuteFlag
) {
7921 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7925 static void GLAPIENTRY
7926 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7929 GET_CURRENT_CONTEXT(ctx
);
7931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7932 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7937 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7939 if (ctx
->ExecuteFlag
) {
7940 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7944 static void GLAPIENTRY
7945 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7948 GET_CURRENT_CONTEXT(ctx
);
7950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7951 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7956 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7958 if (ctx
->ExecuteFlag
) {
7959 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7963 static void GLAPIENTRY
7964 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7966 GET_CURRENT_CONTEXT(ctx
);
7968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7969 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7973 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7975 if (ctx
->ExecuteFlag
) {
7976 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7980 static void GLAPIENTRY
7981 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7983 GET_CURRENT_CONTEXT(ctx
);
7985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7986 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7990 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7991 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7993 if (ctx
->ExecuteFlag
) {
7994 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7998 static void GLAPIENTRY
7999 save_ProgramUniform3d(GLuint program
, GLint location
,
8000 GLdouble x
, GLdouble y
, GLdouble z
)
8002 GET_CURRENT_CONTEXT(ctx
);
8004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8005 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8009 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8010 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8011 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8013 if (ctx
->ExecuteFlag
) {
8014 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8018 static void GLAPIENTRY
8019 save_ProgramUniform4d(GLuint program
, GLint location
,
8020 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8022 GET_CURRENT_CONTEXT(ctx
);
8024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8025 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8029 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8030 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8031 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8032 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8034 if (ctx
->ExecuteFlag
) {
8035 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8039 static void GLAPIENTRY
8040 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8043 GET_CURRENT_CONTEXT(ctx
);
8045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8046 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8051 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8053 if (ctx
->ExecuteFlag
) {
8054 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8058 static void GLAPIENTRY
8059 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8062 GET_CURRENT_CONTEXT(ctx
);
8064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8065 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8070 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8072 if (ctx
->ExecuteFlag
) {
8073 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8077 static void GLAPIENTRY
8078 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8081 GET_CURRENT_CONTEXT(ctx
);
8083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8084 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8089 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8091 if (ctx
->ExecuteFlag
) {
8092 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8096 static void GLAPIENTRY
8097 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8100 GET_CURRENT_CONTEXT(ctx
);
8102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8103 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8108 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8110 if (ctx
->ExecuteFlag
) {
8111 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8115 static void GLAPIENTRY
8116 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8118 GET_CURRENT_CONTEXT(ctx
);
8120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8121 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8127 if (ctx
->ExecuteFlag
) {
8128 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8132 static void GLAPIENTRY
8133 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8135 GET_CURRENT_CONTEXT(ctx
);
8137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8138 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8145 if (ctx
->ExecuteFlag
) {
8146 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8150 static void GLAPIENTRY
8151 save_ProgramUniform3i(GLuint program
, GLint location
,
8152 GLint x
, GLint y
, GLint z
)
8154 GET_CURRENT_CONTEXT(ctx
);
8156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8157 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8165 if (ctx
->ExecuteFlag
) {
8166 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8170 static void GLAPIENTRY
8171 save_ProgramUniform4i(GLuint program
, GLint location
,
8172 GLint x
, GLint y
, GLint z
, GLint w
)
8174 GET_CURRENT_CONTEXT(ctx
);
8176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8177 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8186 if (ctx
->ExecuteFlag
) {
8187 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8191 static void GLAPIENTRY
8192 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8195 GET_CURRENT_CONTEXT(ctx
);
8197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8198 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8203 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8205 if (ctx
->ExecuteFlag
) {
8206 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8210 static void GLAPIENTRY
8211 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8214 GET_CURRENT_CONTEXT(ctx
);
8216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8217 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8222 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8224 if (ctx
->ExecuteFlag
) {
8225 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8229 static void GLAPIENTRY
8230 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8233 GET_CURRENT_CONTEXT(ctx
);
8235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8236 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8241 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8243 if (ctx
->ExecuteFlag
) {
8244 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8248 static void GLAPIENTRY
8249 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8252 GET_CURRENT_CONTEXT(ctx
);
8254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8255 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8260 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8262 if (ctx
->ExecuteFlag
) {
8263 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8267 static void GLAPIENTRY
8268 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8270 GET_CURRENT_CONTEXT(ctx
);
8272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8273 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8279 if (ctx
->ExecuteFlag
) {
8280 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8284 static void GLAPIENTRY
8285 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8287 GET_CURRENT_CONTEXT(ctx
);
8289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8290 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8297 if (ctx
->ExecuteFlag
) {
8298 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8302 static void GLAPIENTRY
8303 save_ProgramUniform3ui(GLuint program
, GLint location
,
8304 GLuint x
, GLuint y
, GLuint z
)
8306 GET_CURRENT_CONTEXT(ctx
);
8308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8309 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8317 if (ctx
->ExecuteFlag
) {
8318 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8322 static void GLAPIENTRY
8323 save_ProgramUniform4ui(GLuint program
, GLint location
,
8324 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8326 GET_CURRENT_CONTEXT(ctx
);
8328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8329 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8338 if (ctx
->ExecuteFlag
) {
8339 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8343 static void GLAPIENTRY
8344 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8347 GET_CURRENT_CONTEXT(ctx
);
8349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8350 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8355 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8357 if (ctx
->ExecuteFlag
) {
8358 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8362 static void GLAPIENTRY
8363 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8366 GET_CURRENT_CONTEXT(ctx
);
8368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8369 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8374 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8376 if (ctx
->ExecuteFlag
) {
8377 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8381 static void GLAPIENTRY
8382 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8385 GET_CURRENT_CONTEXT(ctx
);
8387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8388 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8393 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8395 if (ctx
->ExecuteFlag
) {
8396 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8400 static void GLAPIENTRY
8401 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8404 GET_CURRENT_CONTEXT(ctx
);
8406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8407 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8412 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8414 if (ctx
->ExecuteFlag
) {
8415 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8419 static void GLAPIENTRY
8420 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8421 GLboolean transpose
, const GLfloat
*v
)
8423 GET_CURRENT_CONTEXT(ctx
);
8425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8426 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8427 4 + POINTER_DWORDS
);
8433 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8435 if (ctx
->ExecuteFlag
) {
8436 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8437 (program
, location
, count
, transpose
, v
));
8441 static void GLAPIENTRY
8442 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8443 GLboolean transpose
, const GLfloat
*v
)
8445 GET_CURRENT_CONTEXT(ctx
);
8447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8448 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8449 4 + POINTER_DWORDS
);
8455 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8457 if (ctx
->ExecuteFlag
) {
8458 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8459 (program
, location
, count
, transpose
, v
));
8463 static void GLAPIENTRY
8464 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8465 GLboolean transpose
, const GLfloat
*v
)
8467 GET_CURRENT_CONTEXT(ctx
);
8469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8470 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8471 4 + POINTER_DWORDS
);
8477 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8479 if (ctx
->ExecuteFlag
) {
8480 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8481 (program
, location
, count
, transpose
, v
));
8485 static void GLAPIENTRY
8486 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8487 GLboolean transpose
, const GLfloat
*v
)
8489 GET_CURRENT_CONTEXT(ctx
);
8491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8492 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8493 4 + POINTER_DWORDS
);
8499 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8501 if (ctx
->ExecuteFlag
) {
8502 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8503 (program
, location
, count
, transpose
, v
));
8507 static void GLAPIENTRY
8508 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8509 GLboolean transpose
, const GLfloat
*v
)
8511 GET_CURRENT_CONTEXT(ctx
);
8513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8514 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8515 4 + POINTER_DWORDS
);
8521 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8523 if (ctx
->ExecuteFlag
) {
8524 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8525 (program
, location
, count
, transpose
, v
));
8529 static void GLAPIENTRY
8530 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8531 GLboolean transpose
, const GLfloat
*v
)
8533 GET_CURRENT_CONTEXT(ctx
);
8535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8536 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8537 4 + POINTER_DWORDS
);
8543 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8545 if (ctx
->ExecuteFlag
) {
8546 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8547 (program
, location
, count
, transpose
, v
));
8551 static void GLAPIENTRY
8552 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8553 GLboolean transpose
, const GLfloat
*v
)
8555 GET_CURRENT_CONTEXT(ctx
);
8557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8558 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8559 4 + POINTER_DWORDS
);
8565 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8567 if (ctx
->ExecuteFlag
) {
8568 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8569 (program
, location
, count
, transpose
, v
));
8573 static void GLAPIENTRY
8574 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8575 GLboolean transpose
, const GLfloat
*v
)
8577 GET_CURRENT_CONTEXT(ctx
);
8579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8580 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8581 4 + POINTER_DWORDS
);
8587 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8589 if (ctx
->ExecuteFlag
) {
8590 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8591 (program
, location
, count
, transpose
, v
));
8595 static void GLAPIENTRY
8596 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8597 GLboolean transpose
, const GLfloat
*v
)
8599 GET_CURRENT_CONTEXT(ctx
);
8601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8602 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8603 4 + POINTER_DWORDS
);
8609 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8611 if (ctx
->ExecuteFlag
) {
8612 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8613 (program
, location
, count
, transpose
, v
));
8617 static void GLAPIENTRY
8618 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8619 GLboolean transpose
, const GLdouble
*v
)
8621 GET_CURRENT_CONTEXT(ctx
);
8623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8624 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8625 4 + POINTER_DWORDS
);
8631 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8633 if (ctx
->ExecuteFlag
) {
8634 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8635 (program
, location
, count
, transpose
, v
));
8639 static void GLAPIENTRY
8640 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8641 GLboolean transpose
, const GLdouble
*v
)
8643 GET_CURRENT_CONTEXT(ctx
);
8645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8646 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8647 4 + POINTER_DWORDS
);
8653 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8655 if (ctx
->ExecuteFlag
) {
8656 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8657 (program
, location
, count
, transpose
, v
));
8661 static void GLAPIENTRY
8662 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8663 GLboolean transpose
, const GLdouble
*v
)
8665 GET_CURRENT_CONTEXT(ctx
);
8667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8668 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8669 4 + POINTER_DWORDS
);
8675 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8677 if (ctx
->ExecuteFlag
) {
8678 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8679 (program
, location
, count
, transpose
, v
));
8683 static void GLAPIENTRY
8684 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8685 GLboolean transpose
, const GLdouble
*v
)
8687 GET_CURRENT_CONTEXT(ctx
);
8689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8690 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8691 4 + POINTER_DWORDS
);
8697 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8699 if (ctx
->ExecuteFlag
) {
8700 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8701 (program
, location
, count
, transpose
, v
));
8705 static void GLAPIENTRY
8706 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8707 GLboolean transpose
, const GLdouble
*v
)
8709 GET_CURRENT_CONTEXT(ctx
);
8711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8712 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8713 4 + POINTER_DWORDS
);
8719 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8721 if (ctx
->ExecuteFlag
) {
8722 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8723 (program
, location
, count
, transpose
, v
));
8727 static void GLAPIENTRY
8728 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8729 GLboolean transpose
, const GLdouble
*v
)
8731 GET_CURRENT_CONTEXT(ctx
);
8733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8734 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8735 4 + POINTER_DWORDS
);
8741 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8743 if (ctx
->ExecuteFlag
) {
8744 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8745 (program
, location
, count
, transpose
, v
));
8749 static void GLAPIENTRY
8750 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8751 GLboolean transpose
, const GLdouble
*v
)
8753 GET_CURRENT_CONTEXT(ctx
);
8755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8756 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8757 4 + POINTER_DWORDS
);
8763 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8765 if (ctx
->ExecuteFlag
) {
8766 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8767 (program
, location
, count
, transpose
, v
));
8771 static void GLAPIENTRY
8772 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8773 GLboolean transpose
, const GLdouble
*v
)
8775 GET_CURRENT_CONTEXT(ctx
);
8777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8778 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8779 4 + POINTER_DWORDS
);
8785 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8787 if (ctx
->ExecuteFlag
) {
8788 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8789 (program
, location
, count
, transpose
, v
));
8793 static void GLAPIENTRY
8794 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8795 GLboolean transpose
, const GLdouble
*v
)
8797 GET_CURRENT_CONTEXT(ctx
);
8799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8800 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8801 4 + POINTER_DWORDS
);
8807 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8809 if (ctx
->ExecuteFlag
) {
8810 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8811 (program
, location
, count
, transpose
, v
));
8815 static void GLAPIENTRY
8816 save_ClipControl(GLenum origin
, GLenum depth
)
8818 GET_CURRENT_CONTEXT(ctx
);
8820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8821 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8826 if (ctx
->ExecuteFlag
) {
8827 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8831 static void GLAPIENTRY
8832 save_ClampColorARB(GLenum target
, GLenum clamp
)
8834 GET_CURRENT_CONTEXT(ctx
);
8836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8837 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8842 if (ctx
->ExecuteFlag
) {
8843 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8847 /** GL_EXT_texture_integer */
8848 static void GLAPIENTRY
8849 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8851 GET_CURRENT_CONTEXT(ctx
);
8853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8854 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8861 if (ctx
->ExecuteFlag
) {
8862 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8866 /** GL_EXT_texture_integer */
8867 static void GLAPIENTRY
8868 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8870 GET_CURRENT_CONTEXT(ctx
);
8872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8873 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8880 if (ctx
->ExecuteFlag
) {
8881 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8885 /** GL_EXT_texture_integer */
8886 static void GLAPIENTRY
8887 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8889 GET_CURRENT_CONTEXT(ctx
);
8891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8892 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8901 if (ctx
->ExecuteFlag
) {
8902 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8906 /** GL_EXT_texture_integer */
8907 static void GLAPIENTRY
8908 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8910 GET_CURRENT_CONTEXT(ctx
);
8912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8913 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8917 n
[3].ui
= params
[0];
8918 n
[4].ui
= params
[1];
8919 n
[5].ui
= params
[2];
8920 n
[6].ui
= params
[3];
8922 if (ctx
->ExecuteFlag
) {
8923 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8927 /* GL_ARB_instanced_arrays */
8928 static void GLAPIENTRY
8929 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8931 GET_CURRENT_CONTEXT(ctx
);
8933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8934 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8939 if (ctx
->ExecuteFlag
) {
8940 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8945 /* GL_NV_texture_barrier */
8946 static void GLAPIENTRY
8947 save_TextureBarrierNV(void)
8949 GET_CURRENT_CONTEXT(ctx
);
8950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8951 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8952 if (ctx
->ExecuteFlag
) {
8953 CALL_TextureBarrierNV(ctx
->Exec
, ());
8958 /* GL_ARB_sampler_objects */
8959 static void GLAPIENTRY
8960 save_BindSampler(GLuint unit
, GLuint sampler
)
8963 GET_CURRENT_CONTEXT(ctx
);
8964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8965 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8970 if (ctx
->ExecuteFlag
) {
8971 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8975 static void GLAPIENTRY
8976 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8979 GET_CURRENT_CONTEXT(ctx
);
8980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8981 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8986 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8992 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8995 if (ctx
->ExecuteFlag
) {
8996 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9000 static void GLAPIENTRY
9001 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9005 parray
[1] = parray
[2] = parray
[3] = 0;
9006 save_SamplerParameteriv(sampler
, pname
, parray
);
9009 static void GLAPIENTRY
9010 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9013 GET_CURRENT_CONTEXT(ctx
);
9014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9015 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9020 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9026 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9029 if (ctx
->ExecuteFlag
) {
9030 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9034 static void GLAPIENTRY
9035 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9039 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9040 save_SamplerParameterfv(sampler
, pname
, parray
);
9043 static void GLAPIENTRY
9044 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9047 GET_CURRENT_CONTEXT(ctx
);
9048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9049 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9054 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9060 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9063 if (ctx
->ExecuteFlag
) {
9064 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9068 static void GLAPIENTRY
9069 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9072 GET_CURRENT_CONTEXT(ctx
);
9073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9074 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9078 n
[3].ui
= params
[0];
9079 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9080 n
[4].ui
= params
[1];
9081 n
[5].ui
= params
[2];
9082 n
[6].ui
= params
[3];
9085 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9088 if (ctx
->ExecuteFlag
) {
9089 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9093 static void GLAPIENTRY
9094 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9097 GET_CURRENT_CONTEXT(ctx
);
9098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9099 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9101 union uint64_pair p
;
9104 n
[2].ui
= p
.uint32
[0];
9105 n
[3].ui
= p
.uint32
[1];
9106 save_pointer(&n
[4], sync
);
9108 if (ctx
->ExecuteFlag
) {
9109 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9114 /** GL_NV_conditional_render */
9115 static void GLAPIENTRY
9116 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9118 GET_CURRENT_CONTEXT(ctx
);
9120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9121 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9126 if (ctx
->ExecuteFlag
) {
9127 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9131 static void GLAPIENTRY
9132 save_EndConditionalRender(void)
9134 GET_CURRENT_CONTEXT(ctx
);
9135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9136 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9137 if (ctx
->ExecuteFlag
) {
9138 CALL_EndConditionalRender(ctx
->Exec
, ());
9142 static void GLAPIENTRY
9143 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9145 GET_CURRENT_CONTEXT(ctx
);
9147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9148 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9154 if (ctx
->ExecuteFlag
) {
9155 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9159 static void GLAPIENTRY
9160 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9161 const GLuint
*indices
)
9163 GET_CURRENT_CONTEXT(ctx
);
9165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9166 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9168 GLint
*indices_copy
= NULL
;
9171 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9172 n
[1].e
= shadertype
;
9174 save_pointer(&n
[3], indices_copy
);
9176 if (ctx
->ExecuteFlag
) {
9177 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9181 /** GL_EXT_window_rectangles */
9182 static void GLAPIENTRY
9183 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9185 GET_CURRENT_CONTEXT(ctx
);
9187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9188 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9190 GLint
*box_copy
= NULL
;
9193 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9196 save_pointer(&n
[3], box_copy
);
9198 if (ctx
->ExecuteFlag
) {
9199 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9204 /** GL_NV_conservative_raster */
9205 static void GLAPIENTRY
9206 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9208 GET_CURRENT_CONTEXT(ctx
);
9210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9211 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9216 if (ctx
->ExecuteFlag
) {
9217 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9221 /** GL_NV_conservative_raster_dilate */
9222 static void GLAPIENTRY
9223 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9225 GET_CURRENT_CONTEXT(ctx
);
9227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9228 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9233 if (ctx
->ExecuteFlag
) {
9234 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9238 /** GL_NV_conservative_raster_pre_snap_triangles */
9239 static void GLAPIENTRY
9240 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9242 GET_CURRENT_CONTEXT(ctx
);
9244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9245 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9250 if (ctx
->ExecuteFlag
) {
9251 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9255 /** GL_EXT_direct_state_access */
9257 static void GLAPIENTRY
9258 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9260 GET_CURRENT_CONTEXT(ctx
);
9262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9263 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9265 n
[1].e
= matrixMode
;
9266 for (unsigned i
= 0; i
< 16; i
++) {
9270 if (ctx
->ExecuteFlag
) {
9271 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9275 static void GLAPIENTRY
9276 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9279 for (unsigned i
= 0; i
< 16; i
++) {
9280 f
[i
] = (GLfloat
) m
[i
];
9282 save_MatrixLoadfEXT(matrixMode
, f
);
9285 static void GLAPIENTRY
9286 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9288 GET_CURRENT_CONTEXT(ctx
);
9290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9291 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9293 n
[1].e
= matrixMode
;
9294 for (unsigned i
= 0; i
< 16; i
++) {
9298 if (ctx
->ExecuteFlag
) {
9299 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9303 static void GLAPIENTRY
9304 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9307 for (unsigned i
= 0; i
< 16; i
++) {
9308 f
[i
] = (GLfloat
) m
[i
];
9310 save_MatrixMultfEXT(matrixMode
, f
);
9313 static void GLAPIENTRY
9314 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9316 GET_CURRENT_CONTEXT(ctx
);
9318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9319 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9321 n
[1].e
= matrixMode
;
9327 if (ctx
->ExecuteFlag
) {
9328 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9332 static void GLAPIENTRY
9333 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9335 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9338 static void GLAPIENTRY
9339 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9341 GET_CURRENT_CONTEXT(ctx
);
9343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9344 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9346 n
[1].e
= matrixMode
;
9351 if (ctx
->ExecuteFlag
) {
9352 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9356 static void GLAPIENTRY
9357 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9359 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9362 static void GLAPIENTRY
9363 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9365 GET_CURRENT_CONTEXT(ctx
);
9367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9368 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9370 n
[1].e
= matrixMode
;
9375 if (ctx
->ExecuteFlag
) {
9376 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9380 static void GLAPIENTRY
9381 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9383 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9386 static void GLAPIENTRY
9387 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9389 GET_CURRENT_CONTEXT(ctx
);
9391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9392 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9394 n
[1].e
= matrixMode
;
9396 if (ctx
->ExecuteFlag
) {
9397 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9401 static void GLAPIENTRY
9402 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9403 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9405 GET_CURRENT_CONTEXT(ctx
);
9407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9408 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9410 n
[1].e
= matrixMode
;
9411 n
[2].f
= (GLfloat
) left
;
9412 n
[3].f
= (GLfloat
) right
;
9413 n
[4].f
= (GLfloat
) bottom
;
9414 n
[5].f
= (GLfloat
) top
;
9415 n
[6].f
= (GLfloat
) nearval
;
9416 n
[7].f
= (GLfloat
) farval
;
9418 if (ctx
->ExecuteFlag
) {
9419 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9424 static void GLAPIENTRY
9425 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9426 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9428 GET_CURRENT_CONTEXT(ctx
);
9430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9431 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9433 n
[1].e
= matrixMode
;
9434 n
[2].f
= (GLfloat
) left
;
9435 n
[3].f
= (GLfloat
) right
;
9436 n
[4].f
= (GLfloat
) bottom
;
9437 n
[5].f
= (GLfloat
) top
;
9438 n
[6].f
= (GLfloat
) nearval
;
9439 n
[7].f
= (GLfloat
) farval
;
9441 if (ctx
->ExecuteFlag
) {
9442 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9446 static void GLAPIENTRY
9447 save_MatrixPushEXT(GLenum matrixMode
)
9449 GET_CURRENT_CONTEXT(ctx
);
9451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9452 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9454 n
[1].e
= matrixMode
;
9456 if (ctx
->ExecuteFlag
) {
9457 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9461 static void GLAPIENTRY
9462 save_MatrixPopEXT(GLenum matrixMode
)
9464 GET_CURRENT_CONTEXT(ctx
);
9466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9467 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9469 n
[1].e
= matrixMode
;
9471 if (ctx
->ExecuteFlag
) {
9472 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9476 static void GLAPIENTRY
9477 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9480 _math_transposef(tm
, m
);
9481 save_MatrixLoadfEXT(matrixMode
, tm
);
9484 static void GLAPIENTRY
9485 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9488 _math_transposefd(tm
, m
);
9489 save_MatrixLoadfEXT(matrixMode
, tm
);
9492 static void GLAPIENTRY
9493 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9496 _math_transposef(tm
, m
);
9497 save_MatrixMultfEXT(matrixMode
, tm
);
9500 static void GLAPIENTRY
9501 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9504 _math_transposefd(tm
, m
);
9505 save_MatrixMultfEXT(matrixMode
, tm
);
9508 static void GLAPIENTRY
9509 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9510 const GLfloat
*params
)
9512 GET_CURRENT_CONTEXT(ctx
);
9514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9515 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9525 if (ctx
->ExecuteFlag
) {
9526 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9531 static void GLAPIENTRY
9532 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9536 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9537 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9540 static void GLAPIENTRY
9541 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9543 GET_CURRENT_CONTEXT(ctx
);
9545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9546 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9556 if (ctx
->ExecuteFlag
) {
9557 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9561 static void GLAPIENTRY
9562 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9566 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9567 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9570 static void GLAPIENTRY
9571 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9572 GLint level
, GLint components
,
9573 GLsizei width
, GLint border
,
9574 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9576 GET_CURRENT_CONTEXT(ctx
);
9577 if (target
== GL_PROXY_TEXTURE_1D
) {
9578 /* don't compile, execute immediately */
9579 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9580 border
, format
, type
, pixels
));
9584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9585 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9590 n
[4].i
= components
;
9591 n
[5].i
= (GLint
) width
;
9596 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9597 pixels
, &ctx
->Unpack
));
9599 if (ctx
->ExecuteFlag
) {
9600 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9601 border
, format
, type
, pixels
));
9607 static void GLAPIENTRY
9608 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9609 GLint level
, GLint components
,
9610 GLsizei width
, GLsizei height
, GLint border
,
9611 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9613 GET_CURRENT_CONTEXT(ctx
);
9614 if (target
== GL_PROXY_TEXTURE_2D
) {
9615 /* don't compile, execute immediately */
9616 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9617 height
, border
, format
, type
, pixels
));
9621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9622 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9627 n
[4].i
= components
;
9628 n
[5].i
= (GLint
) width
;
9629 n
[6].i
= (GLint
) height
;
9633 save_pointer(&n
[10],
9634 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9635 pixels
, &ctx
->Unpack
));
9637 if (ctx
->ExecuteFlag
) {
9638 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9639 height
, border
, format
, type
, pixels
));
9645 static void GLAPIENTRY
9646 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9647 GLint level
, GLint internalFormat
,
9648 GLsizei width
, GLsizei height
, GLsizei depth
,
9650 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9652 GET_CURRENT_CONTEXT(ctx
);
9653 if (target
== GL_PROXY_TEXTURE_3D
) {
9654 /* don't compile, execute immediately */
9655 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9656 height
, depth
, border
, format
, type
,
9661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9662 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9667 n
[4].i
= (GLint
) internalFormat
;
9668 n
[5].i
= (GLint
) width
;
9669 n
[6].i
= (GLint
) height
;
9670 n
[7].i
= (GLint
) depth
;
9674 save_pointer(&n
[11],
9675 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9676 pixels
, &ctx
->Unpack
));
9678 if (ctx
->ExecuteFlag
) {
9679 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9680 width
, height
, depth
, border
, format
,
9687 static void GLAPIENTRY
9688 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9689 GLsizei width
, GLenum format
, GLenum type
,
9690 const GLvoid
* pixels
)
9692 GET_CURRENT_CONTEXT(ctx
);
9695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9697 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9703 n
[5].i
= (GLint
) width
;
9707 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9708 pixels
, &ctx
->Unpack
));
9710 if (ctx
->ExecuteFlag
) {
9711 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9712 format
, type
, pixels
));
9717 static void GLAPIENTRY
9718 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9719 GLint xoffset
, GLint yoffset
,
9720 GLsizei width
, GLsizei height
,
9721 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9723 GET_CURRENT_CONTEXT(ctx
);
9726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9728 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9735 n
[6].i
= (GLint
) width
;
9736 n
[7].i
= (GLint
) height
;
9739 save_pointer(&n
[10],
9740 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9741 pixels
, &ctx
->Unpack
));
9743 if (ctx
->ExecuteFlag
) {
9744 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9745 width
, height
, format
, type
, pixels
));
9750 static void GLAPIENTRY
9751 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9752 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9753 GLsizei width
, GLsizei height
, GLsizei depth
,
9754 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9756 GET_CURRENT_CONTEXT(ctx
);
9759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9761 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9769 n
[7].i
= (GLint
) width
;
9770 n
[8].i
= (GLint
) height
;
9771 n
[9].i
= (GLint
) depth
;
9774 save_pointer(&n
[12],
9775 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9776 pixels
, &ctx
->Unpack
));
9778 if (ctx
->ExecuteFlag
) {
9779 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9780 xoffset
, yoffset
, zoffset
,
9781 width
, height
, depth
, format
, type
,
9786 static void GLAPIENTRY
9787 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9788 GLenum internalformat
, GLint x
, GLint y
,
9789 GLsizei width
, GLint border
)
9791 GET_CURRENT_CONTEXT(ctx
);
9793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9794 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9799 n
[4].e
= internalformat
;
9805 if (ctx
->ExecuteFlag
) {
9806 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9807 internalformat
, x
, y
,
9812 static void GLAPIENTRY
9813 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9814 GLenum internalformat
,
9815 GLint x
, GLint y
, GLsizei width
,
9816 GLsizei height
, GLint border
)
9818 GET_CURRENT_CONTEXT(ctx
);
9820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9821 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9826 n
[4].e
= internalformat
;
9833 if (ctx
->ExecuteFlag
) {
9834 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9835 internalformat
, x
, y
,
9836 width
, height
, border
));
9840 static void GLAPIENTRY
9841 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9842 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9844 GET_CURRENT_CONTEXT(ctx
);
9846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9847 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9857 if (ctx
->ExecuteFlag
) {
9858 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9859 (texture
, target
, level
, xoffset
, x
, y
, width
));
9863 static void GLAPIENTRY
9864 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9865 GLint xoffset
, GLint yoffset
,
9866 GLint x
, GLint y
, GLsizei width
, GLint height
)
9868 GET_CURRENT_CONTEXT(ctx
);
9870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9871 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9883 if (ctx
->ExecuteFlag
) {
9884 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9886 x
, y
, width
, height
));
9891 static void GLAPIENTRY
9892 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9893 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9894 GLint x
, GLint y
, GLsizei width
, GLint height
)
9896 GET_CURRENT_CONTEXT(ctx
);
9898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9899 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9912 if (ctx
->ExecuteFlag
) {
9913 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9914 xoffset
, yoffset
, zoffset
,
9915 x
, y
, width
, height
));
9920 static void GLAPIENTRY
9921 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9923 GET_CURRENT_CONTEXT(ctx
);
9925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9926 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9932 if (ctx
->ExecuteFlag
) {
9933 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9938 static void GLAPIENTRY
9939 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9940 const GLfloat
*params
)
9942 GET_CURRENT_CONTEXT(ctx
);
9944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9945 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
9955 if (ctx
->ExecuteFlag
) {
9956 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9961 static void GLAPIENTRY
9962 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
9966 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9967 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
9970 static void GLAPIENTRY
9971 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
9973 GET_CURRENT_CONTEXT(ctx
);
9975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9976 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
9986 if (ctx
->ExecuteFlag
) {
9987 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9991 static void GLAPIENTRY
9992 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
9996 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9997 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10001 static void GLAPIENTRY
10002 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10003 GLint level
, GLint components
,
10004 GLsizei width
, GLint border
,
10005 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10007 GET_CURRENT_CONTEXT(ctx
);
10008 if (target
== GL_PROXY_TEXTURE_1D
) {
10009 /* don't compile, execute immediately */
10010 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10011 border
, format
, type
, pixels
));
10015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10016 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10021 n
[4].i
= components
;
10022 n
[5].i
= (GLint
) width
;
10026 save_pointer(&n
[9],
10027 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10028 pixels
, &ctx
->Unpack
));
10030 if (ctx
->ExecuteFlag
) {
10031 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10032 border
, format
, type
, pixels
));
10038 static void GLAPIENTRY
10039 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10040 GLint level
, GLint components
,
10041 GLsizei width
, GLsizei height
, GLint border
,
10042 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10044 GET_CURRENT_CONTEXT(ctx
);
10045 if (target
== GL_PROXY_TEXTURE_2D
) {
10046 /* don't compile, execute immediately */
10047 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10048 height
, border
, format
, type
, pixels
));
10052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10053 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10058 n
[4].i
= components
;
10059 n
[5].i
= (GLint
) width
;
10060 n
[6].i
= (GLint
) height
;
10064 save_pointer(&n
[10],
10065 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10066 pixels
, &ctx
->Unpack
));
10068 if (ctx
->ExecuteFlag
) {
10069 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10070 height
, border
, format
, type
, pixels
));
10076 static void GLAPIENTRY
10077 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10078 GLint level
, GLint internalFormat
,
10079 GLsizei width
, GLsizei height
, GLsizei depth
,
10081 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10083 GET_CURRENT_CONTEXT(ctx
);
10084 if (target
== GL_PROXY_TEXTURE_3D
) {
10085 /* don't compile, execute immediately */
10086 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10087 height
, depth
, border
, format
, type
,
10092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10093 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10098 n
[4].i
= (GLint
) internalFormat
;
10099 n
[5].i
= (GLint
) width
;
10100 n
[6].i
= (GLint
) height
;
10101 n
[7].i
= (GLint
) depth
;
10105 save_pointer(&n
[11],
10106 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10107 pixels
, &ctx
->Unpack
));
10109 if (ctx
->ExecuteFlag
) {
10110 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10111 width
, height
, depth
, border
, format
,
10119 static void GLAPIENTRY
10120 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10122 GET_CURRENT_CONTEXT(ctx
);
10124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10125 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10130 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10131 n
[4].f
= params
[0];
10132 n
[5].f
= params
[1];
10133 n
[6].f
= params
[2];
10134 n
[7].f
= params
[3];
10137 n
[4].f
= params
[0];
10138 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10141 if (ctx
->ExecuteFlag
) {
10142 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10147 static void GLAPIENTRY
10148 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10151 parray
[0] = (GLfloat
) param
;
10152 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10153 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10157 static void GLAPIENTRY
10158 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10161 p
[0] = (GLfloat
) param
;
10162 p
[1] = p
[2] = p
[3] = 0.0F
;
10163 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10167 static void GLAPIENTRY
10168 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10171 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10172 p
[0] = INT_TO_FLOAT(param
[0]);
10173 p
[1] = INT_TO_FLOAT(param
[1]);
10174 p
[2] = INT_TO_FLOAT(param
[2]);
10175 p
[3] = INT_TO_FLOAT(param
[3]);
10178 p
[0] = (GLfloat
) param
[0];
10179 p
[1] = p
[2] = p
[3] = 0.0F
;
10181 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10185 static void GLAPIENTRY
10186 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10187 GLint yoffset
, GLsizei width
, GLsizei height
,
10188 GLenum format
, GLsizei imageSize
,
10189 const GLvoid
* data
)
10192 GET_CURRENT_CONTEXT(ctx
);
10193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10195 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10196 9 + POINTER_DWORDS
);
10203 n
[6].i
= (GLint
) width
;
10204 n
[7].i
= (GLint
) height
;
10206 n
[9].i
= imageSize
;
10207 save_pointer(&n
[10],
10208 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10210 if (ctx
->ExecuteFlag
) {
10211 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10212 (texture
, target
, level
, xoffset
, yoffset
,
10213 width
, height
, format
, imageSize
, data
));
10219 * Save an error-generating command into display list.
10221 * KW: Will appear in the list before the vertex buffer containing the
10222 * command that provoked the error. I don't see this as a problem.
10225 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10228 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
10231 save_pointer(&n
[2], (void *) s
);
10232 /* note: the data/string here doesn't have to be freed in
10233 * _mesa_delete_list() since the string is never dynamically
10241 * Compile an error into current display list.
10244 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10246 if (ctx
->CompileFlag
)
10247 save_error(ctx
, error
, s
);
10248 if (ctx
->ExecuteFlag
)
10249 _mesa_error(ctx
, error
, "%s", s
);
10254 * Test if ID names a display list.
10257 islist(struct gl_context
*ctx
, GLuint list
)
10259 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
10269 /**********************************************************************/
10270 /* Display list execution */
10271 /**********************************************************************/
10275 * Execute a display list. Note that the ListBase offset must have already
10276 * been added before calling this function. I.e. the list argument is
10277 * the absolute list number, not relative to ListBase.
10278 * \param list - display list number
10281 execute_list(struct gl_context
*ctx
, GLuint list
)
10283 struct gl_display_list
*dlist
;
10287 if (list
== 0 || !islist(ctx
, list
))
10290 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10291 /* raise an error? */
10295 dlist
= _mesa_lookup_list(ctx
, list
);
10299 ctx
->ListState
.CallDepth
++;
10301 vbo_save_BeginCallList(ctx
, dlist
);
10307 const OpCode opcode
= n
[0].opcode
;
10309 if (is_ext_opcode(opcode
)) {
10310 n
+= ext_opcode_execute(ctx
, n
);
10315 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10318 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10320 case OPCODE_ALPHA_FUNC
:
10321 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10323 case OPCODE_BIND_TEXTURE
:
10324 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10326 case OPCODE_BITMAP
:
10328 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10329 ctx
->Unpack
= ctx
->DefaultPacking
;
10330 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10331 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10332 get_pointer(&n
[7])));
10333 ctx
->Unpack
= save
; /* restore */
10336 case OPCODE_BLEND_COLOR
:
10337 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10339 case OPCODE_BLEND_EQUATION
:
10340 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10342 case OPCODE_BLEND_EQUATION_SEPARATE
:
10343 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10345 case OPCODE_BLEND_FUNC_SEPARATE
:
10346 CALL_BlendFuncSeparate(ctx
->Exec
,
10347 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10350 case OPCODE_BLEND_FUNC_I
:
10351 /* GL_ARB_draw_buffers_blend */
10352 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10354 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10355 /* GL_ARB_draw_buffers_blend */
10356 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10359 case OPCODE_BLEND_EQUATION_I
:
10360 /* GL_ARB_draw_buffers_blend */
10361 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10363 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10364 /* GL_ARB_draw_buffers_blend */
10365 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10366 (n
[1].ui
, n
[2].e
, n
[3].e
));
10369 case OPCODE_CALL_LIST
:
10370 /* Generated by glCallList(), don't add ListBase */
10371 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10372 execute_list(ctx
, n
[1].ui
);
10375 case OPCODE_CALL_LISTS
:
10376 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10377 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10381 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10383 case OPCODE_CLEAR_BUFFER_IV
:
10390 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10393 case OPCODE_CLEAR_BUFFER_UIV
:
10396 value
[0] = n
[3].ui
;
10397 value
[1] = n
[4].ui
;
10398 value
[2] = n
[5].ui
;
10399 value
[3] = n
[6].ui
;
10400 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10403 case OPCODE_CLEAR_BUFFER_FV
:
10410 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10413 case OPCODE_CLEAR_BUFFER_FI
:
10414 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10416 case OPCODE_CLEAR_COLOR
:
10417 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10419 case OPCODE_CLEAR_ACCUM
:
10420 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10422 case OPCODE_CLEAR_DEPTH
:
10423 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10425 case OPCODE_CLEAR_INDEX
:
10426 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10428 case OPCODE_CLEAR_STENCIL
:
10429 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10431 case OPCODE_CLIP_PLANE
:
10438 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10441 case OPCODE_COLOR_MASK
:
10442 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10444 case OPCODE_COLOR_MASK_INDEXED
:
10445 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10448 case OPCODE_COLOR_MATERIAL
:
10449 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10451 case OPCODE_COPY_PIXELS
:
10452 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10453 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10456 case OPCODE_COPY_TEX_IMAGE1D
:
10457 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10458 n
[5].i
, n
[6].i
, n
[7].i
));
10460 case OPCODE_COPY_TEX_IMAGE2D
:
10461 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10462 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10464 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10465 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10466 n
[4].i
, n
[5].i
, n
[6].i
));
10468 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10469 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10470 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10473 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10474 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10475 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10478 case OPCODE_CULL_FACE
:
10479 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10481 case OPCODE_DEPTH_FUNC
:
10482 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10484 case OPCODE_DEPTH_MASK
:
10485 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10487 case OPCODE_DEPTH_RANGE
:
10488 CALL_DepthRange(ctx
->Exec
,
10489 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10491 case OPCODE_DISABLE
:
10492 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10494 case OPCODE_DISABLE_INDEXED
:
10495 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10497 case OPCODE_DRAW_BUFFER
:
10498 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10500 case OPCODE_DRAW_PIXELS
:
10502 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10503 ctx
->Unpack
= ctx
->DefaultPacking
;
10504 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10505 get_pointer(&n
[5])));
10506 ctx
->Unpack
= save
; /* restore */
10509 case OPCODE_ENABLE
:
10510 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10512 case OPCODE_ENABLE_INDEXED
:
10513 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10515 case OPCODE_EVALMESH1
:
10516 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10518 case OPCODE_EVALMESH2
:
10519 CALL_EvalMesh2(ctx
->Exec
,
10520 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10529 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10532 case OPCODE_FRONT_FACE
:
10533 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10535 case OPCODE_FRUSTUM
:
10536 CALL_Frustum(ctx
->Exec
,
10537 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10540 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10542 case OPCODE_INDEX_MASK
:
10543 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10545 case OPCODE_INIT_NAMES
:
10546 CALL_InitNames(ctx
->Exec
, ());
10555 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10558 case OPCODE_LIGHT_MODEL
:
10565 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10568 case OPCODE_LINE_STIPPLE
:
10569 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10571 case OPCODE_LINE_WIDTH
:
10572 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10574 case OPCODE_LIST_BASE
:
10575 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10577 case OPCODE_LOAD_IDENTITY
:
10578 CALL_LoadIdentity(ctx
->Exec
, ());
10580 case OPCODE_LOAD_MATRIX
:
10581 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10582 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10584 case OPCODE_LOAD_NAME
:
10585 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10587 case OPCODE_LOGIC_OP
:
10588 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10592 GLenum target
= n
[1].e
;
10593 GLint ustride
= _mesa_evaluator_components(target
);
10594 GLint uorder
= n
[5].i
;
10595 GLfloat u1
= n
[2].f
;
10596 GLfloat u2
= n
[3].f
;
10597 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10598 (GLfloat
*) get_pointer(&n
[6])));
10603 GLenum target
= n
[1].e
;
10604 GLfloat u1
= n
[2].f
;
10605 GLfloat u2
= n
[3].f
;
10606 GLfloat v1
= n
[4].f
;
10607 GLfloat v2
= n
[5].f
;
10608 GLint ustride
= n
[6].i
;
10609 GLint vstride
= n
[7].i
;
10610 GLint uorder
= n
[8].i
;
10611 GLint vorder
= n
[9].i
;
10612 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10613 v1
, v2
, vstride
, vorder
,
10614 (GLfloat
*) get_pointer(&n
[10])));
10617 case OPCODE_MAPGRID1
:
10618 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10620 case OPCODE_MAPGRID2
:
10621 CALL_MapGrid2f(ctx
->Exec
,
10622 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10624 case OPCODE_MATRIX_MODE
:
10625 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10627 case OPCODE_MULT_MATRIX
:
10628 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10631 CALL_Ortho(ctx
->Exec
,
10632 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10634 case OPCODE_PASSTHROUGH
:
10635 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10637 case OPCODE_PATCH_PARAMETER_I
:
10638 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10640 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10643 params
[0] = n
[2].f
;
10644 params
[1] = n
[3].f
;
10645 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10648 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10651 params
[0] = n
[2].f
;
10652 params
[1] = n
[3].f
;
10653 params
[2] = n
[4].f
;
10654 params
[3] = n
[5].f
;
10655 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10658 case OPCODE_PIXEL_MAP
:
10659 CALL_PixelMapfv(ctx
->Exec
,
10660 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10662 case OPCODE_PIXEL_TRANSFER
:
10663 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10665 case OPCODE_PIXEL_ZOOM
:
10666 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10668 case OPCODE_POINT_SIZE
:
10669 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10671 case OPCODE_POINT_PARAMETERS
:
10674 params
[0] = n
[2].f
;
10675 params
[1] = n
[3].f
;
10676 params
[2] = n
[4].f
;
10677 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10680 case OPCODE_POLYGON_MODE
:
10681 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10683 case OPCODE_POLYGON_STIPPLE
:
10685 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10686 ctx
->Unpack
= ctx
->DefaultPacking
;
10687 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10688 ctx
->Unpack
= save
; /* restore */
10691 case OPCODE_POLYGON_OFFSET
:
10692 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10694 case OPCODE_POLYGON_OFFSET_CLAMP
:
10695 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10697 case OPCODE_POP_ATTRIB
:
10698 CALL_PopAttrib(ctx
->Exec
, ());
10700 case OPCODE_POP_MATRIX
:
10701 CALL_PopMatrix(ctx
->Exec
, ());
10703 case OPCODE_POP_NAME
:
10704 CALL_PopName(ctx
->Exec
, ());
10706 case OPCODE_PRIORITIZE_TEXTURE
:
10707 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10709 case OPCODE_PUSH_ATTRIB
:
10710 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10712 case OPCODE_PUSH_MATRIX
:
10713 CALL_PushMatrix(ctx
->Exec
, ());
10715 case OPCODE_PUSH_NAME
:
10716 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10718 case OPCODE_RASTER_POS
:
10719 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10721 case OPCODE_READ_BUFFER
:
10722 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10724 case OPCODE_ROTATE
:
10725 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10728 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10730 case OPCODE_SCISSOR
:
10731 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10733 case OPCODE_SHADE_MODEL
:
10734 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10736 case OPCODE_PROVOKING_VERTEX
:
10737 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10739 case OPCODE_STENCIL_FUNC
:
10740 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10742 case OPCODE_STENCIL_MASK
:
10743 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10745 case OPCODE_STENCIL_OP
:
10746 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10748 case OPCODE_STENCIL_FUNC_SEPARATE
:
10749 CALL_StencilFuncSeparate(ctx
->Exec
,
10750 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10752 case OPCODE_STENCIL_MASK_SEPARATE
:
10753 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10755 case OPCODE_STENCIL_OP_SEPARATE
:
10756 CALL_StencilOpSeparate(ctx
->Exec
,
10757 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10759 case OPCODE_TEXENV
:
10762 params
[0] = n
[3].f
;
10763 params
[1] = n
[4].f
;
10764 params
[2] = n
[5].f
;
10765 params
[3] = n
[6].f
;
10766 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10769 case OPCODE_TEXGEN
:
10772 params
[0] = n
[3].f
;
10773 params
[1] = n
[4].f
;
10774 params
[2] = n
[5].f
;
10775 params
[3] = n
[6].f
;
10776 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10779 case OPCODE_TEXPARAMETER
:
10782 params
[0] = n
[3].f
;
10783 params
[1] = n
[4].f
;
10784 params
[2] = n
[5].f
;
10785 params
[3] = n
[6].f
;
10786 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10789 case OPCODE_TEX_IMAGE1D
:
10791 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10792 ctx
->Unpack
= ctx
->DefaultPacking
;
10793 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10794 n
[2].i
, /* level */
10795 n
[3].i
, /* components */
10796 n
[4].i
, /* width */
10797 n
[5].e
, /* border */
10798 n
[6].e
, /* format */
10800 get_pointer(&n
[8])));
10801 ctx
->Unpack
= save
; /* restore */
10804 case OPCODE_TEX_IMAGE2D
:
10806 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10807 ctx
->Unpack
= ctx
->DefaultPacking
;
10808 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10809 n
[2].i
, /* level */
10810 n
[3].i
, /* components */
10811 n
[4].i
, /* width */
10812 n
[5].i
, /* height */
10813 n
[6].e
, /* border */
10814 n
[7].e
, /* format */
10816 get_pointer(&n
[9])));
10817 ctx
->Unpack
= save
; /* restore */
10820 case OPCODE_TEX_IMAGE3D
:
10822 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10823 ctx
->Unpack
= ctx
->DefaultPacking
;
10824 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10825 n
[2].i
, /* level */
10826 n
[3].i
, /* components */
10827 n
[4].i
, /* width */
10828 n
[5].i
, /* height */
10829 n
[6].i
, /* depth */
10830 n
[7].e
, /* border */
10831 n
[8].e
, /* format */
10833 get_pointer(&n
[10])));
10834 ctx
->Unpack
= save
; /* restore */
10837 case OPCODE_TEX_SUB_IMAGE1D
:
10839 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10840 ctx
->Unpack
= ctx
->DefaultPacking
;
10841 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10843 n
[6].e
, get_pointer(&n
[7])));
10844 ctx
->Unpack
= save
; /* restore */
10847 case OPCODE_TEX_SUB_IMAGE2D
:
10849 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10850 ctx
->Unpack
= ctx
->DefaultPacking
;
10851 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10853 n
[6].i
, n
[7].e
, n
[8].e
,
10854 get_pointer(&n
[9])));
10855 ctx
->Unpack
= save
; /* restore */
10858 case OPCODE_TEX_SUB_IMAGE3D
:
10860 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10861 ctx
->Unpack
= ctx
->DefaultPacking
;
10862 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10863 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10864 n
[8].i
, n
[9].e
, n
[10].e
,
10865 get_pointer(&n
[11])));
10866 ctx
->Unpack
= save
; /* restore */
10869 case OPCODE_TRANSLATE
:
10870 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10872 case OPCODE_VIEWPORT
:
10873 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10874 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10876 case OPCODE_WINDOW_POS
:
10877 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10879 case OPCODE_VIEWPORT_ARRAY_V
:
10880 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10881 get_pointer(&n
[3])));
10883 case OPCODE_VIEWPORT_INDEXED_F
:
10884 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10887 case OPCODE_VIEWPORT_INDEXED_FV
: {
10893 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
10896 case OPCODE_SCISSOR_ARRAY_V
:
10897 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10898 get_pointer(&n
[3])));
10900 case OPCODE_SCISSOR_INDEXED
:
10901 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
10904 case OPCODE_SCISSOR_INDEXED_V
: {
10910 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
10913 case OPCODE_DEPTH_ARRAY_V
:
10914 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10915 get_pointer(&n
[3])));
10917 case OPCODE_DEPTH_INDEXED
:
10918 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
10920 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
10921 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
10923 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
10924 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10925 n
[4].i
, n
[5].i
, n
[6].i
,
10926 get_pointer(&n
[7])));
10928 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
10929 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10930 n
[4].i
, n
[5].i
, n
[6].i
,
10931 n
[7].i
, get_pointer(&n
[8])));
10933 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
10934 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10935 n
[4].i
, n
[5].i
, n
[6].i
,
10937 get_pointer(&n
[9])));
10939 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
10940 CALL_CompressedTexSubImage1D(ctx
->Exec
,
10941 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10943 get_pointer(&n
[7])));
10945 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
10946 CALL_CompressedTexSubImage2D(ctx
->Exec
,
10947 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10948 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
10949 get_pointer(&n
[9])));
10951 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
10952 CALL_CompressedTexSubImage3D(ctx
->Exec
,
10953 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10954 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10956 get_pointer(&n
[11])));
10958 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
10959 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
10961 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
10962 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10964 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
10965 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10967 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
10968 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
10969 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
10972 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
10973 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
10975 case OPCODE_DEPTH_BOUNDS_EXT
:
10976 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10978 case OPCODE_PROGRAM_STRING_ARB
:
10979 CALL_ProgramStringARB(ctx
->Exec
,
10980 (n
[1].e
, n
[2].e
, n
[3].i
,
10981 get_pointer(&n
[4])));
10983 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
10984 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
10988 case OPCODE_BEGIN_QUERY_ARB
:
10989 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10991 case OPCODE_END_QUERY_ARB
:
10992 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
10994 case OPCODE_QUERY_COUNTER
:
10995 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10997 case OPCODE_BEGIN_QUERY_INDEXED
:
10998 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11000 case OPCODE_END_QUERY_INDEXED
:
11001 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11003 case OPCODE_DRAW_BUFFERS_ARB
:
11005 GLenum buffers
[MAX_DRAW_BUFFERS
];
11006 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11007 for (i
= 0; i
< count
; i
++)
11008 buffers
[i
] = n
[2 + i
].e
;
11009 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11012 case OPCODE_BLIT_FRAMEBUFFER
:
11013 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11014 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11017 case OPCODE_PRIMITIVE_RESTART_NV
:
11018 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11021 case OPCODE_USE_PROGRAM
:
11022 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11024 case OPCODE_UNIFORM_1F
:
11025 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11027 case OPCODE_UNIFORM_2F
:
11028 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11030 case OPCODE_UNIFORM_3F
:
11031 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11033 case OPCODE_UNIFORM_4F
:
11034 CALL_Uniform4f(ctx
->Exec
,
11035 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11037 case OPCODE_UNIFORM_1FV
:
11038 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11040 case OPCODE_UNIFORM_2FV
:
11041 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11043 case OPCODE_UNIFORM_3FV
:
11044 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11046 case OPCODE_UNIFORM_4FV
:
11047 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11049 case OPCODE_UNIFORM_1D
: {
11050 union float64_pair x
;
11052 x
.uint32
[0] = n
[2].ui
;
11053 x
.uint32
[1] = n
[3].ui
;
11055 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11058 case OPCODE_UNIFORM_2D
: {
11059 union float64_pair x
;
11060 union float64_pair y
;
11062 x
.uint32
[0] = n
[2].ui
;
11063 x
.uint32
[1] = n
[3].ui
;
11064 y
.uint32
[0] = n
[4].ui
;
11065 y
.uint32
[1] = n
[5].ui
;
11067 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11070 case OPCODE_UNIFORM_3D
: {
11071 union float64_pair x
;
11072 union float64_pair y
;
11073 union float64_pair z
;
11075 x
.uint32
[0] = n
[2].ui
;
11076 x
.uint32
[1] = n
[3].ui
;
11077 y
.uint32
[0] = n
[4].ui
;
11078 y
.uint32
[1] = n
[5].ui
;
11079 z
.uint32
[0] = n
[6].ui
;
11080 z
.uint32
[1] = n
[7].ui
;
11082 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11085 case OPCODE_UNIFORM_4D
: {
11086 union float64_pair x
;
11087 union float64_pair y
;
11088 union float64_pair z
;
11089 union float64_pair w
;
11091 x
.uint32
[0] = n
[2].ui
;
11092 x
.uint32
[1] = n
[3].ui
;
11093 y
.uint32
[0] = n
[4].ui
;
11094 y
.uint32
[1] = n
[5].ui
;
11095 z
.uint32
[0] = n
[6].ui
;
11096 z
.uint32
[1] = n
[7].ui
;
11097 w
.uint32
[0] = n
[8].ui
;
11098 w
.uint32
[1] = n
[9].ui
;
11100 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11103 case OPCODE_UNIFORM_1DV
:
11104 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11106 case OPCODE_UNIFORM_2DV
:
11107 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11109 case OPCODE_UNIFORM_3DV
:
11110 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11112 case OPCODE_UNIFORM_4DV
:
11113 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11115 case OPCODE_UNIFORM_1I
:
11116 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11118 case OPCODE_UNIFORM_2I
:
11119 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11121 case OPCODE_UNIFORM_3I
:
11122 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11124 case OPCODE_UNIFORM_4I
:
11125 CALL_Uniform4i(ctx
->Exec
,
11126 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11128 case OPCODE_UNIFORM_1IV
:
11129 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11131 case OPCODE_UNIFORM_2IV
:
11132 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11134 case OPCODE_UNIFORM_3IV
:
11135 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11137 case OPCODE_UNIFORM_4IV
:
11138 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11140 case OPCODE_UNIFORM_1UI
:
11141 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11143 case OPCODE_UNIFORM_2UI
:
11144 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11146 case OPCODE_UNIFORM_3UI
:
11147 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11149 case OPCODE_UNIFORM_4UI
:
11150 CALL_Uniform4ui(ctx
->Exec
,
11151 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11153 case OPCODE_UNIFORM_1UIV
:
11154 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11156 case OPCODE_UNIFORM_2UIV
:
11157 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11159 case OPCODE_UNIFORM_3UIV
:
11160 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11162 case OPCODE_UNIFORM_4UIV
:
11163 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11165 case OPCODE_UNIFORM_MATRIX22
:
11166 CALL_UniformMatrix2fv(ctx
->Exec
,
11167 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11169 case OPCODE_UNIFORM_MATRIX33
:
11170 CALL_UniformMatrix3fv(ctx
->Exec
,
11171 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11173 case OPCODE_UNIFORM_MATRIX44
:
11174 CALL_UniformMatrix4fv(ctx
->Exec
,
11175 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11177 case OPCODE_UNIFORM_MATRIX23
:
11178 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11179 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11181 case OPCODE_UNIFORM_MATRIX32
:
11182 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11183 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11185 case OPCODE_UNIFORM_MATRIX24
:
11186 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11187 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11189 case OPCODE_UNIFORM_MATRIX42
:
11190 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11191 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11193 case OPCODE_UNIFORM_MATRIX34
:
11194 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11195 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11197 case OPCODE_UNIFORM_MATRIX43
:
11198 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11199 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11201 case OPCODE_UNIFORM_MATRIX22D
:
11202 CALL_UniformMatrix2dv(ctx
->Exec
,
11203 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11205 case OPCODE_UNIFORM_MATRIX33D
:
11206 CALL_UniformMatrix3dv(ctx
->Exec
,
11207 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11209 case OPCODE_UNIFORM_MATRIX44D
:
11210 CALL_UniformMatrix4dv(ctx
->Exec
,
11211 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11213 case OPCODE_UNIFORM_MATRIX23D
:
11214 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11215 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11217 case OPCODE_UNIFORM_MATRIX32D
:
11218 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11219 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11221 case OPCODE_UNIFORM_MATRIX24D
:
11222 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11223 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11225 case OPCODE_UNIFORM_MATRIX42D
:
11226 CALL_UniformMatrix4x2dv(ctx
->Exec
,
11227 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11229 case OPCODE_UNIFORM_MATRIX34D
:
11230 CALL_UniformMatrix3x4dv(ctx
->Exec
,
11231 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11233 case OPCODE_UNIFORM_MATRIX43D
:
11234 CALL_UniformMatrix4x3dv(ctx
->Exec
,
11235 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11238 case OPCODE_USE_PROGRAM_STAGES
:
11239 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11241 case OPCODE_PROGRAM_UNIFORM_1F
:
11242 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
11244 case OPCODE_PROGRAM_UNIFORM_2F
:
11245 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
11247 case OPCODE_PROGRAM_UNIFORM_3F
:
11248 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11249 n
[3].f
, n
[4].f
, n
[5].f
));
11251 case OPCODE_PROGRAM_UNIFORM_4F
:
11252 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11253 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11255 case OPCODE_PROGRAM_UNIFORM_1FV
:
11256 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11257 get_pointer(&n
[4])));
11259 case OPCODE_PROGRAM_UNIFORM_2FV
:
11260 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11261 get_pointer(&n
[4])));
11263 case OPCODE_PROGRAM_UNIFORM_3FV
:
11264 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11265 get_pointer(&n
[4])));
11267 case OPCODE_PROGRAM_UNIFORM_4FV
:
11268 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11269 get_pointer(&n
[4])));
11271 case OPCODE_PROGRAM_UNIFORM_1D
: {
11272 union float64_pair x
;
11274 x
.uint32
[0] = n
[3].ui
;
11275 x
.uint32
[1] = n
[4].ui
;
11277 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11280 case OPCODE_PROGRAM_UNIFORM_2D
: {
11281 union float64_pair x
;
11282 union float64_pair y
;
11284 x
.uint32
[0] = n
[3].ui
;
11285 x
.uint32
[1] = n
[4].ui
;
11286 y
.uint32
[0] = n
[5].ui
;
11287 y
.uint32
[1] = n
[6].ui
;
11289 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11292 case OPCODE_PROGRAM_UNIFORM_3D
: {
11293 union float64_pair x
;
11294 union float64_pair y
;
11295 union float64_pair z
;
11297 x
.uint32
[0] = n
[3].ui
;
11298 x
.uint32
[1] = n
[4].ui
;
11299 y
.uint32
[0] = n
[5].ui
;
11300 y
.uint32
[1] = n
[6].ui
;
11301 z
.uint32
[0] = n
[7].ui
;
11302 z
.uint32
[1] = n
[8].ui
;
11304 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11308 case OPCODE_PROGRAM_UNIFORM_4D
: {
11309 union float64_pair x
;
11310 union float64_pair y
;
11311 union float64_pair z
;
11312 union float64_pair w
;
11314 x
.uint32
[0] = n
[3].ui
;
11315 x
.uint32
[1] = n
[4].ui
;
11316 y
.uint32
[0] = n
[5].ui
;
11317 y
.uint32
[1] = n
[6].ui
;
11318 z
.uint32
[0] = n
[7].ui
;
11319 z
.uint32
[1] = n
[8].ui
;
11320 w
.uint32
[0] = n
[9].ui
;
11321 w
.uint32
[1] = n
[10].ui
;
11323 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11324 x
.d
, y
.d
, z
.d
, w
.d
));
11327 case OPCODE_PROGRAM_UNIFORM_1DV
:
11328 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11329 get_pointer(&n
[4])));
11331 case OPCODE_PROGRAM_UNIFORM_2DV
:
11332 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11333 get_pointer(&n
[4])));
11335 case OPCODE_PROGRAM_UNIFORM_3DV
:
11336 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11337 get_pointer(&n
[4])));
11339 case OPCODE_PROGRAM_UNIFORM_4DV
:
11340 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11341 get_pointer(&n
[4])));
11343 case OPCODE_PROGRAM_UNIFORM_1I
:
11344 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11346 case OPCODE_PROGRAM_UNIFORM_2I
:
11347 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11349 case OPCODE_PROGRAM_UNIFORM_3I
:
11350 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11351 n
[3].i
, n
[4].i
, n
[5].i
));
11353 case OPCODE_PROGRAM_UNIFORM_4I
:
11354 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11355 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11357 case OPCODE_PROGRAM_UNIFORM_1IV
:
11358 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11359 get_pointer(&n
[4])));
11361 case OPCODE_PROGRAM_UNIFORM_2IV
:
11362 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11363 get_pointer(&n
[4])));
11365 case OPCODE_PROGRAM_UNIFORM_3IV
:
11366 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11367 get_pointer(&n
[4])));
11369 case OPCODE_PROGRAM_UNIFORM_4IV
:
11370 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11371 get_pointer(&n
[4])));
11373 case OPCODE_PROGRAM_UNIFORM_1UI
:
11374 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11376 case OPCODE_PROGRAM_UNIFORM_2UI
:
11377 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11378 n
[3].ui
, n
[4].ui
));
11380 case OPCODE_PROGRAM_UNIFORM_3UI
:
11381 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11382 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11384 case OPCODE_PROGRAM_UNIFORM_4UI
:
11385 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11387 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11389 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11390 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11391 get_pointer(&n
[4])));
11393 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11394 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11395 get_pointer(&n
[4])));
11397 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11398 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11399 get_pointer(&n
[4])));
11401 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11402 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11403 get_pointer(&n
[4])));
11405 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11406 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11407 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11408 get_pointer(&n
[5])));
11410 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11411 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11412 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11413 get_pointer(&n
[5])));
11415 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11416 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11417 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11418 get_pointer(&n
[5])));
11420 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11421 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11422 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11423 get_pointer(&n
[5])));
11425 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11426 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11427 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11428 get_pointer(&n
[5])));
11430 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11431 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11432 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11433 get_pointer(&n
[5])));
11435 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11436 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11437 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11438 get_pointer(&n
[5])));
11440 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11441 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11442 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11443 get_pointer(&n
[5])));
11445 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11446 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11447 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11448 get_pointer(&n
[5])));
11450 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11451 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11452 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11453 get_pointer(&n
[5])));
11455 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11456 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11457 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11458 get_pointer(&n
[5])));
11460 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11461 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11462 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11463 get_pointer(&n
[5])));
11465 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11466 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11467 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11468 get_pointer(&n
[5])));
11470 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11471 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11472 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11473 get_pointer(&n
[5])));
11475 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11476 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11477 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11478 get_pointer(&n
[5])));
11480 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11481 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11482 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11483 get_pointer(&n
[5])));
11485 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11486 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11487 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11488 get_pointer(&n
[5])));
11490 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11491 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11492 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11493 get_pointer(&n
[5])));
11496 case OPCODE_CLIP_CONTROL
:
11497 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11500 case OPCODE_CLAMP_COLOR
:
11501 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11504 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11505 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11507 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11508 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11510 case OPCODE_ATTR_1F_NV
:
11511 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11513 case OPCODE_ATTR_2F_NV
:
11514 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11516 case OPCODE_ATTR_3F_NV
:
11517 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11519 case OPCODE_ATTR_4F_NV
:
11520 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11522 case OPCODE_ATTR_1F_ARB
:
11523 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11525 case OPCODE_ATTR_2F_ARB
:
11526 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11528 case OPCODE_ATTR_3F_ARB
:
11529 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11531 case OPCODE_ATTR_4F_ARB
:
11532 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11534 case OPCODE_ATTR_1D
: {
11535 GLdouble
*d
= (GLdouble
*) &n
[2];
11536 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11539 case OPCODE_ATTR_2D
: {
11540 GLdouble
*d
= (GLdouble
*) &n
[2];
11541 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11544 case OPCODE_ATTR_3D
: {
11545 GLdouble
*d
= (GLdouble
*) &n
[2];
11546 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11549 case OPCODE_ATTR_4D
: {
11550 GLdouble
*d
= (GLdouble
*) &n
[2];
11551 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11554 case OPCODE_MATERIAL
:
11555 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11558 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11561 CALL_End(ctx
->Exec
, ());
11564 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11566 case OPCODE_EVAL_C1
:
11567 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11569 case OPCODE_EVAL_C2
:
11570 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11572 case OPCODE_EVAL_P1
:
11573 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11575 case OPCODE_EVAL_P2
:
11576 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11579 /* GL_EXT_texture_integer */
11580 case OPCODE_CLEARCOLOR_I
:
11581 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11583 case OPCODE_CLEARCOLOR_UI
:
11584 CALL_ClearColorIuiEXT(ctx
->Exec
,
11585 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11587 case OPCODE_TEXPARAMETER_I
:
11590 params
[0] = n
[3].i
;
11591 params
[1] = n
[4].i
;
11592 params
[2] = n
[5].i
;
11593 params
[3] = n
[6].i
;
11594 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11597 case OPCODE_TEXPARAMETER_UI
:
11600 params
[0] = n
[3].ui
;
11601 params
[1] = n
[4].ui
;
11602 params
[2] = n
[5].ui
;
11603 params
[3] = n
[6].ui
;
11604 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11608 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11609 /* GL_ARB_instanced_arrays */
11610 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11613 case OPCODE_TEXTURE_BARRIER_NV
:
11614 CALL_TextureBarrierNV(ctx
->Exec
, ());
11617 /* GL_EXT/ARB_transform_feedback */
11618 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11619 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11621 case OPCODE_END_TRANSFORM_FEEDBACK
:
11622 CALL_EndTransformFeedback(ctx
->Exec
, ());
11624 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11625 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11627 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11628 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11630 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11631 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11633 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11634 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11636 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11637 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11638 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11640 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11641 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11642 (n
[1].e
, n
[2].ui
, n
[3].si
));
11644 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11645 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11646 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11650 case OPCODE_BIND_SAMPLER
:
11651 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11653 case OPCODE_SAMPLER_PARAMETERIV
:
11656 params
[0] = n
[3].i
;
11657 params
[1] = n
[4].i
;
11658 params
[2] = n
[5].i
;
11659 params
[3] = n
[6].i
;
11660 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11663 case OPCODE_SAMPLER_PARAMETERFV
:
11666 params
[0] = n
[3].f
;
11667 params
[1] = n
[4].f
;
11668 params
[2] = n
[5].f
;
11669 params
[3] = n
[6].f
;
11670 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11673 case OPCODE_SAMPLER_PARAMETERIIV
:
11676 params
[0] = n
[3].i
;
11677 params
[1] = n
[4].i
;
11678 params
[2] = n
[5].i
;
11679 params
[3] = n
[6].i
;
11680 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11683 case OPCODE_SAMPLER_PARAMETERUIV
:
11686 params
[0] = n
[3].ui
;
11687 params
[1] = n
[4].ui
;
11688 params
[2] = n
[5].ui
;
11689 params
[3] = n
[6].ui
;
11690 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11694 /* ARB_compute_shader */
11695 case OPCODE_DISPATCH_COMPUTE
:
11696 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11700 case OPCODE_WAIT_SYNC
:
11702 union uint64_pair p
;
11703 p
.uint32
[0] = n
[2].ui
;
11704 p
.uint32
[1] = n
[3].ui
;
11705 CALL_WaitSync(ctx
->Exec
,
11706 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11710 /* GL_NV_conditional_render */
11711 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11712 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11714 case OPCODE_END_CONDITIONAL_RENDER
:
11715 CALL_EndConditionalRender(ctx
->Exec
, ());
11718 case OPCODE_UNIFORM_BLOCK_BINDING
:
11719 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11722 case OPCODE_UNIFORM_SUBROUTINES
:
11723 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11724 get_pointer(&n
[3])));
11727 /* GL_EXT_window_rectangles */
11728 case OPCODE_WINDOW_RECTANGLES
:
11729 CALL_WindowRectanglesEXT(
11730 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11733 /* GL_NV_conservative_raster */
11734 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11735 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11738 /* GL_NV_conservative_raster_dilate */
11739 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11740 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11743 /* GL_NV_conservative_raster_pre_snap_triangles */
11744 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11745 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11748 /* GL_EXT_direct_state_access */
11749 case OPCODE_MATRIX_LOAD
:
11750 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11752 case OPCODE_MATRIX_MULT
:
11753 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11755 case OPCODE_MATRIX_ROTATE
:
11756 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11758 case OPCODE_MATRIX_SCALE
:
11759 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11761 case OPCODE_MATRIX_TRANSLATE
:
11762 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11764 case OPCODE_MATRIX_LOAD_IDENTITY
:
11765 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11767 case OPCODE_MATRIX_ORTHO
:
11768 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11769 n
[2].f
, n
[3].f
, n
[4].f
,
11770 n
[5].f
, n
[6].f
, n
[7].f
));
11772 case OPCODE_MATRIX_FRUSTUM
:
11773 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11774 n
[2].f
, n
[3].f
, n
[4].f
,
11775 n
[5].f
, n
[6].f
, n
[7].f
));
11777 case OPCODE_MATRIX_PUSH
:
11778 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11780 case OPCODE_MATRIX_POP
:
11781 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11783 case OPCODE_TEXTUREPARAMETER_F
:
11786 params
[0] = n
[4].f
;
11787 params
[1] = n
[5].f
;
11788 params
[2] = n
[6].f
;
11789 params
[3] = n
[7].f
;
11790 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11793 case OPCODE_TEXTUREPARAMETER_I
:
11796 params
[0] = n
[4].i
;
11797 params
[1] = n
[5].i
;
11798 params
[2] = n
[6].i
;
11799 params
[3] = n
[7].i
;
11800 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11803 case OPCODE_TEXTURE_IMAGE1D
:
11805 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11806 ctx
->Unpack
= ctx
->DefaultPacking
;
11807 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11808 n
[2].e
, /* target */
11809 n
[3].i
, /* level */
11810 n
[4].i
, /* components */
11811 n
[5].i
, /* width */
11812 n
[6].e
, /* border */
11813 n
[7].e
, /* format */
11815 get_pointer(&n
[9])));
11816 ctx
->Unpack
= save
; /* restore */
11819 case OPCODE_TEXTURE_IMAGE2D
:
11821 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11822 ctx
->Unpack
= ctx
->DefaultPacking
;
11823 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11824 n
[2].e
, /* target */
11825 n
[3].i
, /* level */
11826 n
[4].i
, /* components */
11827 n
[5].i
, /* width */
11828 n
[6].i
, /* height */
11829 n
[7].e
, /* border */
11830 n
[8].e
, /* format */
11832 get_pointer(&n
[10])));
11833 ctx
->Unpack
= save
; /* restore */
11836 case OPCODE_TEXTURE_IMAGE3D
:
11838 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11839 ctx
->Unpack
= ctx
->DefaultPacking
;
11840 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11841 n
[2].e
, /* target */
11842 n
[3].i
, /* level */
11843 n
[4].i
, /* components */
11844 n
[5].i
, /* width */
11845 n
[6].i
, /* height */
11846 n
[7].i
, /* depth */
11847 n
[8].e
, /* border */
11848 n
[9].e
, /* format */
11849 n
[10].e
, /* type */
11850 get_pointer(&n
[11])));
11851 ctx
->Unpack
= save
; /* restore */
11854 case OPCODE_TEXTURE_SUB_IMAGE1D
:
11856 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11857 ctx
->Unpack
= ctx
->DefaultPacking
;
11858 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11859 n
[4].i
, n
[5].i
, n
[6].e
,
11860 n
[7].e
, get_pointer(&n
[8])));
11861 ctx
->Unpack
= save
; /* restore */
11864 case OPCODE_TEXTURE_SUB_IMAGE2D
:
11866 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11867 ctx
->Unpack
= ctx
->DefaultPacking
;
11868 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11869 n
[4].i
, n
[5].i
, n
[6].e
,
11870 n
[7].i
, n
[8].e
, n
[9].e
,
11871 get_pointer(&n
[10])));
11872 ctx
->Unpack
= save
;
11875 case OPCODE_TEXTURE_SUB_IMAGE3D
:
11877 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11878 ctx
->Unpack
= ctx
->DefaultPacking
;
11879 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11880 n
[4].i
, n
[5].i
, n
[6].i
,
11881 n
[7].i
, n
[8].i
, n
[9].i
,
11883 get_pointer(&n
[12])));
11884 ctx
->Unpack
= save
; /* restore */
11887 case OPCODE_COPY_TEXTURE_IMAGE1D
:
11888 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11889 n
[4].e
, n
[5].i
, n
[6].i
,
11892 case OPCODE_COPY_TEXTURE_IMAGE2D
:
11893 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11894 n
[4].e
, n
[5].i
, n
[6].i
,
11895 n
[7].i
, n
[8].i
, n
[9].i
));
11897 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
11898 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11899 n
[4].i
, n
[5].i
, n
[6].i
,
11902 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
11903 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11904 n
[4].i
, n
[5].i
, n
[6].i
,
11905 n
[7].i
, n
[8].i
, n
[9].i
));
11907 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
11908 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11909 n
[4].i
, n
[5].i
, n
[6].i
,
11910 n
[7].i
, n
[8].i
, n
[9].i
,
11913 case OPCODE_BIND_MULTITEXTURE
:
11914 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
11916 case OPCODE_MULTITEXPARAMETER_F
:
11919 params
[0] = n
[4].f
;
11920 params
[1] = n
[5].f
;
11921 params
[2] = n
[6].f
;
11922 params
[3] = n
[7].f
;
11923 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11926 case OPCODE_MULTITEXPARAMETER_I
:
11929 params
[0] = n
[4].i
;
11930 params
[1] = n
[5].i
;
11931 params
[2] = n
[6].i
;
11932 params
[3] = n
[7].i
;
11933 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11936 case OPCODE_MULTITEX_IMAGE1D
:
11938 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11939 ctx
->Unpack
= ctx
->DefaultPacking
;
11940 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
11941 n
[2].e
, /* target */
11942 n
[3].i
, /* level */
11943 n
[4].i
, /* components */
11944 n
[5].i
, /* width */
11945 n
[6].e
, /* border */
11946 n
[7].e
, /* format */
11948 get_pointer(&n
[9])));
11949 ctx
->Unpack
= save
; /* restore */
11952 case OPCODE_MULTITEX_IMAGE2D
:
11954 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11955 ctx
->Unpack
= ctx
->DefaultPacking
;
11956 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
11957 n
[2].e
, /* target */
11958 n
[3].i
, /* level */
11959 n
[4].i
, /* components */
11960 n
[5].i
, /* width */
11961 n
[6].i
, /* height */
11962 n
[7].e
, /* border */
11963 n
[8].e
, /* format */
11965 get_pointer(&n
[10])));
11966 ctx
->Unpack
= save
; /* restore */
11969 case OPCODE_MULTITEX_IMAGE3D
:
11971 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11972 ctx
->Unpack
= ctx
->DefaultPacking
;
11973 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
11974 n
[2].e
, /* target */
11975 n
[3].i
, /* level */
11976 n
[4].i
, /* components */
11977 n
[5].i
, /* width */
11978 n
[6].i
, /* height */
11979 n
[7].i
, /* depth */
11980 n
[8].e
, /* border */
11981 n
[9].e
, /* format */
11982 n
[10].e
, /* type */
11983 get_pointer(&n
[11])));
11984 ctx
->Unpack
= save
; /* restore */
11987 case OPCODE_MULTITEXENV
:
11990 params
[0] = n
[4].f
;
11991 params
[1] = n
[5].f
;
11992 params
[2] = n
[6].f
;
11993 params
[3] = n
[7].f
;
11994 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11997 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
11998 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
11999 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12000 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12001 n
[9].i
, get_pointer(&n
[10])));
12004 case OPCODE_CONTINUE
:
12005 n
= (Node
*) get_pointer(&n
[1]);
12010 case OPCODE_END_OF_LIST
:
12016 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
12018 _mesa_problem(ctx
, "%s", msg
);
12023 /* increment n to point to next compiled command */
12024 if (opcode
!= OPCODE_CONTINUE
) {
12025 assert(InstSize
[opcode
] > 0);
12026 n
+= InstSize
[opcode
];
12031 vbo_save_EndCallList(ctx
);
12033 ctx
->ListState
.CallDepth
--;
12038 /**********************************************************************/
12040 /**********************************************************************/
12043 * Test if a display list number is valid.
12045 GLboolean GLAPIENTRY
12046 _mesa_IsList(GLuint list
)
12048 GET_CURRENT_CONTEXT(ctx
);
12049 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12050 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
12051 return islist(ctx
, list
);
12056 * Delete a sequence of consecutive display lists.
12059 _mesa_DeleteLists(GLuint list
, GLsizei range
)
12061 GET_CURRENT_CONTEXT(ctx
);
12063 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12064 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12067 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
12072 /* We may be deleting a set of bitmap lists. See if there's a
12073 * bitmap atlas to free.
12075 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
12077 _mesa_delete_bitmap_atlas(ctx
, atlas
);
12078 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
12082 for (i
= list
; i
< list
+ range
; i
++) {
12083 destroy_list(ctx
, i
);
12089 * Return a display list number, n, such that lists n through n+range-1
12093 _mesa_GenLists(GLsizei range
)
12095 GET_CURRENT_CONTEXT(ctx
);
12097 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12098 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
12101 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
12109 * Make this an atomic operation
12111 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
12113 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
12115 /* reserve the list IDs by with empty/dummy lists */
12117 for (i
= 0; i
< range
; i
++) {
12118 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
12119 make_list(base
+ i
, 1));
12123 if (USE_BITMAP_ATLAS
&&
12125 ctx
->Driver
.DrawAtlasBitmaps
) {
12126 /* "range > 16" is a rough heuristic to guess when glGenLists might be
12127 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
12128 * Create the empty atlas now.
12130 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
12132 atlas
= alloc_bitmap_atlas(ctx
, base
);
12135 /* Atlas _should_ be new/empty now, but clobbering is OK */
12136 assert(atlas
->numBitmaps
== 0);
12137 atlas
->numBitmaps
= range
;
12141 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
12148 * Begin a new display list.
12151 _mesa_NewList(GLuint name
, GLenum mode
)
12153 GET_CURRENT_CONTEXT(ctx
);
12155 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
12156 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12158 if (MESA_VERBOSE
& VERBOSE_API
)
12159 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
12160 _mesa_enum_to_string(mode
));
12163 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
12167 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
12168 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
12172 if (ctx
->ListState
.CurrentList
) {
12173 /* already compiling a display list */
12174 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
12178 ctx
->CompileFlag
= GL_TRUE
;
12179 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
12181 /* Reset accumulated list state */
12182 invalidate_saved_current_state( ctx
);
12184 /* Allocate new display list */
12185 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
12186 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
12187 ctx
->ListState
.CurrentPos
= 0;
12189 vbo_save_NewList(ctx
, name
, mode
);
12191 ctx
->CurrentServerDispatch
= ctx
->Save
;
12192 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12193 if (ctx
->MarshalExec
== NULL
) {
12194 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12200 * End definition of current display list.
12203 _mesa_EndList(void)
12205 GET_CURRENT_CONTEXT(ctx
);
12206 SAVE_FLUSH_VERTICES(ctx
);
12207 FLUSH_VERTICES(ctx
, 0);
12209 if (MESA_VERBOSE
& VERBOSE_API
)
12210 _mesa_debug(ctx
, "glEndList\n");
12212 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
12213 _mesa_error(ctx
, GL_INVALID_OPERATION
,
12214 "glEndList() called inside glBegin/End");
12217 /* Check that a list is under construction */
12218 if (!ctx
->ListState
.CurrentList
) {
12219 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
12223 /* Call before emitting END_OF_LIST, in case the driver wants to
12224 * emit opcodes itself.
12226 vbo_save_EndList(ctx
);
12228 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
12232 /* Destroy old list, if any */
12233 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
12235 /* Install the new list */
12236 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
12237 ctx
->ListState
.CurrentList
->Name
,
12238 ctx
->ListState
.CurrentList
);
12241 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
12242 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
12244 ctx
->ListState
.CurrentList
= NULL
;
12245 ctx
->ListState
.CurrentBlock
= NULL
;
12246 ctx
->ListState
.CurrentPos
= 0;
12247 ctx
->ExecuteFlag
= GL_TRUE
;
12248 ctx
->CompileFlag
= GL_FALSE
;
12250 ctx
->CurrentServerDispatch
= ctx
->Exec
;
12251 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12252 if (ctx
->MarshalExec
== NULL
) {
12253 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12259 _mesa_CallList(GLuint list
)
12261 GLboolean save_compile_flag
;
12262 GET_CURRENT_CONTEXT(ctx
);
12263 FLUSH_CURRENT(ctx
, 0);
12265 if (MESA_VERBOSE
& VERBOSE_API
)
12266 _mesa_debug(ctx
, "glCallList %d\n", list
);
12269 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
12274 mesa_print_display_list( list
);
12276 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
12277 * execute the display list, and restore the CompileFlag.
12279 save_compile_flag
= ctx
->CompileFlag
;
12280 if (save_compile_flag
) {
12281 ctx
->CompileFlag
= GL_FALSE
;
12284 execute_list(ctx
, list
);
12285 ctx
->CompileFlag
= save_compile_flag
;
12287 /* also restore API function pointers to point to "save" versions */
12288 if (save_compile_flag
) {
12289 ctx
->CurrentServerDispatch
= ctx
->Save
;
12290 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12291 if (ctx
->MarshalExec
== NULL
) {
12292 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12299 * Try to execute a glCallLists() command where the display lists contain
12300 * glBitmap commands with a texture atlas.
12301 * \return true for success, false otherwise
12304 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
12307 struct gl_bitmap_atlas
*atlas
;
12310 if (!USE_BITMAP_ATLAS
||
12311 !ctx
->Current
.RasterPosValid
||
12312 ctx
->List
.ListBase
== 0 ||
12313 type
!= GL_UNSIGNED_BYTE
||
12314 !ctx
->Driver
.DrawAtlasBitmaps
) {
12319 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12322 /* Even if glGenLists wasn't called, we can still try to create
12325 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12328 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
12329 /* Try to build the bitmap atlas now.
12330 * If the atlas was created in glGenLists, we'll have recorded the
12331 * number of lists (bitmaps). Otherwise, take a guess at 256.
12333 if (atlas
->numBitmaps
== 0)
12334 atlas
->numBitmaps
= 256;
12335 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
12338 if (!atlas
|| !atlas
->complete
) {
12342 /* check that all display list IDs are in the atlas */
12343 for (i
= 0; i
< n
; i
++) {
12344 const GLubyte
*ids
= (const GLubyte
*) lists
;
12346 if (ids
[i
] >= atlas
->numBitmaps
) {
12351 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
12358 * Execute glCallLists: call multiple display lists.
12361 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12363 GET_CURRENT_CONTEXT(ctx
);
12365 GLboolean save_compile_flag
;
12367 if (MESA_VERBOSE
& VERBOSE_API
)
12368 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12372 case GL_UNSIGNED_BYTE
:
12374 case GL_UNSIGNED_SHORT
:
12376 case GL_UNSIGNED_INT
:
12384 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12389 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12391 } else if (n
== 0 || lists
== NULL
) {
12392 /* nothing to do */
12396 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12400 /* Save the CompileFlag status, turn it off, execute display list,
12401 * and restore the CompileFlag.
12403 save_compile_flag
= ctx
->CompileFlag
;
12404 ctx
->CompileFlag
= GL_FALSE
;
12406 for (i
= 0; i
< n
; i
++) {
12407 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12408 execute_list(ctx
, list
);
12411 ctx
->CompileFlag
= save_compile_flag
;
12413 /* also restore API function pointers to point to "save" versions */
12414 if (save_compile_flag
) {
12415 ctx
->CurrentServerDispatch
= ctx
->Save
;
12416 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12417 if (ctx
->MarshalExec
== NULL
) {
12418 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12425 * Set the offset added to list numbers in glCallLists.
12428 _mesa_ListBase(GLuint base
)
12430 GET_CURRENT_CONTEXT(ctx
);
12431 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12432 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12433 ctx
->List
.ListBase
= base
;
12437 * Setup the given dispatch table to point to Mesa's display list
12438 * building functions.
12440 * This does not include any of the tnl functions - they are
12441 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12445 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12447 struct _glapi_table
*table
= ctx
->Save
;
12448 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12450 /* Initially populate the dispatch table with the contents of the
12451 * normal-execution dispatch table. This lets us skip populating functions
12452 * that should be called directly instead of compiled into display lists.
12454 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12456 _mesa_loopback_init_api_table(ctx
, table
);
12458 /* VBO functions */
12459 vbo_initialize_save_dispatch(ctx
, table
);
12462 SET_Accum(table
, save_Accum
);
12463 SET_AlphaFunc(table
, save_AlphaFunc
);
12464 SET_Bitmap(table
, save_Bitmap
);
12465 SET_BlendFunc(table
, save_BlendFunc
);
12466 SET_CallList(table
, save_CallList
);
12467 SET_CallLists(table
, save_CallLists
);
12468 SET_Clear(table
, save_Clear
);
12469 SET_ClearAccum(table
, save_ClearAccum
);
12470 SET_ClearColor(table
, save_ClearColor
);
12471 SET_ClearDepth(table
, save_ClearDepth
);
12472 SET_ClearIndex(table
, save_ClearIndex
);
12473 SET_ClearStencil(table
, save_ClearStencil
);
12474 SET_ClipPlane(table
, save_ClipPlane
);
12475 SET_ColorMask(table
, save_ColorMask
);
12476 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12477 SET_ColorMaterial(table
, save_ColorMaterial
);
12478 SET_CopyPixels(table
, save_CopyPixels
);
12479 SET_CullFace(table
, save_CullFace
);
12480 SET_DepthFunc(table
, save_DepthFunc
);
12481 SET_DepthMask(table
, save_DepthMask
);
12482 SET_DepthRange(table
, save_DepthRange
);
12483 SET_Disable(table
, save_Disable
);
12484 SET_Disablei(table
, save_DisableIndexed
);
12485 SET_DrawBuffer(table
, save_DrawBuffer
);
12486 SET_DrawPixels(table
, save_DrawPixels
);
12487 SET_Enable(table
, save_Enable
);
12488 SET_Enablei(table
, save_EnableIndexed
);
12489 SET_EvalMesh1(table
, save_EvalMesh1
);
12490 SET_EvalMesh2(table
, save_EvalMesh2
);
12491 SET_Fogf(table
, save_Fogf
);
12492 SET_Fogfv(table
, save_Fogfv
);
12493 SET_Fogi(table
, save_Fogi
);
12494 SET_Fogiv(table
, save_Fogiv
);
12495 SET_FrontFace(table
, save_FrontFace
);
12496 SET_Frustum(table
, save_Frustum
);
12497 SET_Hint(table
, save_Hint
);
12498 SET_IndexMask(table
, save_IndexMask
);
12499 SET_InitNames(table
, save_InitNames
);
12500 SET_LightModelf(table
, save_LightModelf
);
12501 SET_LightModelfv(table
, save_LightModelfv
);
12502 SET_LightModeli(table
, save_LightModeli
);
12503 SET_LightModeliv(table
, save_LightModeliv
);
12504 SET_Lightf(table
, save_Lightf
);
12505 SET_Lightfv(table
, save_Lightfv
);
12506 SET_Lighti(table
, save_Lighti
);
12507 SET_Lightiv(table
, save_Lightiv
);
12508 SET_LineStipple(table
, save_LineStipple
);
12509 SET_LineWidth(table
, save_LineWidth
);
12510 SET_ListBase(table
, save_ListBase
);
12511 SET_LoadIdentity(table
, save_LoadIdentity
);
12512 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12513 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12514 SET_LoadName(table
, save_LoadName
);
12515 SET_LogicOp(table
, save_LogicOp
);
12516 SET_Map1d(table
, save_Map1d
);
12517 SET_Map1f(table
, save_Map1f
);
12518 SET_Map2d(table
, save_Map2d
);
12519 SET_Map2f(table
, save_Map2f
);
12520 SET_MapGrid1d(table
, save_MapGrid1d
);
12521 SET_MapGrid1f(table
, save_MapGrid1f
);
12522 SET_MapGrid2d(table
, save_MapGrid2d
);
12523 SET_MapGrid2f(table
, save_MapGrid2f
);
12524 SET_MatrixMode(table
, save_MatrixMode
);
12525 SET_MultMatrixd(table
, save_MultMatrixd
);
12526 SET_MultMatrixf(table
, save_MultMatrixf
);
12527 SET_NewList(table
, save_NewList
);
12528 SET_Ortho(table
, save_Ortho
);
12529 SET_PassThrough(table
, save_PassThrough
);
12530 SET_PixelMapfv(table
, save_PixelMapfv
);
12531 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12532 SET_PixelMapusv(table
, save_PixelMapusv
);
12533 SET_PixelTransferf(table
, save_PixelTransferf
);
12534 SET_PixelTransferi(table
, save_PixelTransferi
);
12535 SET_PixelZoom(table
, save_PixelZoom
);
12536 SET_PointSize(table
, save_PointSize
);
12537 SET_PolygonMode(table
, save_PolygonMode
);
12538 SET_PolygonOffset(table
, save_PolygonOffset
);
12539 SET_PolygonStipple(table
, save_PolygonStipple
);
12540 SET_PopAttrib(table
, save_PopAttrib
);
12541 SET_PopMatrix(table
, save_PopMatrix
);
12542 SET_PopName(table
, save_PopName
);
12543 SET_PushAttrib(table
, save_PushAttrib
);
12544 SET_PushMatrix(table
, save_PushMatrix
);
12545 SET_PushName(table
, save_PushName
);
12546 SET_RasterPos2d(table
, save_RasterPos2d
);
12547 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12548 SET_RasterPos2f(table
, save_RasterPos2f
);
12549 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12550 SET_RasterPos2i(table
, save_RasterPos2i
);
12551 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12552 SET_RasterPos2s(table
, save_RasterPos2s
);
12553 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12554 SET_RasterPos3d(table
, save_RasterPos3d
);
12555 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12556 SET_RasterPos3f(table
, save_RasterPos3f
);
12557 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12558 SET_RasterPos3i(table
, save_RasterPos3i
);
12559 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12560 SET_RasterPos3s(table
, save_RasterPos3s
);
12561 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12562 SET_RasterPos4d(table
, save_RasterPos4d
);
12563 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12564 SET_RasterPos4f(table
, save_RasterPos4f
);
12565 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12566 SET_RasterPos4i(table
, save_RasterPos4i
);
12567 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12568 SET_RasterPos4s(table
, save_RasterPos4s
);
12569 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12570 SET_ReadBuffer(table
, save_ReadBuffer
);
12571 SET_Rectf(table
, save_Rectf
);
12572 SET_Rotated(table
, save_Rotated
);
12573 SET_Rotatef(table
, save_Rotatef
);
12574 SET_Scaled(table
, save_Scaled
);
12575 SET_Scalef(table
, save_Scalef
);
12576 SET_Scissor(table
, save_Scissor
);
12577 SET_ShadeModel(table
, save_ShadeModel
);
12578 SET_StencilFunc(table
, save_StencilFunc
);
12579 SET_StencilMask(table
, save_StencilMask
);
12580 SET_StencilOp(table
, save_StencilOp
);
12581 SET_TexEnvf(table
, save_TexEnvf
);
12582 SET_TexEnvfv(table
, save_TexEnvfv
);
12583 SET_TexEnvi(table
, save_TexEnvi
);
12584 SET_TexEnviv(table
, save_TexEnviv
);
12585 SET_TexGend(table
, save_TexGend
);
12586 SET_TexGendv(table
, save_TexGendv
);
12587 SET_TexGenf(table
, save_TexGenf
);
12588 SET_TexGenfv(table
, save_TexGenfv
);
12589 SET_TexGeni(table
, save_TexGeni
);
12590 SET_TexGeniv(table
, save_TexGeniv
);
12591 SET_TexImage1D(table
, save_TexImage1D
);
12592 SET_TexImage2D(table
, save_TexImage2D
);
12593 SET_TexParameterf(table
, save_TexParameterf
);
12594 SET_TexParameterfv(table
, save_TexParameterfv
);
12595 SET_TexParameteri(table
, save_TexParameteri
);
12596 SET_TexParameteriv(table
, save_TexParameteriv
);
12597 SET_Translated(table
, save_Translated
);
12598 SET_Translatef(table
, save_Translatef
);
12599 SET_Viewport(table
, save_Viewport
);
12602 SET_BindTexture(table
, save_BindTexture
);
12603 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12604 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12605 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12606 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12607 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12608 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12609 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12612 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12613 SET_TexImage3D(table
, save_TexImage3D
);
12614 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12617 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12618 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12619 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12621 /* ATI_separate_stencil */
12622 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12624 /* GL_ARB_imaging */
12625 /* Not all are supported */
12626 SET_BlendColor(table
, save_BlendColor
);
12627 SET_BlendEquation(table
, save_BlendEquation
);
12629 /* 2. GL_EXT_blend_color */
12631 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12634 /* 6. GL_EXT_texture3d */
12636 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12637 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12638 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12641 /* 37. GL_EXT_blend_minmax */
12643 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12646 /* 54. GL_EXT_point_parameters */
12647 SET_PointParameterf(table
, save_PointParameterfEXT
);
12648 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12650 /* 91. GL_ARB_tessellation_shader */
12651 SET_PatchParameteri(table
, save_PatchParameteri
);
12652 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12654 /* 100. ARB_viewport_array */
12655 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12656 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12657 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12658 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12659 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12660 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12661 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12662 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12664 /* 122. ARB_compute_shader */
12665 SET_DispatchCompute(table
, save_DispatchCompute
);
12666 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12668 /* 173. GL_EXT_blend_func_separate */
12669 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12671 /* 197. GL_MESA_window_pos */
12672 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12673 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12674 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12675 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12676 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12677 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12678 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12679 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12680 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12681 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12682 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12683 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12684 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12685 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12686 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12687 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12688 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12689 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12690 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12691 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12692 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12693 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
12694 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
12695 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
12697 /* 245. GL_ATI_fragment_shader */
12698 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
12699 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
12701 /* 262. GL_NV_point_sprite */
12702 SET_PointParameteri(table
, save_PointParameteriNV
);
12703 SET_PointParameteriv(table
, save_PointParameterivNV
);
12705 /* 268. GL_EXT_stencil_two_side */
12706 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
12708 /* ???. GL_EXT_depth_bounds_test */
12709 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
12711 /* ARB 1. GL_ARB_multitexture */
12712 SET_ActiveTexture(table
, save_ActiveTextureARB
);
12714 /* ARB 3. GL_ARB_transpose_matrix */
12715 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
12716 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
12717 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
12718 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
12720 /* ARB 5. GL_ARB_multisample */
12721 SET_SampleCoverage(table
, save_SampleCoverageARB
);
12723 /* ARB 12. GL_ARB_texture_compression */
12724 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
12725 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
12726 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
12727 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
12728 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
12729 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
12731 /* ARB 14. GL_ARB_point_parameters */
12732 /* aliased with EXT_point_parameters functions */
12734 /* ARB 25. GL_ARB_window_pos */
12735 /* aliased with MESA_window_pos functions */
12737 /* ARB 26. GL_ARB_vertex_program */
12738 /* ARB 27. GL_ARB_fragment_program */
12739 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
12740 SET_ProgramStringARB(table
, save_ProgramStringARB
);
12741 SET_BindProgramARB(table
, save_BindProgramARB
);
12742 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
12743 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
12744 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
12745 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
12746 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
12747 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
12748 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
12749 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
12751 SET_BeginQuery(table
, save_BeginQueryARB
);
12752 SET_EndQuery(table
, save_EndQueryARB
);
12753 SET_QueryCounter(table
, save_QueryCounter
);
12755 SET_DrawBuffers(table
, save_DrawBuffersARB
);
12757 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
12759 SET_UseProgram(table
, save_UseProgram
);
12760 SET_Uniform1f(table
, save_Uniform1fARB
);
12761 SET_Uniform2f(table
, save_Uniform2fARB
);
12762 SET_Uniform3f(table
, save_Uniform3fARB
);
12763 SET_Uniform4f(table
, save_Uniform4fARB
);
12764 SET_Uniform1fv(table
, save_Uniform1fvARB
);
12765 SET_Uniform2fv(table
, save_Uniform2fvARB
);
12766 SET_Uniform3fv(table
, save_Uniform3fvARB
);
12767 SET_Uniform4fv(table
, save_Uniform4fvARB
);
12768 SET_Uniform1i(table
, save_Uniform1iARB
);
12769 SET_Uniform2i(table
, save_Uniform2iARB
);
12770 SET_Uniform3i(table
, save_Uniform3iARB
);
12771 SET_Uniform4i(table
, save_Uniform4iARB
);
12772 SET_Uniform1iv(table
, save_Uniform1ivARB
);
12773 SET_Uniform2iv(table
, save_Uniform2ivARB
);
12774 SET_Uniform3iv(table
, save_Uniform3ivARB
);
12775 SET_Uniform4iv(table
, save_Uniform4ivARB
);
12776 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
12777 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
12778 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
12779 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
12780 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
12781 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
12782 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
12783 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
12784 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
12786 /* 299. GL_EXT_blend_equation_separate */
12787 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
12789 /* GL_EXT_gpu_program_parameters */
12790 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
12791 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
12793 /* 364. GL_EXT_provoking_vertex */
12794 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
12796 /* GL_EXT_texture_integer */
12797 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
12798 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
12799 SET_TexParameterIiv(table
, save_TexParameterIiv
);
12800 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
12802 /* GL_ARB_clip_control */
12803 SET_ClipControl(table
, save_ClipControl
);
12805 /* GL_ARB_color_buffer_float */
12806 SET_ClampColor(table
, save_ClampColorARB
);
12809 SET_ClearBufferiv(table
, save_ClearBufferiv
);
12810 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
12811 SET_ClearBufferfv(table
, save_ClearBufferfv
);
12812 SET_ClearBufferfi(table
, save_ClearBufferfi
);
12813 SET_Uniform1ui(table
, save_Uniform1ui
);
12814 SET_Uniform2ui(table
, save_Uniform2ui
);
12815 SET_Uniform3ui(table
, save_Uniform3ui
);
12816 SET_Uniform4ui(table
, save_Uniform4ui
);
12817 SET_Uniform1uiv(table
, save_Uniform1uiv
);
12818 SET_Uniform2uiv(table
, save_Uniform2uiv
);
12819 SET_Uniform3uiv(table
, save_Uniform3uiv
);
12820 SET_Uniform4uiv(table
, save_Uniform4uiv
);
12822 /* GL_ARB_gpu_shader_fp64 */
12823 SET_Uniform1d(table
, save_Uniform1d
);
12824 SET_Uniform2d(table
, save_Uniform2d
);
12825 SET_Uniform3d(table
, save_Uniform3d
);
12826 SET_Uniform4d(table
, save_Uniform4d
);
12827 SET_Uniform1dv(table
, save_Uniform1dv
);
12828 SET_Uniform2dv(table
, save_Uniform2dv
);
12829 SET_Uniform3dv(table
, save_Uniform3dv
);
12830 SET_Uniform4dv(table
, save_Uniform4dv
);
12831 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
12832 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
12833 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
12834 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
12835 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
12836 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
12837 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
12838 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
12839 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
12842 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
12843 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
12844 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
12845 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
12846 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
12847 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
12848 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
12849 SET_DrawTransformFeedbackInstanced(table
,
12850 save_DrawTransformFeedbackInstanced
);
12851 SET_DrawTransformFeedbackStreamInstanced(table
,
12852 save_DrawTransformFeedbackStreamInstanced
);
12853 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
12854 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
12856 /* GL_ARB_instanced_arrays */
12857 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
12859 /* GL_NV_texture_barrier */
12860 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
12862 SET_BindSampler(table
, save_BindSampler
);
12863 SET_SamplerParameteri(table
, save_SamplerParameteri
);
12864 SET_SamplerParameterf(table
, save_SamplerParameterf
);
12865 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
12866 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
12867 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
12868 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
12870 /* GL_ARB_draw_buffer_blend */
12871 SET_BlendFunciARB(table
, save_BlendFunci
);
12872 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
12873 SET_BlendEquationiARB(table
, save_BlendEquationi
);
12874 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
12876 /* GL_NV_conditional_render */
12877 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
12878 SET_EndConditionalRender(table
, save_EndConditionalRender
);
12881 SET_WaitSync(table
, save_WaitSync
);
12883 /* GL_ARB_uniform_buffer_object */
12884 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
12886 /* GL_ARB_shader_subroutines */
12887 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
12889 /* GL_ARB_draw_instanced */
12890 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
12891 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
12893 /* GL_ARB_draw_elements_base_vertex */
12894 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
12896 /* GL_ARB_base_instance */
12897 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
12898 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
12899 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
12901 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
12902 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
12903 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
12904 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
12905 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
12907 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
12908 SET_UseProgramStages(table
, save_UseProgramStages
);
12909 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
12910 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
12911 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
12912 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
12913 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
12914 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
12915 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
12916 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
12917 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
12918 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
12919 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
12920 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
12921 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
12922 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
12923 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
12924 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
12925 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
12926 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
12927 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
12928 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
12929 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
12930 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
12931 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
12932 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
12933 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
12934 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
12935 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
12936 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
12937 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
12938 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
12939 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
12940 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
12941 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
12942 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
12943 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
12944 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
12945 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
12946 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
12947 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
12948 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
12949 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
12950 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
12951 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
12952 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
12953 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
12954 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
12955 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
12956 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
12957 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
12958 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
12960 /* GL_{ARB,EXT}_polygon_offset_clamp */
12961 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
12963 /* GL_EXT_window_rectangles */
12964 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
12966 /* GL_NV_conservative_raster */
12967 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
12969 /* GL_NV_conservative_raster_dilate */
12970 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
12972 /* GL_NV_conservative_raster_pre_snap_triangles */
12973 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
12975 /* GL_EXT_direct_state_access */
12976 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
12977 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
12978 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
12979 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
12980 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
12981 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
12982 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
12983 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
12984 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
12985 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
12986 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
12987 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
12988 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
12989 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
12990 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
12991 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
12992 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
12993 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
12994 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
12995 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
12996 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
12997 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
12998 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
12999 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
13000 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
13001 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
13002 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
13003 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
13004 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
13005 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
13006 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
13007 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
13008 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
13009 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
13010 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
13011 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
13012 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
13013 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
13014 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
13015 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
13016 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
13017 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
13018 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
13019 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
13020 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
13021 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
13022 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
13027 static const char *
13028 enum_string(GLenum k
)
13030 return _mesa_enum_to_string(k
);
13035 * Print the commands in a display list. For debugging only.
13036 * TODO: many commands aren't handled yet.
13037 * \param fname filename to write display list to. If null, use stdout.
13039 static void GLAPIENTRY
13040 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
13042 struct gl_display_list
*dlist
;
13048 f
= fopen(fname
, "w");
13053 if (!islist(ctx
, list
)) {
13054 fprintf(f
, "%u is not a display list ID\n", list
);
13058 dlist
= _mesa_lookup_list(ctx
, list
);
13065 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
13067 done
= n
? GL_FALSE
: GL_TRUE
;
13069 const OpCode opcode
= n
[0].opcode
;
13071 if (is_ext_opcode(opcode
)) {
13072 n
+= ext_opcode_print(ctx
, n
, f
);
13077 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
13079 case OPCODE_ACTIVE_TEXTURE
:
13080 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
13082 case OPCODE_BITMAP
:
13083 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
13084 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
13085 get_pointer(&n
[7]));
13087 case OPCODE_BLEND_COLOR
:
13088 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
13089 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13091 case OPCODE_BLEND_EQUATION
:
13092 fprintf(f
, "BlendEquation %s\n",
13093 enum_string(n
[1].e
));
13095 case OPCODE_BLEND_EQUATION_SEPARATE
:
13096 fprintf(f
, "BlendEquationSeparate %s, %s\n",
13097 enum_string(n
[1].e
),
13098 enum_string(n
[2].e
));
13100 case OPCODE_BLEND_FUNC_SEPARATE
:
13101 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
13102 enum_string(n
[1].e
),
13103 enum_string(n
[2].e
),
13104 enum_string(n
[3].e
),
13105 enum_string(n
[4].e
));
13107 case OPCODE_BLEND_EQUATION_I
:
13108 fprintf(f
, "BlendEquationi %u, %s\n",
13109 n
[1].ui
, enum_string(n
[2].e
));
13111 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
13112 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
13113 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13115 case OPCODE_BLEND_FUNC_I
:
13116 fprintf(f
, "BlendFunci %u, %s, %s\n",
13117 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13119 case OPCODE_BLEND_FUNC_SEPARATE_I
:
13120 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
13122 enum_string(n
[2].e
),
13123 enum_string(n
[3].e
),
13124 enum_string(n
[4].e
),
13125 enum_string(n
[5].e
));
13127 case OPCODE_CALL_LIST
:
13128 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
13130 case OPCODE_CALL_LISTS
:
13131 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
13133 case OPCODE_DISABLE
:
13134 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
13136 case OPCODE_ENABLE
:
13137 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
13139 case OPCODE_FRUSTUM
:
13140 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
13141 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13143 case OPCODE_LINE_STIPPLE
:
13144 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
13146 case OPCODE_LINE_WIDTH
:
13147 fprintf(f
, "LineWidth %f\n", n
[1].f
);
13149 case OPCODE_LOAD_IDENTITY
:
13150 fprintf(f
, "LoadIdentity\n");
13152 case OPCODE_LOAD_MATRIX
:
13153 fprintf(f
, "LoadMatrix\n");
13154 fprintf(f
, " %8f %8f %8f %8f\n",
13155 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13156 fprintf(f
, " %8f %8f %8f %8f\n",
13157 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13158 fprintf(f
, " %8f %8f %8f %8f\n",
13159 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13160 fprintf(f
, " %8f %8f %8f %8f\n",
13161 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13163 case OPCODE_MULT_MATRIX
:
13164 fprintf(f
, "MultMatrix (or Rotate)\n");
13165 fprintf(f
, " %8f %8f %8f %8f\n",
13166 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13167 fprintf(f
, " %8f %8f %8f %8f\n",
13168 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13169 fprintf(f
, " %8f %8f %8f %8f\n",
13170 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13171 fprintf(f
, " %8f %8f %8f %8f\n",
13172 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13175 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
13176 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13178 case OPCODE_POINT_SIZE
:
13179 fprintf(f
, "PointSize %f\n", n
[1].f
);
13181 case OPCODE_POP_ATTRIB
:
13182 fprintf(f
, "PopAttrib\n");
13184 case OPCODE_POP_MATRIX
:
13185 fprintf(f
, "PopMatrix\n");
13187 case OPCODE_POP_NAME
:
13188 fprintf(f
, "PopName\n");
13190 case OPCODE_PUSH_ATTRIB
:
13191 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
13193 case OPCODE_PUSH_MATRIX
:
13194 fprintf(f
, "PushMatrix\n");
13196 case OPCODE_PUSH_NAME
:
13197 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
13199 case OPCODE_RASTER_POS
:
13200 fprintf(f
, "RasterPos %g %g %g %g\n",
13201 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13203 case OPCODE_ROTATE
:
13204 fprintf(f
, "Rotate %g %g %g %g\n",
13205 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13208 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13210 case OPCODE_TRANSLATE
:
13211 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13213 case OPCODE_BIND_TEXTURE
:
13214 fprintf(f
, "BindTexture %s %d\n",
13215 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
13217 case OPCODE_SHADE_MODEL
:
13218 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
13221 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
13222 _mesa_enum_to_string(n
[1].ui
),
13223 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
13226 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13227 _mesa_enum_to_string(n
[1].ui
),
13228 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
13229 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
13231 case OPCODE_MAPGRID1
:
13232 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
13234 case OPCODE_MAPGRID2
:
13235 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13236 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
13238 case OPCODE_EVALMESH1
:
13239 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
13241 case OPCODE_EVALMESH2
:
13242 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
13243 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
13246 case OPCODE_ATTR_1F_NV
:
13247 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
13249 case OPCODE_ATTR_2F_NV
:
13250 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
13251 n
[1].i
, n
[2].f
, n
[3].f
);
13253 case OPCODE_ATTR_3F_NV
:
13254 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
13255 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13257 case OPCODE_ATTR_4F_NV
:
13258 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13259 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13261 case OPCODE_ATTR_1F_ARB
:
13262 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
13264 case OPCODE_ATTR_2F_ARB
:
13265 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
13266 n
[1].i
, n
[2].f
, n
[3].f
);
13268 case OPCODE_ATTR_3F_ARB
:
13269 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
13270 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13272 case OPCODE_ATTR_4F_ARB
:
13273 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13274 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13277 case OPCODE_MATERIAL
:
13278 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
13279 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13282 fprintf(f
, "BEGIN %x\n", n
[1].i
);
13285 fprintf(f
, "END\n");
13288 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
13291 case OPCODE_EVAL_C1
:
13292 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
13294 case OPCODE_EVAL_C2
:
13295 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
13297 case OPCODE_EVAL_P1
:
13298 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
13300 case OPCODE_EVAL_P2
:
13301 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
13304 case OPCODE_PROVOKING_VERTEX
:
13305 fprintf(f
, "ProvokingVertex %s\n",
13306 _mesa_enum_to_string(n
[1].ui
));
13310 * meta opcodes/commands
13313 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
13314 (const char *) get_pointer(&n
[2]));
13316 case OPCODE_CONTINUE
:
13317 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
13318 n
= (Node
*) get_pointer(&n
[1]);
13321 fprintf(f
, "NOP\n");
13323 case OPCODE_END_OF_LIST
:
13324 fprintf(f
, "END-LIST %u\n", list
);
13328 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
13330 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13331 opcode
, (void *) n
);
13335 fprintf(f
, "command %d, %u operands\n", opcode
,
13339 /* increment n to point to next compiled command */
13340 if (opcode
!= OPCODE_CONTINUE
) {
13341 assert(InstSize
[opcode
] > 0);
13342 n
+= InstSize
[opcode
];
13356 * Clients may call this function to help debug display list problems.
13357 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
13358 * changed, or break in the future without notice.
13361 mesa_print_display_list(GLuint list
)
13363 GET_CURRENT_CONTEXT(ctx
);
13364 print_list(ctx
, list
, NULL
);
13368 /**********************************************************************/
13369 /***** Initialization *****/
13370 /**********************************************************************/
13373 save_vtxfmt_init(GLvertexformat
* vfmt
)
13375 vfmt
->ArrayElement
= _ae_ArrayElement
;
13377 vfmt
->Begin
= save_Begin
;
13379 vfmt
->CallList
= save_CallList
;
13380 vfmt
->CallLists
= save_CallLists
;
13382 vfmt
->Color3f
= save_Color3f
;
13383 vfmt
->Color3fv
= save_Color3fv
;
13384 vfmt
->Color4f
= save_Color4f
;
13385 vfmt
->Color4fv
= save_Color4fv
;
13386 vfmt
->EdgeFlag
= save_EdgeFlag
;
13387 vfmt
->End
= save_End
;
13389 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13390 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13391 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13392 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13393 vfmt
->EvalPoint1
= save_EvalPoint1
;
13394 vfmt
->EvalPoint2
= save_EvalPoint2
;
13396 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13397 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13398 vfmt
->Indexf
= save_Indexf
;
13399 vfmt
->Indexfv
= save_Indexfv
;
13400 vfmt
->Materialfv
= save_Materialfv
;
13401 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13402 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13403 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13404 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13405 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13406 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13407 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13408 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13409 vfmt
->Normal3f
= save_Normal3f
;
13410 vfmt
->Normal3fv
= save_Normal3fv
;
13411 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13412 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13413 vfmt
->TexCoord1f
= save_TexCoord1f
;
13414 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13415 vfmt
->TexCoord2f
= save_TexCoord2f
;
13416 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13417 vfmt
->TexCoord3f
= save_TexCoord3f
;
13418 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13419 vfmt
->TexCoord4f
= save_TexCoord4f
;
13420 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13421 vfmt
->Vertex2f
= save_Vertex2f
;
13422 vfmt
->Vertex2fv
= save_Vertex2fv
;
13423 vfmt
->Vertex3f
= save_Vertex3f
;
13424 vfmt
->Vertex3fv
= save_Vertex3fv
;
13425 vfmt
->Vertex4f
= save_Vertex4f
;
13426 vfmt
->Vertex4fv
= save_Vertex4fv
;
13427 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13428 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13429 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13430 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13431 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13432 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13433 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13434 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13435 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13436 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13437 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13438 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13439 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13440 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13441 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13442 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13444 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13449 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13450 const GLvertexformat
*vfmt
)
13452 SET_CallList(disp
, vfmt
->CallList
);
13453 SET_CallLists(disp
, vfmt
->CallLists
);
13458 * Initialize display list state for given context.
13461 _mesa_init_display_list(struct gl_context
*ctx
)
13463 static GLboolean tableInitialized
= GL_FALSE
;
13465 /* zero-out the instruction size table, just once */
13466 if (!tableInitialized
) {
13467 memset(InstSize
, 0, sizeof(InstSize
));
13468 tableInitialized
= GL_TRUE
;
13471 /* extension info */
13472 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13475 ctx
->ListState
.CallDepth
= 0;
13476 ctx
->ExecuteFlag
= GL_TRUE
;
13477 ctx
->CompileFlag
= GL_FALSE
;
13478 ctx
->ListState
.CurrentBlock
= NULL
;
13479 ctx
->ListState
.CurrentPos
= 0;
13481 /* Display List group */
13482 ctx
->List
.ListBase
= 0;
13484 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13486 InstSize
[OPCODE_NOP
] = 1;
13491 _mesa_free_display_list_data(struct gl_context
*ctx
)
13493 free(ctx
->ListExt
);
13494 ctx
->ListExt
= NULL
;