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_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
586 /* The following three are meta instructions */
587 OPCODE_ERROR
, /* raise compiled-in error */
589 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
599 * Display list instructions are stored as sequences of "nodes". Nodes
600 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
601 * are linked together with a pointer.
603 * Each instruction in the display list is stored as a sequence of
604 * contiguous nodes in memory.
605 * Each node is the union of a variety of data types.
607 * Note, all of these members should be 4 bytes in size or less for the
608 * sake of compact display lists. We store 8-byte pointers in a pair of
609 * these nodes using the save/get_pointer() functions below.
627 typedef union gl_dlist_node Node
;
630 /** How many 4-byte dwords to store a pointer */
631 #define POINTER_DWORDS (sizeof(void *) / 4)
633 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
634 * space for display lists. The following types and functions are
635 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
640 GLuint dwords
[POINTER_DWORDS
];
645 * Save a 4 or 8-byte pointer at dest (and dest+1).
648 save_pointer(Node
*dest
, void *src
)
653 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
654 STATIC_ASSERT(sizeof(Node
) == 4);
658 for (i
= 0; i
< POINTER_DWORDS
; i
++)
659 dest
[i
].ui
= p
.dwords
[i
];
664 * Retrieve a 4 or 8-byte pointer from node (node+1).
667 get_pointer(const Node
*node
)
672 for (i
= 0; i
< POINTER_DWORDS
; i
++)
673 p
.dwords
[i
] = node
[i
].ui
;
680 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
697 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
699 union float64_pair tmp; \
701 n[idx].ui = tmp.uint32[0]; \
702 n[idx+1].ui = tmp.uint32[1]; \
707 * How many nodes to allocate at a time. Note that bulk vertex data
708 * from glBegin/glVertex/glEnd primitives will typically wind up in
709 * a VBO, and not directly in the display list itself.
711 #define BLOCK_SIZE 256
716 * Number of nodes of storage needed for each instruction.
717 * Sizes for dynamically allocated opcodes are stored in the context struct.
719 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
722 void mesa_print_display_list(GLuint list
);
726 * Does the given display list only contain a single glBitmap call?
729 is_bitmap_list(const struct gl_display_list
*dlist
)
731 const Node
*n
= dlist
->Head
;
732 if (n
[0].opcode
== OPCODE_BITMAP
) {
733 n
+= InstSize
[OPCODE_BITMAP
];
734 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
742 * Is the given display list an empty list?
745 is_empty_list(const struct gl_display_list
*dlist
)
747 const Node
*n
= dlist
->Head
;
748 return n
[0].opcode
== OPCODE_END_OF_LIST
;
753 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
756 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
759 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
766 * Lookup a gl_bitmap_atlas by listBase ID.
768 static struct gl_bitmap_atlas
*
769 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
771 struct gl_bitmap_atlas
*atlas
;
773 assert(listBase
> 0);
774 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
780 * Create new bitmap atlas and insert into hash table.
782 static struct gl_bitmap_atlas
*
783 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
785 struct gl_bitmap_atlas
*atlas
;
787 assert(listBase
> 0);
788 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
790 atlas
= calloc(1, sizeof(*atlas
));
792 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
800 * Try to build a bitmap atlas. This involves examining a sequence of
801 * display lists which contain glBitmap commands and putting the bitmap
802 * images into a texture map (the atlas).
803 * If we succeed, gl_bitmap_atlas::complete will be set to true.
804 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
807 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
810 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
815 assert(!atlas
->complete
);
816 assert(atlas
->numBitmaps
> 0);
818 /* We use a rectangle texture (non-normalized coords) for the atlas */
819 assert(ctx
->Extensions
.NV_texture_rectangle
);
820 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
822 atlas
->texWidth
= 1024;
823 atlas
->texHeight
= 0; /* determined below */
825 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
826 if (!atlas
->glyphs
) {
828 atlas
->incomplete
= true;
832 /* Loop over the display lists. They should all contain a single glBitmap
833 * call. If not, bail out. Also, compute the position and sizes of each
834 * bitmap in the atlas to determine the texture atlas size.
836 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
837 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
839 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
840 unsigned bitmap_width
, bitmap_height
;
841 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
843 if (!list
|| is_empty_list(list
)) {
845 atlas
->numBitmaps
= i
;
849 if (!is_bitmap_list(list
)) {
850 /* This list does not contain exactly one glBitmap command. Give up. */
851 atlas
->incomplete
= true;
855 /* get bitmap info from the display list command */
857 assert(n
[0].opcode
== OPCODE_BITMAP
);
858 bitmap_width
= n
[1].i
;
859 bitmap_height
= n
[2].i
;
860 bitmap_xorig
= n
[3].f
;
861 bitmap_yorig
= n
[4].f
;
862 bitmap_xmove
= n
[5].f
;
863 bitmap_ymove
= n
[6].f
;
865 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
866 /* advance to the next row of the texture */
872 /* save the bitmap's position in the atlas */
876 g
->h
= bitmap_height
;
877 g
->xorig
= bitmap_xorig
;
878 g
->yorig
= bitmap_yorig
;
879 g
->xmove
= bitmap_xmove
;
880 g
->ymove
= bitmap_ymove
;
882 xpos
+= bitmap_width
;
884 /* keep track of tallest bitmap in the row */
885 row_height
= MAX2(row_height
, bitmap_height
);
888 /* Now we know the texture height */
889 atlas
->texHeight
= ypos
+ row_height
;
891 if (atlas
->texHeight
== 0) {
892 /* no glyphs found, give up */
895 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
896 /* too large, give up */
900 /* Create atlas texture (texture ID is irrelevant) */
901 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
902 if (!atlas
->texObj
) {
906 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
907 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
908 atlas
->texObj
->MaxLevel
= 0;
909 atlas
->texObj
->Immutable
= GL_TRUE
;
911 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
912 GL_TEXTURE_RECTANGLE
, 0);
913 if (!atlas
->texImage
) {
917 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
918 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
919 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
921 /* alloc image storage */
922 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
926 /* map teximage, load with bitmap glyphs */
927 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
928 0, 0, atlas
->texWidth
, atlas
->texHeight
,
929 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
934 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
935 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
937 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
938 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
939 const Node
*n
= list
->Head
;
941 assert(n
[0].opcode
== OPCODE_BITMAP
||
942 n
[0].opcode
== OPCODE_END_OF_LIST
);
944 if (n
[0].opcode
== OPCODE_BITMAP
) {
945 unsigned bitmap_width
= n
[1].i
;
946 unsigned bitmap_height
= n
[2].i
;
947 unsigned xpos
= atlas
->glyphs
[i
].x
;
948 unsigned ypos
= atlas
->glyphs
[i
].y
;
949 const void *bitmap_image
= get_pointer(&n
[7]);
951 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
952 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
954 /* put the bitmap image into the texture image */
955 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
956 &ctx
->DefaultPacking
, bitmap_image
,
957 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
962 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
964 atlas
->complete
= true;
969 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
972 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
975 atlas
->glyphs
= NULL
;
976 atlas
->incomplete
= true;
981 * Allocate a gl_display_list object with an initial block of storage.
982 * \param count how many display list nodes/tokens to allocate
984 static struct gl_display_list
*
985 make_list(GLuint name
, GLuint count
)
987 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
989 dlist
->Head
= malloc(sizeof(Node
) * count
);
990 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
991 /* All InstSize[] entries must be non-zero */
992 InstSize
[OPCODE_END_OF_LIST
] = 1;
998 * Lookup function to just encapsulate casting.
1000 struct gl_display_list
*
1001 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1003 return (struct gl_display_list
*)
1004 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1008 /** Is the given opcode an extension code? */
1009 static inline GLboolean
1010 is_ext_opcode(OpCode opcode
)
1012 return (opcode
>= OPCODE_EXT_0
);
1016 /** Destroy an extended opcode instruction */
1018 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1020 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1022 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1023 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1028 /** Execute an extended opcode instruction */
1030 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1032 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1034 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1035 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1040 /** Print an extended opcode instruction */
1042 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1044 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1046 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1047 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1053 * Delete the named display list, but don't remove from hash table.
1054 * \param dlist - display list pointer
1057 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1062 n
= block
= dlist
->Head
;
1064 done
= block
? GL_FALSE
: GL_TRUE
;
1066 const OpCode opcode
= n
[0].opcode
;
1068 /* check for extension opcodes first */
1069 if (is_ext_opcode(opcode
)) {
1070 n
+= ext_opcode_destroy(ctx
, n
);
1074 /* for some commands, we need to free malloc'd memory */
1076 free(get_pointer(&n
[6]));
1079 free(get_pointer(&n
[10]));
1081 case OPCODE_CALL_LISTS
:
1082 free(get_pointer(&n
[3]));
1084 case OPCODE_DRAW_PIXELS
:
1085 free(get_pointer(&n
[5]));
1088 free(get_pointer(&n
[7]));
1090 case OPCODE_POLYGON_STIPPLE
:
1091 free(get_pointer(&n
[1]));
1093 case OPCODE_TEX_IMAGE1D
:
1094 free(get_pointer(&n
[8]));
1096 case OPCODE_TEX_IMAGE2D
:
1097 free(get_pointer(&n
[9]));
1099 case OPCODE_TEX_IMAGE3D
:
1100 free(get_pointer(&n
[10]));
1102 case OPCODE_TEX_SUB_IMAGE1D
:
1103 free(get_pointer(&n
[7]));
1105 case OPCODE_TEX_SUB_IMAGE2D
:
1106 free(get_pointer(&n
[9]));
1108 case OPCODE_TEX_SUB_IMAGE3D
:
1109 free(get_pointer(&n
[11]));
1111 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1112 free(get_pointer(&n
[7]));
1114 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1115 free(get_pointer(&n
[8]));
1117 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1118 free(get_pointer(&n
[9]));
1120 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1121 free(get_pointer(&n
[7]));
1123 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1124 free(get_pointer(&n
[9]));
1126 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1127 free(get_pointer(&n
[11]));
1129 case OPCODE_PROGRAM_STRING_ARB
:
1130 free(get_pointer(&n
[4])); /* program string */
1132 case OPCODE_UNIFORM_1FV
:
1133 case OPCODE_UNIFORM_2FV
:
1134 case OPCODE_UNIFORM_3FV
:
1135 case OPCODE_UNIFORM_4FV
:
1136 case OPCODE_UNIFORM_1DV
:
1137 case OPCODE_UNIFORM_2DV
:
1138 case OPCODE_UNIFORM_3DV
:
1139 case OPCODE_UNIFORM_4DV
:
1140 case OPCODE_UNIFORM_1IV
:
1141 case OPCODE_UNIFORM_2IV
:
1142 case OPCODE_UNIFORM_3IV
:
1143 case OPCODE_UNIFORM_4IV
:
1144 case OPCODE_UNIFORM_1UIV
:
1145 case OPCODE_UNIFORM_2UIV
:
1146 case OPCODE_UNIFORM_3UIV
:
1147 case OPCODE_UNIFORM_4UIV
:
1148 free(get_pointer(&n
[3]));
1150 case OPCODE_UNIFORM_MATRIX22
:
1151 case OPCODE_UNIFORM_MATRIX33
:
1152 case OPCODE_UNIFORM_MATRIX44
:
1153 case OPCODE_UNIFORM_MATRIX24
:
1154 case OPCODE_UNIFORM_MATRIX42
:
1155 case OPCODE_UNIFORM_MATRIX23
:
1156 case OPCODE_UNIFORM_MATRIX32
:
1157 case OPCODE_UNIFORM_MATRIX34
:
1158 case OPCODE_UNIFORM_MATRIX43
:
1159 case OPCODE_UNIFORM_MATRIX22D
:
1160 case OPCODE_UNIFORM_MATRIX33D
:
1161 case OPCODE_UNIFORM_MATRIX44D
:
1162 case OPCODE_UNIFORM_MATRIX24D
:
1163 case OPCODE_UNIFORM_MATRIX42D
:
1164 case OPCODE_UNIFORM_MATRIX23D
:
1165 case OPCODE_UNIFORM_MATRIX32D
:
1166 case OPCODE_UNIFORM_MATRIX34D
:
1167 case OPCODE_UNIFORM_MATRIX43D
:
1168 free(get_pointer(&n
[4]));
1170 case OPCODE_PROGRAM_UNIFORM_1FV
:
1171 case OPCODE_PROGRAM_UNIFORM_2FV
:
1172 case OPCODE_PROGRAM_UNIFORM_3FV
:
1173 case OPCODE_PROGRAM_UNIFORM_4FV
:
1174 case OPCODE_PROGRAM_UNIFORM_1DV
:
1175 case OPCODE_PROGRAM_UNIFORM_2DV
:
1176 case OPCODE_PROGRAM_UNIFORM_3DV
:
1177 case OPCODE_PROGRAM_UNIFORM_4DV
:
1178 case OPCODE_PROGRAM_UNIFORM_1IV
:
1179 case OPCODE_PROGRAM_UNIFORM_2IV
:
1180 case OPCODE_PROGRAM_UNIFORM_3IV
:
1181 case OPCODE_PROGRAM_UNIFORM_4IV
:
1182 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1183 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1184 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1185 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1186 free(get_pointer(&n
[4]));
1188 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1189 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1190 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1191 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1192 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1193 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1194 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1195 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1196 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1197 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1198 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1199 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1200 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1201 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1202 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1203 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1206 free(get_pointer(&n
[5]));
1208 case OPCODE_PIXEL_MAP
:
1209 free(get_pointer(&n
[3]));
1211 case OPCODE_VIEWPORT_ARRAY_V
:
1212 case OPCODE_SCISSOR_ARRAY_V
:
1213 case OPCODE_DEPTH_ARRAY_V
:
1214 case OPCODE_UNIFORM_SUBROUTINES
:
1215 case OPCODE_WINDOW_RECTANGLES
:
1216 free(get_pointer(&n
[3]));
1218 case OPCODE_TEXTURE_IMAGE1D
:
1219 free(get_pointer(&n
[9]));
1221 case OPCODE_TEXTURE_IMAGE2D
:
1222 free(get_pointer(&n
[10]));
1224 case OPCODE_TEXTURE_IMAGE3D
:
1225 free(get_pointer(&n
[11]));
1227 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1228 free(get_pointer(&n
[8]));
1230 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1231 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1232 free(get_pointer(&n
[10]));
1234 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1235 free(get_pointer(&n
[12]));
1237 case OPCODE_CONTINUE
:
1238 n
= (Node
*) get_pointer(&n
[1]);
1242 case OPCODE_END_OF_LIST
:
1247 /* just increment 'n' pointer, below */
1251 if (opcode
!= OPCODE_CONTINUE
) {
1252 assert(InstSize
[opcode
] > 0);
1253 n
+= InstSize
[opcode
];
1264 * Called by _mesa_HashWalk() to check if a display list which is being
1265 * deleted belongs to a bitmap texture atlas.
1268 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1270 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1271 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1273 /* See if the list_id falls in the range contained in this texture atlas */
1274 if (atlas
->complete
&&
1275 list_id
>= atlas_id
&&
1276 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1277 /* Mark the atlas as incomplete so it doesn't get used. But don't
1278 * delete it yet since we don't want to try to recreate it in the next
1281 atlas
->complete
= false;
1282 atlas
->incomplete
= true;
1288 * Destroy a display list and remove from hash table.
1289 * \param list - display list number
1292 destroy_list(struct gl_context
*ctx
, GLuint list
)
1294 struct gl_display_list
*dlist
;
1299 dlist
= _mesa_lookup_list(ctx
, list
);
1303 if (is_bitmap_list(dlist
)) {
1304 /* If we're destroying a simple glBitmap display list, there's a
1305 * chance that we're destroying a bitmap image that's in a texture
1306 * atlas. Examine all atlases to see if that's the case. There's
1307 * usually few (if any) atlases so this isn't expensive.
1309 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1310 check_atlas_for_deleted_list
, &list
);
1313 _mesa_delete_list(ctx
, dlist
);
1314 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1319 * Translate the nth element of list from <type> to GLint.
1322 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1334 bptr
= (GLbyte
*) list
;
1335 return (GLint
) bptr
[n
];
1336 case GL_UNSIGNED_BYTE
:
1337 ubptr
= (GLubyte
*) list
;
1338 return (GLint
) ubptr
[n
];
1340 sptr
= (GLshort
*) list
;
1341 return (GLint
) sptr
[n
];
1342 case GL_UNSIGNED_SHORT
:
1343 usptr
= (GLushort
*) list
;
1344 return (GLint
) usptr
[n
];
1346 iptr
= (GLint
*) list
;
1348 case GL_UNSIGNED_INT
:
1349 uiptr
= (GLuint
*) list
;
1350 return (GLint
) uiptr
[n
];
1352 fptr
= (GLfloat
*) list
;
1353 return (GLint
) floorf(fptr
[n
]);
1355 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1356 return (GLint
) ubptr
[0] * 256
1359 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1360 return (GLint
) ubptr
[0] * 65536
1361 + (GLint
) ubptr
[1] * 256
1364 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1365 return (GLint
) ubptr
[0] * 16777216
1366 + (GLint
) ubptr
[1] * 65536
1367 + (GLint
) ubptr
[2] * 256
1376 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1377 * If width < 0 or height < 0 or format or type are invalid we'll just
1378 * return NULL. We will not generate an error since OpenGL command
1379 * arguments aren't error-checked until the command is actually executed
1380 * (not when they're compiled).
1381 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1384 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1385 GLsizei width
, GLsizei height
, GLsizei depth
,
1386 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1387 const struct gl_pixelstore_attrib
*unpack
)
1389 if (width
<= 0 || height
<= 0) {
1393 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1394 /* bad format and/or type */
1398 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1402 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1403 format
, type
, pixels
, unpack
);
1404 if (pixels
&& !image
) {
1405 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1409 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1410 depth
, format
, type
, INT_MAX
, pixels
)) {
1411 const GLubyte
*map
, *src
;
1415 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1416 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1419 /* unable to map src buffer! */
1420 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1424 src
= ADD_POINTERS(map
, pixels
);
1425 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1426 format
, type
, src
, unpack
);
1428 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1431 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1437 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1442 /** Return copy of memory */
1444 memdup(const void *src
, GLsizei bytes
)
1446 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1448 memcpy(b
, src
, bytes
);
1454 * Allocate space for a display list instruction (opcode + payload space).
1455 * \param opcode the instruction opcode (OPCODE_* value)
1456 * \param bytes instruction payload size (not counting opcode)
1457 * \param align8 does the payload need to be 8-byte aligned?
1458 * This is only relevant in 64-bit environments.
1459 * \return pointer to allocated memory (the payload will be at pointer+1)
1462 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1464 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1465 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1469 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1471 if (opcode
< OPCODE_EXT_0
) {
1472 if (InstSize
[opcode
] == 0) {
1473 /* save instruction size now */
1474 InstSize
[opcode
] = numNodes
;
1477 /* make sure instruction size agrees */
1478 assert(numNodes
== InstSize
[opcode
]);
1482 if (sizeof(void *) > sizeof(Node
) && align8
1483 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1484 /* The opcode would get placed at node[0] and the payload would start
1485 * at node[1]. But the payload needs to be at an even offset (8-byte
1494 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1496 /* This block is full. Allocate a new block and chain to it */
1498 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1499 n
[0].opcode
= OPCODE_CONTINUE
;
1500 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1502 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1506 /* a fresh block should be 8-byte aligned on 64-bit systems */
1507 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1509 save_pointer(&n
[1], newblock
);
1510 ctx
->ListState
.CurrentBlock
= newblock
;
1511 ctx
->ListState
.CurrentPos
= 0;
1513 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1514 * we have to insert a NOP so that the payload of the real opcode lands
1515 * on an even location:
1516 * node[0] = OPCODE_NOP
1517 * node[1] = OPCODE_x;
1518 * node[2] = start of payload
1520 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1523 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1525 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1526 n
[0].opcode
= OPCODE_NOP
;
1528 /* The "real" opcode will now be at an odd location and the payload
1529 * will be at an even location.
1532 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1534 n
[0].opcode
= opcode
;
1542 * Allocate space for a display list instruction. Used by callers outside
1543 * this file for things like VBO vertex data.
1545 * \param opcode the instruction opcode (OPCODE_* value)
1546 * \param bytes instruction size in bytes, not counting opcode.
1547 * \return pointer to the usable data area (not including the internal
1551 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1553 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1555 return n
+ 1; /* return pointer to payload area, after opcode */
1562 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1563 * aligned in 64-bit environments, 4-byte aligned otherwise.
1566 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1568 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1570 return n
+ 1; /* return pointer to payload area, after opcode */
1577 * This function allows modules and drivers to get their own opcodes
1578 * for extending display list functionality.
1579 * \param ctx the rendering context
1580 * \param size number of bytes for storing the new display list command
1581 * \param execute function to execute the new display list command
1582 * \param destroy function to destroy the new display list command
1583 * \param print function to print the new display list command
1584 * \return the new opcode number or -1 if error
1587 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1589 void (*execute
) (struct gl_context
*, void *),
1590 void (*destroy
) (struct gl_context
*, void *),
1591 void (*print
) (struct gl_context
*, void *, FILE *))
1593 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1594 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1595 ctx
->ListExt
->Opcode
[i
].Size
=
1596 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1597 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1598 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1599 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1600 return i
+ OPCODE_EXT_0
;
1607 * Allocate space for a display list instruction. The space is basically
1608 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1609 * function parameter, node[2] is the second parameter, etc.
1611 * \param opcode one of OPCODE_x
1612 * \param nparams number of function parameters
1613 * \return pointer to start of instruction space
1615 static inline Node
*
1616 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1618 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1623 * Called by EndList to try to reduce memory used for the list.
1626 trim_list(struct gl_context
*ctx
)
1628 /* If the list we're ending only has one allocated block of nodes/tokens
1629 * and its size isn't a full block size, realloc the block to use less
1630 * memory. This is important for apps that create many small display
1631 * lists and apps that use glXUseXFont (many lists each containing one
1633 * Note: we currently only trim display lists that allocated one block
1634 * of tokens. That hits the short list case which is what we're mainly
1635 * concerned with. Trimming longer lists would involve traversing the
1636 * linked list of blocks.
1638 struct gl_dlist_state
*list
= &ctx
->ListState
;
1640 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1641 (list
->CurrentPos
< BLOCK_SIZE
)) {
1642 /* There's only one block and it's not full, so realloc */
1643 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1644 list
->CurrentList
->Head
=
1645 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1646 if (!list
->CurrentBlock
) {
1647 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1655 * Display List compilation functions
1657 static void GLAPIENTRY
1658 save_Accum(GLenum op
, GLfloat value
)
1660 GET_CURRENT_CONTEXT(ctx
);
1662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1663 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1668 if (ctx
->ExecuteFlag
) {
1669 CALL_Accum(ctx
->Exec
, (op
, value
));
1674 static void GLAPIENTRY
1675 save_AlphaFunc(GLenum func
, GLclampf ref
)
1677 GET_CURRENT_CONTEXT(ctx
);
1679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1680 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1683 n
[2].f
= (GLfloat
) ref
;
1685 if (ctx
->ExecuteFlag
) {
1686 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1691 static void GLAPIENTRY
1692 save_BindTexture(GLenum target
, GLuint texture
)
1694 GET_CURRENT_CONTEXT(ctx
);
1696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1697 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1702 if (ctx
->ExecuteFlag
) {
1703 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1708 static void GLAPIENTRY
1709 save_Bitmap(GLsizei width
, GLsizei height
,
1710 GLfloat xorig
, GLfloat yorig
,
1711 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1713 GET_CURRENT_CONTEXT(ctx
);
1715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1716 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1718 n
[1].i
= (GLint
) width
;
1719 n
[2].i
= (GLint
) height
;
1725 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1726 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1728 if (ctx
->ExecuteFlag
) {
1729 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1730 xorig
, yorig
, xmove
, ymove
, pixels
));
1735 static void GLAPIENTRY
1736 save_BlendEquation(GLenum mode
)
1738 GET_CURRENT_CONTEXT(ctx
);
1740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1741 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1745 if (ctx
->ExecuteFlag
) {
1746 CALL_BlendEquation(ctx
->Exec
, (mode
));
1751 static void GLAPIENTRY
1752 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1754 GET_CURRENT_CONTEXT(ctx
);
1756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1757 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1768 static void GLAPIENTRY
1769 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1770 GLenum sfactorA
, GLenum dfactorA
)
1772 GET_CURRENT_CONTEXT(ctx
);
1774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1775 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1777 n
[1].e
= sfactorRGB
;
1778 n
[2].e
= dfactorRGB
;
1782 if (ctx
->ExecuteFlag
) {
1783 CALL_BlendFuncSeparate(ctx
->Exec
,
1784 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1789 static void GLAPIENTRY
1790 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1792 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1796 static void GLAPIENTRY
1797 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1799 GET_CURRENT_CONTEXT(ctx
);
1801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1802 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1809 if (ctx
->ExecuteFlag
) {
1810 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1814 /* GL_ARB_draw_buffers_blend */
1815 static void GLAPIENTRY
1816 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1817 GLenum sfactorA
, GLenum dfactorA
)
1819 GET_CURRENT_CONTEXT(ctx
);
1821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1822 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1825 n
[2].e
= sfactorRGB
;
1826 n
[3].e
= dfactorRGB
;
1830 if (ctx
->ExecuteFlag
) {
1831 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1832 sfactorA
, dfactorA
));
1836 /* GL_ARB_draw_buffers_blend */
1837 static void GLAPIENTRY
1838 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1840 GET_CURRENT_CONTEXT(ctx
);
1842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1843 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1849 if (ctx
->ExecuteFlag
) {
1850 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1854 /* GL_ARB_draw_buffers_blend */
1855 static void GLAPIENTRY
1856 save_BlendEquationi(GLuint buf
, GLenum mode
)
1858 GET_CURRENT_CONTEXT(ctx
);
1860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1861 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1866 if (ctx
->ExecuteFlag
) {
1867 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1871 /* GL_ARB_draw_buffers_blend */
1872 static void GLAPIENTRY
1873 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1875 GET_CURRENT_CONTEXT(ctx
);
1877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1878 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1884 if (ctx
->ExecuteFlag
) {
1885 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1890 /* GL_ARB_draw_instanced. */
1891 static void GLAPIENTRY
1892 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1894 UNUSED GLsizei count
,
1895 UNUSED GLsizei primcount
)
1897 GET_CURRENT_CONTEXT(ctx
);
1898 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1899 "glDrawArraysInstanced() during display list compile");
1902 static void GLAPIENTRY
1903 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1904 UNUSED GLsizei count
,
1906 UNUSED
const GLvoid
*indices
,
1907 UNUSED GLsizei primcount
)
1909 GET_CURRENT_CONTEXT(ctx
);
1910 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1911 "glDrawElementsInstanced() during display list compile");
1914 static void GLAPIENTRY
1915 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1916 UNUSED GLsizei count
,
1918 UNUSED
const GLvoid
*indices
,
1919 UNUSED GLsizei primcount
,
1920 UNUSED GLint basevertex
)
1922 GET_CURRENT_CONTEXT(ctx
);
1923 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1924 "glDrawElementsInstancedBaseVertex() during display list compile");
1927 /* GL_ARB_base_instance. */
1928 static void GLAPIENTRY
1929 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1931 UNUSED GLsizei count
,
1932 UNUSED GLsizei primcount
,
1933 UNUSED GLuint baseinstance
)
1935 GET_CURRENT_CONTEXT(ctx
);
1936 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1937 "glDrawArraysInstancedBaseInstance() during display list compile");
1940 static void APIENTRY
1941 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1942 UNUSED GLsizei count
,
1944 UNUSED
const void *indices
,
1945 UNUSED GLsizei primcount
,
1946 UNUSED GLuint baseinstance
)
1948 GET_CURRENT_CONTEXT(ctx
);
1949 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1950 "glDrawElementsInstancedBaseInstance() during display list compile");
1953 static void APIENTRY
1954 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1955 UNUSED GLsizei count
,
1957 UNUSED
const void *indices
,
1958 UNUSED GLsizei primcount
,
1959 UNUSED GLint basevertex
,
1960 UNUSED GLuint baseinstance
)
1962 GET_CURRENT_CONTEXT(ctx
);
1963 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1964 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1967 static void APIENTRY
1968 save_DrawArraysIndirect(UNUSED GLenum mode
,
1969 UNUSED
const void *indirect
)
1971 GET_CURRENT_CONTEXT(ctx
);
1972 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1973 "glDrawArraysIndirect() during display list compile");
1976 static void APIENTRY
1977 save_DrawElementsIndirect(UNUSED GLenum mode
,
1979 UNUSED
const void *indirect
)
1981 GET_CURRENT_CONTEXT(ctx
);
1982 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1983 "glDrawElementsIndirect() during display list compile");
1986 static void APIENTRY
1987 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1988 UNUSED
const void *indirect
,
1989 UNUSED GLsizei primcount
,
1990 UNUSED GLsizei stride
)
1992 GET_CURRENT_CONTEXT(ctx
);
1993 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1994 "glMultiDrawArraysIndirect() during display list compile");
1997 static void APIENTRY
1998 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2000 UNUSED
const void *indirect
,
2001 UNUSED GLsizei primcount
,
2002 UNUSED GLsizei stride
)
2004 GET_CURRENT_CONTEXT(ctx
);
2005 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2006 "glMultiDrawElementsIndirect() during display list compile");
2010 * While building a display list we cache some OpenGL state.
2011 * Under some circumstances we need to invalidate that state (immediately
2012 * when we start compiling a list, or after glCallList(s)).
2015 invalidate_saved_current_state(struct gl_context
*ctx
)
2019 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2020 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2022 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2023 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2025 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2027 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2031 static void GLAPIENTRY
2032 save_CallList(GLuint list
)
2034 GET_CURRENT_CONTEXT(ctx
);
2036 SAVE_FLUSH_VERTICES(ctx
);
2038 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2043 /* After this, we don't know what state we're in. Invalidate all
2044 * cached information previously gathered:
2046 invalidate_saved_current_state( ctx
);
2048 if (ctx
->ExecuteFlag
) {
2049 _mesa_CallList(list
);
2054 static void GLAPIENTRY
2055 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2057 GET_CURRENT_CONTEXT(ctx
);
2062 SAVE_FLUSH_VERTICES(ctx
);
2066 case GL_UNSIGNED_BYTE
:
2070 case GL_UNSIGNED_SHORT
:
2078 case GL_UNSIGNED_INT
:
2087 if (num
> 0 && type_size
> 0) {
2088 /* create a copy of the array of list IDs to save in the display list */
2089 lists_copy
= memdup(lists
, num
* type_size
);
2094 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2098 save_pointer(&n
[3], lists_copy
);
2101 /* After this, we don't know what state we're in. Invalidate all
2102 * cached information previously gathered:
2104 invalidate_saved_current_state( ctx
);
2106 if (ctx
->ExecuteFlag
) {
2107 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2112 static void GLAPIENTRY
2113 save_Clear(GLbitfield mask
)
2115 GET_CURRENT_CONTEXT(ctx
);
2117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2118 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2122 if (ctx
->ExecuteFlag
) {
2123 CALL_Clear(ctx
->Exec
, (mask
));
2128 static void GLAPIENTRY
2129 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2131 GET_CURRENT_CONTEXT(ctx
);
2133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2134 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2137 n
[2].i
= drawbuffer
;
2139 if (buffer
== GL_COLOR
) {
2150 if (ctx
->ExecuteFlag
) {
2151 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2156 static void GLAPIENTRY
2157 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2159 GET_CURRENT_CONTEXT(ctx
);
2161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2162 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2165 n
[2].i
= drawbuffer
;
2167 if (buffer
== GL_COLOR
) {
2178 if (ctx
->ExecuteFlag
) {
2179 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2184 static void GLAPIENTRY
2185 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2187 GET_CURRENT_CONTEXT(ctx
);
2189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2190 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2193 n
[2].i
= drawbuffer
;
2195 if (buffer
== GL_COLOR
) {
2206 if (ctx
->ExecuteFlag
) {
2207 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2212 static void GLAPIENTRY
2213 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2214 GLfloat depth
, GLint stencil
)
2216 GET_CURRENT_CONTEXT(ctx
);
2218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2219 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2222 n
[2].i
= drawbuffer
;
2226 if (ctx
->ExecuteFlag
) {
2227 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2232 static void GLAPIENTRY
2233 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2235 GET_CURRENT_CONTEXT(ctx
);
2237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2238 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2245 if (ctx
->ExecuteFlag
) {
2246 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2251 static void GLAPIENTRY
2252 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2264 if (ctx
->ExecuteFlag
) {
2265 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2270 static void GLAPIENTRY
2271 save_ClearDepth(GLclampd depth
)
2273 GET_CURRENT_CONTEXT(ctx
);
2275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2276 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2278 n
[1].f
= (GLfloat
) depth
;
2280 if (ctx
->ExecuteFlag
) {
2281 CALL_ClearDepth(ctx
->Exec
, (depth
));
2286 static void GLAPIENTRY
2287 save_ClearIndex(GLfloat c
)
2289 GET_CURRENT_CONTEXT(ctx
);
2291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2292 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2296 if (ctx
->ExecuteFlag
) {
2297 CALL_ClearIndex(ctx
->Exec
, (c
));
2302 static void GLAPIENTRY
2303 save_ClearStencil(GLint s
)
2305 GET_CURRENT_CONTEXT(ctx
);
2307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2308 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2312 if (ctx
->ExecuteFlag
) {
2313 CALL_ClearStencil(ctx
->Exec
, (s
));
2318 static void GLAPIENTRY
2319 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2321 GET_CURRENT_CONTEXT(ctx
);
2323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2324 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2327 n
[2].f
= (GLfloat
) equ
[0];
2328 n
[3].f
= (GLfloat
) equ
[1];
2329 n
[4].f
= (GLfloat
) equ
[2];
2330 n
[5].f
= (GLfloat
) equ
[3];
2332 if (ctx
->ExecuteFlag
) {
2333 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2339 static void GLAPIENTRY
2340 save_ColorMask(GLboolean red
, GLboolean green
,
2341 GLboolean blue
, GLboolean alpha
)
2343 GET_CURRENT_CONTEXT(ctx
);
2345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2346 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2353 if (ctx
->ExecuteFlag
) {
2354 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2359 static void GLAPIENTRY
2360 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2361 GLboolean blue
, GLboolean alpha
)
2363 GET_CURRENT_CONTEXT(ctx
);
2365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2366 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2374 if (ctx
->ExecuteFlag
) {
2375 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2380 static void GLAPIENTRY
2381 save_ColorMaterial(GLenum face
, GLenum mode
)
2383 GET_CURRENT_CONTEXT(ctx
);
2385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2387 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2392 if (ctx
->ExecuteFlag
) {
2393 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2398 static void GLAPIENTRY
2399 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2401 GET_CURRENT_CONTEXT(ctx
);
2403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2404 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2408 n
[3].i
= (GLint
) width
;
2409 n
[4].i
= (GLint
) height
;
2412 if (ctx
->ExecuteFlag
) {
2413 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2419 static void GLAPIENTRY
2420 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2421 GLint x
, GLint y
, GLsizei width
, GLint border
)
2423 GET_CURRENT_CONTEXT(ctx
);
2425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2426 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2430 n
[3].e
= internalformat
;
2436 if (ctx
->ExecuteFlag
) {
2437 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2438 x
, y
, width
, border
));
2443 static void GLAPIENTRY
2444 save_CopyTexImage2D(GLenum target
, GLint level
,
2445 GLenum internalformat
,
2446 GLint x
, GLint y
, GLsizei width
,
2447 GLsizei height
, GLint border
)
2449 GET_CURRENT_CONTEXT(ctx
);
2451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2452 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2456 n
[3].e
= internalformat
;
2463 if (ctx
->ExecuteFlag
) {
2464 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2465 x
, y
, width
, height
, border
));
2471 static void GLAPIENTRY
2472 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2473 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2475 GET_CURRENT_CONTEXT(ctx
);
2477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2478 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2487 if (ctx
->ExecuteFlag
) {
2488 CALL_CopyTexSubImage1D(ctx
->Exec
,
2489 (target
, level
, xoffset
, x
, y
, width
));
2494 static void GLAPIENTRY
2495 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2496 GLint xoffset
, GLint yoffset
,
2497 GLint x
, GLint y
, GLsizei width
, GLint height
)
2499 GET_CURRENT_CONTEXT(ctx
);
2501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2502 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2513 if (ctx
->ExecuteFlag
) {
2514 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2515 x
, y
, width
, height
));
2520 static void GLAPIENTRY
2521 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2522 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2523 GLint x
, GLint y
, GLsizei width
, GLint height
)
2525 GET_CURRENT_CONTEXT(ctx
);
2527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2528 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2540 if (ctx
->ExecuteFlag
) {
2541 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2542 xoffset
, yoffset
, zoffset
,
2543 x
, y
, width
, height
));
2548 static void GLAPIENTRY
2549 save_CullFace(GLenum mode
)
2551 GET_CURRENT_CONTEXT(ctx
);
2553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2554 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2558 if (ctx
->ExecuteFlag
) {
2559 CALL_CullFace(ctx
->Exec
, (mode
));
2564 static void GLAPIENTRY
2565 save_DepthFunc(GLenum func
)
2567 GET_CURRENT_CONTEXT(ctx
);
2569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2570 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2574 if (ctx
->ExecuteFlag
) {
2575 CALL_DepthFunc(ctx
->Exec
, (func
));
2580 static void GLAPIENTRY
2581 save_DepthMask(GLboolean mask
)
2583 GET_CURRENT_CONTEXT(ctx
);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2586 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_DepthMask(ctx
->Exec
, (mask
));
2596 static void GLAPIENTRY
2597 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2599 GET_CURRENT_CONTEXT(ctx
);
2601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2602 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2604 n
[1].f
= (GLfloat
) nearval
;
2605 n
[2].f
= (GLfloat
) farval
;
2607 if (ctx
->ExecuteFlag
) {
2608 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2613 static void GLAPIENTRY
2614 save_Disable(GLenum cap
)
2616 GET_CURRENT_CONTEXT(ctx
);
2618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2619 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2623 if (ctx
->ExecuteFlag
) {
2624 CALL_Disable(ctx
->Exec
, (cap
));
2629 static void GLAPIENTRY
2630 save_DisableIndexed(GLuint index
, GLenum cap
)
2632 GET_CURRENT_CONTEXT(ctx
);
2634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2635 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2640 if (ctx
->ExecuteFlag
) {
2641 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2646 static void GLAPIENTRY
2647 save_DrawBuffer(GLenum mode
)
2649 GET_CURRENT_CONTEXT(ctx
);
2651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2652 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2656 if (ctx
->ExecuteFlag
) {
2657 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2662 static void GLAPIENTRY
2663 save_DrawPixels(GLsizei width
, GLsizei height
,
2664 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2666 GET_CURRENT_CONTEXT(ctx
);
2669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2671 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2678 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2679 pixels
, &ctx
->Unpack
));
2681 if (ctx
->ExecuteFlag
) {
2682 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2688 static void GLAPIENTRY
2689 save_Enable(GLenum cap
)
2691 GET_CURRENT_CONTEXT(ctx
);
2693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2694 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2698 if (ctx
->ExecuteFlag
) {
2699 CALL_Enable(ctx
->Exec
, (cap
));
2705 static void GLAPIENTRY
2706 save_EnableIndexed(GLuint index
, GLenum cap
)
2708 GET_CURRENT_CONTEXT(ctx
);
2710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2711 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2716 if (ctx
->ExecuteFlag
) {
2717 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2723 static void GLAPIENTRY
2724 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2726 GET_CURRENT_CONTEXT(ctx
);
2728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2729 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2735 if (ctx
->ExecuteFlag
) {
2736 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2741 static void GLAPIENTRY
2742 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2744 GET_CURRENT_CONTEXT(ctx
);
2746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2747 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2755 if (ctx
->ExecuteFlag
) {
2756 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2763 static void GLAPIENTRY
2764 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2766 GET_CURRENT_CONTEXT(ctx
);
2768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2769 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2777 if (ctx
->ExecuteFlag
) {
2778 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2783 static void GLAPIENTRY
2784 save_Fogf(GLenum pname
, GLfloat param
)
2788 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2789 save_Fogfv(pname
, parray
);
2793 static void GLAPIENTRY
2794 save_Fogiv(GLenum pname
, const GLint
*params
)
2799 case GL_FOG_DENSITY
:
2803 case GL_FOG_COORDINATE_SOURCE
:
2804 p
[0] = (GLfloat
) *params
;
2810 p
[0] = INT_TO_FLOAT(params
[0]);
2811 p
[1] = INT_TO_FLOAT(params
[1]);
2812 p
[2] = INT_TO_FLOAT(params
[2]);
2813 p
[3] = INT_TO_FLOAT(params
[3]);
2816 /* Error will be caught later in gl_Fogfv */
2817 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2819 save_Fogfv(pname
, p
);
2823 static void GLAPIENTRY
2824 save_Fogi(GLenum pname
, GLint param
)
2828 parray
[1] = parray
[2] = parray
[3] = 0;
2829 save_Fogiv(pname
, parray
);
2833 static void GLAPIENTRY
2834 save_FrontFace(GLenum mode
)
2836 GET_CURRENT_CONTEXT(ctx
);
2838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2839 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2843 if (ctx
->ExecuteFlag
) {
2844 CALL_FrontFace(ctx
->Exec
, (mode
));
2849 static void GLAPIENTRY
2850 save_Frustum(GLdouble left
, GLdouble right
,
2851 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2853 GET_CURRENT_CONTEXT(ctx
);
2855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2856 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2858 n
[1].f
= (GLfloat
) left
;
2859 n
[2].f
= (GLfloat
) right
;
2860 n
[3].f
= (GLfloat
) bottom
;
2861 n
[4].f
= (GLfloat
) top
;
2862 n
[5].f
= (GLfloat
) nearval
;
2863 n
[6].f
= (GLfloat
) farval
;
2865 if (ctx
->ExecuteFlag
) {
2866 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2871 static void GLAPIENTRY
2872 save_Hint(GLenum target
, GLenum mode
)
2874 GET_CURRENT_CONTEXT(ctx
);
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2877 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2882 if (ctx
->ExecuteFlag
) {
2883 CALL_Hint(ctx
->Exec
, (target
, mode
));
2888 static void GLAPIENTRY
2889 save_IndexMask(GLuint mask
)
2891 GET_CURRENT_CONTEXT(ctx
);
2893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2894 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2898 if (ctx
->ExecuteFlag
) {
2899 CALL_IndexMask(ctx
->Exec
, (mask
));
2904 static void GLAPIENTRY
2905 save_InitNames(void)
2907 GET_CURRENT_CONTEXT(ctx
);
2908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2909 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2910 if (ctx
->ExecuteFlag
) {
2911 CALL_InitNames(ctx
->Exec
, ());
2916 static void GLAPIENTRY
2917 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2919 GET_CURRENT_CONTEXT(ctx
);
2921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2922 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2940 case GL_SPOT_DIRECTION
:
2943 case GL_SPOT_EXPONENT
:
2946 case GL_SPOT_CUTOFF
:
2949 case GL_CONSTANT_ATTENUATION
:
2952 case GL_LINEAR_ATTENUATION
:
2955 case GL_QUADRATIC_ATTENUATION
:
2961 for (i
= 0; i
< nParams
; i
++) {
2962 n
[3 + i
].f
= params
[i
];
2965 if (ctx
->ExecuteFlag
) {
2966 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2971 static void GLAPIENTRY
2972 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2976 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2977 save_Lightfv(light
, pname
, parray
);
2981 static void GLAPIENTRY
2982 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2989 fparam
[0] = INT_TO_FLOAT(params
[0]);
2990 fparam
[1] = INT_TO_FLOAT(params
[1]);
2991 fparam
[2] = INT_TO_FLOAT(params
[2]);
2992 fparam
[3] = INT_TO_FLOAT(params
[3]);
2995 fparam
[0] = (GLfloat
) params
[0];
2996 fparam
[1] = (GLfloat
) params
[1];
2997 fparam
[2] = (GLfloat
) params
[2];
2998 fparam
[3] = (GLfloat
) params
[3];
3000 case GL_SPOT_DIRECTION
:
3001 fparam
[0] = (GLfloat
) params
[0];
3002 fparam
[1] = (GLfloat
) params
[1];
3003 fparam
[2] = (GLfloat
) params
[2];
3005 case GL_SPOT_EXPONENT
:
3006 case GL_SPOT_CUTOFF
:
3007 case GL_CONSTANT_ATTENUATION
:
3008 case GL_LINEAR_ATTENUATION
:
3009 case GL_QUADRATIC_ATTENUATION
:
3010 fparam
[0] = (GLfloat
) params
[0];
3013 /* error will be caught later in gl_Lightfv */
3016 save_Lightfv(light
, pname
, fparam
);
3020 static void GLAPIENTRY
3021 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3025 parray
[1] = parray
[2] = parray
[3] = 0;
3026 save_Lightiv(light
, pname
, parray
);
3030 static void GLAPIENTRY
3031 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3033 GET_CURRENT_CONTEXT(ctx
);
3035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3036 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3044 if (ctx
->ExecuteFlag
) {
3045 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3050 static void GLAPIENTRY
3051 save_LightModelf(GLenum pname
, GLfloat param
)
3055 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3056 save_LightModelfv(pname
, parray
);
3060 static void GLAPIENTRY
3061 save_LightModeliv(GLenum pname
, const GLint
*params
)
3065 case GL_LIGHT_MODEL_AMBIENT
:
3066 fparam
[0] = INT_TO_FLOAT(params
[0]);
3067 fparam
[1] = INT_TO_FLOAT(params
[1]);
3068 fparam
[2] = INT_TO_FLOAT(params
[2]);
3069 fparam
[3] = INT_TO_FLOAT(params
[3]);
3071 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3072 case GL_LIGHT_MODEL_TWO_SIDE
:
3073 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3074 fparam
[0] = (GLfloat
) params
[0];
3080 /* Error will be caught later in gl_LightModelfv */
3081 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3083 save_LightModelfv(pname
, fparam
);
3087 static void GLAPIENTRY
3088 save_LightModeli(GLenum pname
, GLint param
)
3092 parray
[1] = parray
[2] = parray
[3] = 0;
3093 save_LightModeliv(pname
, parray
);
3097 static void GLAPIENTRY
3098 save_LineStipple(GLint factor
, GLushort pattern
)
3100 GET_CURRENT_CONTEXT(ctx
);
3102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3103 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3108 if (ctx
->ExecuteFlag
) {
3109 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3114 static void GLAPIENTRY
3115 save_LineWidth(GLfloat width
)
3117 GET_CURRENT_CONTEXT(ctx
);
3119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3120 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3124 if (ctx
->ExecuteFlag
) {
3125 CALL_LineWidth(ctx
->Exec
, (width
));
3130 static void GLAPIENTRY
3131 save_ListBase(GLuint base
)
3133 GET_CURRENT_CONTEXT(ctx
);
3135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3136 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3140 if (ctx
->ExecuteFlag
) {
3141 CALL_ListBase(ctx
->Exec
, (base
));
3146 static void GLAPIENTRY
3147 save_LoadIdentity(void)
3149 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3152 if (ctx
->ExecuteFlag
) {
3153 CALL_LoadIdentity(ctx
->Exec
, ());
3158 static void GLAPIENTRY
3159 save_LoadMatrixf(const GLfloat
* m
)
3161 GET_CURRENT_CONTEXT(ctx
);
3163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3164 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3167 for (i
= 0; i
< 16; i
++) {
3171 if (ctx
->ExecuteFlag
) {
3172 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3177 static void GLAPIENTRY
3178 save_LoadMatrixd(const GLdouble
* m
)
3182 for (i
= 0; i
< 16; i
++) {
3183 f
[i
] = (GLfloat
) m
[i
];
3185 save_LoadMatrixf(f
);
3189 static void GLAPIENTRY
3190 save_LoadName(GLuint name
)
3192 GET_CURRENT_CONTEXT(ctx
);
3194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3195 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3199 if (ctx
->ExecuteFlag
) {
3200 CALL_LoadName(ctx
->Exec
, (name
));
3205 static void GLAPIENTRY
3206 save_LogicOp(GLenum opcode
)
3208 GET_CURRENT_CONTEXT(ctx
);
3210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3211 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3215 if (ctx
->ExecuteFlag
) {
3216 CALL_LogicOp(ctx
->Exec
, (opcode
));
3221 static void GLAPIENTRY
3222 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3223 GLint order
, const GLdouble
* points
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3230 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3232 n
[2].f
= (GLfloat
) u1
;
3233 n
[3].f
= (GLfloat
) u2
;
3234 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3236 save_pointer(&n
[6], pnts
);
3238 if (ctx
->ExecuteFlag
) {
3239 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3243 static void GLAPIENTRY
3244 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3245 GLint order
, const GLfloat
* points
)
3247 GET_CURRENT_CONTEXT(ctx
);
3249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3250 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3252 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3256 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3258 save_pointer(&n
[6], pnts
);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3266 static void GLAPIENTRY
3267 save_Map2d(GLenum target
,
3268 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3269 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3270 const GLdouble
* points
)
3272 GET_CURRENT_CONTEXT(ctx
);
3274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3275 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3277 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3278 vstride
, vorder
, points
);
3280 n
[2].f
= (GLfloat
) u1
;
3281 n
[3].f
= (GLfloat
) u2
;
3282 n
[4].f
= (GLfloat
) v1
;
3283 n
[5].f
= (GLfloat
) v2
;
3284 /* XXX verify these strides are correct */
3285 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3286 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3289 save_pointer(&n
[10], pnts
);
3291 if (ctx
->ExecuteFlag
) {
3292 CALL_Map2d(ctx
->Exec
, (target
,
3293 u1
, u2
, ustride
, uorder
,
3294 v1
, v2
, vstride
, vorder
, points
));
3299 static void GLAPIENTRY
3300 save_Map2f(GLenum target
,
3301 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3302 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3303 const GLfloat
* points
)
3305 GET_CURRENT_CONTEXT(ctx
);
3307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3308 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3310 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3311 vstride
, vorder
, points
);
3317 /* XXX verify these strides are correct */
3318 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3319 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3322 save_pointer(&n
[10], pnts
);
3324 if (ctx
->ExecuteFlag
) {
3325 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3326 v1
, v2
, vstride
, vorder
, points
));
3331 static void GLAPIENTRY
3332 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3334 GET_CURRENT_CONTEXT(ctx
);
3336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3337 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3343 if (ctx
->ExecuteFlag
) {
3344 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3349 static void GLAPIENTRY
3350 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3352 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3356 static void GLAPIENTRY
3357 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3358 GLint vn
, GLfloat v1
, GLfloat v2
)
3360 GET_CURRENT_CONTEXT(ctx
);
3362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3363 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3372 if (ctx
->ExecuteFlag
) {
3373 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3379 static void GLAPIENTRY
3380 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3381 GLint vn
, GLdouble v1
, GLdouble v2
)
3383 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3384 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3388 static void GLAPIENTRY
3389 save_MatrixMode(GLenum mode
)
3391 GET_CURRENT_CONTEXT(ctx
);
3393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3394 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3398 if (ctx
->ExecuteFlag
) {
3399 CALL_MatrixMode(ctx
->Exec
, (mode
));
3404 static void GLAPIENTRY
3405 save_MultMatrixf(const GLfloat
* m
)
3407 GET_CURRENT_CONTEXT(ctx
);
3409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3410 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3413 for (i
= 0; i
< 16; i
++) {
3417 if (ctx
->ExecuteFlag
) {
3418 CALL_MultMatrixf(ctx
->Exec
, (m
));
3423 static void GLAPIENTRY
3424 save_MultMatrixd(const GLdouble
* m
)
3428 for (i
= 0; i
< 16; i
++) {
3429 f
[i
] = (GLfloat
) m
[i
];
3431 save_MultMatrixf(f
);
3435 static void GLAPIENTRY
3436 save_NewList(GLuint name
, GLenum mode
)
3438 GET_CURRENT_CONTEXT(ctx
);
3439 /* It's an error to call this function while building a display list */
3440 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3447 static void GLAPIENTRY
3448 save_Ortho(GLdouble left
, GLdouble right
,
3449 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3451 GET_CURRENT_CONTEXT(ctx
);
3453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3454 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3456 n
[1].f
= (GLfloat
) left
;
3457 n
[2].f
= (GLfloat
) right
;
3458 n
[3].f
= (GLfloat
) bottom
;
3459 n
[4].f
= (GLfloat
) top
;
3460 n
[5].f
= (GLfloat
) nearval
;
3461 n
[6].f
= (GLfloat
) farval
;
3463 if (ctx
->ExecuteFlag
) {
3464 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3469 static void GLAPIENTRY
3470 save_PatchParameteri(GLenum pname
, const GLint value
)
3472 GET_CURRENT_CONTEXT(ctx
);
3474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3475 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3480 if (ctx
->ExecuteFlag
) {
3481 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3486 static void GLAPIENTRY
3487 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3489 GET_CURRENT_CONTEXT(ctx
);
3491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3493 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3494 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3496 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3497 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3501 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3511 if (ctx
->ExecuteFlag
) {
3512 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3517 static void GLAPIENTRY
3518 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3520 GET_CURRENT_CONTEXT(ctx
);
3522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3523 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3527 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3529 if (ctx
->ExecuteFlag
) {
3530 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3535 static void GLAPIENTRY
3536 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3538 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3540 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3541 for (i
= 0; i
< mapsize
; i
++) {
3542 fvalues
[i
] = (GLfloat
) values
[i
];
3546 for (i
= 0; i
< mapsize
; i
++) {
3547 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3550 save_PixelMapfv(map
, mapsize
, fvalues
);
3554 static void GLAPIENTRY
3555 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3557 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3559 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3560 for (i
= 0; i
< mapsize
; i
++) {
3561 fvalues
[i
] = (GLfloat
) values
[i
];
3565 for (i
= 0; i
< mapsize
; i
++) {
3566 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3569 save_PixelMapfv(map
, mapsize
, fvalues
);
3573 static void GLAPIENTRY
3574 save_PixelTransferf(GLenum pname
, GLfloat param
)
3576 GET_CURRENT_CONTEXT(ctx
);
3578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3579 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3584 if (ctx
->ExecuteFlag
) {
3585 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3590 static void GLAPIENTRY
3591 save_PixelTransferi(GLenum pname
, GLint param
)
3593 save_PixelTransferf(pname
, (GLfloat
) param
);
3597 static void GLAPIENTRY
3598 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3600 GET_CURRENT_CONTEXT(ctx
);
3602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3603 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3608 if (ctx
->ExecuteFlag
) {
3609 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3614 static void GLAPIENTRY
3615 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3617 GET_CURRENT_CONTEXT(ctx
);
3619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3620 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3627 if (ctx
->ExecuteFlag
) {
3628 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3633 static void GLAPIENTRY
3634 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3638 parray
[1] = parray
[2] = 0.0F
;
3639 save_PointParameterfvEXT(pname
, parray
);
3642 static void GLAPIENTRY
3643 save_PointParameteriNV(GLenum pname
, GLint param
)
3646 parray
[0] = (GLfloat
) param
;
3647 parray
[1] = parray
[2] = 0.0F
;
3648 save_PointParameterfvEXT(pname
, parray
);
3651 static void GLAPIENTRY
3652 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3655 parray
[0] = (GLfloat
) param
[0];
3656 parray
[1] = parray
[2] = 0.0F
;
3657 save_PointParameterfvEXT(pname
, parray
);
3661 static void GLAPIENTRY
3662 save_PointSize(GLfloat size
)
3664 GET_CURRENT_CONTEXT(ctx
);
3666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3667 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3671 if (ctx
->ExecuteFlag
) {
3672 CALL_PointSize(ctx
->Exec
, (size
));
3677 static void GLAPIENTRY
3678 save_PolygonMode(GLenum face
, GLenum mode
)
3680 GET_CURRENT_CONTEXT(ctx
);
3682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3683 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3688 if (ctx
->ExecuteFlag
) {
3689 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3694 static void GLAPIENTRY
3695 save_PolygonStipple(const GLubyte
* pattern
)
3697 GET_CURRENT_CONTEXT(ctx
);
3700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3702 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3705 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3706 pattern
, &ctx
->Unpack
));
3708 if (ctx
->ExecuteFlag
) {
3709 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3714 static void GLAPIENTRY
3715 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3717 GET_CURRENT_CONTEXT(ctx
);
3719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3720 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3725 if (ctx
->ExecuteFlag
) {
3726 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3731 static void GLAPIENTRY
3732 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3734 GET_CURRENT_CONTEXT(ctx
);
3736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3737 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3743 if (ctx
->ExecuteFlag
) {
3744 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3748 static void GLAPIENTRY
3749 save_PopAttrib(void)
3751 GET_CURRENT_CONTEXT(ctx
);
3752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3753 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3754 if (ctx
->ExecuteFlag
) {
3755 CALL_PopAttrib(ctx
->Exec
, ());
3760 static void GLAPIENTRY
3761 save_PopMatrix(void)
3763 GET_CURRENT_CONTEXT(ctx
);
3764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3765 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3766 if (ctx
->ExecuteFlag
) {
3767 CALL_PopMatrix(ctx
->Exec
, ());
3772 static void GLAPIENTRY
3775 GET_CURRENT_CONTEXT(ctx
);
3776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3777 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3778 if (ctx
->ExecuteFlag
) {
3779 CALL_PopName(ctx
->Exec
, ());
3784 static void GLAPIENTRY
3785 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3786 const GLclampf
* priorities
)
3788 GET_CURRENT_CONTEXT(ctx
);
3790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3792 for (i
= 0; i
< num
; i
++) {
3794 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3796 n
[1].ui
= textures
[i
];
3797 n
[2].f
= priorities
[i
];
3800 if (ctx
->ExecuteFlag
) {
3801 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3806 static void GLAPIENTRY
3807 save_PushAttrib(GLbitfield mask
)
3809 GET_CURRENT_CONTEXT(ctx
);
3811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3812 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3816 if (ctx
->ExecuteFlag
) {
3817 CALL_PushAttrib(ctx
->Exec
, (mask
));
3822 static void GLAPIENTRY
3823 save_PushMatrix(void)
3825 GET_CURRENT_CONTEXT(ctx
);
3826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3827 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3828 if (ctx
->ExecuteFlag
) {
3829 CALL_PushMatrix(ctx
->Exec
, ());
3834 static void GLAPIENTRY
3835 save_PushName(GLuint name
)
3837 GET_CURRENT_CONTEXT(ctx
);
3839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3840 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3844 if (ctx
->ExecuteFlag
) {
3845 CALL_PushName(ctx
->Exec
, (name
));
3850 static void GLAPIENTRY
3851 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3853 GET_CURRENT_CONTEXT(ctx
);
3855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3856 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3863 if (ctx
->ExecuteFlag
) {
3864 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3868 static void GLAPIENTRY
3869 save_RasterPos2d(GLdouble x
, GLdouble y
)
3871 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3874 static void GLAPIENTRY
3875 save_RasterPos2f(GLfloat x
, GLfloat y
)
3877 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3880 static void GLAPIENTRY
3881 save_RasterPos2i(GLint x
, GLint y
)
3883 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3886 static void GLAPIENTRY
3887 save_RasterPos2s(GLshort x
, GLshort y
)
3889 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3892 static void GLAPIENTRY
3893 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3895 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3898 static void GLAPIENTRY
3899 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3901 save_RasterPos4f(x
, y
, z
, 1.0F
);
3904 static void GLAPIENTRY
3905 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3907 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3910 static void GLAPIENTRY
3911 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3913 save_RasterPos4f(x
, y
, z
, 1.0F
);
3916 static void GLAPIENTRY
3917 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3919 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3922 static void GLAPIENTRY
3923 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3925 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3928 static void GLAPIENTRY
3929 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3931 save_RasterPos4f(x
, y
, z
, w
);
3934 static void GLAPIENTRY
3935 save_RasterPos2dv(const GLdouble
* v
)
3937 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3940 static void GLAPIENTRY
3941 save_RasterPos2fv(const GLfloat
* v
)
3943 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3946 static void GLAPIENTRY
3947 save_RasterPos2iv(const GLint
* v
)
3949 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3952 static void GLAPIENTRY
3953 save_RasterPos2sv(const GLshort
* v
)
3955 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3958 static void GLAPIENTRY
3959 save_RasterPos3dv(const GLdouble
* v
)
3961 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3964 static void GLAPIENTRY
3965 save_RasterPos3fv(const GLfloat
* v
)
3967 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3970 static void GLAPIENTRY
3971 save_RasterPos3iv(const GLint
* v
)
3973 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3976 static void GLAPIENTRY
3977 save_RasterPos3sv(const GLshort
* v
)
3979 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3982 static void GLAPIENTRY
3983 save_RasterPos4dv(const GLdouble
* v
)
3985 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3986 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3989 static void GLAPIENTRY
3990 save_RasterPos4fv(const GLfloat
* v
)
3992 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3995 static void GLAPIENTRY
3996 save_RasterPos4iv(const GLint
* v
)
3998 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3999 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4002 static void GLAPIENTRY
4003 save_RasterPos4sv(const GLshort
* v
)
4005 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4009 static void GLAPIENTRY
4010 save_PassThrough(GLfloat token
)
4012 GET_CURRENT_CONTEXT(ctx
);
4014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4015 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4019 if (ctx
->ExecuteFlag
) {
4020 CALL_PassThrough(ctx
->Exec
, (token
));
4025 static void GLAPIENTRY
4026 save_ReadBuffer(GLenum mode
)
4028 GET_CURRENT_CONTEXT(ctx
);
4030 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4031 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4035 if (ctx
->ExecuteFlag
) {
4036 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4041 static void GLAPIENTRY
4042 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4044 GET_CURRENT_CONTEXT(ctx
);
4046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4047 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4054 if (ctx
->ExecuteFlag
) {
4055 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4060 static void GLAPIENTRY
4061 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4063 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4067 static void GLAPIENTRY
4068 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4070 GET_CURRENT_CONTEXT(ctx
);
4072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4073 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4079 if (ctx
->ExecuteFlag
) {
4080 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4085 static void GLAPIENTRY
4086 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4088 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4092 static void GLAPIENTRY
4093 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4095 GET_CURRENT_CONTEXT(ctx
);
4097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4098 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4105 if (ctx
->ExecuteFlag
) {
4106 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4111 static void GLAPIENTRY
4112 save_ShadeModel(GLenum mode
)
4114 GET_CURRENT_CONTEXT(ctx
);
4116 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4118 if (ctx
->ExecuteFlag
) {
4119 CALL_ShadeModel(ctx
->Exec
, (mode
));
4122 /* Don't compile this call if it's a no-op.
4123 * By avoiding this state change we have a better chance of
4124 * coalescing subsequent drawing commands into one batch.
4126 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4129 SAVE_FLUSH_VERTICES(ctx
);
4131 ctx
->ListState
.Current
.ShadeModel
= mode
;
4133 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4140 static void GLAPIENTRY
4141 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4143 GET_CURRENT_CONTEXT(ctx
);
4145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4146 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4152 if (ctx
->ExecuteFlag
) {
4153 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4158 static void GLAPIENTRY
4159 save_StencilMask(GLuint mask
)
4161 GET_CURRENT_CONTEXT(ctx
);
4163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4164 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4168 if (ctx
->ExecuteFlag
) {
4169 CALL_StencilMask(ctx
->Exec
, (mask
));
4174 static void GLAPIENTRY
4175 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4177 GET_CURRENT_CONTEXT(ctx
);
4179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4180 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4186 if (ctx
->ExecuteFlag
) {
4187 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4192 static void GLAPIENTRY
4193 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4195 GET_CURRENT_CONTEXT(ctx
);
4197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4198 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4205 if (ctx
->ExecuteFlag
) {
4206 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4211 static void GLAPIENTRY
4212 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4215 GET_CURRENT_CONTEXT(ctx
);
4217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4219 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4227 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4234 if (ctx
->ExecuteFlag
) {
4235 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4236 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4241 static void GLAPIENTRY
4242 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4244 GET_CURRENT_CONTEXT(ctx
);
4246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4247 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4252 if (ctx
->ExecuteFlag
) {
4253 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4258 static void GLAPIENTRY
4259 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4261 GET_CURRENT_CONTEXT(ctx
);
4263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4264 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4271 if (ctx
->ExecuteFlag
) {
4272 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4277 static void GLAPIENTRY
4278 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4280 GET_CURRENT_CONTEXT(ctx
);
4282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4283 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4287 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4295 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4298 if (ctx
->ExecuteFlag
) {
4299 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4304 static void GLAPIENTRY
4305 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4308 parray
[0] = (GLfloat
) param
;
4309 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4310 save_TexEnvfv(target
, pname
, parray
);
4314 static void GLAPIENTRY
4315 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4318 p
[0] = (GLfloat
) param
;
4319 p
[1] = p
[2] = p
[3] = 0.0F
;
4320 save_TexEnvfv(target
, pname
, p
);
4324 static void GLAPIENTRY
4325 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4328 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4329 p
[0] = INT_TO_FLOAT(param
[0]);
4330 p
[1] = INT_TO_FLOAT(param
[1]);
4331 p
[2] = INT_TO_FLOAT(param
[2]);
4332 p
[3] = INT_TO_FLOAT(param
[3]);
4335 p
[0] = (GLfloat
) param
[0];
4336 p
[1] = p
[2] = p
[3] = 0.0F
;
4338 save_TexEnvfv(target
, pname
, p
);
4342 static void GLAPIENTRY
4343 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4345 GET_CURRENT_CONTEXT(ctx
);
4347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4348 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4357 if (ctx
->ExecuteFlag
) {
4358 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4363 static void GLAPIENTRY
4364 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4367 p
[0] = (GLfloat
) params
[0];
4368 p
[1] = (GLfloat
) params
[1];
4369 p
[2] = (GLfloat
) params
[2];
4370 p
[3] = (GLfloat
) params
[3];
4371 save_TexGenfv(coord
, pname
, p
);
4375 static void GLAPIENTRY
4376 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4379 parray
[0] = (GLfloat
) param
;
4380 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4381 save_TexGenfv(coord
, pname
, parray
);
4385 static void GLAPIENTRY
4386 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4389 p
[0] = (GLfloat
) params
[0];
4390 p
[1] = (GLfloat
) params
[1];
4391 p
[2] = (GLfloat
) params
[2];
4392 p
[3] = (GLfloat
) params
[3];
4393 save_TexGenfv(coord
, pname
, p
);
4397 static void GLAPIENTRY
4398 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4402 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4403 save_TexGenfv(coord
, pname
, parray
);
4407 static void GLAPIENTRY
4408 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4412 parray
[1] = parray
[2] = parray
[3] = 0;
4413 save_TexGeniv(coord
, pname
, parray
);
4417 static void GLAPIENTRY
4418 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4420 GET_CURRENT_CONTEXT(ctx
);
4422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4423 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4432 if (ctx
->ExecuteFlag
) {
4433 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4438 static void GLAPIENTRY
4439 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4443 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4444 save_TexParameterfv(target
, pname
, parray
);
4448 static void GLAPIENTRY
4449 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4452 fparam
[0] = (GLfloat
) param
;
4453 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4454 save_TexParameterfv(target
, pname
, fparam
);
4458 static void GLAPIENTRY
4459 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4462 fparam
[0] = (GLfloat
) params
[0];
4463 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4464 save_TexParameterfv(target
, pname
, fparam
);
4468 static void GLAPIENTRY
4469 save_TexImage1D(GLenum target
,
4470 GLint level
, GLint components
,
4471 GLsizei width
, GLint border
,
4472 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4474 GET_CURRENT_CONTEXT(ctx
);
4475 if (target
== GL_PROXY_TEXTURE_1D
) {
4476 /* don't compile, execute immediately */
4477 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4478 border
, format
, type
, pixels
));
4482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4483 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4487 n
[3].i
= components
;
4488 n
[4].i
= (GLint
) width
;
4493 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4494 pixels
, &ctx
->Unpack
));
4496 if (ctx
->ExecuteFlag
) {
4497 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4498 border
, format
, type
, pixels
));
4504 static void GLAPIENTRY
4505 save_TexImage2D(GLenum target
,
4506 GLint level
, GLint components
,
4507 GLsizei width
, GLsizei height
, GLint border
,
4508 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4510 GET_CURRENT_CONTEXT(ctx
);
4511 if (target
== GL_PROXY_TEXTURE_2D
) {
4512 /* don't compile, execute immediately */
4513 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4514 height
, border
, format
, type
, pixels
));
4518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4519 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4523 n
[3].i
= components
;
4524 n
[4].i
= (GLint
) width
;
4525 n
[5].i
= (GLint
) height
;
4530 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4531 pixels
, &ctx
->Unpack
));
4533 if (ctx
->ExecuteFlag
) {
4534 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4535 height
, border
, format
, type
, pixels
));
4541 static void GLAPIENTRY
4542 save_TexImage3D(GLenum target
,
4543 GLint level
, GLint internalFormat
,
4544 GLsizei width
, GLsizei height
, GLsizei depth
,
4546 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4548 GET_CURRENT_CONTEXT(ctx
);
4549 if (target
== GL_PROXY_TEXTURE_3D
) {
4550 /* don't compile, execute immediately */
4551 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4552 height
, depth
, border
, format
, type
,
4557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4558 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4562 n
[3].i
= (GLint
) internalFormat
;
4563 n
[4].i
= (GLint
) width
;
4564 n
[5].i
= (GLint
) height
;
4565 n
[6].i
= (GLint
) depth
;
4569 save_pointer(&n
[10],
4570 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4571 pixels
, &ctx
->Unpack
));
4573 if (ctx
->ExecuteFlag
) {
4574 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4575 height
, depth
, border
, format
, type
,
4582 static void GLAPIENTRY
4583 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4584 GLsizei width
, GLenum format
, GLenum type
,
4585 const GLvoid
* pixels
)
4587 GET_CURRENT_CONTEXT(ctx
);
4590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4592 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4597 n
[4].i
= (GLint
) width
;
4601 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4602 pixels
, &ctx
->Unpack
));
4604 if (ctx
->ExecuteFlag
) {
4605 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4606 format
, type
, pixels
));
4611 static void GLAPIENTRY
4612 save_TexSubImage2D(GLenum target
, GLint level
,
4613 GLint xoffset
, GLint yoffset
,
4614 GLsizei width
, GLsizei height
,
4615 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4617 GET_CURRENT_CONTEXT(ctx
);
4620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4622 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4628 n
[5].i
= (GLint
) width
;
4629 n
[6].i
= (GLint
) height
;
4633 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4634 pixels
, &ctx
->Unpack
));
4636 if (ctx
->ExecuteFlag
) {
4637 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4638 width
, height
, format
, type
, pixels
));
4643 static void GLAPIENTRY
4644 save_TexSubImage3D(GLenum target
, GLint level
,
4645 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4646 GLsizei width
, GLsizei height
, GLsizei depth
,
4647 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4649 GET_CURRENT_CONTEXT(ctx
);
4652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4654 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4661 n
[6].i
= (GLint
) width
;
4662 n
[7].i
= (GLint
) height
;
4663 n
[8].i
= (GLint
) depth
;
4666 save_pointer(&n
[11],
4667 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4668 pixels
, &ctx
->Unpack
));
4670 if (ctx
->ExecuteFlag
) {
4671 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4672 xoffset
, yoffset
, zoffset
,
4673 width
, height
, depth
, format
, type
,
4679 static void GLAPIENTRY
4680 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4682 GET_CURRENT_CONTEXT(ctx
);
4684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4685 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4691 if (ctx
->ExecuteFlag
) {
4692 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4697 static void GLAPIENTRY
4698 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4700 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4705 static void GLAPIENTRY
4706 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4708 GET_CURRENT_CONTEXT(ctx
);
4710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4711 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4715 n
[3].i
= (GLint
) width
;
4716 n
[4].i
= (GLint
) height
;
4718 if (ctx
->ExecuteFlag
) {
4719 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4723 static void GLAPIENTRY
4724 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4727 GET_CURRENT_CONTEXT(ctx
);
4729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4730 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4738 if (ctx
->ExecuteFlag
) {
4739 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4743 static void GLAPIENTRY
4744 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4746 GET_CURRENT_CONTEXT(ctx
);
4748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4749 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4757 if (ctx
->ExecuteFlag
) {
4758 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4762 static void GLAPIENTRY
4763 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4765 GET_CURRENT_CONTEXT(ctx
);
4767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4768 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4772 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4774 if (ctx
->ExecuteFlag
) {
4775 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4779 static void GLAPIENTRY
4780 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4783 GET_CURRENT_CONTEXT(ctx
);
4785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4786 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4794 if (ctx
->ExecuteFlag
) {
4795 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4799 static void GLAPIENTRY
4800 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4802 GET_CURRENT_CONTEXT(ctx
);
4804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4805 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4813 if (ctx
->ExecuteFlag
) {
4814 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4818 static void GLAPIENTRY
4819 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4821 GET_CURRENT_CONTEXT(ctx
);
4823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4824 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4828 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4830 if (ctx
->ExecuteFlag
) {
4831 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4835 static void GLAPIENTRY
4836 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4838 GET_CURRENT_CONTEXT(ctx
);
4840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4841 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4844 /* Mesa stores these as floats internally so we deliberately convert
4845 * them to a float here.
4850 if (ctx
->ExecuteFlag
) {
4851 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4855 static void GLAPIENTRY
4856 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4858 GET_CURRENT_CONTEXT(ctx
);
4860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4861 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4865 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4867 if (ctx
->ExecuteFlag
) {
4868 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4872 static void GLAPIENTRY
4873 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4878 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4885 if (ctx
->ExecuteFlag
) {
4886 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4890 static void GLAPIENTRY
4891 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4893 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4896 static void GLAPIENTRY
4897 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4899 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4902 static void GLAPIENTRY
4903 save_WindowPos2iMESA(GLint x
, GLint y
)
4905 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4908 static void GLAPIENTRY
4909 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4911 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4914 static void GLAPIENTRY
4915 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4917 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4920 static void GLAPIENTRY
4921 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4923 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4926 static void GLAPIENTRY
4927 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4929 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4932 static void GLAPIENTRY
4933 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4935 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4938 static void GLAPIENTRY
4939 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4941 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4944 static void GLAPIENTRY
4945 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4947 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4950 static void GLAPIENTRY
4951 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4953 save_WindowPos4fMESA(x
, y
, z
, w
);
4956 static void GLAPIENTRY
4957 save_WindowPos2dvMESA(const GLdouble
* v
)
4959 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4962 static void GLAPIENTRY
4963 save_WindowPos2fvMESA(const GLfloat
* v
)
4965 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4968 static void GLAPIENTRY
4969 save_WindowPos2ivMESA(const GLint
* v
)
4971 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4974 static void GLAPIENTRY
4975 save_WindowPos2svMESA(const GLshort
* v
)
4977 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4980 static void GLAPIENTRY
4981 save_WindowPos3dvMESA(const GLdouble
* v
)
4983 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4986 static void GLAPIENTRY
4987 save_WindowPos3fvMESA(const GLfloat
* v
)
4989 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4992 static void GLAPIENTRY
4993 save_WindowPos3ivMESA(const GLint
* v
)
4995 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4998 static void GLAPIENTRY
4999 save_WindowPos3svMESA(const GLshort
* v
)
5001 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5004 static void GLAPIENTRY
5005 save_WindowPos4dvMESA(const GLdouble
* v
)
5007 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5008 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5011 static void GLAPIENTRY
5012 save_WindowPos4fvMESA(const GLfloat
* v
)
5014 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5017 static void GLAPIENTRY
5018 save_WindowPos4ivMESA(const GLint
* v
)
5020 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5021 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5024 static void GLAPIENTRY
5025 save_WindowPos4svMESA(const GLshort
* v
)
5027 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5032 /* GL_ARB_multitexture */
5033 static void GLAPIENTRY
5034 save_ActiveTextureARB(GLenum target
)
5036 GET_CURRENT_CONTEXT(ctx
);
5038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5039 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5043 if (ctx
->ExecuteFlag
) {
5044 CALL_ActiveTexture(ctx
->Exec
, (target
));
5049 /* GL_ARB_transpose_matrix */
5051 static void GLAPIENTRY
5052 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5055 _math_transposefd(tm
, m
);
5056 save_LoadMatrixf(tm
);
5060 static void GLAPIENTRY
5061 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5064 _math_transposef(tm
, m
);
5065 save_LoadMatrixf(tm
);
5069 static void GLAPIENTRY
5070 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5073 _math_transposefd(tm
, m
);
5074 save_MultMatrixf(tm
);
5078 static void GLAPIENTRY
5079 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5082 _math_transposef(tm
, m
);
5083 save_MultMatrixf(tm
);
5086 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5088 GET_CURRENT_CONTEXT(ctx
);
5094 image
= malloc(size
);
5096 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5099 memcpy(image
, data
, size
);
5105 /* GL_ARB_texture_compression */
5106 static void GLAPIENTRY
5107 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5108 GLenum internalFormat
, GLsizei width
,
5109 GLint border
, GLsizei imageSize
,
5110 const GLvoid
* data
)
5112 GET_CURRENT_CONTEXT(ctx
);
5113 if (target
== GL_PROXY_TEXTURE_1D
) {
5114 /* don't compile, execute immediately */
5115 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5116 width
, border
, imageSize
,
5121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5123 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5124 6 + POINTER_DWORDS
);
5128 n
[3].e
= internalFormat
;
5129 n
[4].i
= (GLint
) width
;
5133 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5135 if (ctx
->ExecuteFlag
) {
5136 CALL_CompressedTexImage1D(ctx
->Exec
,
5137 (target
, level
, internalFormat
, width
,
5138 border
, imageSize
, data
));
5144 static void GLAPIENTRY
5145 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5146 GLenum internalFormat
, GLsizei width
,
5147 GLsizei height
, GLint border
, GLsizei imageSize
,
5148 const GLvoid
* data
)
5150 GET_CURRENT_CONTEXT(ctx
);
5151 if (target
== GL_PROXY_TEXTURE_2D
) {
5152 /* don't compile, execute immediately */
5153 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5154 width
, height
, border
,
5159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5161 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5162 7 + POINTER_DWORDS
);
5166 n
[3].e
= internalFormat
;
5167 n
[4].i
= (GLint
) width
;
5168 n
[5].i
= (GLint
) height
;
5172 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5174 if (ctx
->ExecuteFlag
) {
5175 CALL_CompressedTexImage2D(ctx
->Exec
,
5176 (target
, level
, internalFormat
, width
,
5177 height
, border
, imageSize
, data
));
5183 static void GLAPIENTRY
5184 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5185 GLenum internalFormat
, GLsizei width
,
5186 GLsizei height
, GLsizei depth
, GLint border
,
5187 GLsizei imageSize
, const GLvoid
* data
)
5189 GET_CURRENT_CONTEXT(ctx
);
5190 if (target
== GL_PROXY_TEXTURE_3D
) {
5191 /* don't compile, execute immediately */
5192 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5193 width
, height
, depth
, border
,
5198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5200 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5201 8 + POINTER_DWORDS
);
5205 n
[3].e
= internalFormat
;
5206 n
[4].i
= (GLint
) width
;
5207 n
[5].i
= (GLint
) height
;
5208 n
[6].i
= (GLint
) depth
;
5212 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5214 if (ctx
->ExecuteFlag
) {
5215 CALL_CompressedTexImage3D(ctx
->Exec
,
5216 (target
, level
, internalFormat
, width
,
5217 height
, depth
, border
, imageSize
,
5224 static void GLAPIENTRY
5225 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5226 GLsizei width
, GLenum format
,
5227 GLsizei imageSize
, const GLvoid
* data
)
5230 GET_CURRENT_CONTEXT(ctx
);
5231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5233 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5234 6 + POINTER_DWORDS
);
5239 n
[4].i
= (GLint
) width
;
5243 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5245 if (ctx
->ExecuteFlag
) {
5246 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5247 width
, format
, imageSize
,
5253 static void GLAPIENTRY
5254 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5255 GLint yoffset
, GLsizei width
, GLsizei height
,
5256 GLenum format
, GLsizei imageSize
,
5257 const GLvoid
* data
)
5260 GET_CURRENT_CONTEXT(ctx
);
5261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5263 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5264 8 + POINTER_DWORDS
);
5270 n
[5].i
= (GLint
) width
;
5271 n
[6].i
= (GLint
) height
;
5275 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5277 if (ctx
->ExecuteFlag
) {
5278 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5279 (target
, level
, xoffset
, yoffset
, width
,
5280 height
, format
, imageSize
, data
));
5285 static void GLAPIENTRY
5286 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5287 GLint yoffset
, GLint zoffset
, GLsizei width
,
5288 GLsizei height
, GLsizei depth
, GLenum format
,
5289 GLsizei imageSize
, const GLvoid
* data
)
5292 GET_CURRENT_CONTEXT(ctx
);
5293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5295 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5296 10 + POINTER_DWORDS
);
5303 n
[6].i
= (GLint
) width
;
5304 n
[7].i
= (GLint
) height
;
5305 n
[8].i
= (GLint
) depth
;
5307 n
[10].i
= imageSize
;
5308 save_pointer(&n
[11],
5309 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5311 if (ctx
->ExecuteFlag
) {
5312 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5313 (target
, level
, xoffset
, yoffset
,
5314 zoffset
, width
, height
, depth
, format
,
5320 /* GL_ARB_multisample */
5321 static void GLAPIENTRY
5322 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5324 GET_CURRENT_CONTEXT(ctx
);
5326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5327 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5332 if (ctx
->ExecuteFlag
) {
5333 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5339 * GL_ARB_vertex_program
5341 static void GLAPIENTRY
5342 save_BindProgramARB(GLenum target
, GLuint id
)
5344 GET_CURRENT_CONTEXT(ctx
);
5346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5347 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5352 if (ctx
->ExecuteFlag
) {
5353 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5357 static void GLAPIENTRY
5358 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5359 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5361 GET_CURRENT_CONTEXT(ctx
);
5363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5364 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5373 if (ctx
->ExecuteFlag
) {
5374 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5379 static void GLAPIENTRY
5380 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5381 const GLfloat
*params
)
5383 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5384 params
[2], params
[3]);
5388 static void GLAPIENTRY
5389 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5390 const GLfloat
* params
)
5392 GET_CURRENT_CONTEXT(ctx
);
5394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5398 const GLfloat
* p
= params
;
5400 for (i
= 0 ; i
< count
; i
++) {
5401 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5414 if (ctx
->ExecuteFlag
) {
5415 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5420 static void GLAPIENTRY
5421 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5422 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5424 save_ProgramEnvParameter4fARB(target
, index
,
5426 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5430 static void GLAPIENTRY
5431 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5432 const GLdouble
*params
)
5434 save_ProgramEnvParameter4fARB(target
, index
,
5435 (GLfloat
) params
[0],
5436 (GLfloat
) params
[1],
5437 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5441 static void GLAPIENTRY
5442 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5443 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5445 GET_CURRENT_CONTEXT(ctx
);
5447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5448 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5457 if (ctx
->ExecuteFlag
) {
5458 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5463 static void GLAPIENTRY
5464 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5465 const GLfloat
*params
)
5467 GET_CURRENT_CONTEXT(ctx
);
5469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5470 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5479 if (ctx
->ExecuteFlag
) {
5480 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5485 static void GLAPIENTRY
5486 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5487 const GLfloat
*params
)
5489 GET_CURRENT_CONTEXT(ctx
);
5491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5495 const GLfloat
* p
= params
;
5497 for (i
= 0 ; i
< count
; i
++) {
5498 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5511 if (ctx
->ExecuteFlag
) {
5512 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5517 static void GLAPIENTRY
5518 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5519 GLdouble x
, GLdouble y
,
5520 GLdouble z
, GLdouble w
)
5522 GET_CURRENT_CONTEXT(ctx
);
5524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5525 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5529 n
[3].f
= (GLfloat
) x
;
5530 n
[4].f
= (GLfloat
) y
;
5531 n
[5].f
= (GLfloat
) z
;
5532 n
[6].f
= (GLfloat
) w
;
5534 if (ctx
->ExecuteFlag
) {
5535 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5540 static void GLAPIENTRY
5541 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5542 const GLdouble
*params
)
5544 GET_CURRENT_CONTEXT(ctx
);
5546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5547 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5551 n
[3].f
= (GLfloat
) params
[0];
5552 n
[4].f
= (GLfloat
) params
[1];
5553 n
[5].f
= (GLfloat
) params
[2];
5554 n
[6].f
= (GLfloat
) params
[3];
5556 if (ctx
->ExecuteFlag
) {
5557 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5562 /* GL_EXT_stencil_two_side */
5563 static void GLAPIENTRY
5564 save_ActiveStencilFaceEXT(GLenum face
)
5566 GET_CURRENT_CONTEXT(ctx
);
5568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5569 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5573 if (ctx
->ExecuteFlag
) {
5574 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5579 /* GL_EXT_depth_bounds_test */
5580 static void GLAPIENTRY
5581 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5583 GET_CURRENT_CONTEXT(ctx
);
5585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5586 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5588 n
[1].f
= (GLfloat
) zmin
;
5589 n
[2].f
= (GLfloat
) zmax
;
5591 if (ctx
->ExecuteFlag
) {
5592 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5598 static void GLAPIENTRY
5599 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5600 const GLvoid
* string
)
5602 GET_CURRENT_CONTEXT(ctx
);
5605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5607 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5609 GLubyte
*programCopy
= malloc(len
);
5611 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5614 memcpy(programCopy
, string
, len
);
5618 save_pointer(&n
[4], programCopy
);
5620 if (ctx
->ExecuteFlag
) {
5621 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5626 static void GLAPIENTRY
5627 save_BeginQueryARB(GLenum target
, GLuint id
)
5629 GET_CURRENT_CONTEXT(ctx
);
5631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5632 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5637 if (ctx
->ExecuteFlag
) {
5638 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5642 static void GLAPIENTRY
5643 save_EndQueryARB(GLenum target
)
5645 GET_CURRENT_CONTEXT(ctx
);
5647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5648 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5652 if (ctx
->ExecuteFlag
) {
5653 CALL_EndQuery(ctx
->Exec
, (target
));
5657 static void GLAPIENTRY
5658 save_QueryCounter(GLuint id
, GLenum target
)
5660 GET_CURRENT_CONTEXT(ctx
);
5662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5663 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5668 if (ctx
->ExecuteFlag
) {
5669 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5673 static void GLAPIENTRY
5674 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5676 GET_CURRENT_CONTEXT(ctx
);
5678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5679 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5685 if (ctx
->ExecuteFlag
) {
5686 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5690 static void GLAPIENTRY
5691 save_EndQueryIndexed(GLenum target
, GLuint index
)
5693 GET_CURRENT_CONTEXT(ctx
);
5695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5696 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5701 if (ctx
->ExecuteFlag
) {
5702 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5707 static void GLAPIENTRY
5708 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5710 GET_CURRENT_CONTEXT(ctx
);
5712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5713 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5717 if (count
> MAX_DRAW_BUFFERS
)
5718 count
= MAX_DRAW_BUFFERS
;
5719 for (i
= 0; i
< count
; i
++) {
5720 n
[2 + i
].e
= buffers
[i
];
5723 if (ctx
->ExecuteFlag
) {
5724 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5728 static void GLAPIENTRY
5729 save_BindFragmentShaderATI(GLuint id
)
5731 GET_CURRENT_CONTEXT(ctx
);
5734 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5738 if (ctx
->ExecuteFlag
) {
5739 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5743 static void GLAPIENTRY
5744 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5746 GET_CURRENT_CONTEXT(ctx
);
5749 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5757 if (ctx
->ExecuteFlag
) {
5758 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5762 static void GLAPIENTRY
5763 save_Attr1fNV(GLenum attr
, GLfloat x
)
5765 GET_CURRENT_CONTEXT(ctx
);
5767 SAVE_FLUSH_VERTICES(ctx
);
5768 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5774 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5775 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5776 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5778 if (ctx
->ExecuteFlag
) {
5779 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5783 static void GLAPIENTRY
5784 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5786 GET_CURRENT_CONTEXT(ctx
);
5788 SAVE_FLUSH_VERTICES(ctx
);
5789 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5796 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5797 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5798 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5800 if (ctx
->ExecuteFlag
) {
5801 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5805 static void GLAPIENTRY
5806 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5808 GET_CURRENT_CONTEXT(ctx
);
5810 SAVE_FLUSH_VERTICES(ctx
);
5811 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5819 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5820 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5821 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5823 if (ctx
->ExecuteFlag
) {
5824 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5828 static void GLAPIENTRY
5829 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5831 GET_CURRENT_CONTEXT(ctx
);
5833 SAVE_FLUSH_VERTICES(ctx
);
5834 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5843 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5844 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5845 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5847 if (ctx
->ExecuteFlag
) {
5848 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5853 static void GLAPIENTRY
5854 save_Attr1fARB(GLenum attr
, GLfloat x
)
5856 GET_CURRENT_CONTEXT(ctx
);
5858 SAVE_FLUSH_VERTICES(ctx
);
5859 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5865 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5866 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5867 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5869 if (ctx
->ExecuteFlag
) {
5870 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5874 static void GLAPIENTRY
5875 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5877 GET_CURRENT_CONTEXT(ctx
);
5879 SAVE_FLUSH_VERTICES(ctx
);
5880 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5887 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5888 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5889 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5891 if (ctx
->ExecuteFlag
) {
5892 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5896 static void GLAPIENTRY
5897 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5899 GET_CURRENT_CONTEXT(ctx
);
5901 SAVE_FLUSH_VERTICES(ctx
);
5902 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5910 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5911 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5912 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5914 if (ctx
->ExecuteFlag
) {
5915 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5919 static void GLAPIENTRY
5920 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5922 GET_CURRENT_CONTEXT(ctx
);
5924 SAVE_FLUSH_VERTICES(ctx
);
5925 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5934 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5935 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5936 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5938 if (ctx
->ExecuteFlag
) {
5939 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5944 static void GLAPIENTRY
5945 save_EvalCoord1f(GLfloat x
)
5947 GET_CURRENT_CONTEXT(ctx
);
5949 SAVE_FLUSH_VERTICES(ctx
);
5950 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5954 if (ctx
->ExecuteFlag
) {
5955 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5959 static void GLAPIENTRY
5960 save_EvalCoord1fv(const GLfloat
* v
)
5962 save_EvalCoord1f(v
[0]);
5965 static void GLAPIENTRY
5966 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5968 GET_CURRENT_CONTEXT(ctx
);
5970 SAVE_FLUSH_VERTICES(ctx
);
5971 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5976 if (ctx
->ExecuteFlag
) {
5977 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5981 static void GLAPIENTRY
5982 save_EvalCoord2fv(const GLfloat
* v
)
5984 save_EvalCoord2f(v
[0], v
[1]);
5988 static void GLAPIENTRY
5989 save_EvalPoint1(GLint x
)
5991 GET_CURRENT_CONTEXT(ctx
);
5993 SAVE_FLUSH_VERTICES(ctx
);
5994 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5998 if (ctx
->ExecuteFlag
) {
5999 CALL_EvalPoint1(ctx
->Exec
, (x
));
6003 static void GLAPIENTRY
6004 save_EvalPoint2(GLint x
, GLint y
)
6006 GET_CURRENT_CONTEXT(ctx
);
6008 SAVE_FLUSH_VERTICES(ctx
);
6009 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6014 if (ctx
->ExecuteFlag
) {
6015 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6019 static void GLAPIENTRY
6020 save_Indexf(GLfloat x
)
6022 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6025 static void GLAPIENTRY
6026 save_Indexfv(const GLfloat
* v
)
6028 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6031 static void GLAPIENTRY
6032 save_EdgeFlag(GLboolean x
)
6034 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6039 * Compare 'count' elements of vectors 'a' and 'b'.
6040 * \return GL_TRUE if equal, GL_FALSE if different.
6042 static inline GLboolean
6043 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6045 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6050 * This glMaterial function is used for glMaterial calls that are outside
6051 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6053 static void GLAPIENTRY
6054 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6056 GET_CURRENT_CONTEXT(ctx
);
6064 case GL_FRONT_AND_BACK
:
6067 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6076 case GL_AMBIENT_AND_DIFFUSE
:
6082 case GL_COLOR_INDEXES
:
6086 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6090 if (ctx
->ExecuteFlag
) {
6091 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6094 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6096 /* Try to eliminate redundant statechanges. Because it is legal to
6097 * call glMaterial even inside begin/end calls, don't need to worry
6098 * about ctx->Driver.CurrentSavePrimitive here.
6100 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6101 if (bitmask
& (1 << i
)) {
6102 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6103 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6104 /* no change in material value */
6105 bitmask
&= ~(1 << i
);
6108 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6109 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6114 /* If this call has no effect, return early */
6118 SAVE_FLUSH_VERTICES(ctx
);
6120 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6124 for (i
= 0; i
< args
; i
++)
6125 n
[3 + i
].f
= param
[i
];
6129 static void GLAPIENTRY
6130 save_Begin(GLenum mode
)
6132 GET_CURRENT_CONTEXT(ctx
);
6134 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6135 /* compile this error into the display list */
6136 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6138 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6139 /* compile this error into the display list */
6140 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6143 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6145 vbo_save_NotifyBegin(ctx
, mode
, false);
6149 static void GLAPIENTRY
6152 GET_CURRENT_CONTEXT(ctx
);
6153 SAVE_FLUSH_VERTICES(ctx
);
6154 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6155 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6156 if (ctx
->ExecuteFlag
) {
6157 CALL_End(ctx
->Exec
, ());
6161 static void GLAPIENTRY
6162 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6164 GET_CURRENT_CONTEXT(ctx
);
6166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6167 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6174 if (ctx
->ExecuteFlag
) {
6175 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6180 static void GLAPIENTRY
6181 save_Vertex2f(GLfloat x
, GLfloat y
)
6183 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6186 static void GLAPIENTRY
6187 save_Vertex2fv(const GLfloat
* v
)
6189 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6192 static void GLAPIENTRY
6193 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6195 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6198 static void GLAPIENTRY
6199 save_Vertex3fv(const GLfloat
* v
)
6201 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6204 static void GLAPIENTRY
6205 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6207 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6210 static void GLAPIENTRY
6211 save_Vertex4fv(const GLfloat
* v
)
6213 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6216 static void GLAPIENTRY
6217 save_TexCoord1f(GLfloat x
)
6219 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6222 static void GLAPIENTRY
6223 save_TexCoord1fv(const GLfloat
* v
)
6225 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6228 static void GLAPIENTRY
6229 save_TexCoord2f(GLfloat x
, GLfloat y
)
6231 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6234 static void GLAPIENTRY
6235 save_TexCoord2fv(const GLfloat
* v
)
6237 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6240 static void GLAPIENTRY
6241 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6243 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6246 static void GLAPIENTRY
6247 save_TexCoord3fv(const GLfloat
* v
)
6249 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6252 static void GLAPIENTRY
6253 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6255 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6258 static void GLAPIENTRY
6259 save_TexCoord4fv(const GLfloat
* v
)
6261 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6264 static void GLAPIENTRY
6265 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6267 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6270 static void GLAPIENTRY
6271 save_Normal3fv(const GLfloat
* v
)
6273 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6276 static void GLAPIENTRY
6277 save_FogCoordfEXT(GLfloat x
)
6279 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6282 static void GLAPIENTRY
6283 save_FogCoordfvEXT(const GLfloat
* v
)
6285 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6288 static void GLAPIENTRY
6289 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6291 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6294 static void GLAPIENTRY
6295 save_Color3fv(const GLfloat
* v
)
6297 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6300 static void GLAPIENTRY
6301 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6303 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6306 static void GLAPIENTRY
6307 save_Color4fv(const GLfloat
* v
)
6309 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6312 static void GLAPIENTRY
6313 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6315 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6318 static void GLAPIENTRY
6319 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6321 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6325 /* Just call the respective ATTR for texcoord
6327 static void GLAPIENTRY
6328 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6330 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6331 save_Attr1fNV(attr
, x
);
6334 static void GLAPIENTRY
6335 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6337 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6338 save_Attr1fNV(attr
, v
[0]);
6341 static void GLAPIENTRY
6342 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6344 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6345 save_Attr2fNV(attr
, x
, y
);
6348 static void GLAPIENTRY
6349 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6351 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6352 save_Attr2fNV(attr
, v
[0], v
[1]);
6355 static void GLAPIENTRY
6356 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6358 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6359 save_Attr3fNV(attr
, x
, y
, z
);
6362 static void GLAPIENTRY
6363 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6365 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6366 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6369 static void GLAPIENTRY
6370 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6371 GLfloat z
, GLfloat w
)
6373 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6374 save_Attr4fNV(attr
, x
, y
, z
, w
);
6377 static void GLAPIENTRY
6378 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6380 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6381 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6386 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6392 GET_CURRENT_CONTEXT(ctx
);
6393 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6398 static void GLAPIENTRY
6399 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6401 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6402 save_Attr1fARB(index
, x
);
6407 static void GLAPIENTRY
6408 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6410 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6411 save_Attr1fARB(index
, v
[0]);
6416 static void GLAPIENTRY
6417 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6419 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6420 save_Attr2fARB(index
, x
, y
);
6425 static void GLAPIENTRY
6426 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6428 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6429 save_Attr2fARB(index
, v
[0], v
[1]);
6434 static void GLAPIENTRY
6435 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6437 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6438 save_Attr3fARB(index
, x
, y
, z
);
6443 static void GLAPIENTRY
6444 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6446 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6447 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6452 static void GLAPIENTRY
6453 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6456 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6457 save_Attr4fARB(index
, x
, y
, z
, w
);
6462 static void GLAPIENTRY
6463 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6465 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6466 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6471 static void GLAPIENTRY
6472 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6474 GET_CURRENT_CONTEXT(ctx
);
6476 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6478 SAVE_FLUSH_VERTICES(ctx
);
6479 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6482 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6485 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6486 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6488 if (ctx
->ExecuteFlag
) {
6489 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6496 static void GLAPIENTRY
6497 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6499 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6500 save_VertexAttribL1d(index
, v
[0]);
6505 static void GLAPIENTRY
6506 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6508 GET_CURRENT_CONTEXT(ctx
);
6510 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6512 SAVE_FLUSH_VERTICES(ctx
);
6513 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6516 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6517 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6520 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6521 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6522 2 * sizeof(GLdouble
));
6524 if (ctx
->ExecuteFlag
) {
6525 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6532 static void GLAPIENTRY
6533 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6535 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6536 save_VertexAttribL2d(index
, v
[0], v
[1]);
6541 static void GLAPIENTRY
6542 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6544 GET_CURRENT_CONTEXT(ctx
);
6546 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6548 SAVE_FLUSH_VERTICES(ctx
);
6549 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6552 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6553 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6554 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6557 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6558 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6559 3 * sizeof(GLdouble
));
6561 if (ctx
->ExecuteFlag
) {
6562 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6569 static void GLAPIENTRY
6570 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6572 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6573 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6578 static void GLAPIENTRY
6579 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6582 GET_CURRENT_CONTEXT(ctx
);
6584 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6586 SAVE_FLUSH_VERTICES(ctx
);
6587 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6590 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6591 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6592 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6593 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6596 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6597 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6598 4 * sizeof(GLdouble
));
6600 if (ctx
->ExecuteFlag
) {
6601 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6608 static void GLAPIENTRY
6609 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6611 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6612 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6617 static void GLAPIENTRY
6618 save_PrimitiveRestartNV(void)
6620 /* Note: this is used when outside a glBegin/End pair in a display list */
6621 GET_CURRENT_CONTEXT(ctx
);
6622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6623 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6624 if (ctx
->ExecuteFlag
) {
6625 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6630 static void GLAPIENTRY
6631 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6632 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6633 GLbitfield mask
, GLenum filter
)
6635 GET_CURRENT_CONTEXT(ctx
);
6637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6638 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6651 if (ctx
->ExecuteFlag
) {
6652 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6653 dstX0
, dstY0
, dstX1
, dstY1
,
6659 /** GL_EXT_provoking_vertex */
6660 static void GLAPIENTRY
6661 save_ProvokingVertexEXT(GLenum mode
)
6663 GET_CURRENT_CONTEXT(ctx
);
6665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6666 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6670 if (ctx
->ExecuteFlag
) {
6671 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6672 _mesa_ProvokingVertex(mode
);
6677 /** GL_EXT_transform_feedback */
6678 static void GLAPIENTRY
6679 save_BeginTransformFeedback(GLenum mode
)
6681 GET_CURRENT_CONTEXT(ctx
);
6683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6684 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6688 if (ctx
->ExecuteFlag
) {
6689 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6694 /** GL_EXT_transform_feedback */
6695 static void GLAPIENTRY
6696 save_EndTransformFeedback(void)
6698 GET_CURRENT_CONTEXT(ctx
);
6699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6700 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6701 if (ctx
->ExecuteFlag
) {
6702 CALL_EndTransformFeedback(ctx
->Exec
, ());
6706 static void GLAPIENTRY
6707 save_BindTransformFeedback(GLenum target
, GLuint name
)
6709 GET_CURRENT_CONTEXT(ctx
);
6711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6712 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6717 if (ctx
->ExecuteFlag
) {
6718 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6722 static void GLAPIENTRY
6723 save_PauseTransformFeedback(void)
6725 GET_CURRENT_CONTEXT(ctx
);
6726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6727 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6728 if (ctx
->ExecuteFlag
) {
6729 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6733 static void GLAPIENTRY
6734 save_ResumeTransformFeedback(void)
6736 GET_CURRENT_CONTEXT(ctx
);
6737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6738 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6739 if (ctx
->ExecuteFlag
) {
6740 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6744 static void GLAPIENTRY
6745 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6747 GET_CURRENT_CONTEXT(ctx
);
6749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6750 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6755 if (ctx
->ExecuteFlag
) {
6756 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6760 static void GLAPIENTRY
6761 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6763 GET_CURRENT_CONTEXT(ctx
);
6765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6766 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6772 if (ctx
->ExecuteFlag
) {
6773 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6777 static void GLAPIENTRY
6778 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6781 GET_CURRENT_CONTEXT(ctx
);
6783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6784 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6788 n
[3].si
= primcount
;
6790 if (ctx
->ExecuteFlag
) {
6791 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6795 static void GLAPIENTRY
6796 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6797 GLuint stream
, GLsizei primcount
)
6799 GET_CURRENT_CONTEXT(ctx
);
6801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6802 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6807 n
[4].si
= primcount
;
6809 if (ctx
->ExecuteFlag
) {
6810 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6815 static void GLAPIENTRY
6816 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6817 GLuint num_groups_z
)
6819 GET_CURRENT_CONTEXT(ctx
);
6821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6822 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6824 n
[1].ui
= num_groups_x
;
6825 n
[2].ui
= num_groups_y
;
6826 n
[3].ui
= num_groups_z
;
6828 if (ctx
->ExecuteFlag
) {
6829 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6834 static void GLAPIENTRY
6835 save_DispatchComputeIndirect(GLintptr indirect
)
6837 GET_CURRENT_CONTEXT(ctx
);
6838 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6839 "glDispatchComputeIndirect() during display list compile");
6842 static void GLAPIENTRY
6843 save_UseProgram(GLuint program
)
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6852 if (ctx
->ExecuteFlag
) {
6853 CALL_UseProgram(ctx
->Exec
, (program
));
6858 static void GLAPIENTRY
6859 save_Uniform1fARB(GLint location
, GLfloat x
)
6861 GET_CURRENT_CONTEXT(ctx
);
6863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6864 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6869 if (ctx
->ExecuteFlag
) {
6870 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6875 static void GLAPIENTRY
6876 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6878 GET_CURRENT_CONTEXT(ctx
);
6880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6881 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6887 if (ctx
->ExecuteFlag
) {
6888 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6893 static void GLAPIENTRY
6894 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6896 GET_CURRENT_CONTEXT(ctx
);
6898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6899 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6906 if (ctx
->ExecuteFlag
) {
6907 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6912 static void GLAPIENTRY
6913 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6915 GET_CURRENT_CONTEXT(ctx
);
6917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6918 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6926 if (ctx
->ExecuteFlag
) {
6927 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6932 static void GLAPIENTRY
6933 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6935 GET_CURRENT_CONTEXT(ctx
);
6937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6938 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6942 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6944 if (ctx
->ExecuteFlag
) {
6945 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6949 static void GLAPIENTRY
6950 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6952 GET_CURRENT_CONTEXT(ctx
);
6954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6955 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6959 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6961 if (ctx
->ExecuteFlag
) {
6962 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6966 static void GLAPIENTRY
6967 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6969 GET_CURRENT_CONTEXT(ctx
);
6971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6972 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6976 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6978 if (ctx
->ExecuteFlag
) {
6979 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6983 static void GLAPIENTRY
6984 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6986 GET_CURRENT_CONTEXT(ctx
);
6988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6989 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6993 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6995 if (ctx
->ExecuteFlag
) {
6996 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7001 static void GLAPIENTRY
7002 save_Uniform1d(GLint location
, GLdouble x
)
7004 GET_CURRENT_CONTEXT(ctx
);
7006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7007 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7010 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7012 if (ctx
->ExecuteFlag
) {
7013 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7018 static void GLAPIENTRY
7019 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7021 GET_CURRENT_CONTEXT(ctx
);
7023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7024 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7027 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7028 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7030 if (ctx
->ExecuteFlag
) {
7031 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7036 static void GLAPIENTRY
7037 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7039 GET_CURRENT_CONTEXT(ctx
);
7041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7042 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7045 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7046 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7047 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7049 if (ctx
->ExecuteFlag
) {
7050 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7055 static void GLAPIENTRY
7056 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7058 GET_CURRENT_CONTEXT(ctx
);
7060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7061 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7064 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7065 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7066 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7067 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7069 if (ctx
->ExecuteFlag
) {
7070 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7075 static void GLAPIENTRY
7076 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7078 GET_CURRENT_CONTEXT(ctx
);
7080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7081 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7085 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7087 if (ctx
->ExecuteFlag
) {
7088 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7093 static void GLAPIENTRY
7094 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7096 GET_CURRENT_CONTEXT(ctx
);
7098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7099 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7103 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7105 if (ctx
->ExecuteFlag
) {
7106 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7111 static void GLAPIENTRY
7112 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7114 GET_CURRENT_CONTEXT(ctx
);
7116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7117 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7121 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7123 if (ctx
->ExecuteFlag
) {
7124 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7129 static void GLAPIENTRY
7130 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7132 GET_CURRENT_CONTEXT(ctx
);
7134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7135 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7139 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7141 if (ctx
->ExecuteFlag
) {
7142 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7147 static void GLAPIENTRY
7148 save_Uniform1iARB(GLint location
, GLint x
)
7150 GET_CURRENT_CONTEXT(ctx
);
7152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7153 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7158 if (ctx
->ExecuteFlag
) {
7159 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7163 static void GLAPIENTRY
7164 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7166 GET_CURRENT_CONTEXT(ctx
);
7168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7169 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7175 if (ctx
->ExecuteFlag
) {
7176 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7180 static void GLAPIENTRY
7181 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7183 GET_CURRENT_CONTEXT(ctx
);
7185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7186 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7193 if (ctx
->ExecuteFlag
) {
7194 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7198 static void GLAPIENTRY
7199 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7201 GET_CURRENT_CONTEXT(ctx
);
7203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7204 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7212 if (ctx
->ExecuteFlag
) {
7213 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7219 static void GLAPIENTRY
7220 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7222 GET_CURRENT_CONTEXT(ctx
);
7224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7225 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7229 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7231 if (ctx
->ExecuteFlag
) {
7232 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7236 static void GLAPIENTRY
7237 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7239 GET_CURRENT_CONTEXT(ctx
);
7241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7242 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7246 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7248 if (ctx
->ExecuteFlag
) {
7249 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7253 static void GLAPIENTRY
7254 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7256 GET_CURRENT_CONTEXT(ctx
);
7258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7259 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7263 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7265 if (ctx
->ExecuteFlag
) {
7266 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7270 static void GLAPIENTRY
7271 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7273 GET_CURRENT_CONTEXT(ctx
);
7275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7276 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7280 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7282 if (ctx
->ExecuteFlag
) {
7283 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7289 static void GLAPIENTRY
7290 save_Uniform1ui(GLint location
, GLuint x
)
7292 GET_CURRENT_CONTEXT(ctx
);
7294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7295 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7300 if (ctx
->ExecuteFlag
) {
7301 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7305 static void GLAPIENTRY
7306 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7308 GET_CURRENT_CONTEXT(ctx
);
7310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7311 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7317 if (ctx
->ExecuteFlag
) {
7318 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7322 static void GLAPIENTRY
7323 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7325 GET_CURRENT_CONTEXT(ctx
);
7327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7328 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7335 if (ctx
->ExecuteFlag
) {
7336 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7340 static void GLAPIENTRY
7341 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7343 GET_CURRENT_CONTEXT(ctx
);
7345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7346 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7354 if (ctx
->ExecuteFlag
) {
7355 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7361 static void GLAPIENTRY
7362 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7364 GET_CURRENT_CONTEXT(ctx
);
7366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7367 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7371 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7373 if (ctx
->ExecuteFlag
) {
7374 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7378 static void GLAPIENTRY
7379 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7381 GET_CURRENT_CONTEXT(ctx
);
7383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7384 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7388 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7390 if (ctx
->ExecuteFlag
) {
7391 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7395 static void GLAPIENTRY
7396 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7398 GET_CURRENT_CONTEXT(ctx
);
7400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7401 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7405 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7407 if (ctx
->ExecuteFlag
) {
7408 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7412 static void GLAPIENTRY
7413 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7415 GET_CURRENT_CONTEXT(ctx
);
7417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7418 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7422 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7424 if (ctx
->ExecuteFlag
) {
7425 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7431 static void GLAPIENTRY
7432 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7435 GET_CURRENT_CONTEXT(ctx
);
7437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7438 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7443 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7445 if (ctx
->ExecuteFlag
) {
7446 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7450 static void GLAPIENTRY
7451 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7454 GET_CURRENT_CONTEXT(ctx
);
7456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7457 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7462 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7464 if (ctx
->ExecuteFlag
) {
7465 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7469 static void GLAPIENTRY
7470 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7473 GET_CURRENT_CONTEXT(ctx
);
7475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7476 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7481 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7483 if (ctx
->ExecuteFlag
) {
7484 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7489 static void GLAPIENTRY
7490 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7493 GET_CURRENT_CONTEXT(ctx
);
7495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7496 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7501 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7503 if (ctx
->ExecuteFlag
) {
7504 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7508 static void GLAPIENTRY
7509 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7512 GET_CURRENT_CONTEXT(ctx
);
7514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7515 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7520 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7522 if (ctx
->ExecuteFlag
) {
7523 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7528 static void GLAPIENTRY
7529 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7532 GET_CURRENT_CONTEXT(ctx
);
7534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7535 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7540 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7542 if (ctx
->ExecuteFlag
) {
7543 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7547 static void GLAPIENTRY
7548 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7551 GET_CURRENT_CONTEXT(ctx
);
7553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7554 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7559 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7561 if (ctx
->ExecuteFlag
) {
7562 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7567 static void GLAPIENTRY
7568 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7571 GET_CURRENT_CONTEXT(ctx
);
7573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7574 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7579 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7581 if (ctx
->ExecuteFlag
) {
7582 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7586 static void GLAPIENTRY
7587 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7590 GET_CURRENT_CONTEXT(ctx
);
7592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7593 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7598 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7600 if (ctx
->ExecuteFlag
) {
7601 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7606 static void GLAPIENTRY
7607 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7610 GET_CURRENT_CONTEXT(ctx
);
7612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7613 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7618 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7620 if (ctx
->ExecuteFlag
) {
7621 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7625 static void GLAPIENTRY
7626 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7629 GET_CURRENT_CONTEXT(ctx
);
7631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7632 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7637 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7639 if (ctx
->ExecuteFlag
) {
7640 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7644 static void GLAPIENTRY
7645 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7648 GET_CURRENT_CONTEXT(ctx
);
7650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7651 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7656 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7658 if (ctx
->ExecuteFlag
) {
7659 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7664 static void GLAPIENTRY
7665 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7668 GET_CURRENT_CONTEXT(ctx
);
7670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7671 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7676 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7678 if (ctx
->ExecuteFlag
) {
7679 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7684 static void GLAPIENTRY
7685 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7688 GET_CURRENT_CONTEXT(ctx
);
7690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7691 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7696 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7698 if (ctx
->ExecuteFlag
) {
7699 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7704 static void GLAPIENTRY
7705 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7708 GET_CURRENT_CONTEXT(ctx
);
7710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7716 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7718 if (ctx
->ExecuteFlag
) {
7719 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7723 static void GLAPIENTRY
7724 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7727 GET_CURRENT_CONTEXT(ctx
);
7729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7730 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7735 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7737 if (ctx
->ExecuteFlag
) {
7738 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7743 static void GLAPIENTRY
7744 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7747 GET_CURRENT_CONTEXT(ctx
);
7749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7750 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7755 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7757 if (ctx
->ExecuteFlag
) {
7758 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7763 static void GLAPIENTRY
7764 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7767 GET_CURRENT_CONTEXT(ctx
);
7769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7770 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7775 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7777 if (ctx
->ExecuteFlag
) {
7778 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7783 static void GLAPIENTRY
7784 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7786 GET_CURRENT_CONTEXT(ctx
);
7788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7789 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7795 if (ctx
->ExecuteFlag
) {
7796 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7800 static void GLAPIENTRY
7801 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7803 GET_CURRENT_CONTEXT(ctx
);
7805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7806 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7812 if (ctx
->ExecuteFlag
) {
7813 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7817 static void GLAPIENTRY
7818 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7820 GET_CURRENT_CONTEXT(ctx
);
7822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7823 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7830 if (ctx
->ExecuteFlag
) {
7831 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7835 static void GLAPIENTRY
7836 save_ProgramUniform3f(GLuint program
, GLint location
,
7837 GLfloat x
, GLfloat y
, GLfloat z
)
7839 GET_CURRENT_CONTEXT(ctx
);
7841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7842 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7850 if (ctx
->ExecuteFlag
) {
7851 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7855 static void GLAPIENTRY
7856 save_ProgramUniform4f(GLuint program
, GLint location
,
7857 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7859 GET_CURRENT_CONTEXT(ctx
);
7861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7862 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7871 if (ctx
->ExecuteFlag
) {
7872 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7876 static void GLAPIENTRY
7877 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7880 GET_CURRENT_CONTEXT(ctx
);
7882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7883 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7888 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7890 if (ctx
->ExecuteFlag
) {
7891 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7895 static void GLAPIENTRY
7896 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7899 GET_CURRENT_CONTEXT(ctx
);
7901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7902 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7907 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7909 if (ctx
->ExecuteFlag
) {
7910 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7914 static void GLAPIENTRY
7915 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7918 GET_CURRENT_CONTEXT(ctx
);
7920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7921 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7926 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7928 if (ctx
->ExecuteFlag
) {
7929 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7933 static void GLAPIENTRY
7934 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7937 GET_CURRENT_CONTEXT(ctx
);
7939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7940 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7945 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7947 if (ctx
->ExecuteFlag
) {
7948 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7952 static void GLAPIENTRY
7953 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7955 GET_CURRENT_CONTEXT(ctx
);
7957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7958 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7962 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7964 if (ctx
->ExecuteFlag
) {
7965 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7969 static void GLAPIENTRY
7970 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7972 GET_CURRENT_CONTEXT(ctx
);
7974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7975 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7979 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7980 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7982 if (ctx
->ExecuteFlag
) {
7983 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7987 static void GLAPIENTRY
7988 save_ProgramUniform3d(GLuint program
, GLint location
,
7989 GLdouble x
, GLdouble y
, GLdouble z
)
7991 GET_CURRENT_CONTEXT(ctx
);
7993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7994 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
7998 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7999 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8000 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8002 if (ctx
->ExecuteFlag
) {
8003 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8007 static void GLAPIENTRY
8008 save_ProgramUniform4d(GLuint program
, GLint location
,
8009 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8011 GET_CURRENT_CONTEXT(ctx
);
8013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8014 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8018 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8019 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8020 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8021 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8023 if (ctx
->ExecuteFlag
) {
8024 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8028 static void GLAPIENTRY
8029 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8032 GET_CURRENT_CONTEXT(ctx
);
8034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8035 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8040 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8042 if (ctx
->ExecuteFlag
) {
8043 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8047 static void GLAPIENTRY
8048 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8051 GET_CURRENT_CONTEXT(ctx
);
8053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8054 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8059 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8061 if (ctx
->ExecuteFlag
) {
8062 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8066 static void GLAPIENTRY
8067 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8070 GET_CURRENT_CONTEXT(ctx
);
8072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8073 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8078 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8080 if (ctx
->ExecuteFlag
) {
8081 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8085 static void GLAPIENTRY
8086 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8089 GET_CURRENT_CONTEXT(ctx
);
8091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8092 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8097 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8099 if (ctx
->ExecuteFlag
) {
8100 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8104 static void GLAPIENTRY
8105 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8107 GET_CURRENT_CONTEXT(ctx
);
8109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8110 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8116 if (ctx
->ExecuteFlag
) {
8117 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8121 static void GLAPIENTRY
8122 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8124 GET_CURRENT_CONTEXT(ctx
);
8126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8127 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8134 if (ctx
->ExecuteFlag
) {
8135 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8139 static void GLAPIENTRY
8140 save_ProgramUniform3i(GLuint program
, GLint location
,
8141 GLint x
, GLint y
, GLint z
)
8143 GET_CURRENT_CONTEXT(ctx
);
8145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8146 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8154 if (ctx
->ExecuteFlag
) {
8155 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8159 static void GLAPIENTRY
8160 save_ProgramUniform4i(GLuint program
, GLint location
,
8161 GLint x
, GLint y
, GLint z
, GLint w
)
8163 GET_CURRENT_CONTEXT(ctx
);
8165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8166 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8175 if (ctx
->ExecuteFlag
) {
8176 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8180 static void GLAPIENTRY
8181 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8184 GET_CURRENT_CONTEXT(ctx
);
8186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8187 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8192 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8194 if (ctx
->ExecuteFlag
) {
8195 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8199 static void GLAPIENTRY
8200 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8203 GET_CURRENT_CONTEXT(ctx
);
8205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8206 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8211 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8213 if (ctx
->ExecuteFlag
) {
8214 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8218 static void GLAPIENTRY
8219 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8222 GET_CURRENT_CONTEXT(ctx
);
8224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8225 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8230 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8232 if (ctx
->ExecuteFlag
) {
8233 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8237 static void GLAPIENTRY
8238 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8241 GET_CURRENT_CONTEXT(ctx
);
8243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8244 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8249 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8251 if (ctx
->ExecuteFlag
) {
8252 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8256 static void GLAPIENTRY
8257 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8259 GET_CURRENT_CONTEXT(ctx
);
8261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8262 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8268 if (ctx
->ExecuteFlag
) {
8269 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8273 static void GLAPIENTRY
8274 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8276 GET_CURRENT_CONTEXT(ctx
);
8278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8279 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8286 if (ctx
->ExecuteFlag
) {
8287 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8291 static void GLAPIENTRY
8292 save_ProgramUniform3ui(GLuint program
, GLint location
,
8293 GLuint x
, GLuint y
, GLuint z
)
8295 GET_CURRENT_CONTEXT(ctx
);
8297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8298 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8306 if (ctx
->ExecuteFlag
) {
8307 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8311 static void GLAPIENTRY
8312 save_ProgramUniform4ui(GLuint program
, GLint location
,
8313 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8315 GET_CURRENT_CONTEXT(ctx
);
8317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8318 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8327 if (ctx
->ExecuteFlag
) {
8328 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8332 static void GLAPIENTRY
8333 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8336 GET_CURRENT_CONTEXT(ctx
);
8338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8339 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8344 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8346 if (ctx
->ExecuteFlag
) {
8347 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8351 static void GLAPIENTRY
8352 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8355 GET_CURRENT_CONTEXT(ctx
);
8357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8358 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8363 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8365 if (ctx
->ExecuteFlag
) {
8366 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8370 static void GLAPIENTRY
8371 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8374 GET_CURRENT_CONTEXT(ctx
);
8376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8377 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8382 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8384 if (ctx
->ExecuteFlag
) {
8385 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8389 static void GLAPIENTRY
8390 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8393 GET_CURRENT_CONTEXT(ctx
);
8395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8396 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8401 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8403 if (ctx
->ExecuteFlag
) {
8404 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8408 static void GLAPIENTRY
8409 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8410 GLboolean transpose
, const GLfloat
*v
)
8412 GET_CURRENT_CONTEXT(ctx
);
8414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8415 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8416 4 + POINTER_DWORDS
);
8422 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8424 if (ctx
->ExecuteFlag
) {
8425 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8426 (program
, location
, count
, transpose
, v
));
8430 static void GLAPIENTRY
8431 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8432 GLboolean transpose
, const GLfloat
*v
)
8434 GET_CURRENT_CONTEXT(ctx
);
8436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8437 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8438 4 + POINTER_DWORDS
);
8444 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8446 if (ctx
->ExecuteFlag
) {
8447 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8448 (program
, location
, count
, transpose
, v
));
8452 static void GLAPIENTRY
8453 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8454 GLboolean transpose
, const GLfloat
*v
)
8456 GET_CURRENT_CONTEXT(ctx
);
8458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8459 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8460 4 + POINTER_DWORDS
);
8466 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8468 if (ctx
->ExecuteFlag
) {
8469 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8470 (program
, location
, count
, transpose
, v
));
8474 static void GLAPIENTRY
8475 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8476 GLboolean transpose
, const GLfloat
*v
)
8478 GET_CURRENT_CONTEXT(ctx
);
8480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8481 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8482 4 + POINTER_DWORDS
);
8488 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8490 if (ctx
->ExecuteFlag
) {
8491 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8492 (program
, location
, count
, transpose
, v
));
8496 static void GLAPIENTRY
8497 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8498 GLboolean transpose
, const GLfloat
*v
)
8500 GET_CURRENT_CONTEXT(ctx
);
8502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8503 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8504 4 + POINTER_DWORDS
);
8510 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8512 if (ctx
->ExecuteFlag
) {
8513 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8514 (program
, location
, count
, transpose
, v
));
8518 static void GLAPIENTRY
8519 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8520 GLboolean transpose
, const GLfloat
*v
)
8522 GET_CURRENT_CONTEXT(ctx
);
8524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8525 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8526 4 + POINTER_DWORDS
);
8532 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8534 if (ctx
->ExecuteFlag
) {
8535 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8536 (program
, location
, count
, transpose
, v
));
8540 static void GLAPIENTRY
8541 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8542 GLboolean transpose
, const GLfloat
*v
)
8544 GET_CURRENT_CONTEXT(ctx
);
8546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8547 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8548 4 + POINTER_DWORDS
);
8554 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8556 if (ctx
->ExecuteFlag
) {
8557 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8558 (program
, location
, count
, transpose
, v
));
8562 static void GLAPIENTRY
8563 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8564 GLboolean transpose
, const GLfloat
*v
)
8566 GET_CURRENT_CONTEXT(ctx
);
8568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8569 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8570 4 + POINTER_DWORDS
);
8576 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8578 if (ctx
->ExecuteFlag
) {
8579 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8580 (program
, location
, count
, transpose
, v
));
8584 static void GLAPIENTRY
8585 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8586 GLboolean transpose
, const GLfloat
*v
)
8588 GET_CURRENT_CONTEXT(ctx
);
8590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8591 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8592 4 + POINTER_DWORDS
);
8598 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8600 if (ctx
->ExecuteFlag
) {
8601 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8602 (program
, location
, count
, transpose
, v
));
8606 static void GLAPIENTRY
8607 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8608 GLboolean transpose
, const GLdouble
*v
)
8610 GET_CURRENT_CONTEXT(ctx
);
8612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8613 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8614 4 + POINTER_DWORDS
);
8620 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8622 if (ctx
->ExecuteFlag
) {
8623 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8624 (program
, location
, count
, transpose
, v
));
8628 static void GLAPIENTRY
8629 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8630 GLboolean transpose
, const GLdouble
*v
)
8632 GET_CURRENT_CONTEXT(ctx
);
8634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8635 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8636 4 + POINTER_DWORDS
);
8642 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8644 if (ctx
->ExecuteFlag
) {
8645 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8646 (program
, location
, count
, transpose
, v
));
8650 static void GLAPIENTRY
8651 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8652 GLboolean transpose
, const GLdouble
*v
)
8654 GET_CURRENT_CONTEXT(ctx
);
8656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8657 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8658 4 + POINTER_DWORDS
);
8664 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8666 if (ctx
->ExecuteFlag
) {
8667 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8668 (program
, location
, count
, transpose
, v
));
8672 static void GLAPIENTRY
8673 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8674 GLboolean transpose
, const GLdouble
*v
)
8676 GET_CURRENT_CONTEXT(ctx
);
8678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8679 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8680 4 + POINTER_DWORDS
);
8686 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8688 if (ctx
->ExecuteFlag
) {
8689 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8690 (program
, location
, count
, transpose
, v
));
8694 static void GLAPIENTRY
8695 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8696 GLboolean transpose
, const GLdouble
*v
)
8698 GET_CURRENT_CONTEXT(ctx
);
8700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8701 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8702 4 + POINTER_DWORDS
);
8708 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8710 if (ctx
->ExecuteFlag
) {
8711 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8712 (program
, location
, count
, transpose
, v
));
8716 static void GLAPIENTRY
8717 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8718 GLboolean transpose
, const GLdouble
*v
)
8720 GET_CURRENT_CONTEXT(ctx
);
8722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8723 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8724 4 + POINTER_DWORDS
);
8730 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8732 if (ctx
->ExecuteFlag
) {
8733 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8734 (program
, location
, count
, transpose
, v
));
8738 static void GLAPIENTRY
8739 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8740 GLboolean transpose
, const GLdouble
*v
)
8742 GET_CURRENT_CONTEXT(ctx
);
8744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8745 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8746 4 + POINTER_DWORDS
);
8752 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8754 if (ctx
->ExecuteFlag
) {
8755 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8756 (program
, location
, count
, transpose
, v
));
8760 static void GLAPIENTRY
8761 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8762 GLboolean transpose
, const GLdouble
*v
)
8764 GET_CURRENT_CONTEXT(ctx
);
8766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8767 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8768 4 + POINTER_DWORDS
);
8774 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8776 if (ctx
->ExecuteFlag
) {
8777 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8778 (program
, location
, count
, transpose
, v
));
8782 static void GLAPIENTRY
8783 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8784 GLboolean transpose
, const GLdouble
*v
)
8786 GET_CURRENT_CONTEXT(ctx
);
8788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8789 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8790 4 + POINTER_DWORDS
);
8796 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8798 if (ctx
->ExecuteFlag
) {
8799 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8800 (program
, location
, count
, transpose
, v
));
8804 static void GLAPIENTRY
8805 save_ClipControl(GLenum origin
, GLenum depth
)
8807 GET_CURRENT_CONTEXT(ctx
);
8809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8810 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8815 if (ctx
->ExecuteFlag
) {
8816 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8820 static void GLAPIENTRY
8821 save_ClampColorARB(GLenum target
, GLenum clamp
)
8823 GET_CURRENT_CONTEXT(ctx
);
8825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8826 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8831 if (ctx
->ExecuteFlag
) {
8832 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8836 /** GL_EXT_texture_integer */
8837 static void GLAPIENTRY
8838 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8840 GET_CURRENT_CONTEXT(ctx
);
8842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8843 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8850 if (ctx
->ExecuteFlag
) {
8851 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8855 /** GL_EXT_texture_integer */
8856 static void GLAPIENTRY
8857 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8859 GET_CURRENT_CONTEXT(ctx
);
8861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8862 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8869 if (ctx
->ExecuteFlag
) {
8870 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8874 /** GL_EXT_texture_integer */
8875 static void GLAPIENTRY
8876 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8878 GET_CURRENT_CONTEXT(ctx
);
8880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8881 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8890 if (ctx
->ExecuteFlag
) {
8891 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8895 /** GL_EXT_texture_integer */
8896 static void GLAPIENTRY
8897 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8899 GET_CURRENT_CONTEXT(ctx
);
8901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8902 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8906 n
[3].ui
= params
[0];
8907 n
[4].ui
= params
[1];
8908 n
[5].ui
= params
[2];
8909 n
[6].ui
= params
[3];
8911 if (ctx
->ExecuteFlag
) {
8912 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8916 /* GL_ARB_instanced_arrays */
8917 static void GLAPIENTRY
8918 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8920 GET_CURRENT_CONTEXT(ctx
);
8922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8923 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8928 if (ctx
->ExecuteFlag
) {
8929 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8934 /* GL_NV_texture_barrier */
8935 static void GLAPIENTRY
8936 save_TextureBarrierNV(void)
8938 GET_CURRENT_CONTEXT(ctx
);
8939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8940 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8941 if (ctx
->ExecuteFlag
) {
8942 CALL_TextureBarrierNV(ctx
->Exec
, ());
8947 /* GL_ARB_sampler_objects */
8948 static void GLAPIENTRY
8949 save_BindSampler(GLuint unit
, GLuint sampler
)
8952 GET_CURRENT_CONTEXT(ctx
);
8953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8954 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8959 if (ctx
->ExecuteFlag
) {
8960 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8964 static void GLAPIENTRY
8965 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8968 GET_CURRENT_CONTEXT(ctx
);
8969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8970 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8975 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8981 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8984 if (ctx
->ExecuteFlag
) {
8985 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8989 static void GLAPIENTRY
8990 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8994 parray
[1] = parray
[2] = parray
[3] = 0;
8995 save_SamplerParameteriv(sampler
, pname
, parray
);
8998 static void GLAPIENTRY
8999 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9002 GET_CURRENT_CONTEXT(ctx
);
9003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9004 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9009 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9015 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9018 if (ctx
->ExecuteFlag
) {
9019 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9023 static void GLAPIENTRY
9024 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9028 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9029 save_SamplerParameterfv(sampler
, pname
, parray
);
9032 static void GLAPIENTRY
9033 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9036 GET_CURRENT_CONTEXT(ctx
);
9037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9038 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9043 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9049 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9052 if (ctx
->ExecuteFlag
) {
9053 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9057 static void GLAPIENTRY
9058 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9061 GET_CURRENT_CONTEXT(ctx
);
9062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9063 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9067 n
[3].ui
= params
[0];
9068 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9069 n
[4].ui
= params
[1];
9070 n
[5].ui
= params
[2];
9071 n
[6].ui
= params
[3];
9074 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9077 if (ctx
->ExecuteFlag
) {
9078 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9082 static void GLAPIENTRY
9083 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9086 GET_CURRENT_CONTEXT(ctx
);
9087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9088 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9090 union uint64_pair p
;
9093 n
[2].ui
= p
.uint32
[0];
9094 n
[3].ui
= p
.uint32
[1];
9095 save_pointer(&n
[4], sync
);
9097 if (ctx
->ExecuteFlag
) {
9098 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9103 /** GL_NV_conditional_render */
9104 static void GLAPIENTRY
9105 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9107 GET_CURRENT_CONTEXT(ctx
);
9109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9110 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9115 if (ctx
->ExecuteFlag
) {
9116 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9120 static void GLAPIENTRY
9121 save_EndConditionalRender(void)
9123 GET_CURRENT_CONTEXT(ctx
);
9124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9125 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9126 if (ctx
->ExecuteFlag
) {
9127 CALL_EndConditionalRender(ctx
->Exec
, ());
9131 static void GLAPIENTRY
9132 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9134 GET_CURRENT_CONTEXT(ctx
);
9136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9137 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9143 if (ctx
->ExecuteFlag
) {
9144 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9148 static void GLAPIENTRY
9149 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9150 const GLuint
*indices
)
9152 GET_CURRENT_CONTEXT(ctx
);
9154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9155 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9157 GLint
*indices_copy
= NULL
;
9160 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9161 n
[1].e
= shadertype
;
9163 save_pointer(&n
[3], indices_copy
);
9165 if (ctx
->ExecuteFlag
) {
9166 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9170 /** GL_EXT_window_rectangles */
9171 static void GLAPIENTRY
9172 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9174 GET_CURRENT_CONTEXT(ctx
);
9176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9177 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9179 GLint
*box_copy
= NULL
;
9182 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9185 save_pointer(&n
[3], box_copy
);
9187 if (ctx
->ExecuteFlag
) {
9188 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9193 /** GL_NV_conservative_raster */
9194 static void GLAPIENTRY
9195 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9197 GET_CURRENT_CONTEXT(ctx
);
9199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9200 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9205 if (ctx
->ExecuteFlag
) {
9206 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9210 /** GL_NV_conservative_raster_dilate */
9211 static void GLAPIENTRY
9212 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9214 GET_CURRENT_CONTEXT(ctx
);
9216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9217 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9222 if (ctx
->ExecuteFlag
) {
9223 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9227 /** GL_NV_conservative_raster_pre_snap_triangles */
9228 static void GLAPIENTRY
9229 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9231 GET_CURRENT_CONTEXT(ctx
);
9233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9234 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9239 if (ctx
->ExecuteFlag
) {
9240 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9244 /** GL_EXT_direct_state_access */
9246 static void GLAPIENTRY
9247 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9249 GET_CURRENT_CONTEXT(ctx
);
9251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9252 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9254 n
[1].e
= matrixMode
;
9255 for (unsigned i
= 0; i
< 16; i
++) {
9259 if (ctx
->ExecuteFlag
) {
9260 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9264 static void GLAPIENTRY
9265 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9268 for (unsigned i
= 0; i
< 16; i
++) {
9269 f
[i
] = (GLfloat
) m
[i
];
9271 save_MatrixLoadfEXT(matrixMode
, f
);
9274 static void GLAPIENTRY
9275 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9277 GET_CURRENT_CONTEXT(ctx
);
9279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9280 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9282 n
[1].e
= matrixMode
;
9283 for (unsigned i
= 0; i
< 16; i
++) {
9287 if (ctx
->ExecuteFlag
) {
9288 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9292 static void GLAPIENTRY
9293 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9296 for (unsigned i
= 0; i
< 16; i
++) {
9297 f
[i
] = (GLfloat
) m
[i
];
9299 save_MatrixMultfEXT(matrixMode
, f
);
9302 static void GLAPIENTRY
9303 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9305 GET_CURRENT_CONTEXT(ctx
);
9307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9308 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9310 n
[1].e
= matrixMode
;
9316 if (ctx
->ExecuteFlag
) {
9317 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9321 static void GLAPIENTRY
9322 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9324 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9327 static void GLAPIENTRY
9328 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9330 GET_CURRENT_CONTEXT(ctx
);
9332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9333 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9335 n
[1].e
= matrixMode
;
9340 if (ctx
->ExecuteFlag
) {
9341 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9345 static void GLAPIENTRY
9346 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9348 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9351 static void GLAPIENTRY
9352 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9354 GET_CURRENT_CONTEXT(ctx
);
9356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9357 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9359 n
[1].e
= matrixMode
;
9364 if (ctx
->ExecuteFlag
) {
9365 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9369 static void GLAPIENTRY
9370 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9372 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9375 static void GLAPIENTRY
9376 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9378 GET_CURRENT_CONTEXT(ctx
);
9380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9381 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9383 n
[1].e
= matrixMode
;
9385 if (ctx
->ExecuteFlag
) {
9386 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9390 static void GLAPIENTRY
9391 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9392 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9394 GET_CURRENT_CONTEXT(ctx
);
9396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9397 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9399 n
[1].e
= matrixMode
;
9400 n
[2].f
= (GLfloat
) left
;
9401 n
[3].f
= (GLfloat
) right
;
9402 n
[4].f
= (GLfloat
) bottom
;
9403 n
[5].f
= (GLfloat
) top
;
9404 n
[6].f
= (GLfloat
) nearval
;
9405 n
[7].f
= (GLfloat
) farval
;
9407 if (ctx
->ExecuteFlag
) {
9408 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9413 static void GLAPIENTRY
9414 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9415 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9417 GET_CURRENT_CONTEXT(ctx
);
9419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9420 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9422 n
[1].e
= matrixMode
;
9423 n
[2].f
= (GLfloat
) left
;
9424 n
[3].f
= (GLfloat
) right
;
9425 n
[4].f
= (GLfloat
) bottom
;
9426 n
[5].f
= (GLfloat
) top
;
9427 n
[6].f
= (GLfloat
) nearval
;
9428 n
[7].f
= (GLfloat
) farval
;
9430 if (ctx
->ExecuteFlag
) {
9431 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9435 static void GLAPIENTRY
9436 save_MatrixPushEXT(GLenum matrixMode
)
9438 GET_CURRENT_CONTEXT(ctx
);
9440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9441 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9443 n
[1].e
= matrixMode
;
9445 if (ctx
->ExecuteFlag
) {
9446 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9450 static void GLAPIENTRY
9451 save_MatrixPopEXT(GLenum matrixMode
)
9453 GET_CURRENT_CONTEXT(ctx
);
9455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9456 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9458 n
[1].e
= matrixMode
;
9460 if (ctx
->ExecuteFlag
) {
9461 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9465 static void GLAPIENTRY
9466 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9469 _math_transposef(tm
, m
);
9470 save_MatrixLoadfEXT(matrixMode
, tm
);
9473 static void GLAPIENTRY
9474 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9477 _math_transposefd(tm
, m
);
9478 save_MatrixLoadfEXT(matrixMode
, tm
);
9481 static void GLAPIENTRY
9482 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9485 _math_transposef(tm
, m
);
9486 save_MatrixMultfEXT(matrixMode
, tm
);
9489 static void GLAPIENTRY
9490 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9493 _math_transposefd(tm
, m
);
9494 save_MatrixMultfEXT(matrixMode
, tm
);
9497 static void GLAPIENTRY
9498 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9499 const GLfloat
*params
)
9501 GET_CURRENT_CONTEXT(ctx
);
9503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9504 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9514 if (ctx
->ExecuteFlag
) {
9515 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9520 static void GLAPIENTRY
9521 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9525 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9526 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9529 static void GLAPIENTRY
9530 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9532 GET_CURRENT_CONTEXT(ctx
);
9534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9535 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9545 if (ctx
->ExecuteFlag
) {
9546 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9550 static void GLAPIENTRY
9551 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9555 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9556 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9559 static void GLAPIENTRY
9560 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9561 GLint level
, GLint components
,
9562 GLsizei width
, GLint border
,
9563 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9565 GET_CURRENT_CONTEXT(ctx
);
9566 if (target
== GL_PROXY_TEXTURE_1D
) {
9567 /* don't compile, execute immediately */
9568 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9569 border
, format
, type
, pixels
));
9573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9574 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9579 n
[4].i
= components
;
9580 n
[5].i
= (GLint
) width
;
9585 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9586 pixels
, &ctx
->Unpack
));
9588 if (ctx
->ExecuteFlag
) {
9589 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9590 border
, format
, type
, pixels
));
9596 static void GLAPIENTRY
9597 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9598 GLint level
, GLint components
,
9599 GLsizei width
, GLsizei height
, GLint border
,
9600 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9602 GET_CURRENT_CONTEXT(ctx
);
9603 if (target
== GL_PROXY_TEXTURE_2D
) {
9604 /* don't compile, execute immediately */
9605 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9606 height
, border
, format
, type
, pixels
));
9610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9611 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9616 n
[4].i
= components
;
9617 n
[5].i
= (GLint
) width
;
9618 n
[6].i
= (GLint
) height
;
9622 save_pointer(&n
[10],
9623 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9624 pixels
, &ctx
->Unpack
));
9626 if (ctx
->ExecuteFlag
) {
9627 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9628 height
, border
, format
, type
, pixels
));
9634 static void GLAPIENTRY
9635 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9636 GLint level
, GLint internalFormat
,
9637 GLsizei width
, GLsizei height
, GLsizei depth
,
9639 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9641 GET_CURRENT_CONTEXT(ctx
);
9642 if (target
== GL_PROXY_TEXTURE_3D
) {
9643 /* don't compile, execute immediately */
9644 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9645 height
, depth
, border
, format
, type
,
9650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9651 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9656 n
[4].i
= (GLint
) internalFormat
;
9657 n
[5].i
= (GLint
) width
;
9658 n
[6].i
= (GLint
) height
;
9659 n
[7].i
= (GLint
) depth
;
9663 save_pointer(&n
[11],
9664 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9665 pixels
, &ctx
->Unpack
));
9667 if (ctx
->ExecuteFlag
) {
9668 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9669 width
, height
, depth
, border
, format
,
9676 static void GLAPIENTRY
9677 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9678 GLsizei width
, GLenum format
, GLenum type
,
9679 const GLvoid
* pixels
)
9681 GET_CURRENT_CONTEXT(ctx
);
9684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9686 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9692 n
[5].i
= (GLint
) width
;
9696 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9697 pixels
, &ctx
->Unpack
));
9699 if (ctx
->ExecuteFlag
) {
9700 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9701 format
, type
, pixels
));
9706 static void GLAPIENTRY
9707 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9708 GLint xoffset
, GLint yoffset
,
9709 GLsizei width
, GLsizei height
,
9710 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9712 GET_CURRENT_CONTEXT(ctx
);
9715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9717 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9724 n
[6].i
= (GLint
) width
;
9725 n
[7].i
= (GLint
) height
;
9728 save_pointer(&n
[10],
9729 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9730 pixels
, &ctx
->Unpack
));
9732 if (ctx
->ExecuteFlag
) {
9733 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9734 width
, height
, format
, type
, pixels
));
9739 static void GLAPIENTRY
9740 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9741 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9742 GLsizei width
, GLsizei height
, GLsizei depth
,
9743 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9745 GET_CURRENT_CONTEXT(ctx
);
9748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9750 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9758 n
[7].i
= (GLint
) width
;
9759 n
[8].i
= (GLint
) height
;
9760 n
[9].i
= (GLint
) depth
;
9763 save_pointer(&n
[12],
9764 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9765 pixels
, &ctx
->Unpack
));
9767 if (ctx
->ExecuteFlag
) {
9768 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9769 xoffset
, yoffset
, zoffset
,
9770 width
, height
, depth
, format
, type
,
9775 static void GLAPIENTRY
9776 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9777 GLenum internalformat
, GLint x
, GLint y
,
9778 GLsizei width
, GLint border
)
9780 GET_CURRENT_CONTEXT(ctx
);
9782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9783 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9788 n
[4].e
= internalformat
;
9794 if (ctx
->ExecuteFlag
) {
9795 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9796 internalformat
, x
, y
,
9801 static void GLAPIENTRY
9802 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9803 GLenum internalformat
,
9804 GLint x
, GLint y
, GLsizei width
,
9805 GLsizei height
, GLint border
)
9807 GET_CURRENT_CONTEXT(ctx
);
9809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9810 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9815 n
[4].e
= internalformat
;
9822 if (ctx
->ExecuteFlag
) {
9823 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9824 internalformat
, x
, y
,
9825 width
, height
, border
));
9829 static void GLAPIENTRY
9830 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9831 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9833 GET_CURRENT_CONTEXT(ctx
);
9835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9836 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9846 if (ctx
->ExecuteFlag
) {
9847 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9848 (texture
, target
, level
, xoffset
, x
, y
, width
));
9852 static void GLAPIENTRY
9853 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9854 GLint xoffset
, GLint yoffset
,
9855 GLint x
, GLint y
, GLsizei width
, GLint height
)
9857 GET_CURRENT_CONTEXT(ctx
);
9859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9860 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9872 if (ctx
->ExecuteFlag
) {
9873 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9875 x
, y
, width
, height
));
9880 static void GLAPIENTRY
9881 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9882 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9883 GLint x
, GLint y
, GLsizei width
, GLint height
)
9885 GET_CURRENT_CONTEXT(ctx
);
9887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9888 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9901 if (ctx
->ExecuteFlag
) {
9902 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9903 xoffset
, yoffset
, zoffset
,
9904 x
, y
, width
, height
));
9908 static void GLAPIENTRY
9909 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9910 GLint yoffset
, GLsizei width
, GLsizei height
,
9911 GLenum format
, GLsizei imageSize
,
9912 const GLvoid
* data
)
9915 GET_CURRENT_CONTEXT(ctx
);
9916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9918 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
9919 9 + POINTER_DWORDS
);
9926 n
[6].i
= (GLint
) width
;
9927 n
[7].i
= (GLint
) height
;
9930 save_pointer(&n
[10],
9931 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
9933 if (ctx
->ExecuteFlag
) {
9934 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
9935 (texture
, target
, level
, xoffset
, yoffset
,
9936 width
, height
, format
, imageSize
, data
));
9942 * Save an error-generating command into display list.
9944 * KW: Will appear in the list before the vertex buffer containing the
9945 * command that provoked the error. I don't see this as a problem.
9948 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9951 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
9954 save_pointer(&n
[2], (void *) s
);
9955 /* note: the data/string here doesn't have to be freed in
9956 * _mesa_delete_list() since the string is never dynamically
9964 * Compile an error into current display list.
9967 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9969 if (ctx
->CompileFlag
)
9970 save_error(ctx
, error
, s
);
9971 if (ctx
->ExecuteFlag
)
9972 _mesa_error(ctx
, error
, "%s", s
);
9977 * Test if ID names a display list.
9980 islist(struct gl_context
*ctx
, GLuint list
)
9982 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
9992 /**********************************************************************/
9993 /* Display list execution */
9994 /**********************************************************************/
9998 * Execute a display list. Note that the ListBase offset must have already
9999 * been added before calling this function. I.e. the list argument is
10000 * the absolute list number, not relative to ListBase.
10001 * \param list - display list number
10004 execute_list(struct gl_context
*ctx
, GLuint list
)
10006 struct gl_display_list
*dlist
;
10010 if (list
== 0 || !islist(ctx
, list
))
10013 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10014 /* raise an error? */
10018 dlist
= _mesa_lookup_list(ctx
, list
);
10022 ctx
->ListState
.CallDepth
++;
10024 vbo_save_BeginCallList(ctx
, dlist
);
10030 const OpCode opcode
= n
[0].opcode
;
10032 if (is_ext_opcode(opcode
)) {
10033 n
+= ext_opcode_execute(ctx
, n
);
10038 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10041 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10043 case OPCODE_ALPHA_FUNC
:
10044 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10046 case OPCODE_BIND_TEXTURE
:
10047 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10049 case OPCODE_BITMAP
:
10051 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10052 ctx
->Unpack
= ctx
->DefaultPacking
;
10053 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10054 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10055 get_pointer(&n
[7])));
10056 ctx
->Unpack
= save
; /* restore */
10059 case OPCODE_BLEND_COLOR
:
10060 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10062 case OPCODE_BLEND_EQUATION
:
10063 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10065 case OPCODE_BLEND_EQUATION_SEPARATE
:
10066 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10068 case OPCODE_BLEND_FUNC_SEPARATE
:
10069 CALL_BlendFuncSeparate(ctx
->Exec
,
10070 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10073 case OPCODE_BLEND_FUNC_I
:
10074 /* GL_ARB_draw_buffers_blend */
10075 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10077 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10078 /* GL_ARB_draw_buffers_blend */
10079 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10082 case OPCODE_BLEND_EQUATION_I
:
10083 /* GL_ARB_draw_buffers_blend */
10084 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10086 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10087 /* GL_ARB_draw_buffers_blend */
10088 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10089 (n
[1].ui
, n
[2].e
, n
[3].e
));
10092 case OPCODE_CALL_LIST
:
10093 /* Generated by glCallList(), don't add ListBase */
10094 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10095 execute_list(ctx
, n
[1].ui
);
10098 case OPCODE_CALL_LISTS
:
10099 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10100 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10104 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10106 case OPCODE_CLEAR_BUFFER_IV
:
10113 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10116 case OPCODE_CLEAR_BUFFER_UIV
:
10119 value
[0] = n
[3].ui
;
10120 value
[1] = n
[4].ui
;
10121 value
[2] = n
[5].ui
;
10122 value
[3] = n
[6].ui
;
10123 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10126 case OPCODE_CLEAR_BUFFER_FV
:
10133 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10136 case OPCODE_CLEAR_BUFFER_FI
:
10137 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10139 case OPCODE_CLEAR_COLOR
:
10140 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10142 case OPCODE_CLEAR_ACCUM
:
10143 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10145 case OPCODE_CLEAR_DEPTH
:
10146 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10148 case OPCODE_CLEAR_INDEX
:
10149 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10151 case OPCODE_CLEAR_STENCIL
:
10152 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10154 case OPCODE_CLIP_PLANE
:
10161 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10164 case OPCODE_COLOR_MASK
:
10165 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10167 case OPCODE_COLOR_MASK_INDEXED
:
10168 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10171 case OPCODE_COLOR_MATERIAL
:
10172 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10174 case OPCODE_COPY_PIXELS
:
10175 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10176 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10179 case OPCODE_COPY_TEX_IMAGE1D
:
10180 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10181 n
[5].i
, n
[6].i
, n
[7].i
));
10183 case OPCODE_COPY_TEX_IMAGE2D
:
10184 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10185 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10187 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10188 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10189 n
[4].i
, n
[5].i
, n
[6].i
));
10191 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10192 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10193 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10196 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10197 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10198 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10201 case OPCODE_CULL_FACE
:
10202 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10204 case OPCODE_DEPTH_FUNC
:
10205 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10207 case OPCODE_DEPTH_MASK
:
10208 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10210 case OPCODE_DEPTH_RANGE
:
10211 CALL_DepthRange(ctx
->Exec
,
10212 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10214 case OPCODE_DISABLE
:
10215 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10217 case OPCODE_DISABLE_INDEXED
:
10218 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10220 case OPCODE_DRAW_BUFFER
:
10221 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10223 case OPCODE_DRAW_PIXELS
:
10225 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10226 ctx
->Unpack
= ctx
->DefaultPacking
;
10227 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10228 get_pointer(&n
[5])));
10229 ctx
->Unpack
= save
; /* restore */
10232 case OPCODE_ENABLE
:
10233 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10235 case OPCODE_ENABLE_INDEXED
:
10236 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10238 case OPCODE_EVALMESH1
:
10239 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10241 case OPCODE_EVALMESH2
:
10242 CALL_EvalMesh2(ctx
->Exec
,
10243 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10252 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10255 case OPCODE_FRONT_FACE
:
10256 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10258 case OPCODE_FRUSTUM
:
10259 CALL_Frustum(ctx
->Exec
,
10260 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10263 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10265 case OPCODE_INDEX_MASK
:
10266 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10268 case OPCODE_INIT_NAMES
:
10269 CALL_InitNames(ctx
->Exec
, ());
10278 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10281 case OPCODE_LIGHT_MODEL
:
10288 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10291 case OPCODE_LINE_STIPPLE
:
10292 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10294 case OPCODE_LINE_WIDTH
:
10295 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10297 case OPCODE_LIST_BASE
:
10298 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10300 case OPCODE_LOAD_IDENTITY
:
10301 CALL_LoadIdentity(ctx
->Exec
, ());
10303 case OPCODE_LOAD_MATRIX
:
10304 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10305 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10307 case OPCODE_LOAD_NAME
:
10308 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10310 case OPCODE_LOGIC_OP
:
10311 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10315 GLenum target
= n
[1].e
;
10316 GLint ustride
= _mesa_evaluator_components(target
);
10317 GLint uorder
= n
[5].i
;
10318 GLfloat u1
= n
[2].f
;
10319 GLfloat u2
= n
[3].f
;
10320 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10321 (GLfloat
*) get_pointer(&n
[6])));
10326 GLenum target
= n
[1].e
;
10327 GLfloat u1
= n
[2].f
;
10328 GLfloat u2
= n
[3].f
;
10329 GLfloat v1
= n
[4].f
;
10330 GLfloat v2
= n
[5].f
;
10331 GLint ustride
= n
[6].i
;
10332 GLint vstride
= n
[7].i
;
10333 GLint uorder
= n
[8].i
;
10334 GLint vorder
= n
[9].i
;
10335 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10336 v1
, v2
, vstride
, vorder
,
10337 (GLfloat
*) get_pointer(&n
[10])));
10340 case OPCODE_MAPGRID1
:
10341 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10343 case OPCODE_MAPGRID2
:
10344 CALL_MapGrid2f(ctx
->Exec
,
10345 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10347 case OPCODE_MATRIX_MODE
:
10348 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10350 case OPCODE_MULT_MATRIX
:
10351 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10354 CALL_Ortho(ctx
->Exec
,
10355 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10357 case OPCODE_PASSTHROUGH
:
10358 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10360 case OPCODE_PATCH_PARAMETER_I
:
10361 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10363 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10366 params
[0] = n
[2].f
;
10367 params
[1] = n
[3].f
;
10368 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10371 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10374 params
[0] = n
[2].f
;
10375 params
[1] = n
[3].f
;
10376 params
[2] = n
[4].f
;
10377 params
[3] = n
[5].f
;
10378 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10381 case OPCODE_PIXEL_MAP
:
10382 CALL_PixelMapfv(ctx
->Exec
,
10383 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10385 case OPCODE_PIXEL_TRANSFER
:
10386 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10388 case OPCODE_PIXEL_ZOOM
:
10389 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10391 case OPCODE_POINT_SIZE
:
10392 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10394 case OPCODE_POINT_PARAMETERS
:
10397 params
[0] = n
[2].f
;
10398 params
[1] = n
[3].f
;
10399 params
[2] = n
[4].f
;
10400 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10403 case OPCODE_POLYGON_MODE
:
10404 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10406 case OPCODE_POLYGON_STIPPLE
:
10408 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10409 ctx
->Unpack
= ctx
->DefaultPacking
;
10410 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10411 ctx
->Unpack
= save
; /* restore */
10414 case OPCODE_POLYGON_OFFSET
:
10415 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10417 case OPCODE_POLYGON_OFFSET_CLAMP
:
10418 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10420 case OPCODE_POP_ATTRIB
:
10421 CALL_PopAttrib(ctx
->Exec
, ());
10423 case OPCODE_POP_MATRIX
:
10424 CALL_PopMatrix(ctx
->Exec
, ());
10426 case OPCODE_POP_NAME
:
10427 CALL_PopName(ctx
->Exec
, ());
10429 case OPCODE_PRIORITIZE_TEXTURE
:
10430 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10432 case OPCODE_PUSH_ATTRIB
:
10433 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10435 case OPCODE_PUSH_MATRIX
:
10436 CALL_PushMatrix(ctx
->Exec
, ());
10438 case OPCODE_PUSH_NAME
:
10439 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10441 case OPCODE_RASTER_POS
:
10442 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10444 case OPCODE_READ_BUFFER
:
10445 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10447 case OPCODE_ROTATE
:
10448 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10451 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10453 case OPCODE_SCISSOR
:
10454 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10456 case OPCODE_SHADE_MODEL
:
10457 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10459 case OPCODE_PROVOKING_VERTEX
:
10460 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10462 case OPCODE_STENCIL_FUNC
:
10463 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10465 case OPCODE_STENCIL_MASK
:
10466 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10468 case OPCODE_STENCIL_OP
:
10469 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10471 case OPCODE_STENCIL_FUNC_SEPARATE
:
10472 CALL_StencilFuncSeparate(ctx
->Exec
,
10473 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10475 case OPCODE_STENCIL_MASK_SEPARATE
:
10476 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10478 case OPCODE_STENCIL_OP_SEPARATE
:
10479 CALL_StencilOpSeparate(ctx
->Exec
,
10480 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10482 case OPCODE_TEXENV
:
10485 params
[0] = n
[3].f
;
10486 params
[1] = n
[4].f
;
10487 params
[2] = n
[5].f
;
10488 params
[3] = n
[6].f
;
10489 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10492 case OPCODE_TEXGEN
:
10495 params
[0] = n
[3].f
;
10496 params
[1] = n
[4].f
;
10497 params
[2] = n
[5].f
;
10498 params
[3] = n
[6].f
;
10499 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10502 case OPCODE_TEXPARAMETER
:
10505 params
[0] = n
[3].f
;
10506 params
[1] = n
[4].f
;
10507 params
[2] = n
[5].f
;
10508 params
[3] = n
[6].f
;
10509 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10512 case OPCODE_TEX_IMAGE1D
:
10514 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10515 ctx
->Unpack
= ctx
->DefaultPacking
;
10516 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10517 n
[2].i
, /* level */
10518 n
[3].i
, /* components */
10519 n
[4].i
, /* width */
10520 n
[5].e
, /* border */
10521 n
[6].e
, /* format */
10523 get_pointer(&n
[8])));
10524 ctx
->Unpack
= save
; /* restore */
10527 case OPCODE_TEX_IMAGE2D
:
10529 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10530 ctx
->Unpack
= ctx
->DefaultPacking
;
10531 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10532 n
[2].i
, /* level */
10533 n
[3].i
, /* components */
10534 n
[4].i
, /* width */
10535 n
[5].i
, /* height */
10536 n
[6].e
, /* border */
10537 n
[7].e
, /* format */
10539 get_pointer(&n
[9])));
10540 ctx
->Unpack
= save
; /* restore */
10543 case OPCODE_TEX_IMAGE3D
:
10545 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10546 ctx
->Unpack
= ctx
->DefaultPacking
;
10547 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10548 n
[2].i
, /* level */
10549 n
[3].i
, /* components */
10550 n
[4].i
, /* width */
10551 n
[5].i
, /* height */
10552 n
[6].i
, /* depth */
10553 n
[7].e
, /* border */
10554 n
[8].e
, /* format */
10556 get_pointer(&n
[10])));
10557 ctx
->Unpack
= save
; /* restore */
10560 case OPCODE_TEX_SUB_IMAGE1D
:
10562 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10563 ctx
->Unpack
= ctx
->DefaultPacking
;
10564 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10566 n
[6].e
, get_pointer(&n
[7])));
10567 ctx
->Unpack
= save
; /* restore */
10570 case OPCODE_TEX_SUB_IMAGE2D
:
10572 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10573 ctx
->Unpack
= ctx
->DefaultPacking
;
10574 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10576 n
[6].i
, n
[7].e
, n
[8].e
,
10577 get_pointer(&n
[9])));
10578 ctx
->Unpack
= save
; /* restore */
10581 case OPCODE_TEX_SUB_IMAGE3D
:
10583 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10584 ctx
->Unpack
= ctx
->DefaultPacking
;
10585 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10586 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10587 n
[8].i
, n
[9].e
, n
[10].e
,
10588 get_pointer(&n
[11])));
10589 ctx
->Unpack
= save
; /* restore */
10592 case OPCODE_TRANSLATE
:
10593 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10595 case OPCODE_VIEWPORT
:
10596 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10597 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10599 case OPCODE_WINDOW_POS
:
10600 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10602 case OPCODE_VIEWPORT_ARRAY_V
:
10603 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10604 get_pointer(&n
[3])));
10606 case OPCODE_VIEWPORT_INDEXED_F
:
10607 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10610 case OPCODE_VIEWPORT_INDEXED_FV
: {
10616 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
10619 case OPCODE_SCISSOR_ARRAY_V
:
10620 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10621 get_pointer(&n
[3])));
10623 case OPCODE_SCISSOR_INDEXED
:
10624 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
10627 case OPCODE_SCISSOR_INDEXED_V
: {
10633 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
10636 case OPCODE_DEPTH_ARRAY_V
:
10637 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10638 get_pointer(&n
[3])));
10640 case OPCODE_DEPTH_INDEXED
:
10641 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
10643 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
10644 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
10646 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
10647 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10648 n
[4].i
, n
[5].i
, n
[6].i
,
10649 get_pointer(&n
[7])));
10651 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
10652 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10653 n
[4].i
, n
[5].i
, n
[6].i
,
10654 n
[7].i
, get_pointer(&n
[8])));
10656 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
10657 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10658 n
[4].i
, n
[5].i
, n
[6].i
,
10660 get_pointer(&n
[9])));
10662 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
10663 CALL_CompressedTexSubImage1D(ctx
->Exec
,
10664 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10666 get_pointer(&n
[7])));
10668 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
10669 CALL_CompressedTexSubImage2D(ctx
->Exec
,
10670 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10671 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
10672 get_pointer(&n
[9])));
10674 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
10675 CALL_CompressedTexSubImage3D(ctx
->Exec
,
10676 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10677 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10679 get_pointer(&n
[11])));
10681 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
10682 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
10684 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
10685 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10687 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
10688 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10690 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
10691 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
10692 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
10695 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
10696 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
10698 case OPCODE_DEPTH_BOUNDS_EXT
:
10699 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10701 case OPCODE_PROGRAM_STRING_ARB
:
10702 CALL_ProgramStringARB(ctx
->Exec
,
10703 (n
[1].e
, n
[2].e
, n
[3].i
,
10704 get_pointer(&n
[4])));
10706 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
10707 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
10711 case OPCODE_BEGIN_QUERY_ARB
:
10712 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10714 case OPCODE_END_QUERY_ARB
:
10715 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
10717 case OPCODE_QUERY_COUNTER
:
10718 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10720 case OPCODE_BEGIN_QUERY_INDEXED
:
10721 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
10723 case OPCODE_END_QUERY_INDEXED
:
10724 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10726 case OPCODE_DRAW_BUFFERS_ARB
:
10728 GLenum buffers
[MAX_DRAW_BUFFERS
];
10729 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
10730 for (i
= 0; i
< count
; i
++)
10731 buffers
[i
] = n
[2 + i
].e
;
10732 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
10735 case OPCODE_BLIT_FRAMEBUFFER
:
10736 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
10737 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10740 case OPCODE_PRIMITIVE_RESTART_NV
:
10741 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10744 case OPCODE_USE_PROGRAM
:
10745 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10747 case OPCODE_UNIFORM_1F
:
10748 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10750 case OPCODE_UNIFORM_2F
:
10751 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10753 case OPCODE_UNIFORM_3F
:
10754 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10756 case OPCODE_UNIFORM_4F
:
10757 CALL_Uniform4f(ctx
->Exec
,
10758 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10760 case OPCODE_UNIFORM_1FV
:
10761 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10763 case OPCODE_UNIFORM_2FV
:
10764 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10766 case OPCODE_UNIFORM_3FV
:
10767 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10769 case OPCODE_UNIFORM_4FV
:
10770 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10772 case OPCODE_UNIFORM_1D
: {
10773 union float64_pair x
;
10775 x
.uint32
[0] = n
[2].ui
;
10776 x
.uint32
[1] = n
[3].ui
;
10778 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10781 case OPCODE_UNIFORM_2D
: {
10782 union float64_pair x
;
10783 union float64_pair y
;
10785 x
.uint32
[0] = n
[2].ui
;
10786 x
.uint32
[1] = n
[3].ui
;
10787 y
.uint32
[0] = n
[4].ui
;
10788 y
.uint32
[1] = n
[5].ui
;
10790 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10793 case OPCODE_UNIFORM_3D
: {
10794 union float64_pair x
;
10795 union float64_pair y
;
10796 union float64_pair z
;
10798 x
.uint32
[0] = n
[2].ui
;
10799 x
.uint32
[1] = n
[3].ui
;
10800 y
.uint32
[0] = n
[4].ui
;
10801 y
.uint32
[1] = n
[5].ui
;
10802 z
.uint32
[0] = n
[6].ui
;
10803 z
.uint32
[1] = n
[7].ui
;
10805 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10808 case OPCODE_UNIFORM_4D
: {
10809 union float64_pair x
;
10810 union float64_pair y
;
10811 union float64_pair z
;
10812 union float64_pair w
;
10814 x
.uint32
[0] = n
[2].ui
;
10815 x
.uint32
[1] = n
[3].ui
;
10816 y
.uint32
[0] = n
[4].ui
;
10817 y
.uint32
[1] = n
[5].ui
;
10818 z
.uint32
[0] = n
[6].ui
;
10819 z
.uint32
[1] = n
[7].ui
;
10820 w
.uint32
[0] = n
[8].ui
;
10821 w
.uint32
[1] = n
[9].ui
;
10823 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10826 case OPCODE_UNIFORM_1DV
:
10827 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10829 case OPCODE_UNIFORM_2DV
:
10830 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10832 case OPCODE_UNIFORM_3DV
:
10833 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10835 case OPCODE_UNIFORM_4DV
:
10836 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10838 case OPCODE_UNIFORM_1I
:
10839 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10841 case OPCODE_UNIFORM_2I
:
10842 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10844 case OPCODE_UNIFORM_3I
:
10845 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10847 case OPCODE_UNIFORM_4I
:
10848 CALL_Uniform4i(ctx
->Exec
,
10849 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10851 case OPCODE_UNIFORM_1IV
:
10852 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10854 case OPCODE_UNIFORM_2IV
:
10855 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10857 case OPCODE_UNIFORM_3IV
:
10858 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10860 case OPCODE_UNIFORM_4IV
:
10861 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10863 case OPCODE_UNIFORM_1UI
:
10864 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10866 case OPCODE_UNIFORM_2UI
:
10867 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10869 case OPCODE_UNIFORM_3UI
:
10870 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10872 case OPCODE_UNIFORM_4UI
:
10873 CALL_Uniform4ui(ctx
->Exec
,
10874 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10876 case OPCODE_UNIFORM_1UIV
:
10877 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10879 case OPCODE_UNIFORM_2UIV
:
10880 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10882 case OPCODE_UNIFORM_3UIV
:
10883 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10885 case OPCODE_UNIFORM_4UIV
:
10886 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10888 case OPCODE_UNIFORM_MATRIX22
:
10889 CALL_UniformMatrix2fv(ctx
->Exec
,
10890 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10892 case OPCODE_UNIFORM_MATRIX33
:
10893 CALL_UniformMatrix3fv(ctx
->Exec
,
10894 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10896 case OPCODE_UNIFORM_MATRIX44
:
10897 CALL_UniformMatrix4fv(ctx
->Exec
,
10898 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10900 case OPCODE_UNIFORM_MATRIX23
:
10901 CALL_UniformMatrix2x3fv(ctx
->Exec
,
10902 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10904 case OPCODE_UNIFORM_MATRIX32
:
10905 CALL_UniformMatrix3x2fv(ctx
->Exec
,
10906 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10908 case OPCODE_UNIFORM_MATRIX24
:
10909 CALL_UniformMatrix2x4fv(ctx
->Exec
,
10910 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10912 case OPCODE_UNIFORM_MATRIX42
:
10913 CALL_UniformMatrix4x2fv(ctx
->Exec
,
10914 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10916 case OPCODE_UNIFORM_MATRIX34
:
10917 CALL_UniformMatrix3x4fv(ctx
->Exec
,
10918 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10920 case OPCODE_UNIFORM_MATRIX43
:
10921 CALL_UniformMatrix4x3fv(ctx
->Exec
,
10922 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10924 case OPCODE_UNIFORM_MATRIX22D
:
10925 CALL_UniformMatrix2dv(ctx
->Exec
,
10926 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10928 case OPCODE_UNIFORM_MATRIX33D
:
10929 CALL_UniformMatrix3dv(ctx
->Exec
,
10930 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10932 case OPCODE_UNIFORM_MATRIX44D
:
10933 CALL_UniformMatrix4dv(ctx
->Exec
,
10934 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10936 case OPCODE_UNIFORM_MATRIX23D
:
10937 CALL_UniformMatrix2x3dv(ctx
->Exec
,
10938 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10940 case OPCODE_UNIFORM_MATRIX32D
:
10941 CALL_UniformMatrix3x2dv(ctx
->Exec
,
10942 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10944 case OPCODE_UNIFORM_MATRIX24D
:
10945 CALL_UniformMatrix2x4dv(ctx
->Exec
,
10946 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10948 case OPCODE_UNIFORM_MATRIX42D
:
10949 CALL_UniformMatrix4x2dv(ctx
->Exec
,
10950 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10952 case OPCODE_UNIFORM_MATRIX34D
:
10953 CALL_UniformMatrix3x4dv(ctx
->Exec
,
10954 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10956 case OPCODE_UNIFORM_MATRIX43D
:
10957 CALL_UniformMatrix4x3dv(ctx
->Exec
,
10958 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10961 case OPCODE_USE_PROGRAM_STAGES
:
10962 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10964 case OPCODE_PROGRAM_UNIFORM_1F
:
10965 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
10967 case OPCODE_PROGRAM_UNIFORM_2F
:
10968 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
10970 case OPCODE_PROGRAM_UNIFORM_3F
:
10971 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10972 n
[3].f
, n
[4].f
, n
[5].f
));
10974 case OPCODE_PROGRAM_UNIFORM_4F
:
10975 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10976 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10978 case OPCODE_PROGRAM_UNIFORM_1FV
:
10979 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10980 get_pointer(&n
[4])));
10982 case OPCODE_PROGRAM_UNIFORM_2FV
:
10983 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10984 get_pointer(&n
[4])));
10986 case OPCODE_PROGRAM_UNIFORM_3FV
:
10987 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10988 get_pointer(&n
[4])));
10990 case OPCODE_PROGRAM_UNIFORM_4FV
:
10991 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10992 get_pointer(&n
[4])));
10994 case OPCODE_PROGRAM_UNIFORM_1D
: {
10995 union float64_pair x
;
10997 x
.uint32
[0] = n
[3].ui
;
10998 x
.uint32
[1] = n
[4].ui
;
11000 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11003 case OPCODE_PROGRAM_UNIFORM_2D
: {
11004 union float64_pair x
;
11005 union float64_pair y
;
11007 x
.uint32
[0] = n
[3].ui
;
11008 x
.uint32
[1] = n
[4].ui
;
11009 y
.uint32
[0] = n
[5].ui
;
11010 y
.uint32
[1] = n
[6].ui
;
11012 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11015 case OPCODE_PROGRAM_UNIFORM_3D
: {
11016 union float64_pair x
;
11017 union float64_pair y
;
11018 union float64_pair z
;
11020 x
.uint32
[0] = n
[3].ui
;
11021 x
.uint32
[1] = n
[4].ui
;
11022 y
.uint32
[0] = n
[5].ui
;
11023 y
.uint32
[1] = n
[6].ui
;
11024 z
.uint32
[0] = n
[7].ui
;
11025 z
.uint32
[1] = n
[8].ui
;
11027 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11031 case OPCODE_PROGRAM_UNIFORM_4D
: {
11032 union float64_pair x
;
11033 union float64_pair y
;
11034 union float64_pair z
;
11035 union float64_pair w
;
11037 x
.uint32
[0] = n
[3].ui
;
11038 x
.uint32
[1] = n
[4].ui
;
11039 y
.uint32
[0] = n
[5].ui
;
11040 y
.uint32
[1] = n
[6].ui
;
11041 z
.uint32
[0] = n
[7].ui
;
11042 z
.uint32
[1] = n
[8].ui
;
11043 w
.uint32
[0] = n
[9].ui
;
11044 w
.uint32
[1] = n
[10].ui
;
11046 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11047 x
.d
, y
.d
, z
.d
, w
.d
));
11050 case OPCODE_PROGRAM_UNIFORM_1DV
:
11051 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11052 get_pointer(&n
[4])));
11054 case OPCODE_PROGRAM_UNIFORM_2DV
:
11055 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11056 get_pointer(&n
[4])));
11058 case OPCODE_PROGRAM_UNIFORM_3DV
:
11059 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11060 get_pointer(&n
[4])));
11062 case OPCODE_PROGRAM_UNIFORM_4DV
:
11063 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11064 get_pointer(&n
[4])));
11066 case OPCODE_PROGRAM_UNIFORM_1I
:
11067 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11069 case OPCODE_PROGRAM_UNIFORM_2I
:
11070 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11072 case OPCODE_PROGRAM_UNIFORM_3I
:
11073 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11074 n
[3].i
, n
[4].i
, n
[5].i
));
11076 case OPCODE_PROGRAM_UNIFORM_4I
:
11077 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11078 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11080 case OPCODE_PROGRAM_UNIFORM_1IV
:
11081 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11082 get_pointer(&n
[4])));
11084 case OPCODE_PROGRAM_UNIFORM_2IV
:
11085 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11086 get_pointer(&n
[4])));
11088 case OPCODE_PROGRAM_UNIFORM_3IV
:
11089 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11090 get_pointer(&n
[4])));
11092 case OPCODE_PROGRAM_UNIFORM_4IV
:
11093 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11094 get_pointer(&n
[4])));
11096 case OPCODE_PROGRAM_UNIFORM_1UI
:
11097 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11099 case OPCODE_PROGRAM_UNIFORM_2UI
:
11100 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11101 n
[3].ui
, n
[4].ui
));
11103 case OPCODE_PROGRAM_UNIFORM_3UI
:
11104 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11105 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11107 case OPCODE_PROGRAM_UNIFORM_4UI
:
11108 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11110 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11112 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11113 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11114 get_pointer(&n
[4])));
11116 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11117 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11118 get_pointer(&n
[4])));
11120 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11121 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11122 get_pointer(&n
[4])));
11124 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11125 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11126 get_pointer(&n
[4])));
11128 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11129 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11130 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11131 get_pointer(&n
[5])));
11133 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11134 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11135 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11136 get_pointer(&n
[5])));
11138 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11139 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11140 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11141 get_pointer(&n
[5])));
11143 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11144 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11145 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11146 get_pointer(&n
[5])));
11148 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11149 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11150 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11151 get_pointer(&n
[5])));
11153 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11154 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11155 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11156 get_pointer(&n
[5])));
11158 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11159 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11160 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11161 get_pointer(&n
[5])));
11163 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11164 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11165 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11166 get_pointer(&n
[5])));
11168 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11169 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11170 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11171 get_pointer(&n
[5])));
11173 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11174 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11175 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11176 get_pointer(&n
[5])));
11178 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11179 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11180 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11181 get_pointer(&n
[5])));
11183 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11184 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11185 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11186 get_pointer(&n
[5])));
11188 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11189 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11190 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11191 get_pointer(&n
[5])));
11193 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11194 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11195 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11196 get_pointer(&n
[5])));
11198 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11199 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11200 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11201 get_pointer(&n
[5])));
11203 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11204 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11205 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11206 get_pointer(&n
[5])));
11208 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11209 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11210 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11211 get_pointer(&n
[5])));
11213 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11214 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11215 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11216 get_pointer(&n
[5])));
11219 case OPCODE_CLIP_CONTROL
:
11220 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11223 case OPCODE_CLAMP_COLOR
:
11224 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11227 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11228 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11230 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11231 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11233 case OPCODE_ATTR_1F_NV
:
11234 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11236 case OPCODE_ATTR_2F_NV
:
11237 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11239 case OPCODE_ATTR_3F_NV
:
11240 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11242 case OPCODE_ATTR_4F_NV
:
11243 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11245 case OPCODE_ATTR_1F_ARB
:
11246 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11248 case OPCODE_ATTR_2F_ARB
:
11249 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11251 case OPCODE_ATTR_3F_ARB
:
11252 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11254 case OPCODE_ATTR_4F_ARB
:
11255 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11257 case OPCODE_ATTR_1D
: {
11258 GLdouble
*d
= (GLdouble
*) &n
[2];
11259 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11262 case OPCODE_ATTR_2D
: {
11263 GLdouble
*d
= (GLdouble
*) &n
[2];
11264 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11267 case OPCODE_ATTR_3D
: {
11268 GLdouble
*d
= (GLdouble
*) &n
[2];
11269 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11272 case OPCODE_ATTR_4D
: {
11273 GLdouble
*d
= (GLdouble
*) &n
[2];
11274 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11277 case OPCODE_MATERIAL
:
11278 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11281 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11284 CALL_End(ctx
->Exec
, ());
11287 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11289 case OPCODE_EVAL_C1
:
11290 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11292 case OPCODE_EVAL_C2
:
11293 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11295 case OPCODE_EVAL_P1
:
11296 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11298 case OPCODE_EVAL_P2
:
11299 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11302 /* GL_EXT_texture_integer */
11303 case OPCODE_CLEARCOLOR_I
:
11304 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11306 case OPCODE_CLEARCOLOR_UI
:
11307 CALL_ClearColorIuiEXT(ctx
->Exec
,
11308 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11310 case OPCODE_TEXPARAMETER_I
:
11313 params
[0] = n
[3].i
;
11314 params
[1] = n
[4].i
;
11315 params
[2] = n
[5].i
;
11316 params
[3] = n
[6].i
;
11317 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11320 case OPCODE_TEXPARAMETER_UI
:
11323 params
[0] = n
[3].ui
;
11324 params
[1] = n
[4].ui
;
11325 params
[2] = n
[5].ui
;
11326 params
[3] = n
[6].ui
;
11327 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11331 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11332 /* GL_ARB_instanced_arrays */
11333 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11336 case OPCODE_TEXTURE_BARRIER_NV
:
11337 CALL_TextureBarrierNV(ctx
->Exec
, ());
11340 /* GL_EXT/ARB_transform_feedback */
11341 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11342 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11344 case OPCODE_END_TRANSFORM_FEEDBACK
:
11345 CALL_EndTransformFeedback(ctx
->Exec
, ());
11347 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11348 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11350 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11351 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11353 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11354 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11356 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11357 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11359 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11360 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11361 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11363 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11364 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11365 (n
[1].e
, n
[2].ui
, n
[3].si
));
11367 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11368 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11369 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11373 case OPCODE_BIND_SAMPLER
:
11374 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11376 case OPCODE_SAMPLER_PARAMETERIV
:
11379 params
[0] = n
[3].i
;
11380 params
[1] = n
[4].i
;
11381 params
[2] = n
[5].i
;
11382 params
[3] = n
[6].i
;
11383 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11386 case OPCODE_SAMPLER_PARAMETERFV
:
11389 params
[0] = n
[3].f
;
11390 params
[1] = n
[4].f
;
11391 params
[2] = n
[5].f
;
11392 params
[3] = n
[6].f
;
11393 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11396 case OPCODE_SAMPLER_PARAMETERIIV
:
11399 params
[0] = n
[3].i
;
11400 params
[1] = n
[4].i
;
11401 params
[2] = n
[5].i
;
11402 params
[3] = n
[6].i
;
11403 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11406 case OPCODE_SAMPLER_PARAMETERUIV
:
11409 params
[0] = n
[3].ui
;
11410 params
[1] = n
[4].ui
;
11411 params
[2] = n
[5].ui
;
11412 params
[3] = n
[6].ui
;
11413 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11417 /* ARB_compute_shader */
11418 case OPCODE_DISPATCH_COMPUTE
:
11419 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11423 case OPCODE_WAIT_SYNC
:
11425 union uint64_pair p
;
11426 p
.uint32
[0] = n
[2].ui
;
11427 p
.uint32
[1] = n
[3].ui
;
11428 CALL_WaitSync(ctx
->Exec
,
11429 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11433 /* GL_NV_conditional_render */
11434 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11435 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11437 case OPCODE_END_CONDITIONAL_RENDER
:
11438 CALL_EndConditionalRender(ctx
->Exec
, ());
11441 case OPCODE_UNIFORM_BLOCK_BINDING
:
11442 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11445 case OPCODE_UNIFORM_SUBROUTINES
:
11446 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11447 get_pointer(&n
[3])));
11450 /* GL_EXT_window_rectangles */
11451 case OPCODE_WINDOW_RECTANGLES
:
11452 CALL_WindowRectanglesEXT(
11453 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11456 /* GL_NV_conservative_raster */
11457 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11458 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11461 /* GL_NV_conservative_raster_dilate */
11462 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11463 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11466 /* GL_NV_conservative_raster_pre_snap_triangles */
11467 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11468 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11471 /* GL_EXT_direct_state_access */
11472 case OPCODE_MATRIX_LOAD
:
11473 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11475 case OPCODE_MATRIX_MULT
:
11476 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11478 case OPCODE_MATRIX_ROTATE
:
11479 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11481 case OPCODE_MATRIX_SCALE
:
11482 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11484 case OPCODE_MATRIX_TRANSLATE
:
11485 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11487 case OPCODE_MATRIX_LOAD_IDENTITY
:
11488 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11490 case OPCODE_MATRIX_ORTHO
:
11491 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11492 n
[2].f
, n
[3].f
, n
[4].f
,
11493 n
[5].f
, n
[6].f
, n
[7].f
));
11495 case OPCODE_MATRIX_FRUSTUM
:
11496 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11497 n
[2].f
, n
[3].f
, n
[4].f
,
11498 n
[5].f
, n
[6].f
, n
[7].f
));
11500 case OPCODE_MATRIX_PUSH
:
11501 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11503 case OPCODE_MATRIX_POP
:
11504 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11506 case OPCODE_TEXTUREPARAMETER_F
:
11509 params
[0] = n
[4].f
;
11510 params
[1] = n
[5].f
;
11511 params
[2] = n
[6].f
;
11512 params
[3] = n
[7].f
;
11513 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11516 case OPCODE_TEXTUREPARAMETER_I
:
11519 params
[0] = n
[4].i
;
11520 params
[1] = n
[5].i
;
11521 params
[2] = n
[6].i
;
11522 params
[3] = n
[7].i
;
11523 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11526 case OPCODE_TEXTURE_IMAGE1D
:
11528 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11529 ctx
->Unpack
= ctx
->DefaultPacking
;
11530 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11531 n
[2].e
, /* target */
11532 n
[3].i
, /* level */
11533 n
[4].i
, /* components */
11534 n
[5].i
, /* width */
11535 n
[6].e
, /* border */
11536 n
[7].e
, /* format */
11538 get_pointer(&n
[9])));
11539 ctx
->Unpack
= save
; /* restore */
11542 case OPCODE_TEXTURE_IMAGE2D
:
11544 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11545 ctx
->Unpack
= ctx
->DefaultPacking
;
11546 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11547 n
[2].e
, /* target */
11548 n
[3].i
, /* level */
11549 n
[4].i
, /* components */
11550 n
[5].i
, /* width */
11551 n
[6].i
, /* height */
11552 n
[7].e
, /* border */
11553 n
[8].e
, /* format */
11555 get_pointer(&n
[10])));
11556 ctx
->Unpack
= save
; /* restore */
11559 case OPCODE_TEXTURE_IMAGE3D
:
11561 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11562 ctx
->Unpack
= ctx
->DefaultPacking
;
11563 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11564 n
[2].e
, /* target */
11565 n
[3].i
, /* level */
11566 n
[4].i
, /* components */
11567 n
[5].i
, /* width */
11568 n
[6].i
, /* height */
11569 n
[7].i
, /* depth */
11570 n
[8].e
, /* border */
11571 n
[9].e
, /* format */
11572 n
[10].e
, /* type */
11573 get_pointer(&n
[11])));
11574 ctx
->Unpack
= save
; /* restore */
11577 case OPCODE_TEXTURE_SUB_IMAGE1D
:
11579 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11580 ctx
->Unpack
= ctx
->DefaultPacking
;
11581 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11582 n
[4].i
, n
[5].i
, n
[6].e
,
11583 n
[7].e
, get_pointer(&n
[8])));
11584 ctx
->Unpack
= save
; /* restore */
11587 case OPCODE_TEXTURE_SUB_IMAGE2D
:
11589 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11590 ctx
->Unpack
= ctx
->DefaultPacking
;
11591 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11592 n
[4].i
, n
[5].i
, n
[6].e
,
11593 n
[7].i
, n
[8].e
, n
[9].e
,
11594 get_pointer(&n
[10])));
11595 ctx
->Unpack
= save
;
11598 case OPCODE_TEXTURE_SUB_IMAGE3D
:
11600 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11601 ctx
->Unpack
= ctx
->DefaultPacking
;
11602 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11603 n
[4].i
, n
[5].i
, n
[6].i
,
11604 n
[7].i
, n
[8].i
, n
[9].i
,
11606 get_pointer(&n
[12])));
11607 ctx
->Unpack
= save
; /* restore */
11610 case OPCODE_COPY_TEXTURE_IMAGE1D
:
11611 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11612 n
[4].e
, n
[5].i
, n
[6].i
,
11615 case OPCODE_COPY_TEXTURE_IMAGE2D
:
11616 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11617 n
[4].e
, n
[5].i
, n
[6].i
,
11618 n
[7].i
, n
[8].i
, n
[9].i
));
11620 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
11621 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11622 n
[4].i
, n
[5].i
, n
[6].i
,
11625 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
11626 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11627 n
[4].i
, n
[5].i
, n
[6].i
,
11628 n
[7].i
, n
[8].i
, n
[9].i
));
11630 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
11631 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11632 n
[4].i
, n
[5].i
, n
[6].i
,
11633 n
[7].i
, n
[8].i
, n
[9].i
,
11636 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
11637 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
11638 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
11639 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
11640 n
[9].i
, get_pointer(&n
[10])));
11643 case OPCODE_CONTINUE
:
11644 n
= (Node
*) get_pointer(&n
[1]);
11649 case OPCODE_END_OF_LIST
:
11655 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
11657 _mesa_problem(ctx
, "%s", msg
);
11662 /* increment n to point to next compiled command */
11663 if (opcode
!= OPCODE_CONTINUE
) {
11664 assert(InstSize
[opcode
] > 0);
11665 n
+= InstSize
[opcode
];
11670 vbo_save_EndCallList(ctx
);
11672 ctx
->ListState
.CallDepth
--;
11677 /**********************************************************************/
11679 /**********************************************************************/
11682 * Test if a display list number is valid.
11684 GLboolean GLAPIENTRY
11685 _mesa_IsList(GLuint list
)
11687 GET_CURRENT_CONTEXT(ctx
);
11688 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11689 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
11690 return islist(ctx
, list
);
11695 * Delete a sequence of consecutive display lists.
11698 _mesa_DeleteLists(GLuint list
, GLsizei range
)
11700 GET_CURRENT_CONTEXT(ctx
);
11702 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11703 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11706 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
11711 /* We may be deleting a set of bitmap lists. See if there's a
11712 * bitmap atlas to free.
11714 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
11716 _mesa_delete_bitmap_atlas(ctx
, atlas
);
11717 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
11721 for (i
= list
; i
< list
+ range
; i
++) {
11722 destroy_list(ctx
, i
);
11728 * Return a display list number, n, such that lists n through n+range-1
11732 _mesa_GenLists(GLsizei range
)
11734 GET_CURRENT_CONTEXT(ctx
);
11736 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11737 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
11740 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
11748 * Make this an atomic operation
11750 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
11752 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
11754 /* reserve the list IDs by with empty/dummy lists */
11756 for (i
= 0; i
< range
; i
++) {
11757 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
11758 make_list(base
+ i
, 1));
11762 if (USE_BITMAP_ATLAS
&&
11764 ctx
->Driver
.DrawAtlasBitmaps
) {
11765 /* "range > 16" is a rough heuristic to guess when glGenLists might be
11766 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
11767 * Create the empty atlas now.
11769 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
11771 atlas
= alloc_bitmap_atlas(ctx
, base
);
11774 /* Atlas _should_ be new/empty now, but clobbering is OK */
11775 assert(atlas
->numBitmaps
== 0);
11776 atlas
->numBitmaps
= range
;
11780 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
11787 * Begin a new display list.
11790 _mesa_NewList(GLuint name
, GLenum mode
)
11792 GET_CURRENT_CONTEXT(ctx
);
11794 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
11795 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11797 if (MESA_VERBOSE
& VERBOSE_API
)
11798 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
11799 _mesa_enum_to_string(mode
));
11802 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
11806 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
11807 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
11811 if (ctx
->ListState
.CurrentList
) {
11812 /* already compiling a display list */
11813 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
11817 ctx
->CompileFlag
= GL_TRUE
;
11818 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
11820 /* Reset accumulated list state */
11821 invalidate_saved_current_state( ctx
);
11823 /* Allocate new display list */
11824 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
11825 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
11826 ctx
->ListState
.CurrentPos
= 0;
11828 vbo_save_NewList(ctx
, name
, mode
);
11830 ctx
->CurrentServerDispatch
= ctx
->Save
;
11831 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11832 if (ctx
->MarshalExec
== NULL
) {
11833 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11839 * End definition of current display list.
11842 _mesa_EndList(void)
11844 GET_CURRENT_CONTEXT(ctx
);
11845 SAVE_FLUSH_VERTICES(ctx
);
11846 FLUSH_VERTICES(ctx
, 0);
11848 if (MESA_VERBOSE
& VERBOSE_API
)
11849 _mesa_debug(ctx
, "glEndList\n");
11851 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
11852 _mesa_error(ctx
, GL_INVALID_OPERATION
,
11853 "glEndList() called inside glBegin/End");
11856 /* Check that a list is under construction */
11857 if (!ctx
->ListState
.CurrentList
) {
11858 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
11862 /* Call before emitting END_OF_LIST, in case the driver wants to
11863 * emit opcodes itself.
11865 vbo_save_EndList(ctx
);
11867 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
11871 /* Destroy old list, if any */
11872 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
11874 /* Install the new list */
11875 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
11876 ctx
->ListState
.CurrentList
->Name
,
11877 ctx
->ListState
.CurrentList
);
11880 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
11881 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
11883 ctx
->ListState
.CurrentList
= NULL
;
11884 ctx
->ListState
.CurrentBlock
= NULL
;
11885 ctx
->ListState
.CurrentPos
= 0;
11886 ctx
->ExecuteFlag
= GL_TRUE
;
11887 ctx
->CompileFlag
= GL_FALSE
;
11889 ctx
->CurrentServerDispatch
= ctx
->Exec
;
11890 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11891 if (ctx
->MarshalExec
== NULL
) {
11892 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11898 _mesa_CallList(GLuint list
)
11900 GLboolean save_compile_flag
;
11901 GET_CURRENT_CONTEXT(ctx
);
11902 FLUSH_CURRENT(ctx
, 0);
11904 if (MESA_VERBOSE
& VERBOSE_API
)
11905 _mesa_debug(ctx
, "glCallList %d\n", list
);
11908 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
11913 mesa_print_display_list( list
);
11915 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
11916 * execute the display list, and restore the CompileFlag.
11918 save_compile_flag
= ctx
->CompileFlag
;
11919 if (save_compile_flag
) {
11920 ctx
->CompileFlag
= GL_FALSE
;
11923 execute_list(ctx
, list
);
11924 ctx
->CompileFlag
= save_compile_flag
;
11926 /* also restore API function pointers to point to "save" versions */
11927 if (save_compile_flag
) {
11928 ctx
->CurrentServerDispatch
= ctx
->Save
;
11929 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11930 if (ctx
->MarshalExec
== NULL
) {
11931 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11938 * Try to execute a glCallLists() command where the display lists contain
11939 * glBitmap commands with a texture atlas.
11940 * \return true for success, false otherwise
11943 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
11946 struct gl_bitmap_atlas
*atlas
;
11949 if (!USE_BITMAP_ATLAS
||
11950 !ctx
->Current
.RasterPosValid
||
11951 ctx
->List
.ListBase
== 0 ||
11952 type
!= GL_UNSIGNED_BYTE
||
11953 !ctx
->Driver
.DrawAtlasBitmaps
) {
11958 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11961 /* Even if glGenLists wasn't called, we can still try to create
11964 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11967 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
11968 /* Try to build the bitmap atlas now.
11969 * If the atlas was created in glGenLists, we'll have recorded the
11970 * number of lists (bitmaps). Otherwise, take a guess at 256.
11972 if (atlas
->numBitmaps
== 0)
11973 atlas
->numBitmaps
= 256;
11974 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
11977 if (!atlas
|| !atlas
->complete
) {
11981 /* check that all display list IDs are in the atlas */
11982 for (i
= 0; i
< n
; i
++) {
11983 const GLubyte
*ids
= (const GLubyte
*) lists
;
11985 if (ids
[i
] >= atlas
->numBitmaps
) {
11990 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
11997 * Execute glCallLists: call multiple display lists.
12000 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12002 GET_CURRENT_CONTEXT(ctx
);
12004 GLboolean save_compile_flag
;
12006 if (MESA_VERBOSE
& VERBOSE_API
)
12007 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12011 case GL_UNSIGNED_BYTE
:
12013 case GL_UNSIGNED_SHORT
:
12015 case GL_UNSIGNED_INT
:
12023 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12028 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12030 } else if (n
== 0 || lists
== NULL
) {
12031 /* nothing to do */
12035 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12039 /* Save the CompileFlag status, turn it off, execute display list,
12040 * and restore the CompileFlag.
12042 save_compile_flag
= ctx
->CompileFlag
;
12043 ctx
->CompileFlag
= GL_FALSE
;
12045 for (i
= 0; i
< n
; i
++) {
12046 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12047 execute_list(ctx
, list
);
12050 ctx
->CompileFlag
= save_compile_flag
;
12052 /* also restore API function pointers to point to "save" versions */
12053 if (save_compile_flag
) {
12054 ctx
->CurrentServerDispatch
= ctx
->Save
;
12055 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12056 if (ctx
->MarshalExec
== NULL
) {
12057 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12064 * Set the offset added to list numbers in glCallLists.
12067 _mesa_ListBase(GLuint base
)
12069 GET_CURRENT_CONTEXT(ctx
);
12070 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12071 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12072 ctx
->List
.ListBase
= base
;
12076 * Setup the given dispatch table to point to Mesa's display list
12077 * building functions.
12079 * This does not include any of the tnl functions - they are
12080 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12084 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12086 struct _glapi_table
*table
= ctx
->Save
;
12087 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12089 /* Initially populate the dispatch table with the contents of the
12090 * normal-execution dispatch table. This lets us skip populating functions
12091 * that should be called directly instead of compiled into display lists.
12093 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12095 _mesa_loopback_init_api_table(ctx
, table
);
12097 /* VBO functions */
12098 vbo_initialize_save_dispatch(ctx
, table
);
12101 SET_Accum(table
, save_Accum
);
12102 SET_AlphaFunc(table
, save_AlphaFunc
);
12103 SET_Bitmap(table
, save_Bitmap
);
12104 SET_BlendFunc(table
, save_BlendFunc
);
12105 SET_CallList(table
, save_CallList
);
12106 SET_CallLists(table
, save_CallLists
);
12107 SET_Clear(table
, save_Clear
);
12108 SET_ClearAccum(table
, save_ClearAccum
);
12109 SET_ClearColor(table
, save_ClearColor
);
12110 SET_ClearDepth(table
, save_ClearDepth
);
12111 SET_ClearIndex(table
, save_ClearIndex
);
12112 SET_ClearStencil(table
, save_ClearStencil
);
12113 SET_ClipPlane(table
, save_ClipPlane
);
12114 SET_ColorMask(table
, save_ColorMask
);
12115 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12116 SET_ColorMaterial(table
, save_ColorMaterial
);
12117 SET_CopyPixels(table
, save_CopyPixels
);
12118 SET_CullFace(table
, save_CullFace
);
12119 SET_DepthFunc(table
, save_DepthFunc
);
12120 SET_DepthMask(table
, save_DepthMask
);
12121 SET_DepthRange(table
, save_DepthRange
);
12122 SET_Disable(table
, save_Disable
);
12123 SET_Disablei(table
, save_DisableIndexed
);
12124 SET_DrawBuffer(table
, save_DrawBuffer
);
12125 SET_DrawPixels(table
, save_DrawPixels
);
12126 SET_Enable(table
, save_Enable
);
12127 SET_Enablei(table
, save_EnableIndexed
);
12128 SET_EvalMesh1(table
, save_EvalMesh1
);
12129 SET_EvalMesh2(table
, save_EvalMesh2
);
12130 SET_Fogf(table
, save_Fogf
);
12131 SET_Fogfv(table
, save_Fogfv
);
12132 SET_Fogi(table
, save_Fogi
);
12133 SET_Fogiv(table
, save_Fogiv
);
12134 SET_FrontFace(table
, save_FrontFace
);
12135 SET_Frustum(table
, save_Frustum
);
12136 SET_Hint(table
, save_Hint
);
12137 SET_IndexMask(table
, save_IndexMask
);
12138 SET_InitNames(table
, save_InitNames
);
12139 SET_LightModelf(table
, save_LightModelf
);
12140 SET_LightModelfv(table
, save_LightModelfv
);
12141 SET_LightModeli(table
, save_LightModeli
);
12142 SET_LightModeliv(table
, save_LightModeliv
);
12143 SET_Lightf(table
, save_Lightf
);
12144 SET_Lightfv(table
, save_Lightfv
);
12145 SET_Lighti(table
, save_Lighti
);
12146 SET_Lightiv(table
, save_Lightiv
);
12147 SET_LineStipple(table
, save_LineStipple
);
12148 SET_LineWidth(table
, save_LineWidth
);
12149 SET_ListBase(table
, save_ListBase
);
12150 SET_LoadIdentity(table
, save_LoadIdentity
);
12151 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12152 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12153 SET_LoadName(table
, save_LoadName
);
12154 SET_LogicOp(table
, save_LogicOp
);
12155 SET_Map1d(table
, save_Map1d
);
12156 SET_Map1f(table
, save_Map1f
);
12157 SET_Map2d(table
, save_Map2d
);
12158 SET_Map2f(table
, save_Map2f
);
12159 SET_MapGrid1d(table
, save_MapGrid1d
);
12160 SET_MapGrid1f(table
, save_MapGrid1f
);
12161 SET_MapGrid2d(table
, save_MapGrid2d
);
12162 SET_MapGrid2f(table
, save_MapGrid2f
);
12163 SET_MatrixMode(table
, save_MatrixMode
);
12164 SET_MultMatrixd(table
, save_MultMatrixd
);
12165 SET_MultMatrixf(table
, save_MultMatrixf
);
12166 SET_NewList(table
, save_NewList
);
12167 SET_Ortho(table
, save_Ortho
);
12168 SET_PassThrough(table
, save_PassThrough
);
12169 SET_PixelMapfv(table
, save_PixelMapfv
);
12170 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12171 SET_PixelMapusv(table
, save_PixelMapusv
);
12172 SET_PixelTransferf(table
, save_PixelTransferf
);
12173 SET_PixelTransferi(table
, save_PixelTransferi
);
12174 SET_PixelZoom(table
, save_PixelZoom
);
12175 SET_PointSize(table
, save_PointSize
);
12176 SET_PolygonMode(table
, save_PolygonMode
);
12177 SET_PolygonOffset(table
, save_PolygonOffset
);
12178 SET_PolygonStipple(table
, save_PolygonStipple
);
12179 SET_PopAttrib(table
, save_PopAttrib
);
12180 SET_PopMatrix(table
, save_PopMatrix
);
12181 SET_PopName(table
, save_PopName
);
12182 SET_PushAttrib(table
, save_PushAttrib
);
12183 SET_PushMatrix(table
, save_PushMatrix
);
12184 SET_PushName(table
, save_PushName
);
12185 SET_RasterPos2d(table
, save_RasterPos2d
);
12186 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12187 SET_RasterPos2f(table
, save_RasterPos2f
);
12188 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12189 SET_RasterPos2i(table
, save_RasterPos2i
);
12190 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12191 SET_RasterPos2s(table
, save_RasterPos2s
);
12192 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12193 SET_RasterPos3d(table
, save_RasterPos3d
);
12194 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12195 SET_RasterPos3f(table
, save_RasterPos3f
);
12196 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12197 SET_RasterPos3i(table
, save_RasterPos3i
);
12198 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12199 SET_RasterPos3s(table
, save_RasterPos3s
);
12200 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12201 SET_RasterPos4d(table
, save_RasterPos4d
);
12202 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12203 SET_RasterPos4f(table
, save_RasterPos4f
);
12204 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12205 SET_RasterPos4i(table
, save_RasterPos4i
);
12206 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12207 SET_RasterPos4s(table
, save_RasterPos4s
);
12208 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12209 SET_ReadBuffer(table
, save_ReadBuffer
);
12210 SET_Rectf(table
, save_Rectf
);
12211 SET_Rotated(table
, save_Rotated
);
12212 SET_Rotatef(table
, save_Rotatef
);
12213 SET_Scaled(table
, save_Scaled
);
12214 SET_Scalef(table
, save_Scalef
);
12215 SET_Scissor(table
, save_Scissor
);
12216 SET_ShadeModel(table
, save_ShadeModel
);
12217 SET_StencilFunc(table
, save_StencilFunc
);
12218 SET_StencilMask(table
, save_StencilMask
);
12219 SET_StencilOp(table
, save_StencilOp
);
12220 SET_TexEnvf(table
, save_TexEnvf
);
12221 SET_TexEnvfv(table
, save_TexEnvfv
);
12222 SET_TexEnvi(table
, save_TexEnvi
);
12223 SET_TexEnviv(table
, save_TexEnviv
);
12224 SET_TexGend(table
, save_TexGend
);
12225 SET_TexGendv(table
, save_TexGendv
);
12226 SET_TexGenf(table
, save_TexGenf
);
12227 SET_TexGenfv(table
, save_TexGenfv
);
12228 SET_TexGeni(table
, save_TexGeni
);
12229 SET_TexGeniv(table
, save_TexGeniv
);
12230 SET_TexImage1D(table
, save_TexImage1D
);
12231 SET_TexImage2D(table
, save_TexImage2D
);
12232 SET_TexParameterf(table
, save_TexParameterf
);
12233 SET_TexParameterfv(table
, save_TexParameterfv
);
12234 SET_TexParameteri(table
, save_TexParameteri
);
12235 SET_TexParameteriv(table
, save_TexParameteriv
);
12236 SET_Translated(table
, save_Translated
);
12237 SET_Translatef(table
, save_Translatef
);
12238 SET_Viewport(table
, save_Viewport
);
12241 SET_BindTexture(table
, save_BindTexture
);
12242 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12243 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12244 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12245 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12246 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12247 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12248 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12251 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12252 SET_TexImage3D(table
, save_TexImage3D
);
12253 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12256 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12257 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12258 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12260 /* ATI_separate_stencil */
12261 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12263 /* GL_ARB_imaging */
12264 /* Not all are supported */
12265 SET_BlendColor(table
, save_BlendColor
);
12266 SET_BlendEquation(table
, save_BlendEquation
);
12268 /* 2. GL_EXT_blend_color */
12270 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12273 /* 6. GL_EXT_texture3d */
12275 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12276 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12277 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12280 /* 37. GL_EXT_blend_minmax */
12282 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12285 /* 54. GL_EXT_point_parameters */
12286 SET_PointParameterf(table
, save_PointParameterfEXT
);
12287 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12289 /* 91. GL_ARB_tessellation_shader */
12290 SET_PatchParameteri(table
, save_PatchParameteri
);
12291 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12293 /* 100. ARB_viewport_array */
12294 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12295 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12296 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12297 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12298 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12299 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12300 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12301 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12303 /* 122. ARB_compute_shader */
12304 SET_DispatchCompute(table
, save_DispatchCompute
);
12305 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12307 /* 173. GL_EXT_blend_func_separate */
12308 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12310 /* 197. GL_MESA_window_pos */
12311 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12312 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12313 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12314 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12315 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12316 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12317 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12318 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12319 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12320 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12321 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12322 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12323 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12324 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12325 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12326 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12327 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12328 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12329 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12330 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12331 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12332 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
12333 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
12334 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
12336 /* 245. GL_ATI_fragment_shader */
12337 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
12338 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
12340 /* 262. GL_NV_point_sprite */
12341 SET_PointParameteri(table
, save_PointParameteriNV
);
12342 SET_PointParameteriv(table
, save_PointParameterivNV
);
12344 /* 268. GL_EXT_stencil_two_side */
12345 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
12347 /* ???. GL_EXT_depth_bounds_test */
12348 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
12350 /* ARB 1. GL_ARB_multitexture */
12351 SET_ActiveTexture(table
, save_ActiveTextureARB
);
12353 /* ARB 3. GL_ARB_transpose_matrix */
12354 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
12355 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
12356 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
12357 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
12359 /* ARB 5. GL_ARB_multisample */
12360 SET_SampleCoverage(table
, save_SampleCoverageARB
);
12362 /* ARB 12. GL_ARB_texture_compression */
12363 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
12364 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
12365 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
12366 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
12367 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
12368 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
12370 /* ARB 14. GL_ARB_point_parameters */
12371 /* aliased with EXT_point_parameters functions */
12373 /* ARB 25. GL_ARB_window_pos */
12374 /* aliased with MESA_window_pos functions */
12376 /* ARB 26. GL_ARB_vertex_program */
12377 /* ARB 27. GL_ARB_fragment_program */
12378 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
12379 SET_ProgramStringARB(table
, save_ProgramStringARB
);
12380 SET_BindProgramARB(table
, save_BindProgramARB
);
12381 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
12382 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
12383 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
12384 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
12385 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
12386 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
12387 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
12388 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
12390 SET_BeginQuery(table
, save_BeginQueryARB
);
12391 SET_EndQuery(table
, save_EndQueryARB
);
12392 SET_QueryCounter(table
, save_QueryCounter
);
12394 SET_DrawBuffers(table
, save_DrawBuffersARB
);
12396 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
12398 SET_UseProgram(table
, save_UseProgram
);
12399 SET_Uniform1f(table
, save_Uniform1fARB
);
12400 SET_Uniform2f(table
, save_Uniform2fARB
);
12401 SET_Uniform3f(table
, save_Uniform3fARB
);
12402 SET_Uniform4f(table
, save_Uniform4fARB
);
12403 SET_Uniform1fv(table
, save_Uniform1fvARB
);
12404 SET_Uniform2fv(table
, save_Uniform2fvARB
);
12405 SET_Uniform3fv(table
, save_Uniform3fvARB
);
12406 SET_Uniform4fv(table
, save_Uniform4fvARB
);
12407 SET_Uniform1i(table
, save_Uniform1iARB
);
12408 SET_Uniform2i(table
, save_Uniform2iARB
);
12409 SET_Uniform3i(table
, save_Uniform3iARB
);
12410 SET_Uniform4i(table
, save_Uniform4iARB
);
12411 SET_Uniform1iv(table
, save_Uniform1ivARB
);
12412 SET_Uniform2iv(table
, save_Uniform2ivARB
);
12413 SET_Uniform3iv(table
, save_Uniform3ivARB
);
12414 SET_Uniform4iv(table
, save_Uniform4ivARB
);
12415 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
12416 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
12417 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
12418 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
12419 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
12420 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
12421 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
12422 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
12423 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
12425 /* 299. GL_EXT_blend_equation_separate */
12426 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
12428 /* GL_EXT_gpu_program_parameters */
12429 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
12430 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
12432 /* 364. GL_EXT_provoking_vertex */
12433 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
12435 /* GL_EXT_texture_integer */
12436 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
12437 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
12438 SET_TexParameterIiv(table
, save_TexParameterIiv
);
12439 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
12441 /* GL_ARB_clip_control */
12442 SET_ClipControl(table
, save_ClipControl
);
12444 /* GL_ARB_color_buffer_float */
12445 SET_ClampColor(table
, save_ClampColorARB
);
12448 SET_ClearBufferiv(table
, save_ClearBufferiv
);
12449 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
12450 SET_ClearBufferfv(table
, save_ClearBufferfv
);
12451 SET_ClearBufferfi(table
, save_ClearBufferfi
);
12452 SET_Uniform1ui(table
, save_Uniform1ui
);
12453 SET_Uniform2ui(table
, save_Uniform2ui
);
12454 SET_Uniform3ui(table
, save_Uniform3ui
);
12455 SET_Uniform4ui(table
, save_Uniform4ui
);
12456 SET_Uniform1uiv(table
, save_Uniform1uiv
);
12457 SET_Uniform2uiv(table
, save_Uniform2uiv
);
12458 SET_Uniform3uiv(table
, save_Uniform3uiv
);
12459 SET_Uniform4uiv(table
, save_Uniform4uiv
);
12461 /* GL_ARB_gpu_shader_fp64 */
12462 SET_Uniform1d(table
, save_Uniform1d
);
12463 SET_Uniform2d(table
, save_Uniform2d
);
12464 SET_Uniform3d(table
, save_Uniform3d
);
12465 SET_Uniform4d(table
, save_Uniform4d
);
12466 SET_Uniform1dv(table
, save_Uniform1dv
);
12467 SET_Uniform2dv(table
, save_Uniform2dv
);
12468 SET_Uniform3dv(table
, save_Uniform3dv
);
12469 SET_Uniform4dv(table
, save_Uniform4dv
);
12470 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
12471 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
12472 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
12473 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
12474 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
12475 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
12476 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
12477 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
12478 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
12481 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
12482 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
12483 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
12484 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
12485 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
12486 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
12487 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
12488 SET_DrawTransformFeedbackInstanced(table
,
12489 save_DrawTransformFeedbackInstanced
);
12490 SET_DrawTransformFeedbackStreamInstanced(table
,
12491 save_DrawTransformFeedbackStreamInstanced
);
12492 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
12493 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
12495 /* GL_ARB_instanced_arrays */
12496 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
12498 /* GL_NV_texture_barrier */
12499 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
12501 SET_BindSampler(table
, save_BindSampler
);
12502 SET_SamplerParameteri(table
, save_SamplerParameteri
);
12503 SET_SamplerParameterf(table
, save_SamplerParameterf
);
12504 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
12505 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
12506 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
12507 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
12509 /* GL_ARB_draw_buffer_blend */
12510 SET_BlendFunciARB(table
, save_BlendFunci
);
12511 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
12512 SET_BlendEquationiARB(table
, save_BlendEquationi
);
12513 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
12515 /* GL_NV_conditional_render */
12516 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
12517 SET_EndConditionalRender(table
, save_EndConditionalRender
);
12520 SET_WaitSync(table
, save_WaitSync
);
12522 /* GL_ARB_uniform_buffer_object */
12523 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
12525 /* GL_ARB_shader_subroutines */
12526 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
12528 /* GL_ARB_draw_instanced */
12529 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
12530 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
12532 /* GL_ARB_draw_elements_base_vertex */
12533 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
12535 /* GL_ARB_base_instance */
12536 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
12537 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
12538 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
12540 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
12541 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
12542 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
12543 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
12544 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
12546 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
12547 SET_UseProgramStages(table
, save_UseProgramStages
);
12548 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
12549 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
12550 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
12551 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
12552 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
12553 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
12554 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
12555 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
12556 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
12557 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
12558 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
12559 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
12560 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
12561 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
12562 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
12563 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
12564 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
12565 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
12566 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
12567 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
12568 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
12569 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
12570 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
12571 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
12572 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
12573 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
12574 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
12575 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
12576 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
12577 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
12578 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
12579 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
12580 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
12581 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
12582 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
12583 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
12584 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
12585 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
12586 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
12587 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
12588 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
12589 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
12590 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
12591 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
12592 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
12593 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
12594 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
12595 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
12596 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
12597 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
12599 /* GL_{ARB,EXT}_polygon_offset_clamp */
12600 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
12602 /* GL_EXT_window_rectangles */
12603 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
12605 /* GL_NV_conservative_raster */
12606 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
12608 /* GL_NV_conservative_raster_dilate */
12609 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
12611 /* GL_NV_conservative_raster_pre_snap_triangles */
12612 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
12614 /* GL_EXT_direct_state_access */
12615 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
12616 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
12617 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
12618 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
12619 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
12620 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
12621 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
12622 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
12623 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
12624 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
12625 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
12626 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
12627 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
12628 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
12629 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
12630 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
12631 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
12632 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
12633 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
12634 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
12635 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
12636 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
12637 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
12638 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
12639 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
12640 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
12641 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
12642 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
12643 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
12644 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
12645 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
12646 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
12647 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
12648 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
12649 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
12654 static const char *
12655 enum_string(GLenum k
)
12657 return _mesa_enum_to_string(k
);
12662 * Print the commands in a display list. For debugging only.
12663 * TODO: many commands aren't handled yet.
12664 * \param fname filename to write display list to. If null, use stdout.
12666 static void GLAPIENTRY
12667 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
12669 struct gl_display_list
*dlist
;
12675 f
= fopen(fname
, "w");
12680 if (!islist(ctx
, list
)) {
12681 fprintf(f
, "%u is not a display list ID\n", list
);
12685 dlist
= _mesa_lookup_list(ctx
, list
);
12692 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
12694 done
= n
? GL_FALSE
: GL_TRUE
;
12696 const OpCode opcode
= n
[0].opcode
;
12698 if (is_ext_opcode(opcode
)) {
12699 n
+= ext_opcode_print(ctx
, n
, f
);
12704 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
12706 case OPCODE_ACTIVE_TEXTURE
:
12707 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
12709 case OPCODE_BITMAP
:
12710 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
12711 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
12712 get_pointer(&n
[7]));
12714 case OPCODE_BLEND_COLOR
:
12715 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
12716 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12718 case OPCODE_BLEND_EQUATION
:
12719 fprintf(f
, "BlendEquation %s\n",
12720 enum_string(n
[1].e
));
12722 case OPCODE_BLEND_EQUATION_SEPARATE
:
12723 fprintf(f
, "BlendEquationSeparate %s, %s\n",
12724 enum_string(n
[1].e
),
12725 enum_string(n
[2].e
));
12727 case OPCODE_BLEND_FUNC_SEPARATE
:
12728 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
12729 enum_string(n
[1].e
),
12730 enum_string(n
[2].e
),
12731 enum_string(n
[3].e
),
12732 enum_string(n
[4].e
));
12734 case OPCODE_BLEND_EQUATION_I
:
12735 fprintf(f
, "BlendEquationi %u, %s\n",
12736 n
[1].ui
, enum_string(n
[2].e
));
12738 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
12739 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
12740 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12742 case OPCODE_BLEND_FUNC_I
:
12743 fprintf(f
, "BlendFunci %u, %s, %s\n",
12744 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12746 case OPCODE_BLEND_FUNC_SEPARATE_I
:
12747 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
12749 enum_string(n
[2].e
),
12750 enum_string(n
[3].e
),
12751 enum_string(n
[4].e
),
12752 enum_string(n
[5].e
));
12754 case OPCODE_CALL_LIST
:
12755 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
12757 case OPCODE_CALL_LISTS
:
12758 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
12760 case OPCODE_DISABLE
:
12761 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
12763 case OPCODE_ENABLE
:
12764 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
12766 case OPCODE_FRUSTUM
:
12767 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
12768 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12770 case OPCODE_LINE_STIPPLE
:
12771 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
12773 case OPCODE_LINE_WIDTH
:
12774 fprintf(f
, "LineWidth %f\n", n
[1].f
);
12776 case OPCODE_LOAD_IDENTITY
:
12777 fprintf(f
, "LoadIdentity\n");
12779 case OPCODE_LOAD_MATRIX
:
12780 fprintf(f
, "LoadMatrix\n");
12781 fprintf(f
, " %8f %8f %8f %8f\n",
12782 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12783 fprintf(f
, " %8f %8f %8f %8f\n",
12784 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12785 fprintf(f
, " %8f %8f %8f %8f\n",
12786 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12787 fprintf(f
, " %8f %8f %8f %8f\n",
12788 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12790 case OPCODE_MULT_MATRIX
:
12791 fprintf(f
, "MultMatrix (or Rotate)\n");
12792 fprintf(f
, " %8f %8f %8f %8f\n",
12793 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12794 fprintf(f
, " %8f %8f %8f %8f\n",
12795 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12796 fprintf(f
, " %8f %8f %8f %8f\n",
12797 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12798 fprintf(f
, " %8f %8f %8f %8f\n",
12799 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12802 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
12803 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12805 case OPCODE_POINT_SIZE
:
12806 fprintf(f
, "PointSize %f\n", n
[1].f
);
12808 case OPCODE_POP_ATTRIB
:
12809 fprintf(f
, "PopAttrib\n");
12811 case OPCODE_POP_MATRIX
:
12812 fprintf(f
, "PopMatrix\n");
12814 case OPCODE_POP_NAME
:
12815 fprintf(f
, "PopName\n");
12817 case OPCODE_PUSH_ATTRIB
:
12818 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
12820 case OPCODE_PUSH_MATRIX
:
12821 fprintf(f
, "PushMatrix\n");
12823 case OPCODE_PUSH_NAME
:
12824 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
12826 case OPCODE_RASTER_POS
:
12827 fprintf(f
, "RasterPos %g %g %g %g\n",
12828 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12830 case OPCODE_ROTATE
:
12831 fprintf(f
, "Rotate %g %g %g %g\n",
12832 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12835 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12837 case OPCODE_TRANSLATE
:
12838 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12840 case OPCODE_BIND_TEXTURE
:
12841 fprintf(f
, "BindTexture %s %d\n",
12842 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
12844 case OPCODE_SHADE_MODEL
:
12845 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
12848 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
12849 _mesa_enum_to_string(n
[1].ui
),
12850 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
12853 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
12854 _mesa_enum_to_string(n
[1].ui
),
12855 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
12856 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
12858 case OPCODE_MAPGRID1
:
12859 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
12861 case OPCODE_MAPGRID2
:
12862 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
12863 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
12865 case OPCODE_EVALMESH1
:
12866 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
12868 case OPCODE_EVALMESH2
:
12869 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
12870 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
12873 case OPCODE_ATTR_1F_NV
:
12874 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
12876 case OPCODE_ATTR_2F_NV
:
12877 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
12878 n
[1].i
, n
[2].f
, n
[3].f
);
12880 case OPCODE_ATTR_3F_NV
:
12881 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
12882 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12884 case OPCODE_ATTR_4F_NV
:
12885 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
12886 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12888 case OPCODE_ATTR_1F_ARB
:
12889 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
12891 case OPCODE_ATTR_2F_ARB
:
12892 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
12893 n
[1].i
, n
[2].f
, n
[3].f
);
12895 case OPCODE_ATTR_3F_ARB
:
12896 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
12897 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12899 case OPCODE_ATTR_4F_ARB
:
12900 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
12901 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12904 case OPCODE_MATERIAL
:
12905 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
12906 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12909 fprintf(f
, "BEGIN %x\n", n
[1].i
);
12912 fprintf(f
, "END\n");
12915 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
12918 case OPCODE_EVAL_C1
:
12919 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
12921 case OPCODE_EVAL_C2
:
12922 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
12924 case OPCODE_EVAL_P1
:
12925 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
12927 case OPCODE_EVAL_P2
:
12928 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
12931 case OPCODE_PROVOKING_VERTEX
:
12932 fprintf(f
, "ProvokingVertex %s\n",
12933 _mesa_enum_to_string(n
[1].ui
));
12937 * meta opcodes/commands
12940 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
12941 (const char *) get_pointer(&n
[2]));
12943 case OPCODE_CONTINUE
:
12944 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
12945 n
= (Node
*) get_pointer(&n
[1]);
12948 fprintf(f
, "NOP\n");
12950 case OPCODE_END_OF_LIST
:
12951 fprintf(f
, "END-LIST %u\n", list
);
12955 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
12957 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
12958 opcode
, (void *) n
);
12962 fprintf(f
, "command %d, %u operands\n", opcode
,
12966 /* increment n to point to next compiled command */
12967 if (opcode
!= OPCODE_CONTINUE
) {
12968 assert(InstSize
[opcode
] > 0);
12969 n
+= InstSize
[opcode
];
12983 * Clients may call this function to help debug display list problems.
12984 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
12985 * changed, or break in the future without notice.
12988 mesa_print_display_list(GLuint list
)
12990 GET_CURRENT_CONTEXT(ctx
);
12991 print_list(ctx
, list
, NULL
);
12995 /**********************************************************************/
12996 /***** Initialization *****/
12997 /**********************************************************************/
13000 save_vtxfmt_init(GLvertexformat
* vfmt
)
13002 vfmt
->ArrayElement
= _ae_ArrayElement
;
13004 vfmt
->Begin
= save_Begin
;
13006 vfmt
->CallList
= save_CallList
;
13007 vfmt
->CallLists
= save_CallLists
;
13009 vfmt
->Color3f
= save_Color3f
;
13010 vfmt
->Color3fv
= save_Color3fv
;
13011 vfmt
->Color4f
= save_Color4f
;
13012 vfmt
->Color4fv
= save_Color4fv
;
13013 vfmt
->EdgeFlag
= save_EdgeFlag
;
13014 vfmt
->End
= save_End
;
13016 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13017 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13018 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13019 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13020 vfmt
->EvalPoint1
= save_EvalPoint1
;
13021 vfmt
->EvalPoint2
= save_EvalPoint2
;
13023 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13024 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13025 vfmt
->Indexf
= save_Indexf
;
13026 vfmt
->Indexfv
= save_Indexfv
;
13027 vfmt
->Materialfv
= save_Materialfv
;
13028 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13029 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13030 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13031 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13032 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13033 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13034 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13035 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13036 vfmt
->Normal3f
= save_Normal3f
;
13037 vfmt
->Normal3fv
= save_Normal3fv
;
13038 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13039 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13040 vfmt
->TexCoord1f
= save_TexCoord1f
;
13041 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13042 vfmt
->TexCoord2f
= save_TexCoord2f
;
13043 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13044 vfmt
->TexCoord3f
= save_TexCoord3f
;
13045 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13046 vfmt
->TexCoord4f
= save_TexCoord4f
;
13047 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13048 vfmt
->Vertex2f
= save_Vertex2f
;
13049 vfmt
->Vertex2fv
= save_Vertex2fv
;
13050 vfmt
->Vertex3f
= save_Vertex3f
;
13051 vfmt
->Vertex3fv
= save_Vertex3fv
;
13052 vfmt
->Vertex4f
= save_Vertex4f
;
13053 vfmt
->Vertex4fv
= save_Vertex4fv
;
13054 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13055 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13056 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13057 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13058 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13059 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13060 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13061 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13062 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13063 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13064 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13065 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13066 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13067 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13068 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13069 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13071 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13076 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13077 const GLvertexformat
*vfmt
)
13079 SET_CallList(disp
, vfmt
->CallList
);
13080 SET_CallLists(disp
, vfmt
->CallLists
);
13085 * Initialize display list state for given context.
13088 _mesa_init_display_list(struct gl_context
*ctx
)
13090 static GLboolean tableInitialized
= GL_FALSE
;
13092 /* zero-out the instruction size table, just once */
13093 if (!tableInitialized
) {
13094 memset(InstSize
, 0, sizeof(InstSize
));
13095 tableInitialized
= GL_TRUE
;
13098 /* extension info */
13099 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13102 ctx
->ListState
.CallDepth
= 0;
13103 ctx
->ExecuteFlag
= GL_TRUE
;
13104 ctx
->CompileFlag
= GL_FALSE
;
13105 ctx
->ListState
.CurrentBlock
= NULL
;
13106 ctx
->ListState
.CurrentPos
= 0;
13108 /* Display List group */
13109 ctx
->List
.ListBase
= 0;
13111 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13113 InstSize
[OPCODE_NOP
] = 1;
13118 _mesa_free_display_list_data(struct gl_context
*ctx
)
13120 free(ctx
->ListExt
);
13121 ctx
->ListExt
= NULL
;