2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_BIND_MULTITEXTURE
,
585 OPCODE_MULTITEXPARAMETER_F
,
586 OPCODE_MULTITEXPARAMETER_I
,
588 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
590 /* The following three are meta instructions */
591 OPCODE_ERROR
, /* raise compiled-in error */
593 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
603 * Display list instructions are stored as sequences of "nodes". Nodes
604 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
605 * are linked together with a pointer.
607 * Each instruction in the display list is stored as a sequence of
608 * contiguous nodes in memory.
609 * Each node is the union of a variety of data types.
611 * Note, all of these members should be 4 bytes in size or less for the
612 * sake of compact display lists. We store 8-byte pointers in a pair of
613 * these nodes using the save/get_pointer() functions below.
631 typedef union gl_dlist_node Node
;
634 /** How many 4-byte dwords to store a pointer */
635 #define POINTER_DWORDS (sizeof(void *) / 4)
637 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
638 * space for display lists. The following types and functions are
639 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
644 GLuint dwords
[POINTER_DWORDS
];
649 * Save a 4 or 8-byte pointer at dest (and dest+1).
652 save_pointer(Node
*dest
, void *src
)
657 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
658 STATIC_ASSERT(sizeof(Node
) == 4);
662 for (i
= 0; i
< POINTER_DWORDS
; i
++)
663 dest
[i
].ui
= p
.dwords
[i
];
668 * Retrieve a 4 or 8-byte pointer from node (node+1).
671 get_pointer(const Node
*node
)
676 for (i
= 0; i
< POINTER_DWORDS
; i
++)
677 p
.dwords
[i
] = node
[i
].ui
;
684 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
701 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
703 union float64_pair tmp; \
705 n[idx].ui = tmp.uint32[0]; \
706 n[idx+1].ui = tmp.uint32[1]; \
711 * How many nodes to allocate at a time. Note that bulk vertex data
712 * from glBegin/glVertex/glEnd primitives will typically wind up in
713 * a VBO, and not directly in the display list itself.
715 #define BLOCK_SIZE 256
720 * Number of nodes of storage needed for each instruction.
721 * Sizes for dynamically allocated opcodes are stored in the context struct.
723 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
726 void mesa_print_display_list(GLuint list
);
730 * Does the given display list only contain a single glBitmap call?
733 is_bitmap_list(const struct gl_display_list
*dlist
)
735 const Node
*n
= dlist
->Head
;
736 if (n
[0].opcode
== OPCODE_BITMAP
) {
737 n
+= InstSize
[OPCODE_BITMAP
];
738 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
746 * Is the given display list an empty list?
749 is_empty_list(const struct gl_display_list
*dlist
)
751 const Node
*n
= dlist
->Head
;
752 return n
[0].opcode
== OPCODE_END_OF_LIST
;
757 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
760 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
763 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
771 * Lookup a gl_bitmap_atlas by listBase ID.
773 static struct gl_bitmap_atlas
*
774 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
776 struct gl_bitmap_atlas
*atlas
;
778 assert(listBase
> 0);
779 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
785 * Create new bitmap atlas and insert into hash table.
787 static struct gl_bitmap_atlas
*
788 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
790 struct gl_bitmap_atlas
*atlas
;
792 assert(listBase
> 0);
793 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
795 atlas
= calloc(1, sizeof(*atlas
));
797 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
805 * Try to build a bitmap atlas. This involves examining a sequence of
806 * display lists which contain glBitmap commands and putting the bitmap
807 * images into a texture map (the atlas).
808 * If we succeed, gl_bitmap_atlas::complete will be set to true.
809 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
812 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
815 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
820 assert(!atlas
->complete
);
821 assert(atlas
->numBitmaps
> 0);
823 /* We use a rectangle texture (non-normalized coords) for the atlas */
824 assert(ctx
->Extensions
.NV_texture_rectangle
);
825 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
827 atlas
->texWidth
= 1024;
828 atlas
->texHeight
= 0; /* determined below */
830 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
831 if (!atlas
->glyphs
) {
833 atlas
->incomplete
= true;
837 /* Loop over the display lists. They should all contain a single glBitmap
838 * call. If not, bail out. Also, compute the position and sizes of each
839 * bitmap in the atlas to determine the texture atlas size.
841 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
842 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
844 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
845 unsigned bitmap_width
, bitmap_height
;
846 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
848 if (!list
|| is_empty_list(list
)) {
850 atlas
->numBitmaps
= i
;
854 if (!is_bitmap_list(list
)) {
855 /* This list does not contain exactly one glBitmap command. Give up. */
856 atlas
->incomplete
= true;
860 /* get bitmap info from the display list command */
862 assert(n
[0].opcode
== OPCODE_BITMAP
);
863 bitmap_width
= n
[1].i
;
864 bitmap_height
= n
[2].i
;
865 bitmap_xorig
= n
[3].f
;
866 bitmap_yorig
= n
[4].f
;
867 bitmap_xmove
= n
[5].f
;
868 bitmap_ymove
= n
[6].f
;
870 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
871 /* advance to the next row of the texture */
877 /* save the bitmap's position in the atlas */
881 g
->h
= bitmap_height
;
882 g
->xorig
= bitmap_xorig
;
883 g
->yorig
= bitmap_yorig
;
884 g
->xmove
= bitmap_xmove
;
885 g
->ymove
= bitmap_ymove
;
887 xpos
+= bitmap_width
;
889 /* keep track of tallest bitmap in the row */
890 row_height
= MAX2(row_height
, bitmap_height
);
893 /* Now we know the texture height */
894 atlas
->texHeight
= ypos
+ row_height
;
896 if (atlas
->texHeight
== 0) {
897 /* no glyphs found, give up */
900 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
901 /* too large, give up */
905 /* Create atlas texture (texture ID is irrelevant) */
906 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
907 if (!atlas
->texObj
) {
911 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
912 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
913 atlas
->texObj
->MaxLevel
= 0;
914 atlas
->texObj
->Immutable
= GL_TRUE
;
916 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
917 GL_TEXTURE_RECTANGLE
, 0);
918 if (!atlas
->texImage
) {
922 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
923 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
924 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
926 /* alloc image storage */
927 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
931 /* map teximage, load with bitmap glyphs */
932 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
933 0, 0, atlas
->texWidth
, atlas
->texHeight
,
934 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
939 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
940 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
942 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
943 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
944 const Node
*n
= list
->Head
;
946 assert(n
[0].opcode
== OPCODE_BITMAP
||
947 n
[0].opcode
== OPCODE_END_OF_LIST
);
949 if (n
[0].opcode
== OPCODE_BITMAP
) {
950 unsigned bitmap_width
= n
[1].i
;
951 unsigned bitmap_height
= n
[2].i
;
952 unsigned xpos
= atlas
->glyphs
[i
].x
;
953 unsigned ypos
= atlas
->glyphs
[i
].y
;
954 const void *bitmap_image
= get_pointer(&n
[7]);
956 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
957 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
959 /* put the bitmap image into the texture image */
960 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
961 &ctx
->DefaultPacking
, bitmap_image
,
962 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
967 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
969 atlas
->complete
= true;
974 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
977 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
980 atlas
->glyphs
= NULL
;
981 atlas
->incomplete
= true;
986 * Allocate a gl_display_list object with an initial block of storage.
987 * \param count how many display list nodes/tokens to allocate
989 static struct gl_display_list
*
990 make_list(GLuint name
, GLuint count
)
992 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
994 dlist
->Head
= malloc(sizeof(Node
) * count
);
995 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
996 /* All InstSize[] entries must be non-zero */
997 InstSize
[OPCODE_END_OF_LIST
] = 1;
1003 * Lookup function to just encapsulate casting.
1005 struct gl_display_list
*
1006 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1008 return (struct gl_display_list
*)
1009 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1013 /** Is the given opcode an extension code? */
1014 static inline GLboolean
1015 is_ext_opcode(OpCode opcode
)
1017 return (opcode
>= OPCODE_EXT_0
);
1021 /** Destroy an extended opcode instruction */
1023 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1025 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1027 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1028 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1033 /** Execute an extended opcode instruction */
1035 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1037 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1039 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1040 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1045 /** Print an extended opcode instruction */
1047 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1049 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1051 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1052 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1058 * Delete the named display list, but don't remove from hash table.
1059 * \param dlist - display list pointer
1062 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1067 n
= block
= dlist
->Head
;
1069 done
= block
? GL_FALSE
: GL_TRUE
;
1071 const OpCode opcode
= n
[0].opcode
;
1073 /* check for extension opcodes first */
1074 if (is_ext_opcode(opcode
)) {
1075 n
+= ext_opcode_destroy(ctx
, n
);
1079 /* for some commands, we need to free malloc'd memory */
1081 free(get_pointer(&n
[6]));
1084 free(get_pointer(&n
[10]));
1086 case OPCODE_CALL_LISTS
:
1087 free(get_pointer(&n
[3]));
1089 case OPCODE_DRAW_PIXELS
:
1090 free(get_pointer(&n
[5]));
1093 free(get_pointer(&n
[7]));
1095 case OPCODE_POLYGON_STIPPLE
:
1096 free(get_pointer(&n
[1]));
1098 case OPCODE_TEX_IMAGE1D
:
1099 free(get_pointer(&n
[8]));
1101 case OPCODE_TEX_IMAGE2D
:
1102 free(get_pointer(&n
[9]));
1104 case OPCODE_TEX_IMAGE3D
:
1105 free(get_pointer(&n
[10]));
1107 case OPCODE_TEX_SUB_IMAGE1D
:
1108 free(get_pointer(&n
[7]));
1110 case OPCODE_TEX_SUB_IMAGE2D
:
1111 free(get_pointer(&n
[9]));
1113 case OPCODE_TEX_SUB_IMAGE3D
:
1114 free(get_pointer(&n
[11]));
1116 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1117 free(get_pointer(&n
[7]));
1119 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1120 free(get_pointer(&n
[8]));
1122 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1123 free(get_pointer(&n
[9]));
1125 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1126 free(get_pointer(&n
[7]));
1128 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1129 free(get_pointer(&n
[9]));
1131 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1132 free(get_pointer(&n
[11]));
1134 case OPCODE_PROGRAM_STRING_ARB
:
1135 free(get_pointer(&n
[4])); /* program string */
1137 case OPCODE_UNIFORM_1FV
:
1138 case OPCODE_UNIFORM_2FV
:
1139 case OPCODE_UNIFORM_3FV
:
1140 case OPCODE_UNIFORM_4FV
:
1141 case OPCODE_UNIFORM_1DV
:
1142 case OPCODE_UNIFORM_2DV
:
1143 case OPCODE_UNIFORM_3DV
:
1144 case OPCODE_UNIFORM_4DV
:
1145 case OPCODE_UNIFORM_1IV
:
1146 case OPCODE_UNIFORM_2IV
:
1147 case OPCODE_UNIFORM_3IV
:
1148 case OPCODE_UNIFORM_4IV
:
1149 case OPCODE_UNIFORM_1UIV
:
1150 case OPCODE_UNIFORM_2UIV
:
1151 case OPCODE_UNIFORM_3UIV
:
1152 case OPCODE_UNIFORM_4UIV
:
1153 free(get_pointer(&n
[3]));
1155 case OPCODE_UNIFORM_MATRIX22
:
1156 case OPCODE_UNIFORM_MATRIX33
:
1157 case OPCODE_UNIFORM_MATRIX44
:
1158 case OPCODE_UNIFORM_MATRIX24
:
1159 case OPCODE_UNIFORM_MATRIX42
:
1160 case OPCODE_UNIFORM_MATRIX23
:
1161 case OPCODE_UNIFORM_MATRIX32
:
1162 case OPCODE_UNIFORM_MATRIX34
:
1163 case OPCODE_UNIFORM_MATRIX43
:
1164 case OPCODE_UNIFORM_MATRIX22D
:
1165 case OPCODE_UNIFORM_MATRIX33D
:
1166 case OPCODE_UNIFORM_MATRIX44D
:
1167 case OPCODE_UNIFORM_MATRIX24D
:
1168 case OPCODE_UNIFORM_MATRIX42D
:
1169 case OPCODE_UNIFORM_MATRIX23D
:
1170 case OPCODE_UNIFORM_MATRIX32D
:
1171 case OPCODE_UNIFORM_MATRIX34D
:
1172 case OPCODE_UNIFORM_MATRIX43D
:
1173 free(get_pointer(&n
[4]));
1175 case OPCODE_PROGRAM_UNIFORM_1FV
:
1176 case OPCODE_PROGRAM_UNIFORM_2FV
:
1177 case OPCODE_PROGRAM_UNIFORM_3FV
:
1178 case OPCODE_PROGRAM_UNIFORM_4FV
:
1179 case OPCODE_PROGRAM_UNIFORM_1DV
:
1180 case OPCODE_PROGRAM_UNIFORM_2DV
:
1181 case OPCODE_PROGRAM_UNIFORM_3DV
:
1182 case OPCODE_PROGRAM_UNIFORM_4DV
:
1183 case OPCODE_PROGRAM_UNIFORM_1IV
:
1184 case OPCODE_PROGRAM_UNIFORM_2IV
:
1185 case OPCODE_PROGRAM_UNIFORM_3IV
:
1186 case OPCODE_PROGRAM_UNIFORM_4IV
:
1187 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1188 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1189 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1190 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1191 free(get_pointer(&n
[4]));
1193 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1194 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1195 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1196 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1197 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1198 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1199 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1200 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1201 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1202 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1203 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1206 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1207 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1208 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1209 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1210 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1211 free(get_pointer(&n
[5]));
1213 case OPCODE_PIXEL_MAP
:
1214 free(get_pointer(&n
[3]));
1216 case OPCODE_VIEWPORT_ARRAY_V
:
1217 case OPCODE_SCISSOR_ARRAY_V
:
1218 case OPCODE_DEPTH_ARRAY_V
:
1219 case OPCODE_UNIFORM_SUBROUTINES
:
1220 case OPCODE_WINDOW_RECTANGLES
:
1221 free(get_pointer(&n
[3]));
1223 case OPCODE_TEXTURE_IMAGE1D
:
1224 free(get_pointer(&n
[9]));
1226 case OPCODE_TEXTURE_IMAGE2D
:
1227 free(get_pointer(&n
[10]));
1229 case OPCODE_TEXTURE_IMAGE3D
:
1230 free(get_pointer(&n
[11]));
1232 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1233 free(get_pointer(&n
[8]));
1235 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1236 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1237 free(get_pointer(&n
[10]));
1239 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1240 free(get_pointer(&n
[12]));
1242 case OPCODE_CONTINUE
:
1243 n
= (Node
*) get_pointer(&n
[1]);
1247 case OPCODE_END_OF_LIST
:
1252 /* just increment 'n' pointer, below */
1256 if (opcode
!= OPCODE_CONTINUE
) {
1257 assert(InstSize
[opcode
] > 0);
1258 n
+= InstSize
[opcode
];
1269 * Called by _mesa_HashWalk() to check if a display list which is being
1270 * deleted belongs to a bitmap texture atlas.
1273 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1275 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1276 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1278 /* See if the list_id falls in the range contained in this texture atlas */
1279 if (atlas
->complete
&&
1280 list_id
>= atlas_id
&&
1281 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1282 /* Mark the atlas as incomplete so it doesn't get used. But don't
1283 * delete it yet since we don't want to try to recreate it in the next
1286 atlas
->complete
= false;
1287 atlas
->incomplete
= true;
1293 * Destroy a display list and remove from hash table.
1294 * \param list - display list number
1297 destroy_list(struct gl_context
*ctx
, GLuint list
)
1299 struct gl_display_list
*dlist
;
1304 dlist
= _mesa_lookup_list(ctx
, list
);
1308 if (is_bitmap_list(dlist
)) {
1309 /* If we're destroying a simple glBitmap display list, there's a
1310 * chance that we're destroying a bitmap image that's in a texture
1311 * atlas. Examine all atlases to see if that's the case. There's
1312 * usually few (if any) atlases so this isn't expensive.
1314 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1315 check_atlas_for_deleted_list
, &list
);
1318 _mesa_delete_list(ctx
, dlist
);
1319 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1324 * Translate the nth element of list from <type> to GLint.
1327 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1339 bptr
= (GLbyte
*) list
;
1340 return (GLint
) bptr
[n
];
1341 case GL_UNSIGNED_BYTE
:
1342 ubptr
= (GLubyte
*) list
;
1343 return (GLint
) ubptr
[n
];
1345 sptr
= (GLshort
*) list
;
1346 return (GLint
) sptr
[n
];
1347 case GL_UNSIGNED_SHORT
:
1348 usptr
= (GLushort
*) list
;
1349 return (GLint
) usptr
[n
];
1351 iptr
= (GLint
*) list
;
1353 case GL_UNSIGNED_INT
:
1354 uiptr
= (GLuint
*) list
;
1355 return (GLint
) uiptr
[n
];
1357 fptr
= (GLfloat
*) list
;
1358 return (GLint
) floorf(fptr
[n
]);
1360 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1361 return (GLint
) ubptr
[0] * 256
1364 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1365 return (GLint
) ubptr
[0] * 65536
1366 + (GLint
) ubptr
[1] * 256
1369 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1370 return (GLint
) ubptr
[0] * 16777216
1371 + (GLint
) ubptr
[1] * 65536
1372 + (GLint
) ubptr
[2] * 256
1381 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1382 * If width < 0 or height < 0 or format or type are invalid we'll just
1383 * return NULL. We will not generate an error since OpenGL command
1384 * arguments aren't error-checked until the command is actually executed
1385 * (not when they're compiled).
1386 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1389 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1390 GLsizei width
, GLsizei height
, GLsizei depth
,
1391 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1392 const struct gl_pixelstore_attrib
*unpack
)
1394 if (width
<= 0 || height
<= 0) {
1398 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1399 /* bad format and/or type */
1403 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1407 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1408 format
, type
, pixels
, unpack
);
1409 if (pixels
&& !image
) {
1410 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1414 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1415 depth
, format
, type
, INT_MAX
, pixels
)) {
1416 const GLubyte
*map
, *src
;
1420 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1421 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1424 /* unable to map src buffer! */
1425 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1429 src
= ADD_POINTERS(map
, pixels
);
1430 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1431 format
, type
, src
, unpack
);
1433 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1436 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1442 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1447 /** Return copy of memory */
1449 memdup(const void *src
, GLsizei bytes
)
1451 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1453 memcpy(b
, src
, bytes
);
1459 * Allocate space for a display list instruction (opcode + payload space).
1460 * \param opcode the instruction opcode (OPCODE_* value)
1461 * \param bytes instruction payload size (not counting opcode)
1462 * \param align8 does the payload need to be 8-byte aligned?
1463 * This is only relevant in 64-bit environments.
1464 * \return pointer to allocated memory (the payload will be at pointer+1)
1467 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1469 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1470 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1474 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1476 if (opcode
< OPCODE_EXT_0
) {
1477 if (InstSize
[opcode
] == 0) {
1478 /* save instruction size now */
1479 InstSize
[opcode
] = numNodes
;
1482 /* make sure instruction size agrees */
1483 assert(numNodes
== InstSize
[opcode
]);
1487 if (sizeof(void *) > sizeof(Node
) && align8
1488 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1489 /* The opcode would get placed at node[0] and the payload would start
1490 * at node[1]. But the payload needs to be at an even offset (8-byte
1499 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1501 /* This block is full. Allocate a new block and chain to it */
1503 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1504 n
[0].opcode
= OPCODE_CONTINUE
;
1505 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1507 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1511 /* a fresh block should be 8-byte aligned on 64-bit systems */
1512 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1514 save_pointer(&n
[1], newblock
);
1515 ctx
->ListState
.CurrentBlock
= newblock
;
1516 ctx
->ListState
.CurrentPos
= 0;
1518 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1519 * we have to insert a NOP so that the payload of the real opcode lands
1520 * on an even location:
1521 * node[0] = OPCODE_NOP
1522 * node[1] = OPCODE_x;
1523 * node[2] = start of payload
1525 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1528 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1530 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1531 n
[0].opcode
= OPCODE_NOP
;
1533 /* The "real" opcode will now be at an odd location and the payload
1534 * will be at an even location.
1537 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1539 n
[0].opcode
= opcode
;
1547 * Allocate space for a display list instruction. Used by callers outside
1548 * this file for things like VBO vertex data.
1550 * \param opcode the instruction opcode (OPCODE_* value)
1551 * \param bytes instruction size in bytes, not counting opcode.
1552 * \return pointer to the usable data area (not including the internal
1556 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1558 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1560 return n
+ 1; /* return pointer to payload area, after opcode */
1567 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1568 * aligned in 64-bit environments, 4-byte aligned otherwise.
1571 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1573 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1575 return n
+ 1; /* return pointer to payload area, after opcode */
1582 * This function allows modules and drivers to get their own opcodes
1583 * for extending display list functionality.
1584 * \param ctx the rendering context
1585 * \param size number of bytes for storing the new display list command
1586 * \param execute function to execute the new display list command
1587 * \param destroy function to destroy the new display list command
1588 * \param print function to print the new display list command
1589 * \return the new opcode number or -1 if error
1592 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1594 void (*execute
) (struct gl_context
*, void *),
1595 void (*destroy
) (struct gl_context
*, void *),
1596 void (*print
) (struct gl_context
*, void *, FILE *))
1598 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1599 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1600 ctx
->ListExt
->Opcode
[i
].Size
=
1601 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1602 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1603 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1604 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1605 return i
+ OPCODE_EXT_0
;
1612 * Allocate space for a display list instruction. The space is basically
1613 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1614 * function parameter, node[2] is the second parameter, etc.
1616 * \param opcode one of OPCODE_x
1617 * \param nparams number of function parameters
1618 * \return pointer to start of instruction space
1620 static inline Node
*
1621 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1623 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1628 * Called by EndList to try to reduce memory used for the list.
1631 trim_list(struct gl_context
*ctx
)
1633 /* If the list we're ending only has one allocated block of nodes/tokens
1634 * and its size isn't a full block size, realloc the block to use less
1635 * memory. This is important for apps that create many small display
1636 * lists and apps that use glXUseXFont (many lists each containing one
1638 * Note: we currently only trim display lists that allocated one block
1639 * of tokens. That hits the short list case which is what we're mainly
1640 * concerned with. Trimming longer lists would involve traversing the
1641 * linked list of blocks.
1643 struct gl_dlist_state
*list
= &ctx
->ListState
;
1645 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1646 (list
->CurrentPos
< BLOCK_SIZE
)) {
1647 /* There's only one block and it's not full, so realloc */
1648 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1649 list
->CurrentList
->Head
=
1650 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1651 if (!list
->CurrentBlock
) {
1652 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1660 * Display List compilation functions
1662 static void GLAPIENTRY
1663 save_Accum(GLenum op
, GLfloat value
)
1665 GET_CURRENT_CONTEXT(ctx
);
1667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1668 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1673 if (ctx
->ExecuteFlag
) {
1674 CALL_Accum(ctx
->Exec
, (op
, value
));
1679 static void GLAPIENTRY
1680 save_AlphaFunc(GLenum func
, GLclampf ref
)
1682 GET_CURRENT_CONTEXT(ctx
);
1684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1685 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1688 n
[2].f
= (GLfloat
) ref
;
1690 if (ctx
->ExecuteFlag
) {
1691 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1696 static void GLAPIENTRY
1697 save_BindTexture(GLenum target
, GLuint texture
)
1699 GET_CURRENT_CONTEXT(ctx
);
1701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1702 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1707 if (ctx
->ExecuteFlag
) {
1708 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1713 static void GLAPIENTRY
1714 save_Bitmap(GLsizei width
, GLsizei height
,
1715 GLfloat xorig
, GLfloat yorig
,
1716 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1718 GET_CURRENT_CONTEXT(ctx
);
1720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1721 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1723 n
[1].i
= (GLint
) width
;
1724 n
[2].i
= (GLint
) height
;
1730 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1731 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1733 if (ctx
->ExecuteFlag
) {
1734 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1735 xorig
, yorig
, xmove
, ymove
, pixels
));
1740 static void GLAPIENTRY
1741 save_BlendEquation(GLenum mode
)
1743 GET_CURRENT_CONTEXT(ctx
);
1745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1746 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1750 if (ctx
->ExecuteFlag
) {
1751 CALL_BlendEquation(ctx
->Exec
, (mode
));
1756 static void GLAPIENTRY
1757 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1759 GET_CURRENT_CONTEXT(ctx
);
1761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1762 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1767 if (ctx
->ExecuteFlag
) {
1768 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1773 static void GLAPIENTRY
1774 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1775 GLenum sfactorA
, GLenum dfactorA
)
1777 GET_CURRENT_CONTEXT(ctx
);
1779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1780 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1782 n
[1].e
= sfactorRGB
;
1783 n
[2].e
= dfactorRGB
;
1787 if (ctx
->ExecuteFlag
) {
1788 CALL_BlendFuncSeparate(ctx
->Exec
,
1789 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1794 static void GLAPIENTRY
1795 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1797 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1801 static void GLAPIENTRY
1802 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1804 GET_CURRENT_CONTEXT(ctx
);
1806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1807 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1814 if (ctx
->ExecuteFlag
) {
1815 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1819 /* GL_ARB_draw_buffers_blend */
1820 static void GLAPIENTRY
1821 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1822 GLenum sfactorA
, GLenum dfactorA
)
1824 GET_CURRENT_CONTEXT(ctx
);
1826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1827 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1830 n
[2].e
= sfactorRGB
;
1831 n
[3].e
= dfactorRGB
;
1835 if (ctx
->ExecuteFlag
) {
1836 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1837 sfactorA
, dfactorA
));
1841 /* GL_ARB_draw_buffers_blend */
1842 static void GLAPIENTRY
1843 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1845 GET_CURRENT_CONTEXT(ctx
);
1847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1848 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1854 if (ctx
->ExecuteFlag
) {
1855 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1859 /* GL_ARB_draw_buffers_blend */
1860 static void GLAPIENTRY
1861 save_BlendEquationi(GLuint buf
, GLenum mode
)
1863 GET_CURRENT_CONTEXT(ctx
);
1865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1866 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1871 if (ctx
->ExecuteFlag
) {
1872 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1876 /* GL_ARB_draw_buffers_blend */
1877 static void GLAPIENTRY
1878 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1889 if (ctx
->ExecuteFlag
) {
1890 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1895 /* GL_ARB_draw_instanced. */
1896 static void GLAPIENTRY
1897 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1899 UNUSED GLsizei count
,
1900 UNUSED GLsizei primcount
)
1902 GET_CURRENT_CONTEXT(ctx
);
1903 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1904 "glDrawArraysInstanced() during display list compile");
1907 static void GLAPIENTRY
1908 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1909 UNUSED GLsizei count
,
1911 UNUSED
const GLvoid
*indices
,
1912 UNUSED GLsizei primcount
)
1914 GET_CURRENT_CONTEXT(ctx
);
1915 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1916 "glDrawElementsInstanced() during display list compile");
1919 static void GLAPIENTRY
1920 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1921 UNUSED GLsizei count
,
1923 UNUSED
const GLvoid
*indices
,
1924 UNUSED GLsizei primcount
,
1925 UNUSED GLint basevertex
)
1927 GET_CURRENT_CONTEXT(ctx
);
1928 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1929 "glDrawElementsInstancedBaseVertex() during display list compile");
1932 /* GL_ARB_base_instance. */
1933 static void GLAPIENTRY
1934 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1936 UNUSED GLsizei count
,
1937 UNUSED GLsizei primcount
,
1938 UNUSED GLuint baseinstance
)
1940 GET_CURRENT_CONTEXT(ctx
);
1941 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1942 "glDrawArraysInstancedBaseInstance() during display list compile");
1945 static void APIENTRY
1946 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1947 UNUSED GLsizei count
,
1949 UNUSED
const void *indices
,
1950 UNUSED GLsizei primcount
,
1951 UNUSED GLuint baseinstance
)
1953 GET_CURRENT_CONTEXT(ctx
);
1954 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1955 "glDrawElementsInstancedBaseInstance() during display list compile");
1958 static void APIENTRY
1959 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1960 UNUSED GLsizei count
,
1962 UNUSED
const void *indices
,
1963 UNUSED GLsizei primcount
,
1964 UNUSED GLint basevertex
,
1965 UNUSED GLuint baseinstance
)
1967 GET_CURRENT_CONTEXT(ctx
);
1968 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1969 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1972 static void APIENTRY
1973 save_DrawArraysIndirect(UNUSED GLenum mode
,
1974 UNUSED
const void *indirect
)
1976 GET_CURRENT_CONTEXT(ctx
);
1977 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1978 "glDrawArraysIndirect() during display list compile");
1981 static void APIENTRY
1982 save_DrawElementsIndirect(UNUSED GLenum mode
,
1984 UNUSED
const void *indirect
)
1986 GET_CURRENT_CONTEXT(ctx
);
1987 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1988 "glDrawElementsIndirect() during display list compile");
1991 static void APIENTRY
1992 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1993 UNUSED
const void *indirect
,
1994 UNUSED GLsizei primcount
,
1995 UNUSED GLsizei stride
)
1997 GET_CURRENT_CONTEXT(ctx
);
1998 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1999 "glMultiDrawArraysIndirect() during display list compile");
2002 static void APIENTRY
2003 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2005 UNUSED
const void *indirect
,
2006 UNUSED GLsizei primcount
,
2007 UNUSED GLsizei stride
)
2009 GET_CURRENT_CONTEXT(ctx
);
2010 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2011 "glMultiDrawElementsIndirect() during display list compile");
2015 * While building a display list we cache some OpenGL state.
2016 * Under some circumstances we need to invalidate that state (immediately
2017 * when we start compiling a list, or after glCallList(s)).
2020 invalidate_saved_current_state(struct gl_context
*ctx
)
2024 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2025 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2027 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2028 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2030 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2032 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2036 static void GLAPIENTRY
2037 save_CallList(GLuint list
)
2039 GET_CURRENT_CONTEXT(ctx
);
2041 SAVE_FLUSH_VERTICES(ctx
);
2043 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2048 /* After this, we don't know what state we're in. Invalidate all
2049 * cached information previously gathered:
2051 invalidate_saved_current_state( ctx
);
2053 if (ctx
->ExecuteFlag
) {
2054 _mesa_CallList(list
);
2059 static void GLAPIENTRY
2060 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2062 GET_CURRENT_CONTEXT(ctx
);
2067 SAVE_FLUSH_VERTICES(ctx
);
2071 case GL_UNSIGNED_BYTE
:
2075 case GL_UNSIGNED_SHORT
:
2083 case GL_UNSIGNED_INT
:
2092 if (num
> 0 && type_size
> 0) {
2093 /* create a copy of the array of list IDs to save in the display list */
2094 lists_copy
= memdup(lists
, num
* type_size
);
2099 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2103 save_pointer(&n
[3], lists_copy
);
2106 /* After this, we don't know what state we're in. Invalidate all
2107 * cached information previously gathered:
2109 invalidate_saved_current_state( ctx
);
2111 if (ctx
->ExecuteFlag
) {
2112 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2117 static void GLAPIENTRY
2118 save_Clear(GLbitfield mask
)
2120 GET_CURRENT_CONTEXT(ctx
);
2122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2123 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2127 if (ctx
->ExecuteFlag
) {
2128 CALL_Clear(ctx
->Exec
, (mask
));
2133 static void GLAPIENTRY
2134 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2136 GET_CURRENT_CONTEXT(ctx
);
2138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2139 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2142 n
[2].i
= drawbuffer
;
2144 if (buffer
== GL_COLOR
) {
2155 if (ctx
->ExecuteFlag
) {
2156 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2161 static void GLAPIENTRY
2162 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2164 GET_CURRENT_CONTEXT(ctx
);
2166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2167 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2170 n
[2].i
= drawbuffer
;
2172 if (buffer
== GL_COLOR
) {
2183 if (ctx
->ExecuteFlag
) {
2184 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2189 static void GLAPIENTRY
2190 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2192 GET_CURRENT_CONTEXT(ctx
);
2194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2195 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2198 n
[2].i
= drawbuffer
;
2200 if (buffer
== GL_COLOR
) {
2211 if (ctx
->ExecuteFlag
) {
2212 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2217 static void GLAPIENTRY
2218 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2219 GLfloat depth
, GLint stencil
)
2221 GET_CURRENT_CONTEXT(ctx
);
2223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2224 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2227 n
[2].i
= drawbuffer
;
2231 if (ctx
->ExecuteFlag
) {
2232 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2237 static void GLAPIENTRY
2238 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2240 GET_CURRENT_CONTEXT(ctx
);
2242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2243 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2250 if (ctx
->ExecuteFlag
) {
2251 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2256 static void GLAPIENTRY
2257 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2259 GET_CURRENT_CONTEXT(ctx
);
2261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2262 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2269 if (ctx
->ExecuteFlag
) {
2270 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2275 static void GLAPIENTRY
2276 save_ClearDepth(GLclampd depth
)
2278 GET_CURRENT_CONTEXT(ctx
);
2280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2281 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2283 n
[1].f
= (GLfloat
) depth
;
2285 if (ctx
->ExecuteFlag
) {
2286 CALL_ClearDepth(ctx
->Exec
, (depth
));
2291 static void GLAPIENTRY
2292 save_ClearIndex(GLfloat c
)
2294 GET_CURRENT_CONTEXT(ctx
);
2296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2297 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2301 if (ctx
->ExecuteFlag
) {
2302 CALL_ClearIndex(ctx
->Exec
, (c
));
2307 static void GLAPIENTRY
2308 save_ClearStencil(GLint s
)
2310 GET_CURRENT_CONTEXT(ctx
);
2312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2313 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2317 if (ctx
->ExecuteFlag
) {
2318 CALL_ClearStencil(ctx
->Exec
, (s
));
2323 static void GLAPIENTRY
2324 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2326 GET_CURRENT_CONTEXT(ctx
);
2328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2329 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2332 n
[2].f
= (GLfloat
) equ
[0];
2333 n
[3].f
= (GLfloat
) equ
[1];
2334 n
[4].f
= (GLfloat
) equ
[2];
2335 n
[5].f
= (GLfloat
) equ
[3];
2337 if (ctx
->ExecuteFlag
) {
2338 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2344 static void GLAPIENTRY
2345 save_ColorMask(GLboolean red
, GLboolean green
,
2346 GLboolean blue
, GLboolean alpha
)
2348 GET_CURRENT_CONTEXT(ctx
);
2350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2351 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2358 if (ctx
->ExecuteFlag
) {
2359 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2364 static void GLAPIENTRY
2365 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2366 GLboolean blue
, GLboolean alpha
)
2368 GET_CURRENT_CONTEXT(ctx
);
2370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2371 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2379 if (ctx
->ExecuteFlag
) {
2380 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2385 static void GLAPIENTRY
2386 save_ColorMaterial(GLenum face
, GLenum mode
)
2388 GET_CURRENT_CONTEXT(ctx
);
2390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2392 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2397 if (ctx
->ExecuteFlag
) {
2398 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2403 static void GLAPIENTRY
2404 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2406 GET_CURRENT_CONTEXT(ctx
);
2408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2409 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2413 n
[3].i
= (GLint
) width
;
2414 n
[4].i
= (GLint
) height
;
2417 if (ctx
->ExecuteFlag
) {
2418 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2424 static void GLAPIENTRY
2425 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2426 GLint x
, GLint y
, GLsizei width
, GLint border
)
2428 GET_CURRENT_CONTEXT(ctx
);
2430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2431 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2435 n
[3].e
= internalformat
;
2441 if (ctx
->ExecuteFlag
) {
2442 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2443 x
, y
, width
, border
));
2448 static void GLAPIENTRY
2449 save_CopyTexImage2D(GLenum target
, GLint level
,
2450 GLenum internalformat
,
2451 GLint x
, GLint y
, GLsizei width
,
2452 GLsizei height
, GLint border
)
2454 GET_CURRENT_CONTEXT(ctx
);
2456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2457 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2461 n
[3].e
= internalformat
;
2468 if (ctx
->ExecuteFlag
) {
2469 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2470 x
, y
, width
, height
, border
));
2476 static void GLAPIENTRY
2477 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2478 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2480 GET_CURRENT_CONTEXT(ctx
);
2482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2483 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2492 if (ctx
->ExecuteFlag
) {
2493 CALL_CopyTexSubImage1D(ctx
->Exec
,
2494 (target
, level
, xoffset
, x
, y
, width
));
2499 static void GLAPIENTRY
2500 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2501 GLint xoffset
, GLint yoffset
,
2502 GLint x
, GLint y
, GLsizei width
, GLint height
)
2504 GET_CURRENT_CONTEXT(ctx
);
2506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2507 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2518 if (ctx
->ExecuteFlag
) {
2519 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2520 x
, y
, width
, height
));
2525 static void GLAPIENTRY
2526 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2527 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2528 GLint x
, GLint y
, GLsizei width
, GLint height
)
2530 GET_CURRENT_CONTEXT(ctx
);
2532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2533 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2545 if (ctx
->ExecuteFlag
) {
2546 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2547 xoffset
, yoffset
, zoffset
,
2548 x
, y
, width
, height
));
2553 static void GLAPIENTRY
2554 save_CullFace(GLenum mode
)
2556 GET_CURRENT_CONTEXT(ctx
);
2558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2559 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2563 if (ctx
->ExecuteFlag
) {
2564 CALL_CullFace(ctx
->Exec
, (mode
));
2569 static void GLAPIENTRY
2570 save_DepthFunc(GLenum func
)
2572 GET_CURRENT_CONTEXT(ctx
);
2574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2575 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2579 if (ctx
->ExecuteFlag
) {
2580 CALL_DepthFunc(ctx
->Exec
, (func
));
2585 static void GLAPIENTRY
2586 save_DepthMask(GLboolean mask
)
2588 GET_CURRENT_CONTEXT(ctx
);
2590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2591 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2595 if (ctx
->ExecuteFlag
) {
2596 CALL_DepthMask(ctx
->Exec
, (mask
));
2601 static void GLAPIENTRY
2602 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2604 GET_CURRENT_CONTEXT(ctx
);
2606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2607 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2609 n
[1].f
= (GLfloat
) nearval
;
2610 n
[2].f
= (GLfloat
) farval
;
2612 if (ctx
->ExecuteFlag
) {
2613 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2618 static void GLAPIENTRY
2619 save_Disable(GLenum cap
)
2621 GET_CURRENT_CONTEXT(ctx
);
2623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2624 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2628 if (ctx
->ExecuteFlag
) {
2629 CALL_Disable(ctx
->Exec
, (cap
));
2634 static void GLAPIENTRY
2635 save_DisableIndexed(GLuint index
, GLenum cap
)
2637 GET_CURRENT_CONTEXT(ctx
);
2639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2640 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2645 if (ctx
->ExecuteFlag
) {
2646 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2651 static void GLAPIENTRY
2652 save_DrawBuffer(GLenum mode
)
2654 GET_CURRENT_CONTEXT(ctx
);
2656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2657 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2661 if (ctx
->ExecuteFlag
) {
2662 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2667 static void GLAPIENTRY
2668 save_DrawPixels(GLsizei width
, GLsizei height
,
2669 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2671 GET_CURRENT_CONTEXT(ctx
);
2674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2676 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2683 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2684 pixels
, &ctx
->Unpack
));
2686 if (ctx
->ExecuteFlag
) {
2687 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2693 static void GLAPIENTRY
2694 save_Enable(GLenum cap
)
2696 GET_CURRENT_CONTEXT(ctx
);
2698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2699 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2703 if (ctx
->ExecuteFlag
) {
2704 CALL_Enable(ctx
->Exec
, (cap
));
2710 static void GLAPIENTRY
2711 save_EnableIndexed(GLuint index
, GLenum cap
)
2713 GET_CURRENT_CONTEXT(ctx
);
2715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2716 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2721 if (ctx
->ExecuteFlag
) {
2722 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2728 static void GLAPIENTRY
2729 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2731 GET_CURRENT_CONTEXT(ctx
);
2733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2734 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2740 if (ctx
->ExecuteFlag
) {
2741 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2746 static void GLAPIENTRY
2747 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2749 GET_CURRENT_CONTEXT(ctx
);
2751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2752 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2760 if (ctx
->ExecuteFlag
) {
2761 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2768 static void GLAPIENTRY
2769 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2771 GET_CURRENT_CONTEXT(ctx
);
2773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2774 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2782 if (ctx
->ExecuteFlag
) {
2783 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2788 static void GLAPIENTRY
2789 save_Fogf(GLenum pname
, GLfloat param
)
2793 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2794 save_Fogfv(pname
, parray
);
2798 static void GLAPIENTRY
2799 save_Fogiv(GLenum pname
, const GLint
*params
)
2804 case GL_FOG_DENSITY
:
2808 case GL_FOG_COORDINATE_SOURCE
:
2809 p
[0] = (GLfloat
) *params
;
2815 p
[0] = INT_TO_FLOAT(params
[0]);
2816 p
[1] = INT_TO_FLOAT(params
[1]);
2817 p
[2] = INT_TO_FLOAT(params
[2]);
2818 p
[3] = INT_TO_FLOAT(params
[3]);
2821 /* Error will be caught later in gl_Fogfv */
2822 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2824 save_Fogfv(pname
, p
);
2828 static void GLAPIENTRY
2829 save_Fogi(GLenum pname
, GLint param
)
2833 parray
[1] = parray
[2] = parray
[3] = 0;
2834 save_Fogiv(pname
, parray
);
2838 static void GLAPIENTRY
2839 save_FrontFace(GLenum mode
)
2841 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2848 if (ctx
->ExecuteFlag
) {
2849 CALL_FrontFace(ctx
->Exec
, (mode
));
2854 static void GLAPIENTRY
2855 save_Frustum(GLdouble left
, GLdouble right
,
2856 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2858 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2863 n
[1].f
= (GLfloat
) left
;
2864 n
[2].f
= (GLfloat
) right
;
2865 n
[3].f
= (GLfloat
) bottom
;
2866 n
[4].f
= (GLfloat
) top
;
2867 n
[5].f
= (GLfloat
) nearval
;
2868 n
[6].f
= (GLfloat
) farval
;
2870 if (ctx
->ExecuteFlag
) {
2871 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2876 static void GLAPIENTRY
2877 save_Hint(GLenum target
, GLenum mode
)
2879 GET_CURRENT_CONTEXT(ctx
);
2881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2882 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2887 if (ctx
->ExecuteFlag
) {
2888 CALL_Hint(ctx
->Exec
, (target
, mode
));
2893 static void GLAPIENTRY
2894 save_IndexMask(GLuint mask
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2899 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2903 if (ctx
->ExecuteFlag
) {
2904 CALL_IndexMask(ctx
->Exec
, (mask
));
2909 static void GLAPIENTRY
2910 save_InitNames(void)
2912 GET_CURRENT_CONTEXT(ctx
);
2913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2914 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2915 if (ctx
->ExecuteFlag
) {
2916 CALL_InitNames(ctx
->Exec
, ());
2921 static void GLAPIENTRY
2922 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2924 GET_CURRENT_CONTEXT(ctx
);
2926 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2927 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2945 case GL_SPOT_DIRECTION
:
2948 case GL_SPOT_EXPONENT
:
2951 case GL_SPOT_CUTOFF
:
2954 case GL_CONSTANT_ATTENUATION
:
2957 case GL_LINEAR_ATTENUATION
:
2960 case GL_QUADRATIC_ATTENUATION
:
2966 for (i
= 0; i
< nParams
; i
++) {
2967 n
[3 + i
].f
= params
[i
];
2970 if (ctx
->ExecuteFlag
) {
2971 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2976 static void GLAPIENTRY
2977 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2981 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2982 save_Lightfv(light
, pname
, parray
);
2986 static void GLAPIENTRY
2987 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2994 fparam
[0] = INT_TO_FLOAT(params
[0]);
2995 fparam
[1] = INT_TO_FLOAT(params
[1]);
2996 fparam
[2] = INT_TO_FLOAT(params
[2]);
2997 fparam
[3] = INT_TO_FLOAT(params
[3]);
3000 fparam
[0] = (GLfloat
) params
[0];
3001 fparam
[1] = (GLfloat
) params
[1];
3002 fparam
[2] = (GLfloat
) params
[2];
3003 fparam
[3] = (GLfloat
) params
[3];
3005 case GL_SPOT_DIRECTION
:
3006 fparam
[0] = (GLfloat
) params
[0];
3007 fparam
[1] = (GLfloat
) params
[1];
3008 fparam
[2] = (GLfloat
) params
[2];
3010 case GL_SPOT_EXPONENT
:
3011 case GL_SPOT_CUTOFF
:
3012 case GL_CONSTANT_ATTENUATION
:
3013 case GL_LINEAR_ATTENUATION
:
3014 case GL_QUADRATIC_ATTENUATION
:
3015 fparam
[0] = (GLfloat
) params
[0];
3018 /* error will be caught later in gl_Lightfv */
3021 save_Lightfv(light
, pname
, fparam
);
3025 static void GLAPIENTRY
3026 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3030 parray
[1] = parray
[2] = parray
[3] = 0;
3031 save_Lightiv(light
, pname
, parray
);
3035 static void GLAPIENTRY
3036 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3038 GET_CURRENT_CONTEXT(ctx
);
3040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3041 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3049 if (ctx
->ExecuteFlag
) {
3050 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3055 static void GLAPIENTRY
3056 save_LightModelf(GLenum pname
, GLfloat param
)
3060 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3061 save_LightModelfv(pname
, parray
);
3065 static void GLAPIENTRY
3066 save_LightModeliv(GLenum pname
, const GLint
*params
)
3070 case GL_LIGHT_MODEL_AMBIENT
:
3071 fparam
[0] = INT_TO_FLOAT(params
[0]);
3072 fparam
[1] = INT_TO_FLOAT(params
[1]);
3073 fparam
[2] = INT_TO_FLOAT(params
[2]);
3074 fparam
[3] = INT_TO_FLOAT(params
[3]);
3076 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3077 case GL_LIGHT_MODEL_TWO_SIDE
:
3078 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3079 fparam
[0] = (GLfloat
) params
[0];
3085 /* Error will be caught later in gl_LightModelfv */
3086 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3088 save_LightModelfv(pname
, fparam
);
3092 static void GLAPIENTRY
3093 save_LightModeli(GLenum pname
, GLint param
)
3097 parray
[1] = parray
[2] = parray
[3] = 0;
3098 save_LightModeliv(pname
, parray
);
3102 static void GLAPIENTRY
3103 save_LineStipple(GLint factor
, GLushort pattern
)
3105 GET_CURRENT_CONTEXT(ctx
);
3107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3108 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3113 if (ctx
->ExecuteFlag
) {
3114 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3119 static void GLAPIENTRY
3120 save_LineWidth(GLfloat width
)
3122 GET_CURRENT_CONTEXT(ctx
);
3124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3125 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3129 if (ctx
->ExecuteFlag
) {
3130 CALL_LineWidth(ctx
->Exec
, (width
));
3135 static void GLAPIENTRY
3136 save_ListBase(GLuint base
)
3138 GET_CURRENT_CONTEXT(ctx
);
3140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3141 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3145 if (ctx
->ExecuteFlag
) {
3146 CALL_ListBase(ctx
->Exec
, (base
));
3151 static void GLAPIENTRY
3152 save_LoadIdentity(void)
3154 GET_CURRENT_CONTEXT(ctx
);
3155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3156 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3157 if (ctx
->ExecuteFlag
) {
3158 CALL_LoadIdentity(ctx
->Exec
, ());
3163 static void GLAPIENTRY
3164 save_LoadMatrixf(const GLfloat
* m
)
3166 GET_CURRENT_CONTEXT(ctx
);
3168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3169 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3172 for (i
= 0; i
< 16; i
++) {
3176 if (ctx
->ExecuteFlag
) {
3177 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3182 static void GLAPIENTRY
3183 save_LoadMatrixd(const GLdouble
* m
)
3187 for (i
= 0; i
< 16; i
++) {
3188 f
[i
] = (GLfloat
) m
[i
];
3190 save_LoadMatrixf(f
);
3194 static void GLAPIENTRY
3195 save_LoadName(GLuint name
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3204 if (ctx
->ExecuteFlag
) {
3205 CALL_LoadName(ctx
->Exec
, (name
));
3210 static void GLAPIENTRY
3211 save_LogicOp(GLenum opcode
)
3213 GET_CURRENT_CONTEXT(ctx
);
3215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3216 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3220 if (ctx
->ExecuteFlag
) {
3221 CALL_LogicOp(ctx
->Exec
, (opcode
));
3226 static void GLAPIENTRY
3227 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3228 GLint order
, const GLdouble
* points
)
3230 GET_CURRENT_CONTEXT(ctx
);
3232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3233 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3235 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3237 n
[2].f
= (GLfloat
) u1
;
3238 n
[3].f
= (GLfloat
) u2
;
3239 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3241 save_pointer(&n
[6], pnts
);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3248 static void GLAPIENTRY
3249 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3250 GLint order
, const GLfloat
* points
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3257 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3261 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3263 save_pointer(&n
[6], pnts
);
3265 if (ctx
->ExecuteFlag
) {
3266 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3271 static void GLAPIENTRY
3272 save_Map2d(GLenum target
,
3273 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3274 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3275 const GLdouble
* points
)
3277 GET_CURRENT_CONTEXT(ctx
);
3279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3280 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3282 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3283 vstride
, vorder
, points
);
3285 n
[2].f
= (GLfloat
) u1
;
3286 n
[3].f
= (GLfloat
) u2
;
3287 n
[4].f
= (GLfloat
) v1
;
3288 n
[5].f
= (GLfloat
) v2
;
3289 /* XXX verify these strides are correct */
3290 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3291 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3294 save_pointer(&n
[10], pnts
);
3296 if (ctx
->ExecuteFlag
) {
3297 CALL_Map2d(ctx
->Exec
, (target
,
3298 u1
, u2
, ustride
, uorder
,
3299 v1
, v2
, vstride
, vorder
, points
));
3304 static void GLAPIENTRY
3305 save_Map2f(GLenum target
,
3306 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3307 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3308 const GLfloat
* points
)
3310 GET_CURRENT_CONTEXT(ctx
);
3312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3313 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3315 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3316 vstride
, vorder
, points
);
3322 /* XXX verify these strides are correct */
3323 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3324 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3327 save_pointer(&n
[10], pnts
);
3329 if (ctx
->ExecuteFlag
) {
3330 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3331 v1
, v2
, vstride
, vorder
, points
));
3336 static void GLAPIENTRY
3337 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3339 GET_CURRENT_CONTEXT(ctx
);
3341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3342 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3348 if (ctx
->ExecuteFlag
) {
3349 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3354 static void GLAPIENTRY
3355 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3357 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3361 static void GLAPIENTRY
3362 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3363 GLint vn
, GLfloat v1
, GLfloat v2
)
3365 GET_CURRENT_CONTEXT(ctx
);
3367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3368 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3377 if (ctx
->ExecuteFlag
) {
3378 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3384 static void GLAPIENTRY
3385 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3386 GLint vn
, GLdouble v1
, GLdouble v2
)
3388 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3389 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3393 static void GLAPIENTRY
3394 save_MatrixMode(GLenum mode
)
3396 GET_CURRENT_CONTEXT(ctx
);
3398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3399 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3403 if (ctx
->ExecuteFlag
) {
3404 CALL_MatrixMode(ctx
->Exec
, (mode
));
3409 static void GLAPIENTRY
3410 save_MultMatrixf(const GLfloat
* m
)
3412 GET_CURRENT_CONTEXT(ctx
);
3414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3415 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3418 for (i
= 0; i
< 16; i
++) {
3422 if (ctx
->ExecuteFlag
) {
3423 CALL_MultMatrixf(ctx
->Exec
, (m
));
3428 static void GLAPIENTRY
3429 save_MultMatrixd(const GLdouble
* m
)
3433 for (i
= 0; i
< 16; i
++) {
3434 f
[i
] = (GLfloat
) m
[i
];
3436 save_MultMatrixf(f
);
3440 static void GLAPIENTRY
3441 save_NewList(GLuint name
, GLenum mode
)
3443 GET_CURRENT_CONTEXT(ctx
);
3444 /* It's an error to call this function while building a display list */
3445 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3452 static void GLAPIENTRY
3453 save_Ortho(GLdouble left
, GLdouble right
,
3454 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3456 GET_CURRENT_CONTEXT(ctx
);
3458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3459 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3461 n
[1].f
= (GLfloat
) left
;
3462 n
[2].f
= (GLfloat
) right
;
3463 n
[3].f
= (GLfloat
) bottom
;
3464 n
[4].f
= (GLfloat
) top
;
3465 n
[5].f
= (GLfloat
) nearval
;
3466 n
[6].f
= (GLfloat
) farval
;
3468 if (ctx
->ExecuteFlag
) {
3469 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3474 static void GLAPIENTRY
3475 save_PatchParameteri(GLenum pname
, const GLint value
)
3477 GET_CURRENT_CONTEXT(ctx
);
3479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3480 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3485 if (ctx
->ExecuteFlag
) {
3486 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3491 static void GLAPIENTRY
3492 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3494 GET_CURRENT_CONTEXT(ctx
);
3496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3498 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3499 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3501 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3502 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3506 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3516 if (ctx
->ExecuteFlag
) {
3517 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3522 static void GLAPIENTRY
3523 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3525 GET_CURRENT_CONTEXT(ctx
);
3527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3528 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3532 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3534 if (ctx
->ExecuteFlag
) {
3535 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3540 static void GLAPIENTRY
3541 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3543 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3545 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3546 for (i
= 0; i
< mapsize
; i
++) {
3547 fvalues
[i
] = (GLfloat
) values
[i
];
3551 for (i
= 0; i
< mapsize
; i
++) {
3552 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3555 save_PixelMapfv(map
, mapsize
, fvalues
);
3559 static void GLAPIENTRY
3560 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3562 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3564 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3565 for (i
= 0; i
< mapsize
; i
++) {
3566 fvalues
[i
] = (GLfloat
) values
[i
];
3570 for (i
= 0; i
< mapsize
; i
++) {
3571 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3574 save_PixelMapfv(map
, mapsize
, fvalues
);
3578 static void GLAPIENTRY
3579 save_PixelTransferf(GLenum pname
, GLfloat param
)
3581 GET_CURRENT_CONTEXT(ctx
);
3583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3584 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3589 if (ctx
->ExecuteFlag
) {
3590 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3595 static void GLAPIENTRY
3596 save_PixelTransferi(GLenum pname
, GLint param
)
3598 save_PixelTransferf(pname
, (GLfloat
) param
);
3602 static void GLAPIENTRY
3603 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3605 GET_CURRENT_CONTEXT(ctx
);
3607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3608 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3613 if (ctx
->ExecuteFlag
) {
3614 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3619 static void GLAPIENTRY
3620 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3622 GET_CURRENT_CONTEXT(ctx
);
3624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3625 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3632 if (ctx
->ExecuteFlag
) {
3633 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3638 static void GLAPIENTRY
3639 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3643 parray
[1] = parray
[2] = 0.0F
;
3644 save_PointParameterfvEXT(pname
, parray
);
3647 static void GLAPIENTRY
3648 save_PointParameteriNV(GLenum pname
, GLint param
)
3651 parray
[0] = (GLfloat
) param
;
3652 parray
[1] = parray
[2] = 0.0F
;
3653 save_PointParameterfvEXT(pname
, parray
);
3656 static void GLAPIENTRY
3657 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3660 parray
[0] = (GLfloat
) param
[0];
3661 parray
[1] = parray
[2] = 0.0F
;
3662 save_PointParameterfvEXT(pname
, parray
);
3666 static void GLAPIENTRY
3667 save_PointSize(GLfloat size
)
3669 GET_CURRENT_CONTEXT(ctx
);
3671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3672 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3676 if (ctx
->ExecuteFlag
) {
3677 CALL_PointSize(ctx
->Exec
, (size
));
3682 static void GLAPIENTRY
3683 save_PolygonMode(GLenum face
, GLenum mode
)
3685 GET_CURRENT_CONTEXT(ctx
);
3687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3688 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3693 if (ctx
->ExecuteFlag
) {
3694 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3699 static void GLAPIENTRY
3700 save_PolygonStipple(const GLubyte
* pattern
)
3702 GET_CURRENT_CONTEXT(ctx
);
3705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3707 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3710 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3711 pattern
, &ctx
->Unpack
));
3713 if (ctx
->ExecuteFlag
) {
3714 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3719 static void GLAPIENTRY
3720 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3722 GET_CURRENT_CONTEXT(ctx
);
3724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3725 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3730 if (ctx
->ExecuteFlag
) {
3731 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3736 static void GLAPIENTRY
3737 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3739 GET_CURRENT_CONTEXT(ctx
);
3741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3742 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3748 if (ctx
->ExecuteFlag
) {
3749 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3753 static void GLAPIENTRY
3754 save_PopAttrib(void)
3756 GET_CURRENT_CONTEXT(ctx
);
3757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3758 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3759 if (ctx
->ExecuteFlag
) {
3760 CALL_PopAttrib(ctx
->Exec
, ());
3765 static void GLAPIENTRY
3766 save_PopMatrix(void)
3768 GET_CURRENT_CONTEXT(ctx
);
3769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3770 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3771 if (ctx
->ExecuteFlag
) {
3772 CALL_PopMatrix(ctx
->Exec
, ());
3777 static void GLAPIENTRY
3780 GET_CURRENT_CONTEXT(ctx
);
3781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3782 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3783 if (ctx
->ExecuteFlag
) {
3784 CALL_PopName(ctx
->Exec
, ());
3789 static void GLAPIENTRY
3790 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3791 const GLclampf
* priorities
)
3793 GET_CURRENT_CONTEXT(ctx
);
3795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3797 for (i
= 0; i
< num
; i
++) {
3799 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3801 n
[1].ui
= textures
[i
];
3802 n
[2].f
= priorities
[i
];
3805 if (ctx
->ExecuteFlag
) {
3806 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3811 static void GLAPIENTRY
3812 save_PushAttrib(GLbitfield mask
)
3814 GET_CURRENT_CONTEXT(ctx
);
3816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3817 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3821 if (ctx
->ExecuteFlag
) {
3822 CALL_PushAttrib(ctx
->Exec
, (mask
));
3827 static void GLAPIENTRY
3828 save_PushMatrix(void)
3830 GET_CURRENT_CONTEXT(ctx
);
3831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3832 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3833 if (ctx
->ExecuteFlag
) {
3834 CALL_PushMatrix(ctx
->Exec
, ());
3839 static void GLAPIENTRY
3840 save_PushName(GLuint name
)
3842 GET_CURRENT_CONTEXT(ctx
);
3844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3845 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3849 if (ctx
->ExecuteFlag
) {
3850 CALL_PushName(ctx
->Exec
, (name
));
3855 static void GLAPIENTRY
3856 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3858 GET_CURRENT_CONTEXT(ctx
);
3860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3861 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3868 if (ctx
->ExecuteFlag
) {
3869 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3873 static void GLAPIENTRY
3874 save_RasterPos2d(GLdouble x
, GLdouble y
)
3876 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3879 static void GLAPIENTRY
3880 save_RasterPos2f(GLfloat x
, GLfloat y
)
3882 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3885 static void GLAPIENTRY
3886 save_RasterPos2i(GLint x
, GLint y
)
3888 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3891 static void GLAPIENTRY
3892 save_RasterPos2s(GLshort x
, GLshort y
)
3894 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3897 static void GLAPIENTRY
3898 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3900 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3903 static void GLAPIENTRY
3904 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3906 save_RasterPos4f(x
, y
, z
, 1.0F
);
3909 static void GLAPIENTRY
3910 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3912 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3915 static void GLAPIENTRY
3916 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3918 save_RasterPos4f(x
, y
, z
, 1.0F
);
3921 static void GLAPIENTRY
3922 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3924 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3927 static void GLAPIENTRY
3928 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3930 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3933 static void GLAPIENTRY
3934 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3936 save_RasterPos4f(x
, y
, z
, w
);
3939 static void GLAPIENTRY
3940 save_RasterPos2dv(const GLdouble
* v
)
3942 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3945 static void GLAPIENTRY
3946 save_RasterPos2fv(const GLfloat
* v
)
3948 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3951 static void GLAPIENTRY
3952 save_RasterPos2iv(const GLint
* v
)
3954 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3957 static void GLAPIENTRY
3958 save_RasterPos2sv(const GLshort
* v
)
3960 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3963 static void GLAPIENTRY
3964 save_RasterPos3dv(const GLdouble
* v
)
3966 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3969 static void GLAPIENTRY
3970 save_RasterPos3fv(const GLfloat
* v
)
3972 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3975 static void GLAPIENTRY
3976 save_RasterPos3iv(const GLint
* v
)
3978 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3981 static void GLAPIENTRY
3982 save_RasterPos3sv(const GLshort
* v
)
3984 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3987 static void GLAPIENTRY
3988 save_RasterPos4dv(const GLdouble
* v
)
3990 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3991 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3994 static void GLAPIENTRY
3995 save_RasterPos4fv(const GLfloat
* v
)
3997 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4000 static void GLAPIENTRY
4001 save_RasterPos4iv(const GLint
* v
)
4003 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4004 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4007 static void GLAPIENTRY
4008 save_RasterPos4sv(const GLshort
* v
)
4010 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4014 static void GLAPIENTRY
4015 save_PassThrough(GLfloat token
)
4017 GET_CURRENT_CONTEXT(ctx
);
4019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4020 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4024 if (ctx
->ExecuteFlag
) {
4025 CALL_PassThrough(ctx
->Exec
, (token
));
4030 static void GLAPIENTRY
4031 save_ReadBuffer(GLenum mode
)
4033 GET_CURRENT_CONTEXT(ctx
);
4035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4036 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4040 if (ctx
->ExecuteFlag
) {
4041 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4046 static void GLAPIENTRY
4047 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4049 GET_CURRENT_CONTEXT(ctx
);
4051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4052 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4059 if (ctx
->ExecuteFlag
) {
4060 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4065 static void GLAPIENTRY
4066 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4068 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4072 static void GLAPIENTRY
4073 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4075 GET_CURRENT_CONTEXT(ctx
);
4077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4078 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4084 if (ctx
->ExecuteFlag
) {
4085 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4090 static void GLAPIENTRY
4091 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4093 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4097 static void GLAPIENTRY
4098 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4100 GET_CURRENT_CONTEXT(ctx
);
4102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4103 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4110 if (ctx
->ExecuteFlag
) {
4111 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4116 static void GLAPIENTRY
4117 save_ShadeModel(GLenum mode
)
4119 GET_CURRENT_CONTEXT(ctx
);
4121 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4123 if (ctx
->ExecuteFlag
) {
4124 CALL_ShadeModel(ctx
->Exec
, (mode
));
4127 /* Don't compile this call if it's a no-op.
4128 * By avoiding this state change we have a better chance of
4129 * coalescing subsequent drawing commands into one batch.
4131 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4134 SAVE_FLUSH_VERTICES(ctx
);
4136 ctx
->ListState
.Current
.ShadeModel
= mode
;
4138 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4145 static void GLAPIENTRY
4146 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4148 GET_CURRENT_CONTEXT(ctx
);
4150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4151 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4157 if (ctx
->ExecuteFlag
) {
4158 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4163 static void GLAPIENTRY
4164 save_StencilMask(GLuint mask
)
4166 GET_CURRENT_CONTEXT(ctx
);
4168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4169 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4173 if (ctx
->ExecuteFlag
) {
4174 CALL_StencilMask(ctx
->Exec
, (mask
));
4179 static void GLAPIENTRY
4180 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4182 GET_CURRENT_CONTEXT(ctx
);
4184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4185 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4191 if (ctx
->ExecuteFlag
) {
4192 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4197 static void GLAPIENTRY
4198 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4200 GET_CURRENT_CONTEXT(ctx
);
4202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4203 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4210 if (ctx
->ExecuteFlag
) {
4211 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4216 static void GLAPIENTRY
4217 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4220 GET_CURRENT_CONTEXT(ctx
);
4222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4224 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4232 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4239 if (ctx
->ExecuteFlag
) {
4240 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4241 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4246 static void GLAPIENTRY
4247 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4249 GET_CURRENT_CONTEXT(ctx
);
4251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4252 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4257 if (ctx
->ExecuteFlag
) {
4258 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4263 static void GLAPIENTRY
4264 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4266 GET_CURRENT_CONTEXT(ctx
);
4268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4269 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4276 if (ctx
->ExecuteFlag
) {
4277 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4282 static void GLAPIENTRY
4283 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4285 GET_CURRENT_CONTEXT(ctx
);
4287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4288 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4292 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4300 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4303 if (ctx
->ExecuteFlag
) {
4304 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4309 static void GLAPIENTRY
4310 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4313 parray
[0] = (GLfloat
) param
;
4314 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4315 save_TexEnvfv(target
, pname
, parray
);
4319 static void GLAPIENTRY
4320 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4323 p
[0] = (GLfloat
) param
;
4324 p
[1] = p
[2] = p
[3] = 0.0F
;
4325 save_TexEnvfv(target
, pname
, p
);
4329 static void GLAPIENTRY
4330 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4333 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4334 p
[0] = INT_TO_FLOAT(param
[0]);
4335 p
[1] = INT_TO_FLOAT(param
[1]);
4336 p
[2] = INT_TO_FLOAT(param
[2]);
4337 p
[3] = INT_TO_FLOAT(param
[3]);
4340 p
[0] = (GLfloat
) param
[0];
4341 p
[1] = p
[2] = p
[3] = 0.0F
;
4343 save_TexEnvfv(target
, pname
, p
);
4347 static void GLAPIENTRY
4348 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4350 GET_CURRENT_CONTEXT(ctx
);
4352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4353 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4362 if (ctx
->ExecuteFlag
) {
4363 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4368 static void GLAPIENTRY
4369 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4372 p
[0] = (GLfloat
) params
[0];
4373 p
[1] = (GLfloat
) params
[1];
4374 p
[2] = (GLfloat
) params
[2];
4375 p
[3] = (GLfloat
) params
[3];
4376 save_TexGenfv(coord
, pname
, p
);
4380 static void GLAPIENTRY
4381 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4384 parray
[0] = (GLfloat
) param
;
4385 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4386 save_TexGenfv(coord
, pname
, parray
);
4390 static void GLAPIENTRY
4391 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4394 p
[0] = (GLfloat
) params
[0];
4395 p
[1] = (GLfloat
) params
[1];
4396 p
[2] = (GLfloat
) params
[2];
4397 p
[3] = (GLfloat
) params
[3];
4398 save_TexGenfv(coord
, pname
, p
);
4402 static void GLAPIENTRY
4403 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4407 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4408 save_TexGenfv(coord
, pname
, parray
);
4412 static void GLAPIENTRY
4413 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4417 parray
[1] = parray
[2] = parray
[3] = 0;
4418 save_TexGeniv(coord
, pname
, parray
);
4422 static void GLAPIENTRY
4423 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4425 GET_CURRENT_CONTEXT(ctx
);
4427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4428 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4437 if (ctx
->ExecuteFlag
) {
4438 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4443 static void GLAPIENTRY
4444 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4448 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4449 save_TexParameterfv(target
, pname
, parray
);
4453 static void GLAPIENTRY
4454 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4457 fparam
[0] = (GLfloat
) param
;
4458 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4459 save_TexParameterfv(target
, pname
, fparam
);
4463 static void GLAPIENTRY
4464 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4467 fparam
[0] = (GLfloat
) params
[0];
4468 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4469 save_TexParameterfv(target
, pname
, fparam
);
4473 static void GLAPIENTRY
4474 save_TexImage1D(GLenum target
,
4475 GLint level
, GLint components
,
4476 GLsizei width
, GLint border
,
4477 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4479 GET_CURRENT_CONTEXT(ctx
);
4480 if (target
== GL_PROXY_TEXTURE_1D
) {
4481 /* don't compile, execute immediately */
4482 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4483 border
, format
, type
, pixels
));
4487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4488 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4492 n
[3].i
= components
;
4493 n
[4].i
= (GLint
) width
;
4498 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4499 pixels
, &ctx
->Unpack
));
4501 if (ctx
->ExecuteFlag
) {
4502 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4503 border
, format
, type
, pixels
));
4509 static void GLAPIENTRY
4510 save_TexImage2D(GLenum target
,
4511 GLint level
, GLint components
,
4512 GLsizei width
, GLsizei height
, GLint border
,
4513 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4515 GET_CURRENT_CONTEXT(ctx
);
4516 if (target
== GL_PROXY_TEXTURE_2D
) {
4517 /* don't compile, execute immediately */
4518 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4519 height
, border
, format
, type
, pixels
));
4523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4524 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4528 n
[3].i
= components
;
4529 n
[4].i
= (GLint
) width
;
4530 n
[5].i
= (GLint
) height
;
4535 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4536 pixels
, &ctx
->Unpack
));
4538 if (ctx
->ExecuteFlag
) {
4539 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4540 height
, border
, format
, type
, pixels
));
4546 static void GLAPIENTRY
4547 save_TexImage3D(GLenum target
,
4548 GLint level
, GLint internalFormat
,
4549 GLsizei width
, GLsizei height
, GLsizei depth
,
4551 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4553 GET_CURRENT_CONTEXT(ctx
);
4554 if (target
== GL_PROXY_TEXTURE_3D
) {
4555 /* don't compile, execute immediately */
4556 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4557 height
, depth
, border
, format
, type
,
4562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4563 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4567 n
[3].i
= (GLint
) internalFormat
;
4568 n
[4].i
= (GLint
) width
;
4569 n
[5].i
= (GLint
) height
;
4570 n
[6].i
= (GLint
) depth
;
4574 save_pointer(&n
[10],
4575 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4576 pixels
, &ctx
->Unpack
));
4578 if (ctx
->ExecuteFlag
) {
4579 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4580 height
, depth
, border
, format
, type
,
4587 static void GLAPIENTRY
4588 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4589 GLsizei width
, GLenum format
, GLenum type
,
4590 const GLvoid
* pixels
)
4592 GET_CURRENT_CONTEXT(ctx
);
4595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4597 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4602 n
[4].i
= (GLint
) width
;
4606 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4607 pixels
, &ctx
->Unpack
));
4609 if (ctx
->ExecuteFlag
) {
4610 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4611 format
, type
, pixels
));
4616 static void GLAPIENTRY
4617 save_TexSubImage2D(GLenum target
, GLint level
,
4618 GLint xoffset
, GLint yoffset
,
4619 GLsizei width
, GLsizei height
,
4620 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4622 GET_CURRENT_CONTEXT(ctx
);
4625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4627 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4633 n
[5].i
= (GLint
) width
;
4634 n
[6].i
= (GLint
) height
;
4638 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4639 pixels
, &ctx
->Unpack
));
4641 if (ctx
->ExecuteFlag
) {
4642 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4643 width
, height
, format
, type
, pixels
));
4648 static void GLAPIENTRY
4649 save_TexSubImage3D(GLenum target
, GLint level
,
4650 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4651 GLsizei width
, GLsizei height
, GLsizei depth
,
4652 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4654 GET_CURRENT_CONTEXT(ctx
);
4657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4659 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4666 n
[6].i
= (GLint
) width
;
4667 n
[7].i
= (GLint
) height
;
4668 n
[8].i
= (GLint
) depth
;
4671 save_pointer(&n
[11],
4672 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4673 pixels
, &ctx
->Unpack
));
4675 if (ctx
->ExecuteFlag
) {
4676 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4677 xoffset
, yoffset
, zoffset
,
4678 width
, height
, depth
, format
, type
,
4684 static void GLAPIENTRY
4685 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4687 GET_CURRENT_CONTEXT(ctx
);
4689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4690 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4696 if (ctx
->ExecuteFlag
) {
4697 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4702 static void GLAPIENTRY
4703 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4705 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4710 static void GLAPIENTRY
4711 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4713 GET_CURRENT_CONTEXT(ctx
);
4715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4716 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4720 n
[3].i
= (GLint
) width
;
4721 n
[4].i
= (GLint
) height
;
4723 if (ctx
->ExecuteFlag
) {
4724 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4728 static void GLAPIENTRY
4729 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4732 GET_CURRENT_CONTEXT(ctx
);
4734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4735 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4743 if (ctx
->ExecuteFlag
) {
4744 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4748 static void GLAPIENTRY
4749 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4751 GET_CURRENT_CONTEXT(ctx
);
4753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4754 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4762 if (ctx
->ExecuteFlag
) {
4763 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4767 static void GLAPIENTRY
4768 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4770 GET_CURRENT_CONTEXT(ctx
);
4772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4773 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4777 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4779 if (ctx
->ExecuteFlag
) {
4780 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4784 static void GLAPIENTRY
4785 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4788 GET_CURRENT_CONTEXT(ctx
);
4790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4791 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4799 if (ctx
->ExecuteFlag
) {
4800 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4804 static void GLAPIENTRY
4805 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4807 GET_CURRENT_CONTEXT(ctx
);
4809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4810 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4818 if (ctx
->ExecuteFlag
) {
4819 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4823 static void GLAPIENTRY
4824 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4826 GET_CURRENT_CONTEXT(ctx
);
4828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4829 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4833 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4835 if (ctx
->ExecuteFlag
) {
4836 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4840 static void GLAPIENTRY
4841 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4843 GET_CURRENT_CONTEXT(ctx
);
4845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4846 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4849 /* Mesa stores these as floats internally so we deliberately convert
4850 * them to a float here.
4855 if (ctx
->ExecuteFlag
) {
4856 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4860 static void GLAPIENTRY
4861 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4863 GET_CURRENT_CONTEXT(ctx
);
4865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4866 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4870 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4872 if (ctx
->ExecuteFlag
) {
4873 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4877 static void GLAPIENTRY
4878 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4880 GET_CURRENT_CONTEXT(ctx
);
4882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4883 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4890 if (ctx
->ExecuteFlag
) {
4891 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4895 static void GLAPIENTRY
4896 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4898 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4901 static void GLAPIENTRY
4902 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4904 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4907 static void GLAPIENTRY
4908 save_WindowPos2iMESA(GLint x
, GLint y
)
4910 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4913 static void GLAPIENTRY
4914 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4916 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4919 static void GLAPIENTRY
4920 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4922 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4925 static void GLAPIENTRY
4926 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4928 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4931 static void GLAPIENTRY
4932 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4934 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4937 static void GLAPIENTRY
4938 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4940 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4943 static void GLAPIENTRY
4944 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4946 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4949 static void GLAPIENTRY
4950 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4952 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4955 static void GLAPIENTRY
4956 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4958 save_WindowPos4fMESA(x
, y
, z
, w
);
4961 static void GLAPIENTRY
4962 save_WindowPos2dvMESA(const GLdouble
* v
)
4964 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4967 static void GLAPIENTRY
4968 save_WindowPos2fvMESA(const GLfloat
* v
)
4970 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4973 static void GLAPIENTRY
4974 save_WindowPos2ivMESA(const GLint
* v
)
4976 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4979 static void GLAPIENTRY
4980 save_WindowPos2svMESA(const GLshort
* v
)
4982 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4985 static void GLAPIENTRY
4986 save_WindowPos3dvMESA(const GLdouble
* v
)
4988 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4991 static void GLAPIENTRY
4992 save_WindowPos3fvMESA(const GLfloat
* v
)
4994 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4997 static void GLAPIENTRY
4998 save_WindowPos3ivMESA(const GLint
* v
)
5000 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5003 static void GLAPIENTRY
5004 save_WindowPos3svMESA(const GLshort
* v
)
5006 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5009 static void GLAPIENTRY
5010 save_WindowPos4dvMESA(const GLdouble
* v
)
5012 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5013 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5016 static void GLAPIENTRY
5017 save_WindowPos4fvMESA(const GLfloat
* v
)
5019 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5022 static void GLAPIENTRY
5023 save_WindowPos4ivMESA(const GLint
* v
)
5025 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5026 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5029 static void GLAPIENTRY
5030 save_WindowPos4svMESA(const GLshort
* v
)
5032 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5037 /* GL_ARB_multitexture */
5038 static void GLAPIENTRY
5039 save_ActiveTextureARB(GLenum target
)
5041 GET_CURRENT_CONTEXT(ctx
);
5043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5044 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5048 if (ctx
->ExecuteFlag
) {
5049 CALL_ActiveTexture(ctx
->Exec
, (target
));
5054 /* GL_ARB_transpose_matrix */
5056 static void GLAPIENTRY
5057 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5060 _math_transposefd(tm
, m
);
5061 save_LoadMatrixf(tm
);
5065 static void GLAPIENTRY
5066 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5069 _math_transposef(tm
, m
);
5070 save_LoadMatrixf(tm
);
5074 static void GLAPIENTRY
5075 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5078 _math_transposefd(tm
, m
);
5079 save_MultMatrixf(tm
);
5083 static void GLAPIENTRY
5084 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5087 _math_transposef(tm
, m
);
5088 save_MultMatrixf(tm
);
5091 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5093 GET_CURRENT_CONTEXT(ctx
);
5099 image
= malloc(size
);
5101 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5104 memcpy(image
, data
, size
);
5110 /* GL_ARB_texture_compression */
5111 static void GLAPIENTRY
5112 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5113 GLenum internalFormat
, GLsizei width
,
5114 GLint border
, GLsizei imageSize
,
5115 const GLvoid
* data
)
5117 GET_CURRENT_CONTEXT(ctx
);
5118 if (target
== GL_PROXY_TEXTURE_1D
) {
5119 /* don't compile, execute immediately */
5120 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5121 width
, border
, imageSize
,
5126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5128 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5129 6 + POINTER_DWORDS
);
5133 n
[3].e
= internalFormat
;
5134 n
[4].i
= (GLint
) width
;
5138 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5140 if (ctx
->ExecuteFlag
) {
5141 CALL_CompressedTexImage1D(ctx
->Exec
,
5142 (target
, level
, internalFormat
, width
,
5143 border
, imageSize
, data
));
5149 static void GLAPIENTRY
5150 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5151 GLenum internalFormat
, GLsizei width
,
5152 GLsizei height
, GLint border
, GLsizei imageSize
,
5153 const GLvoid
* data
)
5155 GET_CURRENT_CONTEXT(ctx
);
5156 if (target
== GL_PROXY_TEXTURE_2D
) {
5157 /* don't compile, execute immediately */
5158 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5159 width
, height
, border
,
5164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5166 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5167 7 + POINTER_DWORDS
);
5171 n
[3].e
= internalFormat
;
5172 n
[4].i
= (GLint
) width
;
5173 n
[5].i
= (GLint
) height
;
5177 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5179 if (ctx
->ExecuteFlag
) {
5180 CALL_CompressedTexImage2D(ctx
->Exec
,
5181 (target
, level
, internalFormat
, width
,
5182 height
, border
, imageSize
, data
));
5188 static void GLAPIENTRY
5189 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5190 GLenum internalFormat
, GLsizei width
,
5191 GLsizei height
, GLsizei depth
, GLint border
,
5192 GLsizei imageSize
, const GLvoid
* data
)
5194 GET_CURRENT_CONTEXT(ctx
);
5195 if (target
== GL_PROXY_TEXTURE_3D
) {
5196 /* don't compile, execute immediately */
5197 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5198 width
, height
, depth
, border
,
5203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5205 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5206 8 + POINTER_DWORDS
);
5210 n
[3].e
= internalFormat
;
5211 n
[4].i
= (GLint
) width
;
5212 n
[5].i
= (GLint
) height
;
5213 n
[6].i
= (GLint
) depth
;
5217 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5219 if (ctx
->ExecuteFlag
) {
5220 CALL_CompressedTexImage3D(ctx
->Exec
,
5221 (target
, level
, internalFormat
, width
,
5222 height
, depth
, border
, imageSize
,
5229 static void GLAPIENTRY
5230 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5231 GLsizei width
, GLenum format
,
5232 GLsizei imageSize
, const GLvoid
* data
)
5235 GET_CURRENT_CONTEXT(ctx
);
5236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5238 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5239 6 + POINTER_DWORDS
);
5244 n
[4].i
= (GLint
) width
;
5248 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5250 if (ctx
->ExecuteFlag
) {
5251 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5252 width
, format
, imageSize
,
5258 static void GLAPIENTRY
5259 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5260 GLint yoffset
, GLsizei width
, GLsizei height
,
5261 GLenum format
, GLsizei imageSize
,
5262 const GLvoid
* data
)
5265 GET_CURRENT_CONTEXT(ctx
);
5266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5268 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5269 8 + POINTER_DWORDS
);
5275 n
[5].i
= (GLint
) width
;
5276 n
[6].i
= (GLint
) height
;
5280 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5282 if (ctx
->ExecuteFlag
) {
5283 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5284 (target
, level
, xoffset
, yoffset
, width
,
5285 height
, format
, imageSize
, data
));
5290 static void GLAPIENTRY
5291 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5292 GLint yoffset
, GLint zoffset
, GLsizei width
,
5293 GLsizei height
, GLsizei depth
, GLenum format
,
5294 GLsizei imageSize
, const GLvoid
* data
)
5297 GET_CURRENT_CONTEXT(ctx
);
5298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5300 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5301 10 + POINTER_DWORDS
);
5308 n
[6].i
= (GLint
) width
;
5309 n
[7].i
= (GLint
) height
;
5310 n
[8].i
= (GLint
) depth
;
5312 n
[10].i
= imageSize
;
5313 save_pointer(&n
[11],
5314 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5316 if (ctx
->ExecuteFlag
) {
5317 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5318 (target
, level
, xoffset
, yoffset
,
5319 zoffset
, width
, height
, depth
, format
,
5325 /* GL_ARB_multisample */
5326 static void GLAPIENTRY
5327 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5329 GET_CURRENT_CONTEXT(ctx
);
5331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5332 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5337 if (ctx
->ExecuteFlag
) {
5338 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5344 * GL_ARB_vertex_program
5346 static void GLAPIENTRY
5347 save_BindProgramARB(GLenum target
, GLuint id
)
5349 GET_CURRENT_CONTEXT(ctx
);
5351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5352 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5357 if (ctx
->ExecuteFlag
) {
5358 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5362 static void GLAPIENTRY
5363 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5364 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5366 GET_CURRENT_CONTEXT(ctx
);
5368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5369 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5378 if (ctx
->ExecuteFlag
) {
5379 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5384 static void GLAPIENTRY
5385 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5386 const GLfloat
*params
)
5388 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5389 params
[2], params
[3]);
5393 static void GLAPIENTRY
5394 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5395 const GLfloat
* params
)
5397 GET_CURRENT_CONTEXT(ctx
);
5399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5403 const GLfloat
* p
= params
;
5405 for (i
= 0 ; i
< count
; i
++) {
5406 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5419 if (ctx
->ExecuteFlag
) {
5420 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5425 static void GLAPIENTRY
5426 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5427 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5429 save_ProgramEnvParameter4fARB(target
, index
,
5431 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5435 static void GLAPIENTRY
5436 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5437 const GLdouble
*params
)
5439 save_ProgramEnvParameter4fARB(target
, index
,
5440 (GLfloat
) params
[0],
5441 (GLfloat
) params
[1],
5442 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5446 static void GLAPIENTRY
5447 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5448 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5450 GET_CURRENT_CONTEXT(ctx
);
5452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5453 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5462 if (ctx
->ExecuteFlag
) {
5463 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5468 static void GLAPIENTRY
5469 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5470 const GLfloat
*params
)
5472 GET_CURRENT_CONTEXT(ctx
);
5474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5475 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5484 if (ctx
->ExecuteFlag
) {
5485 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5490 static void GLAPIENTRY
5491 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5492 const GLfloat
*params
)
5494 GET_CURRENT_CONTEXT(ctx
);
5496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5500 const GLfloat
* p
= params
;
5502 for (i
= 0 ; i
< count
; i
++) {
5503 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5516 if (ctx
->ExecuteFlag
) {
5517 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5522 static void GLAPIENTRY
5523 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5524 GLdouble x
, GLdouble y
,
5525 GLdouble z
, GLdouble w
)
5527 GET_CURRENT_CONTEXT(ctx
);
5529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5530 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5534 n
[3].f
= (GLfloat
) x
;
5535 n
[4].f
= (GLfloat
) y
;
5536 n
[5].f
= (GLfloat
) z
;
5537 n
[6].f
= (GLfloat
) w
;
5539 if (ctx
->ExecuteFlag
) {
5540 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5545 static void GLAPIENTRY
5546 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5547 const GLdouble
*params
)
5549 GET_CURRENT_CONTEXT(ctx
);
5551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5552 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5556 n
[3].f
= (GLfloat
) params
[0];
5557 n
[4].f
= (GLfloat
) params
[1];
5558 n
[5].f
= (GLfloat
) params
[2];
5559 n
[6].f
= (GLfloat
) params
[3];
5561 if (ctx
->ExecuteFlag
) {
5562 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5567 /* GL_EXT_stencil_two_side */
5568 static void GLAPIENTRY
5569 save_ActiveStencilFaceEXT(GLenum face
)
5571 GET_CURRENT_CONTEXT(ctx
);
5573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5574 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5578 if (ctx
->ExecuteFlag
) {
5579 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5584 /* GL_EXT_depth_bounds_test */
5585 static void GLAPIENTRY
5586 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5588 GET_CURRENT_CONTEXT(ctx
);
5590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5591 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5593 n
[1].f
= (GLfloat
) zmin
;
5594 n
[2].f
= (GLfloat
) zmax
;
5596 if (ctx
->ExecuteFlag
) {
5597 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5603 static void GLAPIENTRY
5604 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5605 const GLvoid
* string
)
5607 GET_CURRENT_CONTEXT(ctx
);
5610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5612 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5614 GLubyte
*programCopy
= malloc(len
);
5616 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5619 memcpy(programCopy
, string
, len
);
5623 save_pointer(&n
[4], programCopy
);
5625 if (ctx
->ExecuteFlag
) {
5626 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5631 static void GLAPIENTRY
5632 save_BeginQueryARB(GLenum target
, GLuint id
)
5634 GET_CURRENT_CONTEXT(ctx
);
5636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5637 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5642 if (ctx
->ExecuteFlag
) {
5643 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5647 static void GLAPIENTRY
5648 save_EndQueryARB(GLenum target
)
5650 GET_CURRENT_CONTEXT(ctx
);
5652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5653 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5657 if (ctx
->ExecuteFlag
) {
5658 CALL_EndQuery(ctx
->Exec
, (target
));
5662 static void GLAPIENTRY
5663 save_QueryCounter(GLuint id
, GLenum target
)
5665 GET_CURRENT_CONTEXT(ctx
);
5667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5668 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5673 if (ctx
->ExecuteFlag
) {
5674 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5678 static void GLAPIENTRY
5679 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5681 GET_CURRENT_CONTEXT(ctx
);
5683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5684 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5695 static void GLAPIENTRY
5696 save_EndQueryIndexed(GLenum target
, GLuint index
)
5698 GET_CURRENT_CONTEXT(ctx
);
5700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5701 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5706 if (ctx
->ExecuteFlag
) {
5707 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5712 static void GLAPIENTRY
5713 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5715 GET_CURRENT_CONTEXT(ctx
);
5717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5718 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5722 if (count
> MAX_DRAW_BUFFERS
)
5723 count
= MAX_DRAW_BUFFERS
;
5724 for (i
= 0; i
< count
; i
++) {
5725 n
[2 + i
].e
= buffers
[i
];
5728 if (ctx
->ExecuteFlag
) {
5729 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5733 static void GLAPIENTRY
5734 save_BindFragmentShaderATI(GLuint id
)
5736 GET_CURRENT_CONTEXT(ctx
);
5739 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5743 if (ctx
->ExecuteFlag
) {
5744 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5748 static void GLAPIENTRY
5749 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5751 GET_CURRENT_CONTEXT(ctx
);
5754 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5762 if (ctx
->ExecuteFlag
) {
5763 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5767 static void GLAPIENTRY
5768 save_Attr1fNV(GLenum attr
, GLfloat x
)
5770 GET_CURRENT_CONTEXT(ctx
);
5772 SAVE_FLUSH_VERTICES(ctx
);
5773 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5779 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5780 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5781 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5783 if (ctx
->ExecuteFlag
) {
5784 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5788 static void GLAPIENTRY
5789 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5791 GET_CURRENT_CONTEXT(ctx
);
5793 SAVE_FLUSH_VERTICES(ctx
);
5794 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5801 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5802 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5803 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5805 if (ctx
->ExecuteFlag
) {
5806 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5810 static void GLAPIENTRY
5811 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5813 GET_CURRENT_CONTEXT(ctx
);
5815 SAVE_FLUSH_VERTICES(ctx
);
5816 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5824 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5825 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5826 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5828 if (ctx
->ExecuteFlag
) {
5829 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5833 static void GLAPIENTRY
5834 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5836 GET_CURRENT_CONTEXT(ctx
);
5838 SAVE_FLUSH_VERTICES(ctx
);
5839 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5848 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5849 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5850 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5852 if (ctx
->ExecuteFlag
) {
5853 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5858 static void GLAPIENTRY
5859 save_Attr1fARB(GLenum attr
, GLfloat x
)
5861 GET_CURRENT_CONTEXT(ctx
);
5863 SAVE_FLUSH_VERTICES(ctx
);
5864 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5870 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5871 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5872 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5874 if (ctx
->ExecuteFlag
) {
5875 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5879 static void GLAPIENTRY
5880 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5882 GET_CURRENT_CONTEXT(ctx
);
5884 SAVE_FLUSH_VERTICES(ctx
);
5885 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5892 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5893 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5894 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5896 if (ctx
->ExecuteFlag
) {
5897 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5901 static void GLAPIENTRY
5902 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5904 GET_CURRENT_CONTEXT(ctx
);
5906 SAVE_FLUSH_VERTICES(ctx
);
5907 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5915 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5916 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5917 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5919 if (ctx
->ExecuteFlag
) {
5920 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5924 static void GLAPIENTRY
5925 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5927 GET_CURRENT_CONTEXT(ctx
);
5929 SAVE_FLUSH_VERTICES(ctx
);
5930 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5939 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5940 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5941 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5943 if (ctx
->ExecuteFlag
) {
5944 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5949 static void GLAPIENTRY
5950 save_EvalCoord1f(GLfloat x
)
5952 GET_CURRENT_CONTEXT(ctx
);
5954 SAVE_FLUSH_VERTICES(ctx
);
5955 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5959 if (ctx
->ExecuteFlag
) {
5960 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5964 static void GLAPIENTRY
5965 save_EvalCoord1fv(const GLfloat
* v
)
5967 save_EvalCoord1f(v
[0]);
5970 static void GLAPIENTRY
5971 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5973 GET_CURRENT_CONTEXT(ctx
);
5975 SAVE_FLUSH_VERTICES(ctx
);
5976 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5981 if (ctx
->ExecuteFlag
) {
5982 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5986 static void GLAPIENTRY
5987 save_EvalCoord2fv(const GLfloat
* v
)
5989 save_EvalCoord2f(v
[0], v
[1]);
5993 static void GLAPIENTRY
5994 save_EvalPoint1(GLint x
)
5996 GET_CURRENT_CONTEXT(ctx
);
5998 SAVE_FLUSH_VERTICES(ctx
);
5999 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6003 if (ctx
->ExecuteFlag
) {
6004 CALL_EvalPoint1(ctx
->Exec
, (x
));
6008 static void GLAPIENTRY
6009 save_EvalPoint2(GLint x
, GLint y
)
6011 GET_CURRENT_CONTEXT(ctx
);
6013 SAVE_FLUSH_VERTICES(ctx
);
6014 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6019 if (ctx
->ExecuteFlag
) {
6020 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6024 static void GLAPIENTRY
6025 save_Indexf(GLfloat x
)
6027 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6030 static void GLAPIENTRY
6031 save_Indexfv(const GLfloat
* v
)
6033 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6036 static void GLAPIENTRY
6037 save_EdgeFlag(GLboolean x
)
6039 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6044 * Compare 'count' elements of vectors 'a' and 'b'.
6045 * \return GL_TRUE if equal, GL_FALSE if different.
6047 static inline GLboolean
6048 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6050 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6055 * This glMaterial function is used for glMaterial calls that are outside
6056 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6058 static void GLAPIENTRY
6059 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6061 GET_CURRENT_CONTEXT(ctx
);
6069 case GL_FRONT_AND_BACK
:
6072 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6081 case GL_AMBIENT_AND_DIFFUSE
:
6087 case GL_COLOR_INDEXES
:
6091 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6095 if (ctx
->ExecuteFlag
) {
6096 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6099 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6101 /* Try to eliminate redundant statechanges. Because it is legal to
6102 * call glMaterial even inside begin/end calls, don't need to worry
6103 * about ctx->Driver.CurrentSavePrimitive here.
6105 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6106 if (bitmask
& (1 << i
)) {
6107 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6108 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6109 /* no change in material value */
6110 bitmask
&= ~(1 << i
);
6113 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6114 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6119 /* If this call has no effect, return early */
6123 SAVE_FLUSH_VERTICES(ctx
);
6125 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6129 for (i
= 0; i
< args
; i
++)
6130 n
[3 + i
].f
= param
[i
];
6134 static void GLAPIENTRY
6135 save_Begin(GLenum mode
)
6137 GET_CURRENT_CONTEXT(ctx
);
6139 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6140 /* compile this error into the display list */
6141 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6143 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6144 /* compile this error into the display list */
6145 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6148 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6150 vbo_save_NotifyBegin(ctx
, mode
, false);
6154 static void GLAPIENTRY
6157 GET_CURRENT_CONTEXT(ctx
);
6158 SAVE_FLUSH_VERTICES(ctx
);
6159 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6160 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6161 if (ctx
->ExecuteFlag
) {
6162 CALL_End(ctx
->Exec
, ());
6166 static void GLAPIENTRY
6167 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6169 GET_CURRENT_CONTEXT(ctx
);
6171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6172 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6179 if (ctx
->ExecuteFlag
) {
6180 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6185 static void GLAPIENTRY
6186 save_Vertex2f(GLfloat x
, GLfloat y
)
6188 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6191 static void GLAPIENTRY
6192 save_Vertex2fv(const GLfloat
* v
)
6194 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6197 static void GLAPIENTRY
6198 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6200 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6203 static void GLAPIENTRY
6204 save_Vertex3fv(const GLfloat
* v
)
6206 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6209 static void GLAPIENTRY
6210 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6212 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6215 static void GLAPIENTRY
6216 save_Vertex4fv(const GLfloat
* v
)
6218 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6221 static void GLAPIENTRY
6222 save_TexCoord1f(GLfloat x
)
6224 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6227 static void GLAPIENTRY
6228 save_TexCoord1fv(const GLfloat
* v
)
6230 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6233 static void GLAPIENTRY
6234 save_TexCoord2f(GLfloat x
, GLfloat y
)
6236 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6239 static void GLAPIENTRY
6240 save_TexCoord2fv(const GLfloat
* v
)
6242 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6245 static void GLAPIENTRY
6246 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6248 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6251 static void GLAPIENTRY
6252 save_TexCoord3fv(const GLfloat
* v
)
6254 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6257 static void GLAPIENTRY
6258 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6260 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6263 static void GLAPIENTRY
6264 save_TexCoord4fv(const GLfloat
* v
)
6266 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6269 static void GLAPIENTRY
6270 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6272 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6275 static void GLAPIENTRY
6276 save_Normal3fv(const GLfloat
* v
)
6278 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6281 static void GLAPIENTRY
6282 save_FogCoordfEXT(GLfloat x
)
6284 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6287 static void GLAPIENTRY
6288 save_FogCoordfvEXT(const GLfloat
* v
)
6290 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6293 static void GLAPIENTRY
6294 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6296 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6299 static void GLAPIENTRY
6300 save_Color3fv(const GLfloat
* v
)
6302 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6305 static void GLAPIENTRY
6306 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6308 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6311 static void GLAPIENTRY
6312 save_Color4fv(const GLfloat
* v
)
6314 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6317 static void GLAPIENTRY
6318 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6320 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6323 static void GLAPIENTRY
6324 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6326 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6330 /* Just call the respective ATTR for texcoord
6332 static void GLAPIENTRY
6333 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6335 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6336 save_Attr1fNV(attr
, x
);
6339 static void GLAPIENTRY
6340 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6342 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6343 save_Attr1fNV(attr
, v
[0]);
6346 static void GLAPIENTRY
6347 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6349 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6350 save_Attr2fNV(attr
, x
, y
);
6353 static void GLAPIENTRY
6354 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6356 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6357 save_Attr2fNV(attr
, v
[0], v
[1]);
6360 static void GLAPIENTRY
6361 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6363 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6364 save_Attr3fNV(attr
, x
, y
, z
);
6367 static void GLAPIENTRY
6368 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6370 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6371 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6374 static void GLAPIENTRY
6375 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6376 GLfloat z
, GLfloat w
)
6378 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6379 save_Attr4fNV(attr
, x
, y
, z
, w
);
6382 static void GLAPIENTRY
6383 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6385 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6386 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6391 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6397 GET_CURRENT_CONTEXT(ctx
);
6398 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6403 static void GLAPIENTRY
6404 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6406 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6407 save_Attr1fARB(index
, x
);
6412 static void GLAPIENTRY
6413 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6415 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6416 save_Attr1fARB(index
, v
[0]);
6421 static void GLAPIENTRY
6422 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6424 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6425 save_Attr2fARB(index
, x
, y
);
6430 static void GLAPIENTRY
6431 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6433 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6434 save_Attr2fARB(index
, v
[0], v
[1]);
6439 static void GLAPIENTRY
6440 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6442 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6443 save_Attr3fARB(index
, x
, y
, z
);
6448 static void GLAPIENTRY
6449 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6451 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6452 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6457 static void GLAPIENTRY
6458 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6461 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6462 save_Attr4fARB(index
, x
, y
, z
, w
);
6467 static void GLAPIENTRY
6468 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6470 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6471 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6476 static void GLAPIENTRY
6477 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6479 GET_CURRENT_CONTEXT(ctx
);
6481 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6483 SAVE_FLUSH_VERTICES(ctx
);
6484 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6487 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6490 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6491 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6493 if (ctx
->ExecuteFlag
) {
6494 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6501 static void GLAPIENTRY
6502 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6504 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6505 save_VertexAttribL1d(index
, v
[0]);
6510 static void GLAPIENTRY
6511 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6513 GET_CURRENT_CONTEXT(ctx
);
6515 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6517 SAVE_FLUSH_VERTICES(ctx
);
6518 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6521 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6522 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6525 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6526 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6527 2 * sizeof(GLdouble
));
6529 if (ctx
->ExecuteFlag
) {
6530 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6537 static void GLAPIENTRY
6538 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6540 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6541 save_VertexAttribL2d(index
, v
[0], v
[1]);
6546 static void GLAPIENTRY
6547 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6549 GET_CURRENT_CONTEXT(ctx
);
6551 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6553 SAVE_FLUSH_VERTICES(ctx
);
6554 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6557 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6558 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6559 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6562 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6563 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6564 3 * sizeof(GLdouble
));
6566 if (ctx
->ExecuteFlag
) {
6567 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6574 static void GLAPIENTRY
6575 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6577 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6578 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6583 static void GLAPIENTRY
6584 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6587 GET_CURRENT_CONTEXT(ctx
);
6589 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6591 SAVE_FLUSH_VERTICES(ctx
);
6592 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6595 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6596 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6597 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6598 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6601 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6602 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6603 4 * sizeof(GLdouble
));
6605 if (ctx
->ExecuteFlag
) {
6606 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6613 static void GLAPIENTRY
6614 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6616 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6617 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6622 static void GLAPIENTRY
6623 save_PrimitiveRestartNV(void)
6625 /* Note: this is used when outside a glBegin/End pair in a display list */
6626 GET_CURRENT_CONTEXT(ctx
);
6627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6628 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6629 if (ctx
->ExecuteFlag
) {
6630 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6635 static void GLAPIENTRY
6636 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6637 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6638 GLbitfield mask
, GLenum filter
)
6640 GET_CURRENT_CONTEXT(ctx
);
6642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6643 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6656 if (ctx
->ExecuteFlag
) {
6657 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6658 dstX0
, dstY0
, dstX1
, dstY1
,
6664 /** GL_EXT_provoking_vertex */
6665 static void GLAPIENTRY
6666 save_ProvokingVertexEXT(GLenum mode
)
6668 GET_CURRENT_CONTEXT(ctx
);
6670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6671 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6675 if (ctx
->ExecuteFlag
) {
6676 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6677 _mesa_ProvokingVertex(mode
);
6682 /** GL_EXT_transform_feedback */
6683 static void GLAPIENTRY
6684 save_BeginTransformFeedback(GLenum mode
)
6686 GET_CURRENT_CONTEXT(ctx
);
6688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6689 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6693 if (ctx
->ExecuteFlag
) {
6694 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6699 /** GL_EXT_transform_feedback */
6700 static void GLAPIENTRY
6701 save_EndTransformFeedback(void)
6703 GET_CURRENT_CONTEXT(ctx
);
6704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6705 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6706 if (ctx
->ExecuteFlag
) {
6707 CALL_EndTransformFeedback(ctx
->Exec
, ());
6711 static void GLAPIENTRY
6712 save_BindTransformFeedback(GLenum target
, GLuint name
)
6714 GET_CURRENT_CONTEXT(ctx
);
6716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6717 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6722 if (ctx
->ExecuteFlag
) {
6723 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6727 static void GLAPIENTRY
6728 save_PauseTransformFeedback(void)
6730 GET_CURRENT_CONTEXT(ctx
);
6731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6732 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6733 if (ctx
->ExecuteFlag
) {
6734 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6738 static void GLAPIENTRY
6739 save_ResumeTransformFeedback(void)
6741 GET_CURRENT_CONTEXT(ctx
);
6742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6743 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6744 if (ctx
->ExecuteFlag
) {
6745 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6749 static void GLAPIENTRY
6750 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6752 GET_CURRENT_CONTEXT(ctx
);
6754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6755 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6760 if (ctx
->ExecuteFlag
) {
6761 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6765 static void GLAPIENTRY
6766 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6768 GET_CURRENT_CONTEXT(ctx
);
6770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6771 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6777 if (ctx
->ExecuteFlag
) {
6778 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6782 static void GLAPIENTRY
6783 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6786 GET_CURRENT_CONTEXT(ctx
);
6788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6789 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6793 n
[3].si
= primcount
;
6795 if (ctx
->ExecuteFlag
) {
6796 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6800 static void GLAPIENTRY
6801 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6802 GLuint stream
, GLsizei primcount
)
6804 GET_CURRENT_CONTEXT(ctx
);
6806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6807 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6812 n
[4].si
= primcount
;
6814 if (ctx
->ExecuteFlag
) {
6815 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6820 static void GLAPIENTRY
6821 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6822 GLuint num_groups_z
)
6824 GET_CURRENT_CONTEXT(ctx
);
6826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6827 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6829 n
[1].ui
= num_groups_x
;
6830 n
[2].ui
= num_groups_y
;
6831 n
[3].ui
= num_groups_z
;
6833 if (ctx
->ExecuteFlag
) {
6834 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6839 static void GLAPIENTRY
6840 save_DispatchComputeIndirect(GLintptr indirect
)
6842 GET_CURRENT_CONTEXT(ctx
);
6843 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6844 "glDispatchComputeIndirect() during display list compile");
6847 static void GLAPIENTRY
6848 save_UseProgram(GLuint program
)
6850 GET_CURRENT_CONTEXT(ctx
);
6852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6853 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6857 if (ctx
->ExecuteFlag
) {
6858 CALL_UseProgram(ctx
->Exec
, (program
));
6863 static void GLAPIENTRY
6864 save_Uniform1fARB(GLint location
, GLfloat x
)
6866 GET_CURRENT_CONTEXT(ctx
);
6868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6869 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6874 if (ctx
->ExecuteFlag
) {
6875 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6880 static void GLAPIENTRY
6881 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6883 GET_CURRENT_CONTEXT(ctx
);
6885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6886 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6892 if (ctx
->ExecuteFlag
) {
6893 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6898 static void GLAPIENTRY
6899 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6901 GET_CURRENT_CONTEXT(ctx
);
6903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6904 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6911 if (ctx
->ExecuteFlag
) {
6912 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6917 static void GLAPIENTRY
6918 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6920 GET_CURRENT_CONTEXT(ctx
);
6922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6923 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6931 if (ctx
->ExecuteFlag
) {
6932 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6937 static void GLAPIENTRY
6938 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6940 GET_CURRENT_CONTEXT(ctx
);
6942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6943 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6947 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6949 if (ctx
->ExecuteFlag
) {
6950 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6954 static void GLAPIENTRY
6955 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6957 GET_CURRENT_CONTEXT(ctx
);
6959 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6960 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6964 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6966 if (ctx
->ExecuteFlag
) {
6967 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6971 static void GLAPIENTRY
6972 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6974 GET_CURRENT_CONTEXT(ctx
);
6976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6977 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6981 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6983 if (ctx
->ExecuteFlag
) {
6984 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6988 static void GLAPIENTRY
6989 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6991 GET_CURRENT_CONTEXT(ctx
);
6993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6994 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6998 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7000 if (ctx
->ExecuteFlag
) {
7001 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7006 static void GLAPIENTRY
7007 save_Uniform1d(GLint location
, GLdouble x
)
7009 GET_CURRENT_CONTEXT(ctx
);
7011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7012 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7015 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7017 if (ctx
->ExecuteFlag
) {
7018 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7023 static void GLAPIENTRY
7024 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7026 GET_CURRENT_CONTEXT(ctx
);
7028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7029 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7032 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7033 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7035 if (ctx
->ExecuteFlag
) {
7036 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7041 static void GLAPIENTRY
7042 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7044 GET_CURRENT_CONTEXT(ctx
);
7046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7047 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7050 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7051 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7052 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7054 if (ctx
->ExecuteFlag
) {
7055 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7060 static void GLAPIENTRY
7061 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7063 GET_CURRENT_CONTEXT(ctx
);
7065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7066 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7069 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7070 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7071 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7072 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7074 if (ctx
->ExecuteFlag
) {
7075 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7080 static void GLAPIENTRY
7081 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7083 GET_CURRENT_CONTEXT(ctx
);
7085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7086 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7090 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7092 if (ctx
->ExecuteFlag
) {
7093 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7098 static void GLAPIENTRY
7099 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7101 GET_CURRENT_CONTEXT(ctx
);
7103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7104 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7108 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7110 if (ctx
->ExecuteFlag
) {
7111 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7116 static void GLAPIENTRY
7117 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7119 GET_CURRENT_CONTEXT(ctx
);
7121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7122 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7126 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7128 if (ctx
->ExecuteFlag
) {
7129 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7134 static void GLAPIENTRY
7135 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7137 GET_CURRENT_CONTEXT(ctx
);
7139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7140 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7144 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7146 if (ctx
->ExecuteFlag
) {
7147 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7152 static void GLAPIENTRY
7153 save_Uniform1iARB(GLint location
, GLint x
)
7155 GET_CURRENT_CONTEXT(ctx
);
7157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7158 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7163 if (ctx
->ExecuteFlag
) {
7164 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7168 static void GLAPIENTRY
7169 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7171 GET_CURRENT_CONTEXT(ctx
);
7173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7174 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7180 if (ctx
->ExecuteFlag
) {
7181 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7185 static void GLAPIENTRY
7186 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7188 GET_CURRENT_CONTEXT(ctx
);
7190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7191 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7198 if (ctx
->ExecuteFlag
) {
7199 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7203 static void GLAPIENTRY
7204 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7206 GET_CURRENT_CONTEXT(ctx
);
7208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7209 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7217 if (ctx
->ExecuteFlag
) {
7218 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7224 static void GLAPIENTRY
7225 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7227 GET_CURRENT_CONTEXT(ctx
);
7229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7230 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7234 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7236 if (ctx
->ExecuteFlag
) {
7237 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7241 static void GLAPIENTRY
7242 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7244 GET_CURRENT_CONTEXT(ctx
);
7246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7247 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7251 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7253 if (ctx
->ExecuteFlag
) {
7254 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7258 static void GLAPIENTRY
7259 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7261 GET_CURRENT_CONTEXT(ctx
);
7263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7264 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7268 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7270 if (ctx
->ExecuteFlag
) {
7271 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7275 static void GLAPIENTRY
7276 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7278 GET_CURRENT_CONTEXT(ctx
);
7280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7281 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7285 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7287 if (ctx
->ExecuteFlag
) {
7288 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7294 static void GLAPIENTRY
7295 save_Uniform1ui(GLint location
, GLuint x
)
7297 GET_CURRENT_CONTEXT(ctx
);
7299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7300 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7305 if (ctx
->ExecuteFlag
) {
7306 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7310 static void GLAPIENTRY
7311 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7313 GET_CURRENT_CONTEXT(ctx
);
7315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7316 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7322 if (ctx
->ExecuteFlag
) {
7323 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7327 static void GLAPIENTRY
7328 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7330 GET_CURRENT_CONTEXT(ctx
);
7332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7333 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7340 if (ctx
->ExecuteFlag
) {
7341 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7345 static void GLAPIENTRY
7346 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7348 GET_CURRENT_CONTEXT(ctx
);
7350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7351 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7359 if (ctx
->ExecuteFlag
) {
7360 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7366 static void GLAPIENTRY
7367 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7369 GET_CURRENT_CONTEXT(ctx
);
7371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7372 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7376 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7378 if (ctx
->ExecuteFlag
) {
7379 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7383 static void GLAPIENTRY
7384 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7386 GET_CURRENT_CONTEXT(ctx
);
7388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7389 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7393 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7395 if (ctx
->ExecuteFlag
) {
7396 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7400 static void GLAPIENTRY
7401 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7403 GET_CURRENT_CONTEXT(ctx
);
7405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7406 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7410 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7412 if (ctx
->ExecuteFlag
) {
7413 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7417 static void GLAPIENTRY
7418 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7420 GET_CURRENT_CONTEXT(ctx
);
7422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7423 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7427 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7429 if (ctx
->ExecuteFlag
) {
7430 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7436 static void GLAPIENTRY
7437 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7440 GET_CURRENT_CONTEXT(ctx
);
7442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7443 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7448 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7450 if (ctx
->ExecuteFlag
) {
7451 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7455 static void GLAPIENTRY
7456 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7459 GET_CURRENT_CONTEXT(ctx
);
7461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7462 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7467 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7469 if (ctx
->ExecuteFlag
) {
7470 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7474 static void GLAPIENTRY
7475 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7478 GET_CURRENT_CONTEXT(ctx
);
7480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7481 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7486 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7488 if (ctx
->ExecuteFlag
) {
7489 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7494 static void GLAPIENTRY
7495 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7498 GET_CURRENT_CONTEXT(ctx
);
7500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7501 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7506 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7508 if (ctx
->ExecuteFlag
) {
7509 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7513 static void GLAPIENTRY
7514 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7517 GET_CURRENT_CONTEXT(ctx
);
7519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7520 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7525 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7527 if (ctx
->ExecuteFlag
) {
7528 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7533 static void GLAPIENTRY
7534 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7537 GET_CURRENT_CONTEXT(ctx
);
7539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7540 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7545 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7547 if (ctx
->ExecuteFlag
) {
7548 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7552 static void GLAPIENTRY
7553 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7556 GET_CURRENT_CONTEXT(ctx
);
7558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7559 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7564 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7566 if (ctx
->ExecuteFlag
) {
7567 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7572 static void GLAPIENTRY
7573 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7576 GET_CURRENT_CONTEXT(ctx
);
7578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7579 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7584 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7586 if (ctx
->ExecuteFlag
) {
7587 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7591 static void GLAPIENTRY
7592 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7595 GET_CURRENT_CONTEXT(ctx
);
7597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7598 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7603 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7605 if (ctx
->ExecuteFlag
) {
7606 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7611 static void GLAPIENTRY
7612 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7615 GET_CURRENT_CONTEXT(ctx
);
7617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7618 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7623 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7625 if (ctx
->ExecuteFlag
) {
7626 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7630 static void GLAPIENTRY
7631 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7634 GET_CURRENT_CONTEXT(ctx
);
7636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7637 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7642 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7644 if (ctx
->ExecuteFlag
) {
7645 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7649 static void GLAPIENTRY
7650 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7653 GET_CURRENT_CONTEXT(ctx
);
7655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7656 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7661 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7663 if (ctx
->ExecuteFlag
) {
7664 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7669 static void GLAPIENTRY
7670 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7673 GET_CURRENT_CONTEXT(ctx
);
7675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7676 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7681 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7683 if (ctx
->ExecuteFlag
) {
7684 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7689 static void GLAPIENTRY
7690 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7693 GET_CURRENT_CONTEXT(ctx
);
7695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7696 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7701 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7703 if (ctx
->ExecuteFlag
) {
7704 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7709 static void GLAPIENTRY
7710 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7713 GET_CURRENT_CONTEXT(ctx
);
7715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7716 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7721 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7723 if (ctx
->ExecuteFlag
) {
7724 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7728 static void GLAPIENTRY
7729 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7732 GET_CURRENT_CONTEXT(ctx
);
7734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7735 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7740 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7742 if (ctx
->ExecuteFlag
) {
7743 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7748 static void GLAPIENTRY
7749 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7752 GET_CURRENT_CONTEXT(ctx
);
7754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7755 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7760 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7762 if (ctx
->ExecuteFlag
) {
7763 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7768 static void GLAPIENTRY
7769 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7772 GET_CURRENT_CONTEXT(ctx
);
7774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7775 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7780 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7782 if (ctx
->ExecuteFlag
) {
7783 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7788 static void GLAPIENTRY
7789 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7791 GET_CURRENT_CONTEXT(ctx
);
7793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7794 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7800 if (ctx
->ExecuteFlag
) {
7801 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7805 static void GLAPIENTRY
7806 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7808 GET_CURRENT_CONTEXT(ctx
);
7810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7811 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7817 if (ctx
->ExecuteFlag
) {
7818 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7822 static void GLAPIENTRY
7823 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7825 GET_CURRENT_CONTEXT(ctx
);
7827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7828 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7835 if (ctx
->ExecuteFlag
) {
7836 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7840 static void GLAPIENTRY
7841 save_ProgramUniform3f(GLuint program
, GLint location
,
7842 GLfloat x
, GLfloat y
, GLfloat z
)
7844 GET_CURRENT_CONTEXT(ctx
);
7846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7847 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7855 if (ctx
->ExecuteFlag
) {
7856 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7860 static void GLAPIENTRY
7861 save_ProgramUniform4f(GLuint program
, GLint location
,
7862 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7864 GET_CURRENT_CONTEXT(ctx
);
7866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7867 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7876 if (ctx
->ExecuteFlag
) {
7877 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7881 static void GLAPIENTRY
7882 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7885 GET_CURRENT_CONTEXT(ctx
);
7887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7888 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7893 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7895 if (ctx
->ExecuteFlag
) {
7896 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7900 static void GLAPIENTRY
7901 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7904 GET_CURRENT_CONTEXT(ctx
);
7906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7907 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7912 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7914 if (ctx
->ExecuteFlag
) {
7915 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7919 static void GLAPIENTRY
7920 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7923 GET_CURRENT_CONTEXT(ctx
);
7925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7926 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7931 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7933 if (ctx
->ExecuteFlag
) {
7934 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7938 static void GLAPIENTRY
7939 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7942 GET_CURRENT_CONTEXT(ctx
);
7944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7945 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7950 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7952 if (ctx
->ExecuteFlag
) {
7953 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7957 static void GLAPIENTRY
7958 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7960 GET_CURRENT_CONTEXT(ctx
);
7962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7963 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7967 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7969 if (ctx
->ExecuteFlag
) {
7970 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7974 static void GLAPIENTRY
7975 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7977 GET_CURRENT_CONTEXT(ctx
);
7979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7980 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7984 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7985 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7987 if (ctx
->ExecuteFlag
) {
7988 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7992 static void GLAPIENTRY
7993 save_ProgramUniform3d(GLuint program
, GLint location
,
7994 GLdouble x
, GLdouble y
, GLdouble z
)
7996 GET_CURRENT_CONTEXT(ctx
);
7998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7999 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8003 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8004 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8005 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8007 if (ctx
->ExecuteFlag
) {
8008 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8012 static void GLAPIENTRY
8013 save_ProgramUniform4d(GLuint program
, GLint location
,
8014 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8016 GET_CURRENT_CONTEXT(ctx
);
8018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8019 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8023 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8024 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8025 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8026 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8028 if (ctx
->ExecuteFlag
) {
8029 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8033 static void GLAPIENTRY
8034 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8037 GET_CURRENT_CONTEXT(ctx
);
8039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8040 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8045 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8047 if (ctx
->ExecuteFlag
) {
8048 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8052 static void GLAPIENTRY
8053 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8056 GET_CURRENT_CONTEXT(ctx
);
8058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8059 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8064 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8066 if (ctx
->ExecuteFlag
) {
8067 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8071 static void GLAPIENTRY
8072 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8075 GET_CURRENT_CONTEXT(ctx
);
8077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8078 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8083 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8085 if (ctx
->ExecuteFlag
) {
8086 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8090 static void GLAPIENTRY
8091 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8094 GET_CURRENT_CONTEXT(ctx
);
8096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8097 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8102 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8104 if (ctx
->ExecuteFlag
) {
8105 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8109 static void GLAPIENTRY
8110 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8112 GET_CURRENT_CONTEXT(ctx
);
8114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8115 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8121 if (ctx
->ExecuteFlag
) {
8122 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8126 static void GLAPIENTRY
8127 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8129 GET_CURRENT_CONTEXT(ctx
);
8131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8132 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8139 if (ctx
->ExecuteFlag
) {
8140 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8144 static void GLAPIENTRY
8145 save_ProgramUniform3i(GLuint program
, GLint location
,
8146 GLint x
, GLint y
, GLint z
)
8148 GET_CURRENT_CONTEXT(ctx
);
8150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8151 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8159 if (ctx
->ExecuteFlag
) {
8160 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8164 static void GLAPIENTRY
8165 save_ProgramUniform4i(GLuint program
, GLint location
,
8166 GLint x
, GLint y
, GLint z
, GLint w
)
8168 GET_CURRENT_CONTEXT(ctx
);
8170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8171 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8180 if (ctx
->ExecuteFlag
) {
8181 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8185 static void GLAPIENTRY
8186 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8189 GET_CURRENT_CONTEXT(ctx
);
8191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8192 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8197 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8199 if (ctx
->ExecuteFlag
) {
8200 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8204 static void GLAPIENTRY
8205 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8208 GET_CURRENT_CONTEXT(ctx
);
8210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8211 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8216 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8218 if (ctx
->ExecuteFlag
) {
8219 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8223 static void GLAPIENTRY
8224 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8227 GET_CURRENT_CONTEXT(ctx
);
8229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8230 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8235 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8237 if (ctx
->ExecuteFlag
) {
8238 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8242 static void GLAPIENTRY
8243 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8246 GET_CURRENT_CONTEXT(ctx
);
8248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8249 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8254 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8256 if (ctx
->ExecuteFlag
) {
8257 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8261 static void GLAPIENTRY
8262 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8264 GET_CURRENT_CONTEXT(ctx
);
8266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8267 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8273 if (ctx
->ExecuteFlag
) {
8274 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8278 static void GLAPIENTRY
8279 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8281 GET_CURRENT_CONTEXT(ctx
);
8283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8284 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8291 if (ctx
->ExecuteFlag
) {
8292 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8296 static void GLAPIENTRY
8297 save_ProgramUniform3ui(GLuint program
, GLint location
,
8298 GLuint x
, GLuint y
, GLuint z
)
8300 GET_CURRENT_CONTEXT(ctx
);
8302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8303 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8311 if (ctx
->ExecuteFlag
) {
8312 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8316 static void GLAPIENTRY
8317 save_ProgramUniform4ui(GLuint program
, GLint location
,
8318 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8320 GET_CURRENT_CONTEXT(ctx
);
8322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8323 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8332 if (ctx
->ExecuteFlag
) {
8333 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8337 static void GLAPIENTRY
8338 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8341 GET_CURRENT_CONTEXT(ctx
);
8343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8344 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8349 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8351 if (ctx
->ExecuteFlag
) {
8352 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8356 static void GLAPIENTRY
8357 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8360 GET_CURRENT_CONTEXT(ctx
);
8362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8363 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8368 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8370 if (ctx
->ExecuteFlag
) {
8371 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8375 static void GLAPIENTRY
8376 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8379 GET_CURRENT_CONTEXT(ctx
);
8381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8382 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8387 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8389 if (ctx
->ExecuteFlag
) {
8390 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8394 static void GLAPIENTRY
8395 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8398 GET_CURRENT_CONTEXT(ctx
);
8400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8401 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8406 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8408 if (ctx
->ExecuteFlag
) {
8409 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8413 static void GLAPIENTRY
8414 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8415 GLboolean transpose
, const GLfloat
*v
)
8417 GET_CURRENT_CONTEXT(ctx
);
8419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8420 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8421 4 + POINTER_DWORDS
);
8427 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8429 if (ctx
->ExecuteFlag
) {
8430 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8431 (program
, location
, count
, transpose
, v
));
8435 static void GLAPIENTRY
8436 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8437 GLboolean transpose
, const GLfloat
*v
)
8439 GET_CURRENT_CONTEXT(ctx
);
8441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8442 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8443 4 + POINTER_DWORDS
);
8449 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8451 if (ctx
->ExecuteFlag
) {
8452 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8453 (program
, location
, count
, transpose
, v
));
8457 static void GLAPIENTRY
8458 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8459 GLboolean transpose
, const GLfloat
*v
)
8461 GET_CURRENT_CONTEXT(ctx
);
8463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8464 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8465 4 + POINTER_DWORDS
);
8471 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8473 if (ctx
->ExecuteFlag
) {
8474 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8475 (program
, location
, count
, transpose
, v
));
8479 static void GLAPIENTRY
8480 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8481 GLboolean transpose
, const GLfloat
*v
)
8483 GET_CURRENT_CONTEXT(ctx
);
8485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8486 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8487 4 + POINTER_DWORDS
);
8493 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8495 if (ctx
->ExecuteFlag
) {
8496 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8497 (program
, location
, count
, transpose
, v
));
8501 static void GLAPIENTRY
8502 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8503 GLboolean transpose
, const GLfloat
*v
)
8505 GET_CURRENT_CONTEXT(ctx
);
8507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8508 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8509 4 + POINTER_DWORDS
);
8515 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8517 if (ctx
->ExecuteFlag
) {
8518 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8519 (program
, location
, count
, transpose
, v
));
8523 static void GLAPIENTRY
8524 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8525 GLboolean transpose
, const GLfloat
*v
)
8527 GET_CURRENT_CONTEXT(ctx
);
8529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8530 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8531 4 + POINTER_DWORDS
);
8537 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8539 if (ctx
->ExecuteFlag
) {
8540 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8541 (program
, location
, count
, transpose
, v
));
8545 static void GLAPIENTRY
8546 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8547 GLboolean transpose
, const GLfloat
*v
)
8549 GET_CURRENT_CONTEXT(ctx
);
8551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8552 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8553 4 + POINTER_DWORDS
);
8559 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8561 if (ctx
->ExecuteFlag
) {
8562 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8563 (program
, location
, count
, transpose
, v
));
8567 static void GLAPIENTRY
8568 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8569 GLboolean transpose
, const GLfloat
*v
)
8571 GET_CURRENT_CONTEXT(ctx
);
8573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8574 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8575 4 + POINTER_DWORDS
);
8581 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8583 if (ctx
->ExecuteFlag
) {
8584 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8585 (program
, location
, count
, transpose
, v
));
8589 static void GLAPIENTRY
8590 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8591 GLboolean transpose
, const GLfloat
*v
)
8593 GET_CURRENT_CONTEXT(ctx
);
8595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8596 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8597 4 + POINTER_DWORDS
);
8603 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8605 if (ctx
->ExecuteFlag
) {
8606 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8607 (program
, location
, count
, transpose
, v
));
8611 static void GLAPIENTRY
8612 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8613 GLboolean transpose
, const GLdouble
*v
)
8615 GET_CURRENT_CONTEXT(ctx
);
8617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8618 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8619 4 + POINTER_DWORDS
);
8625 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8627 if (ctx
->ExecuteFlag
) {
8628 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8629 (program
, location
, count
, transpose
, v
));
8633 static void GLAPIENTRY
8634 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8635 GLboolean transpose
, const GLdouble
*v
)
8637 GET_CURRENT_CONTEXT(ctx
);
8639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8640 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8641 4 + POINTER_DWORDS
);
8647 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8649 if (ctx
->ExecuteFlag
) {
8650 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8651 (program
, location
, count
, transpose
, v
));
8655 static void GLAPIENTRY
8656 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8657 GLboolean transpose
, const GLdouble
*v
)
8659 GET_CURRENT_CONTEXT(ctx
);
8661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8662 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8663 4 + POINTER_DWORDS
);
8669 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8671 if (ctx
->ExecuteFlag
) {
8672 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8673 (program
, location
, count
, transpose
, v
));
8677 static void GLAPIENTRY
8678 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8679 GLboolean transpose
, const GLdouble
*v
)
8681 GET_CURRENT_CONTEXT(ctx
);
8683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8684 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8685 4 + POINTER_DWORDS
);
8691 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8693 if (ctx
->ExecuteFlag
) {
8694 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8695 (program
, location
, count
, transpose
, v
));
8699 static void GLAPIENTRY
8700 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8701 GLboolean transpose
, const GLdouble
*v
)
8703 GET_CURRENT_CONTEXT(ctx
);
8705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8706 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8707 4 + POINTER_DWORDS
);
8713 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8715 if (ctx
->ExecuteFlag
) {
8716 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8717 (program
, location
, count
, transpose
, v
));
8721 static void GLAPIENTRY
8722 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8723 GLboolean transpose
, const GLdouble
*v
)
8725 GET_CURRENT_CONTEXT(ctx
);
8727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8728 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8729 4 + POINTER_DWORDS
);
8735 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8737 if (ctx
->ExecuteFlag
) {
8738 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8739 (program
, location
, count
, transpose
, v
));
8743 static void GLAPIENTRY
8744 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8745 GLboolean transpose
, const GLdouble
*v
)
8747 GET_CURRENT_CONTEXT(ctx
);
8749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8750 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8751 4 + POINTER_DWORDS
);
8757 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8759 if (ctx
->ExecuteFlag
) {
8760 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8761 (program
, location
, count
, transpose
, v
));
8765 static void GLAPIENTRY
8766 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8767 GLboolean transpose
, const GLdouble
*v
)
8769 GET_CURRENT_CONTEXT(ctx
);
8771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8772 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8773 4 + POINTER_DWORDS
);
8779 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8781 if (ctx
->ExecuteFlag
) {
8782 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8783 (program
, location
, count
, transpose
, v
));
8787 static void GLAPIENTRY
8788 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8789 GLboolean transpose
, const GLdouble
*v
)
8791 GET_CURRENT_CONTEXT(ctx
);
8793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8794 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8795 4 + POINTER_DWORDS
);
8801 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8803 if (ctx
->ExecuteFlag
) {
8804 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8805 (program
, location
, count
, transpose
, v
));
8809 static void GLAPIENTRY
8810 save_ClipControl(GLenum origin
, GLenum depth
)
8812 GET_CURRENT_CONTEXT(ctx
);
8814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8815 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8820 if (ctx
->ExecuteFlag
) {
8821 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8825 static void GLAPIENTRY
8826 save_ClampColorARB(GLenum target
, GLenum clamp
)
8828 GET_CURRENT_CONTEXT(ctx
);
8830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8831 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8836 if (ctx
->ExecuteFlag
) {
8837 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8841 /** GL_EXT_texture_integer */
8842 static void GLAPIENTRY
8843 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8845 GET_CURRENT_CONTEXT(ctx
);
8847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8848 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8855 if (ctx
->ExecuteFlag
) {
8856 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8860 /** GL_EXT_texture_integer */
8861 static void GLAPIENTRY
8862 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8864 GET_CURRENT_CONTEXT(ctx
);
8866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8867 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8874 if (ctx
->ExecuteFlag
) {
8875 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8879 /** GL_EXT_texture_integer */
8880 static void GLAPIENTRY
8881 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8883 GET_CURRENT_CONTEXT(ctx
);
8885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8886 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8895 if (ctx
->ExecuteFlag
) {
8896 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8900 /** GL_EXT_texture_integer */
8901 static void GLAPIENTRY
8902 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8904 GET_CURRENT_CONTEXT(ctx
);
8906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8907 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8911 n
[3].ui
= params
[0];
8912 n
[4].ui
= params
[1];
8913 n
[5].ui
= params
[2];
8914 n
[6].ui
= params
[3];
8916 if (ctx
->ExecuteFlag
) {
8917 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8921 /* GL_ARB_instanced_arrays */
8922 static void GLAPIENTRY
8923 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8925 GET_CURRENT_CONTEXT(ctx
);
8927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8928 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8933 if (ctx
->ExecuteFlag
) {
8934 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8939 /* GL_NV_texture_barrier */
8940 static void GLAPIENTRY
8941 save_TextureBarrierNV(void)
8943 GET_CURRENT_CONTEXT(ctx
);
8944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8945 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8946 if (ctx
->ExecuteFlag
) {
8947 CALL_TextureBarrierNV(ctx
->Exec
, ());
8952 /* GL_ARB_sampler_objects */
8953 static void GLAPIENTRY
8954 save_BindSampler(GLuint unit
, GLuint sampler
)
8957 GET_CURRENT_CONTEXT(ctx
);
8958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8959 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8964 if (ctx
->ExecuteFlag
) {
8965 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8969 static void GLAPIENTRY
8970 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8973 GET_CURRENT_CONTEXT(ctx
);
8974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8975 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8980 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8986 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8989 if (ctx
->ExecuteFlag
) {
8990 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8994 static void GLAPIENTRY
8995 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8999 parray
[1] = parray
[2] = parray
[3] = 0;
9000 save_SamplerParameteriv(sampler
, pname
, parray
);
9003 static void GLAPIENTRY
9004 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9007 GET_CURRENT_CONTEXT(ctx
);
9008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9009 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9014 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9020 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9023 if (ctx
->ExecuteFlag
) {
9024 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9028 static void GLAPIENTRY
9029 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9033 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9034 save_SamplerParameterfv(sampler
, pname
, parray
);
9037 static void GLAPIENTRY
9038 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9041 GET_CURRENT_CONTEXT(ctx
);
9042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9043 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9048 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9054 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9057 if (ctx
->ExecuteFlag
) {
9058 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9062 static void GLAPIENTRY
9063 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9066 GET_CURRENT_CONTEXT(ctx
);
9067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9068 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9072 n
[3].ui
= params
[0];
9073 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9074 n
[4].ui
= params
[1];
9075 n
[5].ui
= params
[2];
9076 n
[6].ui
= params
[3];
9079 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9082 if (ctx
->ExecuteFlag
) {
9083 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9087 static void GLAPIENTRY
9088 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9091 GET_CURRENT_CONTEXT(ctx
);
9092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9093 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9095 union uint64_pair p
;
9098 n
[2].ui
= p
.uint32
[0];
9099 n
[3].ui
= p
.uint32
[1];
9100 save_pointer(&n
[4], sync
);
9102 if (ctx
->ExecuteFlag
) {
9103 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9108 /** GL_NV_conditional_render */
9109 static void GLAPIENTRY
9110 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9112 GET_CURRENT_CONTEXT(ctx
);
9114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9115 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9120 if (ctx
->ExecuteFlag
) {
9121 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9125 static void GLAPIENTRY
9126 save_EndConditionalRender(void)
9128 GET_CURRENT_CONTEXT(ctx
);
9129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9130 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9131 if (ctx
->ExecuteFlag
) {
9132 CALL_EndConditionalRender(ctx
->Exec
, ());
9136 static void GLAPIENTRY
9137 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9139 GET_CURRENT_CONTEXT(ctx
);
9141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9142 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9148 if (ctx
->ExecuteFlag
) {
9149 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9153 static void GLAPIENTRY
9154 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9155 const GLuint
*indices
)
9157 GET_CURRENT_CONTEXT(ctx
);
9159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9160 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9162 GLint
*indices_copy
= NULL
;
9165 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9166 n
[1].e
= shadertype
;
9168 save_pointer(&n
[3], indices_copy
);
9170 if (ctx
->ExecuteFlag
) {
9171 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9175 /** GL_EXT_window_rectangles */
9176 static void GLAPIENTRY
9177 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9179 GET_CURRENT_CONTEXT(ctx
);
9181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9182 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9184 GLint
*box_copy
= NULL
;
9187 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9190 save_pointer(&n
[3], box_copy
);
9192 if (ctx
->ExecuteFlag
) {
9193 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9198 /** GL_NV_conservative_raster */
9199 static void GLAPIENTRY
9200 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9202 GET_CURRENT_CONTEXT(ctx
);
9204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9205 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9210 if (ctx
->ExecuteFlag
) {
9211 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9215 /** GL_NV_conservative_raster_dilate */
9216 static void GLAPIENTRY
9217 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9219 GET_CURRENT_CONTEXT(ctx
);
9221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9222 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9227 if (ctx
->ExecuteFlag
) {
9228 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9232 /** GL_NV_conservative_raster_pre_snap_triangles */
9233 static void GLAPIENTRY
9234 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9236 GET_CURRENT_CONTEXT(ctx
);
9238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9239 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9244 if (ctx
->ExecuteFlag
) {
9245 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9249 /** GL_EXT_direct_state_access */
9251 static void GLAPIENTRY
9252 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9254 GET_CURRENT_CONTEXT(ctx
);
9256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9257 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9259 n
[1].e
= matrixMode
;
9260 for (unsigned i
= 0; i
< 16; i
++) {
9264 if (ctx
->ExecuteFlag
) {
9265 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9269 static void GLAPIENTRY
9270 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9273 for (unsigned i
= 0; i
< 16; i
++) {
9274 f
[i
] = (GLfloat
) m
[i
];
9276 save_MatrixLoadfEXT(matrixMode
, f
);
9279 static void GLAPIENTRY
9280 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9282 GET_CURRENT_CONTEXT(ctx
);
9284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9285 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9287 n
[1].e
= matrixMode
;
9288 for (unsigned i
= 0; i
< 16; i
++) {
9292 if (ctx
->ExecuteFlag
) {
9293 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9297 static void GLAPIENTRY
9298 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9301 for (unsigned i
= 0; i
< 16; i
++) {
9302 f
[i
] = (GLfloat
) m
[i
];
9304 save_MatrixMultfEXT(matrixMode
, f
);
9307 static void GLAPIENTRY
9308 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9310 GET_CURRENT_CONTEXT(ctx
);
9312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9313 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9315 n
[1].e
= matrixMode
;
9321 if (ctx
->ExecuteFlag
) {
9322 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9326 static void GLAPIENTRY
9327 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9329 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9332 static void GLAPIENTRY
9333 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9335 GET_CURRENT_CONTEXT(ctx
);
9337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9338 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9340 n
[1].e
= matrixMode
;
9345 if (ctx
->ExecuteFlag
) {
9346 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9350 static void GLAPIENTRY
9351 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9353 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9356 static void GLAPIENTRY
9357 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9359 GET_CURRENT_CONTEXT(ctx
);
9361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9362 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9364 n
[1].e
= matrixMode
;
9369 if (ctx
->ExecuteFlag
) {
9370 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9374 static void GLAPIENTRY
9375 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9377 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9380 static void GLAPIENTRY
9381 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9383 GET_CURRENT_CONTEXT(ctx
);
9385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9386 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9388 n
[1].e
= matrixMode
;
9390 if (ctx
->ExecuteFlag
) {
9391 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9395 static void GLAPIENTRY
9396 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9397 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9399 GET_CURRENT_CONTEXT(ctx
);
9401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9402 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9404 n
[1].e
= matrixMode
;
9405 n
[2].f
= (GLfloat
) left
;
9406 n
[3].f
= (GLfloat
) right
;
9407 n
[4].f
= (GLfloat
) bottom
;
9408 n
[5].f
= (GLfloat
) top
;
9409 n
[6].f
= (GLfloat
) nearval
;
9410 n
[7].f
= (GLfloat
) farval
;
9412 if (ctx
->ExecuteFlag
) {
9413 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9418 static void GLAPIENTRY
9419 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9420 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9422 GET_CURRENT_CONTEXT(ctx
);
9424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9425 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9427 n
[1].e
= matrixMode
;
9428 n
[2].f
= (GLfloat
) left
;
9429 n
[3].f
= (GLfloat
) right
;
9430 n
[4].f
= (GLfloat
) bottom
;
9431 n
[5].f
= (GLfloat
) top
;
9432 n
[6].f
= (GLfloat
) nearval
;
9433 n
[7].f
= (GLfloat
) farval
;
9435 if (ctx
->ExecuteFlag
) {
9436 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9440 static void GLAPIENTRY
9441 save_MatrixPushEXT(GLenum matrixMode
)
9443 GET_CURRENT_CONTEXT(ctx
);
9445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9446 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9448 n
[1].e
= matrixMode
;
9450 if (ctx
->ExecuteFlag
) {
9451 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9455 static void GLAPIENTRY
9456 save_MatrixPopEXT(GLenum matrixMode
)
9458 GET_CURRENT_CONTEXT(ctx
);
9460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9461 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9463 n
[1].e
= matrixMode
;
9465 if (ctx
->ExecuteFlag
) {
9466 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9470 static void GLAPIENTRY
9471 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9474 _math_transposef(tm
, m
);
9475 save_MatrixLoadfEXT(matrixMode
, tm
);
9478 static void GLAPIENTRY
9479 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9482 _math_transposefd(tm
, m
);
9483 save_MatrixLoadfEXT(matrixMode
, tm
);
9486 static void GLAPIENTRY
9487 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9490 _math_transposef(tm
, m
);
9491 save_MatrixMultfEXT(matrixMode
, tm
);
9494 static void GLAPIENTRY
9495 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9498 _math_transposefd(tm
, m
);
9499 save_MatrixMultfEXT(matrixMode
, tm
);
9502 static void GLAPIENTRY
9503 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9504 const GLfloat
*params
)
9506 GET_CURRENT_CONTEXT(ctx
);
9508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9509 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9519 if (ctx
->ExecuteFlag
) {
9520 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9525 static void GLAPIENTRY
9526 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9530 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9531 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9534 static void GLAPIENTRY
9535 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9537 GET_CURRENT_CONTEXT(ctx
);
9539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9540 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9550 if (ctx
->ExecuteFlag
) {
9551 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9555 static void GLAPIENTRY
9556 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9560 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9561 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9564 static void GLAPIENTRY
9565 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9566 GLint level
, GLint components
,
9567 GLsizei width
, GLint border
,
9568 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9570 GET_CURRENT_CONTEXT(ctx
);
9571 if (target
== GL_PROXY_TEXTURE_1D
) {
9572 /* don't compile, execute immediately */
9573 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9574 border
, format
, type
, pixels
));
9578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9579 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9584 n
[4].i
= components
;
9585 n
[5].i
= (GLint
) width
;
9590 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9591 pixels
, &ctx
->Unpack
));
9593 if (ctx
->ExecuteFlag
) {
9594 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9595 border
, format
, type
, pixels
));
9601 static void GLAPIENTRY
9602 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9603 GLint level
, GLint components
,
9604 GLsizei width
, GLsizei height
, GLint border
,
9605 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9607 GET_CURRENT_CONTEXT(ctx
);
9608 if (target
== GL_PROXY_TEXTURE_2D
) {
9609 /* don't compile, execute immediately */
9610 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9611 height
, border
, format
, type
, pixels
));
9615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9616 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9621 n
[4].i
= components
;
9622 n
[5].i
= (GLint
) width
;
9623 n
[6].i
= (GLint
) height
;
9627 save_pointer(&n
[10],
9628 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9629 pixels
, &ctx
->Unpack
));
9631 if (ctx
->ExecuteFlag
) {
9632 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9633 height
, border
, format
, type
, pixels
));
9639 static void GLAPIENTRY
9640 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9641 GLint level
, GLint internalFormat
,
9642 GLsizei width
, GLsizei height
, GLsizei depth
,
9644 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9646 GET_CURRENT_CONTEXT(ctx
);
9647 if (target
== GL_PROXY_TEXTURE_3D
) {
9648 /* don't compile, execute immediately */
9649 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9650 height
, depth
, border
, format
, type
,
9655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9656 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9661 n
[4].i
= (GLint
) internalFormat
;
9662 n
[5].i
= (GLint
) width
;
9663 n
[6].i
= (GLint
) height
;
9664 n
[7].i
= (GLint
) depth
;
9668 save_pointer(&n
[11],
9669 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9670 pixels
, &ctx
->Unpack
));
9672 if (ctx
->ExecuteFlag
) {
9673 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9674 width
, height
, depth
, border
, format
,
9681 static void GLAPIENTRY
9682 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9683 GLsizei width
, GLenum format
, GLenum type
,
9684 const GLvoid
* pixels
)
9686 GET_CURRENT_CONTEXT(ctx
);
9689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9691 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9697 n
[5].i
= (GLint
) width
;
9701 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9702 pixels
, &ctx
->Unpack
));
9704 if (ctx
->ExecuteFlag
) {
9705 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9706 format
, type
, pixels
));
9711 static void GLAPIENTRY
9712 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9713 GLint xoffset
, GLint yoffset
,
9714 GLsizei width
, GLsizei height
,
9715 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9717 GET_CURRENT_CONTEXT(ctx
);
9720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9722 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9729 n
[6].i
= (GLint
) width
;
9730 n
[7].i
= (GLint
) height
;
9733 save_pointer(&n
[10],
9734 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9735 pixels
, &ctx
->Unpack
));
9737 if (ctx
->ExecuteFlag
) {
9738 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9739 width
, height
, format
, type
, pixels
));
9744 static void GLAPIENTRY
9745 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9746 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9747 GLsizei width
, GLsizei height
, GLsizei depth
,
9748 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9750 GET_CURRENT_CONTEXT(ctx
);
9753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9755 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9763 n
[7].i
= (GLint
) width
;
9764 n
[8].i
= (GLint
) height
;
9765 n
[9].i
= (GLint
) depth
;
9768 save_pointer(&n
[12],
9769 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9770 pixels
, &ctx
->Unpack
));
9772 if (ctx
->ExecuteFlag
) {
9773 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9774 xoffset
, yoffset
, zoffset
,
9775 width
, height
, depth
, format
, type
,
9780 static void GLAPIENTRY
9781 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9782 GLenum internalformat
, GLint x
, GLint y
,
9783 GLsizei width
, GLint border
)
9785 GET_CURRENT_CONTEXT(ctx
);
9787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9788 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9793 n
[4].e
= internalformat
;
9799 if (ctx
->ExecuteFlag
) {
9800 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9801 internalformat
, x
, y
,
9806 static void GLAPIENTRY
9807 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9808 GLenum internalformat
,
9809 GLint x
, GLint y
, GLsizei width
,
9810 GLsizei height
, GLint border
)
9812 GET_CURRENT_CONTEXT(ctx
);
9814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9815 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9820 n
[4].e
= internalformat
;
9827 if (ctx
->ExecuteFlag
) {
9828 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9829 internalformat
, x
, y
,
9830 width
, height
, border
));
9834 static void GLAPIENTRY
9835 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9836 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9838 GET_CURRENT_CONTEXT(ctx
);
9840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9841 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9851 if (ctx
->ExecuteFlag
) {
9852 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9853 (texture
, target
, level
, xoffset
, x
, y
, width
));
9857 static void GLAPIENTRY
9858 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9859 GLint xoffset
, GLint yoffset
,
9860 GLint x
, GLint y
, GLsizei width
, GLint height
)
9862 GET_CURRENT_CONTEXT(ctx
);
9864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9865 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9877 if (ctx
->ExecuteFlag
) {
9878 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9880 x
, y
, width
, height
));
9885 static void GLAPIENTRY
9886 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9887 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9888 GLint x
, GLint y
, GLsizei width
, GLint height
)
9890 GET_CURRENT_CONTEXT(ctx
);
9892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9893 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9906 if (ctx
->ExecuteFlag
) {
9907 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9908 xoffset
, yoffset
, zoffset
,
9909 x
, y
, width
, height
));
9914 static void GLAPIENTRY
9915 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9917 GET_CURRENT_CONTEXT(ctx
);
9919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9920 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9926 if (ctx
->ExecuteFlag
) {
9927 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9932 static void GLAPIENTRY
9933 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9934 const GLfloat
*params
)
9936 GET_CURRENT_CONTEXT(ctx
);
9938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9939 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
9949 if (ctx
->ExecuteFlag
) {
9950 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9955 static void GLAPIENTRY
9956 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
9960 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9961 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
9964 static void GLAPIENTRY
9965 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
9967 GET_CURRENT_CONTEXT(ctx
);
9969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9970 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
9980 if (ctx
->ExecuteFlag
) {
9981 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9985 static void GLAPIENTRY
9986 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
9990 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9991 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
9995 static void GLAPIENTRY
9996 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
9998 GET_CURRENT_CONTEXT(ctx
);
10000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10001 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10006 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10007 n
[4].f
= params
[0];
10008 n
[5].f
= params
[1];
10009 n
[6].f
= params
[2];
10010 n
[7].f
= params
[3];
10013 n
[4].f
= params
[0];
10014 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10017 if (ctx
->ExecuteFlag
) {
10018 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10023 static void GLAPIENTRY
10024 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10027 parray
[0] = (GLfloat
) param
;
10028 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10029 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10033 static void GLAPIENTRY
10034 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10037 p
[0] = (GLfloat
) param
;
10038 p
[1] = p
[2] = p
[3] = 0.0F
;
10039 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10043 static void GLAPIENTRY
10044 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10047 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10048 p
[0] = INT_TO_FLOAT(param
[0]);
10049 p
[1] = INT_TO_FLOAT(param
[1]);
10050 p
[2] = INT_TO_FLOAT(param
[2]);
10051 p
[3] = INT_TO_FLOAT(param
[3]);
10054 p
[0] = (GLfloat
) param
[0];
10055 p
[1] = p
[2] = p
[3] = 0.0F
;
10057 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10061 static void GLAPIENTRY
10062 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10063 GLint yoffset
, GLsizei width
, GLsizei height
,
10064 GLenum format
, GLsizei imageSize
,
10065 const GLvoid
* data
)
10068 GET_CURRENT_CONTEXT(ctx
);
10069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10071 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10072 9 + POINTER_DWORDS
);
10079 n
[6].i
= (GLint
) width
;
10080 n
[7].i
= (GLint
) height
;
10082 n
[9].i
= imageSize
;
10083 save_pointer(&n
[10],
10084 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10086 if (ctx
->ExecuteFlag
) {
10087 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10088 (texture
, target
, level
, xoffset
, yoffset
,
10089 width
, height
, format
, imageSize
, data
));
10095 * Save an error-generating command into display list.
10097 * KW: Will appear in the list before the vertex buffer containing the
10098 * command that provoked the error. I don't see this as a problem.
10101 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10104 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
10107 save_pointer(&n
[2], (void *) s
);
10108 /* note: the data/string here doesn't have to be freed in
10109 * _mesa_delete_list() since the string is never dynamically
10117 * Compile an error into current display list.
10120 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10122 if (ctx
->CompileFlag
)
10123 save_error(ctx
, error
, s
);
10124 if (ctx
->ExecuteFlag
)
10125 _mesa_error(ctx
, error
, "%s", s
);
10130 * Test if ID names a display list.
10133 islist(struct gl_context
*ctx
, GLuint list
)
10135 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
10145 /**********************************************************************/
10146 /* Display list execution */
10147 /**********************************************************************/
10151 * Execute a display list. Note that the ListBase offset must have already
10152 * been added before calling this function. I.e. the list argument is
10153 * the absolute list number, not relative to ListBase.
10154 * \param list - display list number
10157 execute_list(struct gl_context
*ctx
, GLuint list
)
10159 struct gl_display_list
*dlist
;
10163 if (list
== 0 || !islist(ctx
, list
))
10166 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10167 /* raise an error? */
10171 dlist
= _mesa_lookup_list(ctx
, list
);
10175 ctx
->ListState
.CallDepth
++;
10177 vbo_save_BeginCallList(ctx
, dlist
);
10183 const OpCode opcode
= n
[0].opcode
;
10185 if (is_ext_opcode(opcode
)) {
10186 n
+= ext_opcode_execute(ctx
, n
);
10191 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10194 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10196 case OPCODE_ALPHA_FUNC
:
10197 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10199 case OPCODE_BIND_TEXTURE
:
10200 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10202 case OPCODE_BITMAP
:
10204 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10205 ctx
->Unpack
= ctx
->DefaultPacking
;
10206 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10207 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10208 get_pointer(&n
[7])));
10209 ctx
->Unpack
= save
; /* restore */
10212 case OPCODE_BLEND_COLOR
:
10213 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10215 case OPCODE_BLEND_EQUATION
:
10216 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10218 case OPCODE_BLEND_EQUATION_SEPARATE
:
10219 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10221 case OPCODE_BLEND_FUNC_SEPARATE
:
10222 CALL_BlendFuncSeparate(ctx
->Exec
,
10223 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10226 case OPCODE_BLEND_FUNC_I
:
10227 /* GL_ARB_draw_buffers_blend */
10228 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10230 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10231 /* GL_ARB_draw_buffers_blend */
10232 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10235 case OPCODE_BLEND_EQUATION_I
:
10236 /* GL_ARB_draw_buffers_blend */
10237 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10239 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10240 /* GL_ARB_draw_buffers_blend */
10241 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10242 (n
[1].ui
, n
[2].e
, n
[3].e
));
10245 case OPCODE_CALL_LIST
:
10246 /* Generated by glCallList(), don't add ListBase */
10247 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10248 execute_list(ctx
, n
[1].ui
);
10251 case OPCODE_CALL_LISTS
:
10252 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10253 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10257 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10259 case OPCODE_CLEAR_BUFFER_IV
:
10266 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10269 case OPCODE_CLEAR_BUFFER_UIV
:
10272 value
[0] = n
[3].ui
;
10273 value
[1] = n
[4].ui
;
10274 value
[2] = n
[5].ui
;
10275 value
[3] = n
[6].ui
;
10276 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10279 case OPCODE_CLEAR_BUFFER_FV
:
10286 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10289 case OPCODE_CLEAR_BUFFER_FI
:
10290 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10292 case OPCODE_CLEAR_COLOR
:
10293 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10295 case OPCODE_CLEAR_ACCUM
:
10296 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10298 case OPCODE_CLEAR_DEPTH
:
10299 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10301 case OPCODE_CLEAR_INDEX
:
10302 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10304 case OPCODE_CLEAR_STENCIL
:
10305 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10307 case OPCODE_CLIP_PLANE
:
10314 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10317 case OPCODE_COLOR_MASK
:
10318 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10320 case OPCODE_COLOR_MASK_INDEXED
:
10321 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10324 case OPCODE_COLOR_MATERIAL
:
10325 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10327 case OPCODE_COPY_PIXELS
:
10328 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10329 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10332 case OPCODE_COPY_TEX_IMAGE1D
:
10333 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10334 n
[5].i
, n
[6].i
, n
[7].i
));
10336 case OPCODE_COPY_TEX_IMAGE2D
:
10337 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10338 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10340 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10341 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10342 n
[4].i
, n
[5].i
, n
[6].i
));
10344 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10345 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10346 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10349 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10350 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10351 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10354 case OPCODE_CULL_FACE
:
10355 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10357 case OPCODE_DEPTH_FUNC
:
10358 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10360 case OPCODE_DEPTH_MASK
:
10361 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10363 case OPCODE_DEPTH_RANGE
:
10364 CALL_DepthRange(ctx
->Exec
,
10365 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10367 case OPCODE_DISABLE
:
10368 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10370 case OPCODE_DISABLE_INDEXED
:
10371 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10373 case OPCODE_DRAW_BUFFER
:
10374 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10376 case OPCODE_DRAW_PIXELS
:
10378 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10379 ctx
->Unpack
= ctx
->DefaultPacking
;
10380 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10381 get_pointer(&n
[5])));
10382 ctx
->Unpack
= save
; /* restore */
10385 case OPCODE_ENABLE
:
10386 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10388 case OPCODE_ENABLE_INDEXED
:
10389 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10391 case OPCODE_EVALMESH1
:
10392 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10394 case OPCODE_EVALMESH2
:
10395 CALL_EvalMesh2(ctx
->Exec
,
10396 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10405 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10408 case OPCODE_FRONT_FACE
:
10409 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10411 case OPCODE_FRUSTUM
:
10412 CALL_Frustum(ctx
->Exec
,
10413 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10416 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10418 case OPCODE_INDEX_MASK
:
10419 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10421 case OPCODE_INIT_NAMES
:
10422 CALL_InitNames(ctx
->Exec
, ());
10431 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10434 case OPCODE_LIGHT_MODEL
:
10441 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10444 case OPCODE_LINE_STIPPLE
:
10445 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10447 case OPCODE_LINE_WIDTH
:
10448 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10450 case OPCODE_LIST_BASE
:
10451 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10453 case OPCODE_LOAD_IDENTITY
:
10454 CALL_LoadIdentity(ctx
->Exec
, ());
10456 case OPCODE_LOAD_MATRIX
:
10457 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10458 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10460 case OPCODE_LOAD_NAME
:
10461 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10463 case OPCODE_LOGIC_OP
:
10464 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10468 GLenum target
= n
[1].e
;
10469 GLint ustride
= _mesa_evaluator_components(target
);
10470 GLint uorder
= n
[5].i
;
10471 GLfloat u1
= n
[2].f
;
10472 GLfloat u2
= n
[3].f
;
10473 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10474 (GLfloat
*) get_pointer(&n
[6])));
10479 GLenum target
= n
[1].e
;
10480 GLfloat u1
= n
[2].f
;
10481 GLfloat u2
= n
[3].f
;
10482 GLfloat v1
= n
[4].f
;
10483 GLfloat v2
= n
[5].f
;
10484 GLint ustride
= n
[6].i
;
10485 GLint vstride
= n
[7].i
;
10486 GLint uorder
= n
[8].i
;
10487 GLint vorder
= n
[9].i
;
10488 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10489 v1
, v2
, vstride
, vorder
,
10490 (GLfloat
*) get_pointer(&n
[10])));
10493 case OPCODE_MAPGRID1
:
10494 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10496 case OPCODE_MAPGRID2
:
10497 CALL_MapGrid2f(ctx
->Exec
,
10498 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10500 case OPCODE_MATRIX_MODE
:
10501 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10503 case OPCODE_MULT_MATRIX
:
10504 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10507 CALL_Ortho(ctx
->Exec
,
10508 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10510 case OPCODE_PASSTHROUGH
:
10511 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10513 case OPCODE_PATCH_PARAMETER_I
:
10514 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10516 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10519 params
[0] = n
[2].f
;
10520 params
[1] = n
[3].f
;
10521 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10524 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10527 params
[0] = n
[2].f
;
10528 params
[1] = n
[3].f
;
10529 params
[2] = n
[4].f
;
10530 params
[3] = n
[5].f
;
10531 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10534 case OPCODE_PIXEL_MAP
:
10535 CALL_PixelMapfv(ctx
->Exec
,
10536 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10538 case OPCODE_PIXEL_TRANSFER
:
10539 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10541 case OPCODE_PIXEL_ZOOM
:
10542 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10544 case OPCODE_POINT_SIZE
:
10545 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10547 case OPCODE_POINT_PARAMETERS
:
10550 params
[0] = n
[2].f
;
10551 params
[1] = n
[3].f
;
10552 params
[2] = n
[4].f
;
10553 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10556 case OPCODE_POLYGON_MODE
:
10557 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10559 case OPCODE_POLYGON_STIPPLE
:
10561 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10562 ctx
->Unpack
= ctx
->DefaultPacking
;
10563 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10564 ctx
->Unpack
= save
; /* restore */
10567 case OPCODE_POLYGON_OFFSET
:
10568 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10570 case OPCODE_POLYGON_OFFSET_CLAMP
:
10571 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10573 case OPCODE_POP_ATTRIB
:
10574 CALL_PopAttrib(ctx
->Exec
, ());
10576 case OPCODE_POP_MATRIX
:
10577 CALL_PopMatrix(ctx
->Exec
, ());
10579 case OPCODE_POP_NAME
:
10580 CALL_PopName(ctx
->Exec
, ());
10582 case OPCODE_PRIORITIZE_TEXTURE
:
10583 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10585 case OPCODE_PUSH_ATTRIB
:
10586 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10588 case OPCODE_PUSH_MATRIX
:
10589 CALL_PushMatrix(ctx
->Exec
, ());
10591 case OPCODE_PUSH_NAME
:
10592 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10594 case OPCODE_RASTER_POS
:
10595 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10597 case OPCODE_READ_BUFFER
:
10598 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10600 case OPCODE_ROTATE
:
10601 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10604 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10606 case OPCODE_SCISSOR
:
10607 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10609 case OPCODE_SHADE_MODEL
:
10610 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10612 case OPCODE_PROVOKING_VERTEX
:
10613 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10615 case OPCODE_STENCIL_FUNC
:
10616 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10618 case OPCODE_STENCIL_MASK
:
10619 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10621 case OPCODE_STENCIL_OP
:
10622 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10624 case OPCODE_STENCIL_FUNC_SEPARATE
:
10625 CALL_StencilFuncSeparate(ctx
->Exec
,
10626 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10628 case OPCODE_STENCIL_MASK_SEPARATE
:
10629 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10631 case OPCODE_STENCIL_OP_SEPARATE
:
10632 CALL_StencilOpSeparate(ctx
->Exec
,
10633 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10635 case OPCODE_TEXENV
:
10638 params
[0] = n
[3].f
;
10639 params
[1] = n
[4].f
;
10640 params
[2] = n
[5].f
;
10641 params
[3] = n
[6].f
;
10642 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10645 case OPCODE_TEXGEN
:
10648 params
[0] = n
[3].f
;
10649 params
[1] = n
[4].f
;
10650 params
[2] = n
[5].f
;
10651 params
[3] = n
[6].f
;
10652 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10655 case OPCODE_TEXPARAMETER
:
10658 params
[0] = n
[3].f
;
10659 params
[1] = n
[4].f
;
10660 params
[2] = n
[5].f
;
10661 params
[3] = n
[6].f
;
10662 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10665 case OPCODE_TEX_IMAGE1D
:
10667 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10668 ctx
->Unpack
= ctx
->DefaultPacking
;
10669 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10670 n
[2].i
, /* level */
10671 n
[3].i
, /* components */
10672 n
[4].i
, /* width */
10673 n
[5].e
, /* border */
10674 n
[6].e
, /* format */
10676 get_pointer(&n
[8])));
10677 ctx
->Unpack
= save
; /* restore */
10680 case OPCODE_TEX_IMAGE2D
:
10682 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10683 ctx
->Unpack
= ctx
->DefaultPacking
;
10684 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10685 n
[2].i
, /* level */
10686 n
[3].i
, /* components */
10687 n
[4].i
, /* width */
10688 n
[5].i
, /* height */
10689 n
[6].e
, /* border */
10690 n
[7].e
, /* format */
10692 get_pointer(&n
[9])));
10693 ctx
->Unpack
= save
; /* restore */
10696 case OPCODE_TEX_IMAGE3D
:
10698 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10699 ctx
->Unpack
= ctx
->DefaultPacking
;
10700 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10701 n
[2].i
, /* level */
10702 n
[3].i
, /* components */
10703 n
[4].i
, /* width */
10704 n
[5].i
, /* height */
10705 n
[6].i
, /* depth */
10706 n
[7].e
, /* border */
10707 n
[8].e
, /* format */
10709 get_pointer(&n
[10])));
10710 ctx
->Unpack
= save
; /* restore */
10713 case OPCODE_TEX_SUB_IMAGE1D
:
10715 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10716 ctx
->Unpack
= ctx
->DefaultPacking
;
10717 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10719 n
[6].e
, get_pointer(&n
[7])));
10720 ctx
->Unpack
= save
; /* restore */
10723 case OPCODE_TEX_SUB_IMAGE2D
:
10725 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10726 ctx
->Unpack
= ctx
->DefaultPacking
;
10727 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10729 n
[6].i
, n
[7].e
, n
[8].e
,
10730 get_pointer(&n
[9])));
10731 ctx
->Unpack
= save
; /* restore */
10734 case OPCODE_TEX_SUB_IMAGE3D
:
10736 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10737 ctx
->Unpack
= ctx
->DefaultPacking
;
10738 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10739 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10740 n
[8].i
, n
[9].e
, n
[10].e
,
10741 get_pointer(&n
[11])));
10742 ctx
->Unpack
= save
; /* restore */
10745 case OPCODE_TRANSLATE
:
10746 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10748 case OPCODE_VIEWPORT
:
10749 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10750 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10752 case OPCODE_WINDOW_POS
:
10753 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10755 case OPCODE_VIEWPORT_ARRAY_V
:
10756 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10757 get_pointer(&n
[3])));
10759 case OPCODE_VIEWPORT_INDEXED_F
:
10760 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10763 case OPCODE_VIEWPORT_INDEXED_FV
: {
10769 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
10772 case OPCODE_SCISSOR_ARRAY_V
:
10773 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10774 get_pointer(&n
[3])));
10776 case OPCODE_SCISSOR_INDEXED
:
10777 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
10780 case OPCODE_SCISSOR_INDEXED_V
: {
10786 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
10789 case OPCODE_DEPTH_ARRAY_V
:
10790 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10791 get_pointer(&n
[3])));
10793 case OPCODE_DEPTH_INDEXED
:
10794 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
10796 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
10797 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
10799 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
10800 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10801 n
[4].i
, n
[5].i
, n
[6].i
,
10802 get_pointer(&n
[7])));
10804 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
10805 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10806 n
[4].i
, n
[5].i
, n
[6].i
,
10807 n
[7].i
, get_pointer(&n
[8])));
10809 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
10810 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10811 n
[4].i
, n
[5].i
, n
[6].i
,
10813 get_pointer(&n
[9])));
10815 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
10816 CALL_CompressedTexSubImage1D(ctx
->Exec
,
10817 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10819 get_pointer(&n
[7])));
10821 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
10822 CALL_CompressedTexSubImage2D(ctx
->Exec
,
10823 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10824 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
10825 get_pointer(&n
[9])));
10827 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
10828 CALL_CompressedTexSubImage3D(ctx
->Exec
,
10829 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10830 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10832 get_pointer(&n
[11])));
10834 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
10835 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
10837 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
10838 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10840 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
10841 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10843 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
10844 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
10845 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
10848 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
10849 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
10851 case OPCODE_DEPTH_BOUNDS_EXT
:
10852 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10854 case OPCODE_PROGRAM_STRING_ARB
:
10855 CALL_ProgramStringARB(ctx
->Exec
,
10856 (n
[1].e
, n
[2].e
, n
[3].i
,
10857 get_pointer(&n
[4])));
10859 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
10860 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
10864 case OPCODE_BEGIN_QUERY_ARB
:
10865 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10867 case OPCODE_END_QUERY_ARB
:
10868 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
10870 case OPCODE_QUERY_COUNTER
:
10871 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10873 case OPCODE_BEGIN_QUERY_INDEXED
:
10874 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
10876 case OPCODE_END_QUERY_INDEXED
:
10877 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10879 case OPCODE_DRAW_BUFFERS_ARB
:
10881 GLenum buffers
[MAX_DRAW_BUFFERS
];
10882 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
10883 for (i
= 0; i
< count
; i
++)
10884 buffers
[i
] = n
[2 + i
].e
;
10885 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
10888 case OPCODE_BLIT_FRAMEBUFFER
:
10889 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
10890 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10893 case OPCODE_PRIMITIVE_RESTART_NV
:
10894 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10897 case OPCODE_USE_PROGRAM
:
10898 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10900 case OPCODE_UNIFORM_1F
:
10901 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10903 case OPCODE_UNIFORM_2F
:
10904 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10906 case OPCODE_UNIFORM_3F
:
10907 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10909 case OPCODE_UNIFORM_4F
:
10910 CALL_Uniform4f(ctx
->Exec
,
10911 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10913 case OPCODE_UNIFORM_1FV
:
10914 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10916 case OPCODE_UNIFORM_2FV
:
10917 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10919 case OPCODE_UNIFORM_3FV
:
10920 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10922 case OPCODE_UNIFORM_4FV
:
10923 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10925 case OPCODE_UNIFORM_1D
: {
10926 union float64_pair x
;
10928 x
.uint32
[0] = n
[2].ui
;
10929 x
.uint32
[1] = n
[3].ui
;
10931 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10934 case OPCODE_UNIFORM_2D
: {
10935 union float64_pair x
;
10936 union float64_pair y
;
10938 x
.uint32
[0] = n
[2].ui
;
10939 x
.uint32
[1] = n
[3].ui
;
10940 y
.uint32
[0] = n
[4].ui
;
10941 y
.uint32
[1] = n
[5].ui
;
10943 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10946 case OPCODE_UNIFORM_3D
: {
10947 union float64_pair x
;
10948 union float64_pair y
;
10949 union float64_pair z
;
10951 x
.uint32
[0] = n
[2].ui
;
10952 x
.uint32
[1] = n
[3].ui
;
10953 y
.uint32
[0] = n
[4].ui
;
10954 y
.uint32
[1] = n
[5].ui
;
10955 z
.uint32
[0] = n
[6].ui
;
10956 z
.uint32
[1] = n
[7].ui
;
10958 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10961 case OPCODE_UNIFORM_4D
: {
10962 union float64_pair x
;
10963 union float64_pair y
;
10964 union float64_pair z
;
10965 union float64_pair w
;
10967 x
.uint32
[0] = n
[2].ui
;
10968 x
.uint32
[1] = n
[3].ui
;
10969 y
.uint32
[0] = n
[4].ui
;
10970 y
.uint32
[1] = n
[5].ui
;
10971 z
.uint32
[0] = n
[6].ui
;
10972 z
.uint32
[1] = n
[7].ui
;
10973 w
.uint32
[0] = n
[8].ui
;
10974 w
.uint32
[1] = n
[9].ui
;
10976 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10979 case OPCODE_UNIFORM_1DV
:
10980 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10982 case OPCODE_UNIFORM_2DV
:
10983 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10985 case OPCODE_UNIFORM_3DV
:
10986 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10988 case OPCODE_UNIFORM_4DV
:
10989 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10991 case OPCODE_UNIFORM_1I
:
10992 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10994 case OPCODE_UNIFORM_2I
:
10995 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10997 case OPCODE_UNIFORM_3I
:
10998 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11000 case OPCODE_UNIFORM_4I
:
11001 CALL_Uniform4i(ctx
->Exec
,
11002 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11004 case OPCODE_UNIFORM_1IV
:
11005 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11007 case OPCODE_UNIFORM_2IV
:
11008 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11010 case OPCODE_UNIFORM_3IV
:
11011 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11013 case OPCODE_UNIFORM_4IV
:
11014 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11016 case OPCODE_UNIFORM_1UI
:
11017 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11019 case OPCODE_UNIFORM_2UI
:
11020 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11022 case OPCODE_UNIFORM_3UI
:
11023 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11025 case OPCODE_UNIFORM_4UI
:
11026 CALL_Uniform4ui(ctx
->Exec
,
11027 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11029 case OPCODE_UNIFORM_1UIV
:
11030 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11032 case OPCODE_UNIFORM_2UIV
:
11033 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11035 case OPCODE_UNIFORM_3UIV
:
11036 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11038 case OPCODE_UNIFORM_4UIV
:
11039 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11041 case OPCODE_UNIFORM_MATRIX22
:
11042 CALL_UniformMatrix2fv(ctx
->Exec
,
11043 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11045 case OPCODE_UNIFORM_MATRIX33
:
11046 CALL_UniformMatrix3fv(ctx
->Exec
,
11047 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11049 case OPCODE_UNIFORM_MATRIX44
:
11050 CALL_UniformMatrix4fv(ctx
->Exec
,
11051 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11053 case OPCODE_UNIFORM_MATRIX23
:
11054 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11055 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11057 case OPCODE_UNIFORM_MATRIX32
:
11058 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11059 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11061 case OPCODE_UNIFORM_MATRIX24
:
11062 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11063 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11065 case OPCODE_UNIFORM_MATRIX42
:
11066 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11067 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11069 case OPCODE_UNIFORM_MATRIX34
:
11070 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11071 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11073 case OPCODE_UNIFORM_MATRIX43
:
11074 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11075 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11077 case OPCODE_UNIFORM_MATRIX22D
:
11078 CALL_UniformMatrix2dv(ctx
->Exec
,
11079 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11081 case OPCODE_UNIFORM_MATRIX33D
:
11082 CALL_UniformMatrix3dv(ctx
->Exec
,
11083 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11085 case OPCODE_UNIFORM_MATRIX44D
:
11086 CALL_UniformMatrix4dv(ctx
->Exec
,
11087 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11089 case OPCODE_UNIFORM_MATRIX23D
:
11090 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11091 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11093 case OPCODE_UNIFORM_MATRIX32D
:
11094 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11095 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11097 case OPCODE_UNIFORM_MATRIX24D
:
11098 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11099 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11101 case OPCODE_UNIFORM_MATRIX42D
:
11102 CALL_UniformMatrix4x2dv(ctx
->Exec
,
11103 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11105 case OPCODE_UNIFORM_MATRIX34D
:
11106 CALL_UniformMatrix3x4dv(ctx
->Exec
,
11107 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11109 case OPCODE_UNIFORM_MATRIX43D
:
11110 CALL_UniformMatrix4x3dv(ctx
->Exec
,
11111 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11114 case OPCODE_USE_PROGRAM_STAGES
:
11115 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11117 case OPCODE_PROGRAM_UNIFORM_1F
:
11118 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
11120 case OPCODE_PROGRAM_UNIFORM_2F
:
11121 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
11123 case OPCODE_PROGRAM_UNIFORM_3F
:
11124 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11125 n
[3].f
, n
[4].f
, n
[5].f
));
11127 case OPCODE_PROGRAM_UNIFORM_4F
:
11128 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11129 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11131 case OPCODE_PROGRAM_UNIFORM_1FV
:
11132 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11133 get_pointer(&n
[4])));
11135 case OPCODE_PROGRAM_UNIFORM_2FV
:
11136 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11137 get_pointer(&n
[4])));
11139 case OPCODE_PROGRAM_UNIFORM_3FV
:
11140 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11141 get_pointer(&n
[4])));
11143 case OPCODE_PROGRAM_UNIFORM_4FV
:
11144 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11145 get_pointer(&n
[4])));
11147 case OPCODE_PROGRAM_UNIFORM_1D
: {
11148 union float64_pair x
;
11150 x
.uint32
[0] = n
[3].ui
;
11151 x
.uint32
[1] = n
[4].ui
;
11153 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11156 case OPCODE_PROGRAM_UNIFORM_2D
: {
11157 union float64_pair x
;
11158 union float64_pair y
;
11160 x
.uint32
[0] = n
[3].ui
;
11161 x
.uint32
[1] = n
[4].ui
;
11162 y
.uint32
[0] = n
[5].ui
;
11163 y
.uint32
[1] = n
[6].ui
;
11165 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11168 case OPCODE_PROGRAM_UNIFORM_3D
: {
11169 union float64_pair x
;
11170 union float64_pair y
;
11171 union float64_pair z
;
11173 x
.uint32
[0] = n
[3].ui
;
11174 x
.uint32
[1] = n
[4].ui
;
11175 y
.uint32
[0] = n
[5].ui
;
11176 y
.uint32
[1] = n
[6].ui
;
11177 z
.uint32
[0] = n
[7].ui
;
11178 z
.uint32
[1] = n
[8].ui
;
11180 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11184 case OPCODE_PROGRAM_UNIFORM_4D
: {
11185 union float64_pair x
;
11186 union float64_pair y
;
11187 union float64_pair z
;
11188 union float64_pair w
;
11190 x
.uint32
[0] = n
[3].ui
;
11191 x
.uint32
[1] = n
[4].ui
;
11192 y
.uint32
[0] = n
[5].ui
;
11193 y
.uint32
[1] = n
[6].ui
;
11194 z
.uint32
[0] = n
[7].ui
;
11195 z
.uint32
[1] = n
[8].ui
;
11196 w
.uint32
[0] = n
[9].ui
;
11197 w
.uint32
[1] = n
[10].ui
;
11199 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11200 x
.d
, y
.d
, z
.d
, w
.d
));
11203 case OPCODE_PROGRAM_UNIFORM_1DV
:
11204 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11205 get_pointer(&n
[4])));
11207 case OPCODE_PROGRAM_UNIFORM_2DV
:
11208 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11209 get_pointer(&n
[4])));
11211 case OPCODE_PROGRAM_UNIFORM_3DV
:
11212 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11213 get_pointer(&n
[4])));
11215 case OPCODE_PROGRAM_UNIFORM_4DV
:
11216 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11217 get_pointer(&n
[4])));
11219 case OPCODE_PROGRAM_UNIFORM_1I
:
11220 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11222 case OPCODE_PROGRAM_UNIFORM_2I
:
11223 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11225 case OPCODE_PROGRAM_UNIFORM_3I
:
11226 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11227 n
[3].i
, n
[4].i
, n
[5].i
));
11229 case OPCODE_PROGRAM_UNIFORM_4I
:
11230 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11231 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11233 case OPCODE_PROGRAM_UNIFORM_1IV
:
11234 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11235 get_pointer(&n
[4])));
11237 case OPCODE_PROGRAM_UNIFORM_2IV
:
11238 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11239 get_pointer(&n
[4])));
11241 case OPCODE_PROGRAM_UNIFORM_3IV
:
11242 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11243 get_pointer(&n
[4])));
11245 case OPCODE_PROGRAM_UNIFORM_4IV
:
11246 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11247 get_pointer(&n
[4])));
11249 case OPCODE_PROGRAM_UNIFORM_1UI
:
11250 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11252 case OPCODE_PROGRAM_UNIFORM_2UI
:
11253 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11254 n
[3].ui
, n
[4].ui
));
11256 case OPCODE_PROGRAM_UNIFORM_3UI
:
11257 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11258 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11260 case OPCODE_PROGRAM_UNIFORM_4UI
:
11261 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11263 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11265 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11266 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11267 get_pointer(&n
[4])));
11269 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11270 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11271 get_pointer(&n
[4])));
11273 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11274 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11275 get_pointer(&n
[4])));
11277 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11278 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11279 get_pointer(&n
[4])));
11281 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11282 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11283 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11284 get_pointer(&n
[5])));
11286 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11287 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11288 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11289 get_pointer(&n
[5])));
11291 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11292 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11293 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11294 get_pointer(&n
[5])));
11296 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11297 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11298 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11299 get_pointer(&n
[5])));
11301 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11302 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11303 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11304 get_pointer(&n
[5])));
11306 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11307 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11308 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11309 get_pointer(&n
[5])));
11311 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11312 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11313 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11314 get_pointer(&n
[5])));
11316 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11317 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11318 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11319 get_pointer(&n
[5])));
11321 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11322 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11323 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11324 get_pointer(&n
[5])));
11326 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11327 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11328 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11329 get_pointer(&n
[5])));
11331 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11332 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11333 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11334 get_pointer(&n
[5])));
11336 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11337 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11338 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11339 get_pointer(&n
[5])));
11341 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11342 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11343 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11344 get_pointer(&n
[5])));
11346 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11347 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11348 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11349 get_pointer(&n
[5])));
11351 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11352 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11353 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11354 get_pointer(&n
[5])));
11356 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11357 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11358 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11359 get_pointer(&n
[5])));
11361 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11362 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11363 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11364 get_pointer(&n
[5])));
11366 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11367 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11368 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11369 get_pointer(&n
[5])));
11372 case OPCODE_CLIP_CONTROL
:
11373 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11376 case OPCODE_CLAMP_COLOR
:
11377 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11380 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11381 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11383 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11384 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11386 case OPCODE_ATTR_1F_NV
:
11387 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11389 case OPCODE_ATTR_2F_NV
:
11390 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11392 case OPCODE_ATTR_3F_NV
:
11393 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11395 case OPCODE_ATTR_4F_NV
:
11396 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11398 case OPCODE_ATTR_1F_ARB
:
11399 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11401 case OPCODE_ATTR_2F_ARB
:
11402 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11404 case OPCODE_ATTR_3F_ARB
:
11405 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11407 case OPCODE_ATTR_4F_ARB
:
11408 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11410 case OPCODE_ATTR_1D
: {
11411 GLdouble
*d
= (GLdouble
*) &n
[2];
11412 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11415 case OPCODE_ATTR_2D
: {
11416 GLdouble
*d
= (GLdouble
*) &n
[2];
11417 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11420 case OPCODE_ATTR_3D
: {
11421 GLdouble
*d
= (GLdouble
*) &n
[2];
11422 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11425 case OPCODE_ATTR_4D
: {
11426 GLdouble
*d
= (GLdouble
*) &n
[2];
11427 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11430 case OPCODE_MATERIAL
:
11431 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11434 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11437 CALL_End(ctx
->Exec
, ());
11440 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11442 case OPCODE_EVAL_C1
:
11443 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11445 case OPCODE_EVAL_C2
:
11446 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11448 case OPCODE_EVAL_P1
:
11449 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11451 case OPCODE_EVAL_P2
:
11452 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11455 /* GL_EXT_texture_integer */
11456 case OPCODE_CLEARCOLOR_I
:
11457 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11459 case OPCODE_CLEARCOLOR_UI
:
11460 CALL_ClearColorIuiEXT(ctx
->Exec
,
11461 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11463 case OPCODE_TEXPARAMETER_I
:
11466 params
[0] = n
[3].i
;
11467 params
[1] = n
[4].i
;
11468 params
[2] = n
[5].i
;
11469 params
[3] = n
[6].i
;
11470 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11473 case OPCODE_TEXPARAMETER_UI
:
11476 params
[0] = n
[3].ui
;
11477 params
[1] = n
[4].ui
;
11478 params
[2] = n
[5].ui
;
11479 params
[3] = n
[6].ui
;
11480 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11484 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11485 /* GL_ARB_instanced_arrays */
11486 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11489 case OPCODE_TEXTURE_BARRIER_NV
:
11490 CALL_TextureBarrierNV(ctx
->Exec
, ());
11493 /* GL_EXT/ARB_transform_feedback */
11494 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11495 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11497 case OPCODE_END_TRANSFORM_FEEDBACK
:
11498 CALL_EndTransformFeedback(ctx
->Exec
, ());
11500 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11501 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11503 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11504 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11506 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11507 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11509 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11510 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11512 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11513 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11514 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11516 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11517 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11518 (n
[1].e
, n
[2].ui
, n
[3].si
));
11520 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11521 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11522 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11526 case OPCODE_BIND_SAMPLER
:
11527 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11529 case OPCODE_SAMPLER_PARAMETERIV
:
11532 params
[0] = n
[3].i
;
11533 params
[1] = n
[4].i
;
11534 params
[2] = n
[5].i
;
11535 params
[3] = n
[6].i
;
11536 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11539 case OPCODE_SAMPLER_PARAMETERFV
:
11542 params
[0] = n
[3].f
;
11543 params
[1] = n
[4].f
;
11544 params
[2] = n
[5].f
;
11545 params
[3] = n
[6].f
;
11546 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11549 case OPCODE_SAMPLER_PARAMETERIIV
:
11552 params
[0] = n
[3].i
;
11553 params
[1] = n
[4].i
;
11554 params
[2] = n
[5].i
;
11555 params
[3] = n
[6].i
;
11556 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11559 case OPCODE_SAMPLER_PARAMETERUIV
:
11562 params
[0] = n
[3].ui
;
11563 params
[1] = n
[4].ui
;
11564 params
[2] = n
[5].ui
;
11565 params
[3] = n
[6].ui
;
11566 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11570 /* ARB_compute_shader */
11571 case OPCODE_DISPATCH_COMPUTE
:
11572 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11576 case OPCODE_WAIT_SYNC
:
11578 union uint64_pair p
;
11579 p
.uint32
[0] = n
[2].ui
;
11580 p
.uint32
[1] = n
[3].ui
;
11581 CALL_WaitSync(ctx
->Exec
,
11582 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11586 /* GL_NV_conditional_render */
11587 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11588 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11590 case OPCODE_END_CONDITIONAL_RENDER
:
11591 CALL_EndConditionalRender(ctx
->Exec
, ());
11594 case OPCODE_UNIFORM_BLOCK_BINDING
:
11595 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11598 case OPCODE_UNIFORM_SUBROUTINES
:
11599 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11600 get_pointer(&n
[3])));
11603 /* GL_EXT_window_rectangles */
11604 case OPCODE_WINDOW_RECTANGLES
:
11605 CALL_WindowRectanglesEXT(
11606 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11609 /* GL_NV_conservative_raster */
11610 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11611 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11614 /* GL_NV_conservative_raster_dilate */
11615 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11616 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11619 /* GL_NV_conservative_raster_pre_snap_triangles */
11620 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11621 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11624 /* GL_EXT_direct_state_access */
11625 case OPCODE_MATRIX_LOAD
:
11626 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11628 case OPCODE_MATRIX_MULT
:
11629 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11631 case OPCODE_MATRIX_ROTATE
:
11632 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11634 case OPCODE_MATRIX_SCALE
:
11635 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11637 case OPCODE_MATRIX_TRANSLATE
:
11638 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11640 case OPCODE_MATRIX_LOAD_IDENTITY
:
11641 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11643 case OPCODE_MATRIX_ORTHO
:
11644 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11645 n
[2].f
, n
[3].f
, n
[4].f
,
11646 n
[5].f
, n
[6].f
, n
[7].f
));
11648 case OPCODE_MATRIX_FRUSTUM
:
11649 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11650 n
[2].f
, n
[3].f
, n
[4].f
,
11651 n
[5].f
, n
[6].f
, n
[7].f
));
11653 case OPCODE_MATRIX_PUSH
:
11654 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11656 case OPCODE_MATRIX_POP
:
11657 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11659 case OPCODE_TEXTUREPARAMETER_F
:
11662 params
[0] = n
[4].f
;
11663 params
[1] = n
[5].f
;
11664 params
[2] = n
[6].f
;
11665 params
[3] = n
[7].f
;
11666 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11669 case OPCODE_TEXTUREPARAMETER_I
:
11672 params
[0] = n
[4].i
;
11673 params
[1] = n
[5].i
;
11674 params
[2] = n
[6].i
;
11675 params
[3] = n
[7].i
;
11676 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11679 case OPCODE_TEXTURE_IMAGE1D
:
11681 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11682 ctx
->Unpack
= ctx
->DefaultPacking
;
11683 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11684 n
[2].e
, /* target */
11685 n
[3].i
, /* level */
11686 n
[4].i
, /* components */
11687 n
[5].i
, /* width */
11688 n
[6].e
, /* border */
11689 n
[7].e
, /* format */
11691 get_pointer(&n
[9])));
11692 ctx
->Unpack
= save
; /* restore */
11695 case OPCODE_TEXTURE_IMAGE2D
:
11697 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11698 ctx
->Unpack
= ctx
->DefaultPacking
;
11699 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11700 n
[2].e
, /* target */
11701 n
[3].i
, /* level */
11702 n
[4].i
, /* components */
11703 n
[5].i
, /* width */
11704 n
[6].i
, /* height */
11705 n
[7].e
, /* border */
11706 n
[8].e
, /* format */
11708 get_pointer(&n
[10])));
11709 ctx
->Unpack
= save
; /* restore */
11712 case OPCODE_TEXTURE_IMAGE3D
:
11714 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11715 ctx
->Unpack
= ctx
->DefaultPacking
;
11716 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11717 n
[2].e
, /* target */
11718 n
[3].i
, /* level */
11719 n
[4].i
, /* components */
11720 n
[5].i
, /* width */
11721 n
[6].i
, /* height */
11722 n
[7].i
, /* depth */
11723 n
[8].e
, /* border */
11724 n
[9].e
, /* format */
11725 n
[10].e
, /* type */
11726 get_pointer(&n
[11])));
11727 ctx
->Unpack
= save
; /* restore */
11730 case OPCODE_TEXTURE_SUB_IMAGE1D
:
11732 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11733 ctx
->Unpack
= ctx
->DefaultPacking
;
11734 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11735 n
[4].i
, n
[5].i
, n
[6].e
,
11736 n
[7].e
, get_pointer(&n
[8])));
11737 ctx
->Unpack
= save
; /* restore */
11740 case OPCODE_TEXTURE_SUB_IMAGE2D
:
11742 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11743 ctx
->Unpack
= ctx
->DefaultPacking
;
11744 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11745 n
[4].i
, n
[5].i
, n
[6].e
,
11746 n
[7].i
, n
[8].e
, n
[9].e
,
11747 get_pointer(&n
[10])));
11748 ctx
->Unpack
= save
;
11751 case OPCODE_TEXTURE_SUB_IMAGE3D
:
11753 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11754 ctx
->Unpack
= ctx
->DefaultPacking
;
11755 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11756 n
[4].i
, n
[5].i
, n
[6].i
,
11757 n
[7].i
, n
[8].i
, n
[9].i
,
11759 get_pointer(&n
[12])));
11760 ctx
->Unpack
= save
; /* restore */
11763 case OPCODE_COPY_TEXTURE_IMAGE1D
:
11764 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11765 n
[4].e
, n
[5].i
, n
[6].i
,
11768 case OPCODE_COPY_TEXTURE_IMAGE2D
:
11769 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11770 n
[4].e
, n
[5].i
, n
[6].i
,
11771 n
[7].i
, n
[8].i
, n
[9].i
));
11773 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
11774 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11775 n
[4].i
, n
[5].i
, n
[6].i
,
11778 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
11779 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11780 n
[4].i
, n
[5].i
, n
[6].i
,
11781 n
[7].i
, n
[8].i
, n
[9].i
));
11783 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
11784 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11785 n
[4].i
, n
[5].i
, n
[6].i
,
11786 n
[7].i
, n
[8].i
, n
[9].i
,
11789 case OPCODE_BIND_MULTITEXTURE
:
11790 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
11792 case OPCODE_MULTITEXPARAMETER_F
:
11795 params
[0] = n
[4].f
;
11796 params
[1] = n
[5].f
;
11797 params
[2] = n
[6].f
;
11798 params
[3] = n
[7].f
;
11799 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11802 case OPCODE_MULTITEXPARAMETER_I
:
11805 params
[0] = n
[4].i
;
11806 params
[1] = n
[5].i
;
11807 params
[2] = n
[6].i
;
11808 params
[3] = n
[7].i
;
11809 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11812 case OPCODE_MULTITEXENV
:
11815 params
[0] = n
[4].f
;
11816 params
[1] = n
[5].f
;
11817 params
[2] = n
[6].f
;
11818 params
[3] = n
[7].f
;
11819 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
11822 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
11823 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
11824 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
11825 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
11826 n
[9].i
, get_pointer(&n
[10])));
11829 case OPCODE_CONTINUE
:
11830 n
= (Node
*) get_pointer(&n
[1]);
11835 case OPCODE_END_OF_LIST
:
11841 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
11843 _mesa_problem(ctx
, "%s", msg
);
11848 /* increment n to point to next compiled command */
11849 if (opcode
!= OPCODE_CONTINUE
) {
11850 assert(InstSize
[opcode
] > 0);
11851 n
+= InstSize
[opcode
];
11856 vbo_save_EndCallList(ctx
);
11858 ctx
->ListState
.CallDepth
--;
11863 /**********************************************************************/
11865 /**********************************************************************/
11868 * Test if a display list number is valid.
11870 GLboolean GLAPIENTRY
11871 _mesa_IsList(GLuint list
)
11873 GET_CURRENT_CONTEXT(ctx
);
11874 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11875 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
11876 return islist(ctx
, list
);
11881 * Delete a sequence of consecutive display lists.
11884 _mesa_DeleteLists(GLuint list
, GLsizei range
)
11886 GET_CURRENT_CONTEXT(ctx
);
11888 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11889 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11892 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
11897 /* We may be deleting a set of bitmap lists. See if there's a
11898 * bitmap atlas to free.
11900 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
11902 _mesa_delete_bitmap_atlas(ctx
, atlas
);
11903 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
11907 for (i
= list
; i
< list
+ range
; i
++) {
11908 destroy_list(ctx
, i
);
11914 * Return a display list number, n, such that lists n through n+range-1
11918 _mesa_GenLists(GLsizei range
)
11920 GET_CURRENT_CONTEXT(ctx
);
11922 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11923 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
11926 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
11934 * Make this an atomic operation
11936 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
11938 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
11940 /* reserve the list IDs by with empty/dummy lists */
11942 for (i
= 0; i
< range
; i
++) {
11943 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
11944 make_list(base
+ i
, 1));
11948 if (USE_BITMAP_ATLAS
&&
11950 ctx
->Driver
.DrawAtlasBitmaps
) {
11951 /* "range > 16" is a rough heuristic to guess when glGenLists might be
11952 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
11953 * Create the empty atlas now.
11955 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
11957 atlas
= alloc_bitmap_atlas(ctx
, base
);
11960 /* Atlas _should_ be new/empty now, but clobbering is OK */
11961 assert(atlas
->numBitmaps
== 0);
11962 atlas
->numBitmaps
= range
;
11966 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
11973 * Begin a new display list.
11976 _mesa_NewList(GLuint name
, GLenum mode
)
11978 GET_CURRENT_CONTEXT(ctx
);
11980 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
11981 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11983 if (MESA_VERBOSE
& VERBOSE_API
)
11984 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
11985 _mesa_enum_to_string(mode
));
11988 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
11992 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
11993 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
11997 if (ctx
->ListState
.CurrentList
) {
11998 /* already compiling a display list */
11999 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
12003 ctx
->CompileFlag
= GL_TRUE
;
12004 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
12006 /* Reset accumulated list state */
12007 invalidate_saved_current_state( ctx
);
12009 /* Allocate new display list */
12010 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
12011 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
12012 ctx
->ListState
.CurrentPos
= 0;
12014 vbo_save_NewList(ctx
, name
, mode
);
12016 ctx
->CurrentServerDispatch
= ctx
->Save
;
12017 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12018 if (ctx
->MarshalExec
== NULL
) {
12019 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12025 * End definition of current display list.
12028 _mesa_EndList(void)
12030 GET_CURRENT_CONTEXT(ctx
);
12031 SAVE_FLUSH_VERTICES(ctx
);
12032 FLUSH_VERTICES(ctx
, 0);
12034 if (MESA_VERBOSE
& VERBOSE_API
)
12035 _mesa_debug(ctx
, "glEndList\n");
12037 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
12038 _mesa_error(ctx
, GL_INVALID_OPERATION
,
12039 "glEndList() called inside glBegin/End");
12042 /* Check that a list is under construction */
12043 if (!ctx
->ListState
.CurrentList
) {
12044 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
12048 /* Call before emitting END_OF_LIST, in case the driver wants to
12049 * emit opcodes itself.
12051 vbo_save_EndList(ctx
);
12053 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
12057 /* Destroy old list, if any */
12058 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
12060 /* Install the new list */
12061 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
12062 ctx
->ListState
.CurrentList
->Name
,
12063 ctx
->ListState
.CurrentList
);
12066 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
12067 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
12069 ctx
->ListState
.CurrentList
= NULL
;
12070 ctx
->ListState
.CurrentBlock
= NULL
;
12071 ctx
->ListState
.CurrentPos
= 0;
12072 ctx
->ExecuteFlag
= GL_TRUE
;
12073 ctx
->CompileFlag
= GL_FALSE
;
12075 ctx
->CurrentServerDispatch
= ctx
->Exec
;
12076 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12077 if (ctx
->MarshalExec
== NULL
) {
12078 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12084 _mesa_CallList(GLuint list
)
12086 GLboolean save_compile_flag
;
12087 GET_CURRENT_CONTEXT(ctx
);
12088 FLUSH_CURRENT(ctx
, 0);
12090 if (MESA_VERBOSE
& VERBOSE_API
)
12091 _mesa_debug(ctx
, "glCallList %d\n", list
);
12094 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
12099 mesa_print_display_list( list
);
12101 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
12102 * execute the display list, and restore the CompileFlag.
12104 save_compile_flag
= ctx
->CompileFlag
;
12105 if (save_compile_flag
) {
12106 ctx
->CompileFlag
= GL_FALSE
;
12109 execute_list(ctx
, list
);
12110 ctx
->CompileFlag
= save_compile_flag
;
12112 /* also restore API function pointers to point to "save" versions */
12113 if (save_compile_flag
) {
12114 ctx
->CurrentServerDispatch
= ctx
->Save
;
12115 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12116 if (ctx
->MarshalExec
== NULL
) {
12117 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12124 * Try to execute a glCallLists() command where the display lists contain
12125 * glBitmap commands with a texture atlas.
12126 * \return true for success, false otherwise
12129 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
12132 struct gl_bitmap_atlas
*atlas
;
12135 if (!USE_BITMAP_ATLAS
||
12136 !ctx
->Current
.RasterPosValid
||
12137 ctx
->List
.ListBase
== 0 ||
12138 type
!= GL_UNSIGNED_BYTE
||
12139 !ctx
->Driver
.DrawAtlasBitmaps
) {
12144 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12147 /* Even if glGenLists wasn't called, we can still try to create
12150 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12153 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
12154 /* Try to build the bitmap atlas now.
12155 * If the atlas was created in glGenLists, we'll have recorded the
12156 * number of lists (bitmaps). Otherwise, take a guess at 256.
12158 if (atlas
->numBitmaps
== 0)
12159 atlas
->numBitmaps
= 256;
12160 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
12163 if (!atlas
|| !atlas
->complete
) {
12167 /* check that all display list IDs are in the atlas */
12168 for (i
= 0; i
< n
; i
++) {
12169 const GLubyte
*ids
= (const GLubyte
*) lists
;
12171 if (ids
[i
] >= atlas
->numBitmaps
) {
12176 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
12183 * Execute glCallLists: call multiple display lists.
12186 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12188 GET_CURRENT_CONTEXT(ctx
);
12190 GLboolean save_compile_flag
;
12192 if (MESA_VERBOSE
& VERBOSE_API
)
12193 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12197 case GL_UNSIGNED_BYTE
:
12199 case GL_UNSIGNED_SHORT
:
12201 case GL_UNSIGNED_INT
:
12209 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12214 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12216 } else if (n
== 0 || lists
== NULL
) {
12217 /* nothing to do */
12221 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12225 /* Save the CompileFlag status, turn it off, execute display list,
12226 * and restore the CompileFlag.
12228 save_compile_flag
= ctx
->CompileFlag
;
12229 ctx
->CompileFlag
= GL_FALSE
;
12231 for (i
= 0; i
< n
; i
++) {
12232 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12233 execute_list(ctx
, list
);
12236 ctx
->CompileFlag
= save_compile_flag
;
12238 /* also restore API function pointers to point to "save" versions */
12239 if (save_compile_flag
) {
12240 ctx
->CurrentServerDispatch
= ctx
->Save
;
12241 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12242 if (ctx
->MarshalExec
== NULL
) {
12243 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12250 * Set the offset added to list numbers in glCallLists.
12253 _mesa_ListBase(GLuint base
)
12255 GET_CURRENT_CONTEXT(ctx
);
12256 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12257 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12258 ctx
->List
.ListBase
= base
;
12262 * Setup the given dispatch table to point to Mesa's display list
12263 * building functions.
12265 * This does not include any of the tnl functions - they are
12266 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12270 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12272 struct _glapi_table
*table
= ctx
->Save
;
12273 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12275 /* Initially populate the dispatch table with the contents of the
12276 * normal-execution dispatch table. This lets us skip populating functions
12277 * that should be called directly instead of compiled into display lists.
12279 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12281 _mesa_loopback_init_api_table(ctx
, table
);
12283 /* VBO functions */
12284 vbo_initialize_save_dispatch(ctx
, table
);
12287 SET_Accum(table
, save_Accum
);
12288 SET_AlphaFunc(table
, save_AlphaFunc
);
12289 SET_Bitmap(table
, save_Bitmap
);
12290 SET_BlendFunc(table
, save_BlendFunc
);
12291 SET_CallList(table
, save_CallList
);
12292 SET_CallLists(table
, save_CallLists
);
12293 SET_Clear(table
, save_Clear
);
12294 SET_ClearAccum(table
, save_ClearAccum
);
12295 SET_ClearColor(table
, save_ClearColor
);
12296 SET_ClearDepth(table
, save_ClearDepth
);
12297 SET_ClearIndex(table
, save_ClearIndex
);
12298 SET_ClearStencil(table
, save_ClearStencil
);
12299 SET_ClipPlane(table
, save_ClipPlane
);
12300 SET_ColorMask(table
, save_ColorMask
);
12301 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12302 SET_ColorMaterial(table
, save_ColorMaterial
);
12303 SET_CopyPixels(table
, save_CopyPixels
);
12304 SET_CullFace(table
, save_CullFace
);
12305 SET_DepthFunc(table
, save_DepthFunc
);
12306 SET_DepthMask(table
, save_DepthMask
);
12307 SET_DepthRange(table
, save_DepthRange
);
12308 SET_Disable(table
, save_Disable
);
12309 SET_Disablei(table
, save_DisableIndexed
);
12310 SET_DrawBuffer(table
, save_DrawBuffer
);
12311 SET_DrawPixels(table
, save_DrawPixels
);
12312 SET_Enable(table
, save_Enable
);
12313 SET_Enablei(table
, save_EnableIndexed
);
12314 SET_EvalMesh1(table
, save_EvalMesh1
);
12315 SET_EvalMesh2(table
, save_EvalMesh2
);
12316 SET_Fogf(table
, save_Fogf
);
12317 SET_Fogfv(table
, save_Fogfv
);
12318 SET_Fogi(table
, save_Fogi
);
12319 SET_Fogiv(table
, save_Fogiv
);
12320 SET_FrontFace(table
, save_FrontFace
);
12321 SET_Frustum(table
, save_Frustum
);
12322 SET_Hint(table
, save_Hint
);
12323 SET_IndexMask(table
, save_IndexMask
);
12324 SET_InitNames(table
, save_InitNames
);
12325 SET_LightModelf(table
, save_LightModelf
);
12326 SET_LightModelfv(table
, save_LightModelfv
);
12327 SET_LightModeli(table
, save_LightModeli
);
12328 SET_LightModeliv(table
, save_LightModeliv
);
12329 SET_Lightf(table
, save_Lightf
);
12330 SET_Lightfv(table
, save_Lightfv
);
12331 SET_Lighti(table
, save_Lighti
);
12332 SET_Lightiv(table
, save_Lightiv
);
12333 SET_LineStipple(table
, save_LineStipple
);
12334 SET_LineWidth(table
, save_LineWidth
);
12335 SET_ListBase(table
, save_ListBase
);
12336 SET_LoadIdentity(table
, save_LoadIdentity
);
12337 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12338 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12339 SET_LoadName(table
, save_LoadName
);
12340 SET_LogicOp(table
, save_LogicOp
);
12341 SET_Map1d(table
, save_Map1d
);
12342 SET_Map1f(table
, save_Map1f
);
12343 SET_Map2d(table
, save_Map2d
);
12344 SET_Map2f(table
, save_Map2f
);
12345 SET_MapGrid1d(table
, save_MapGrid1d
);
12346 SET_MapGrid1f(table
, save_MapGrid1f
);
12347 SET_MapGrid2d(table
, save_MapGrid2d
);
12348 SET_MapGrid2f(table
, save_MapGrid2f
);
12349 SET_MatrixMode(table
, save_MatrixMode
);
12350 SET_MultMatrixd(table
, save_MultMatrixd
);
12351 SET_MultMatrixf(table
, save_MultMatrixf
);
12352 SET_NewList(table
, save_NewList
);
12353 SET_Ortho(table
, save_Ortho
);
12354 SET_PassThrough(table
, save_PassThrough
);
12355 SET_PixelMapfv(table
, save_PixelMapfv
);
12356 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12357 SET_PixelMapusv(table
, save_PixelMapusv
);
12358 SET_PixelTransferf(table
, save_PixelTransferf
);
12359 SET_PixelTransferi(table
, save_PixelTransferi
);
12360 SET_PixelZoom(table
, save_PixelZoom
);
12361 SET_PointSize(table
, save_PointSize
);
12362 SET_PolygonMode(table
, save_PolygonMode
);
12363 SET_PolygonOffset(table
, save_PolygonOffset
);
12364 SET_PolygonStipple(table
, save_PolygonStipple
);
12365 SET_PopAttrib(table
, save_PopAttrib
);
12366 SET_PopMatrix(table
, save_PopMatrix
);
12367 SET_PopName(table
, save_PopName
);
12368 SET_PushAttrib(table
, save_PushAttrib
);
12369 SET_PushMatrix(table
, save_PushMatrix
);
12370 SET_PushName(table
, save_PushName
);
12371 SET_RasterPos2d(table
, save_RasterPos2d
);
12372 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12373 SET_RasterPos2f(table
, save_RasterPos2f
);
12374 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12375 SET_RasterPos2i(table
, save_RasterPos2i
);
12376 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12377 SET_RasterPos2s(table
, save_RasterPos2s
);
12378 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12379 SET_RasterPos3d(table
, save_RasterPos3d
);
12380 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12381 SET_RasterPos3f(table
, save_RasterPos3f
);
12382 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12383 SET_RasterPos3i(table
, save_RasterPos3i
);
12384 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12385 SET_RasterPos3s(table
, save_RasterPos3s
);
12386 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12387 SET_RasterPos4d(table
, save_RasterPos4d
);
12388 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12389 SET_RasterPos4f(table
, save_RasterPos4f
);
12390 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12391 SET_RasterPos4i(table
, save_RasterPos4i
);
12392 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12393 SET_RasterPos4s(table
, save_RasterPos4s
);
12394 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12395 SET_ReadBuffer(table
, save_ReadBuffer
);
12396 SET_Rectf(table
, save_Rectf
);
12397 SET_Rotated(table
, save_Rotated
);
12398 SET_Rotatef(table
, save_Rotatef
);
12399 SET_Scaled(table
, save_Scaled
);
12400 SET_Scalef(table
, save_Scalef
);
12401 SET_Scissor(table
, save_Scissor
);
12402 SET_ShadeModel(table
, save_ShadeModel
);
12403 SET_StencilFunc(table
, save_StencilFunc
);
12404 SET_StencilMask(table
, save_StencilMask
);
12405 SET_StencilOp(table
, save_StencilOp
);
12406 SET_TexEnvf(table
, save_TexEnvf
);
12407 SET_TexEnvfv(table
, save_TexEnvfv
);
12408 SET_TexEnvi(table
, save_TexEnvi
);
12409 SET_TexEnviv(table
, save_TexEnviv
);
12410 SET_TexGend(table
, save_TexGend
);
12411 SET_TexGendv(table
, save_TexGendv
);
12412 SET_TexGenf(table
, save_TexGenf
);
12413 SET_TexGenfv(table
, save_TexGenfv
);
12414 SET_TexGeni(table
, save_TexGeni
);
12415 SET_TexGeniv(table
, save_TexGeniv
);
12416 SET_TexImage1D(table
, save_TexImage1D
);
12417 SET_TexImage2D(table
, save_TexImage2D
);
12418 SET_TexParameterf(table
, save_TexParameterf
);
12419 SET_TexParameterfv(table
, save_TexParameterfv
);
12420 SET_TexParameteri(table
, save_TexParameteri
);
12421 SET_TexParameteriv(table
, save_TexParameteriv
);
12422 SET_Translated(table
, save_Translated
);
12423 SET_Translatef(table
, save_Translatef
);
12424 SET_Viewport(table
, save_Viewport
);
12427 SET_BindTexture(table
, save_BindTexture
);
12428 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12429 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12430 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12431 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12432 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12433 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12434 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12437 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12438 SET_TexImage3D(table
, save_TexImage3D
);
12439 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12442 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12443 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12444 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12446 /* ATI_separate_stencil */
12447 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12449 /* GL_ARB_imaging */
12450 /* Not all are supported */
12451 SET_BlendColor(table
, save_BlendColor
);
12452 SET_BlendEquation(table
, save_BlendEquation
);
12454 /* 2. GL_EXT_blend_color */
12456 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12459 /* 6. GL_EXT_texture3d */
12461 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12462 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12463 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12466 /* 37. GL_EXT_blend_minmax */
12468 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12471 /* 54. GL_EXT_point_parameters */
12472 SET_PointParameterf(table
, save_PointParameterfEXT
);
12473 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12475 /* 91. GL_ARB_tessellation_shader */
12476 SET_PatchParameteri(table
, save_PatchParameteri
);
12477 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12479 /* 100. ARB_viewport_array */
12480 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12481 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12482 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12483 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12484 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12485 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12486 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12487 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12489 /* 122. ARB_compute_shader */
12490 SET_DispatchCompute(table
, save_DispatchCompute
);
12491 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12493 /* 173. GL_EXT_blend_func_separate */
12494 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12496 /* 197. GL_MESA_window_pos */
12497 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12498 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12499 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12500 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12501 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12502 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12503 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12504 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12505 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12506 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12507 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12508 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12509 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12510 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12511 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12512 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12513 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12514 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12515 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12516 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12517 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12518 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
12519 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
12520 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
12522 /* 245. GL_ATI_fragment_shader */
12523 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
12524 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
12526 /* 262. GL_NV_point_sprite */
12527 SET_PointParameteri(table
, save_PointParameteriNV
);
12528 SET_PointParameteriv(table
, save_PointParameterivNV
);
12530 /* 268. GL_EXT_stencil_two_side */
12531 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
12533 /* ???. GL_EXT_depth_bounds_test */
12534 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
12536 /* ARB 1. GL_ARB_multitexture */
12537 SET_ActiveTexture(table
, save_ActiveTextureARB
);
12539 /* ARB 3. GL_ARB_transpose_matrix */
12540 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
12541 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
12542 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
12543 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
12545 /* ARB 5. GL_ARB_multisample */
12546 SET_SampleCoverage(table
, save_SampleCoverageARB
);
12548 /* ARB 12. GL_ARB_texture_compression */
12549 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
12550 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
12551 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
12552 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
12553 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
12554 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
12556 /* ARB 14. GL_ARB_point_parameters */
12557 /* aliased with EXT_point_parameters functions */
12559 /* ARB 25. GL_ARB_window_pos */
12560 /* aliased with MESA_window_pos functions */
12562 /* ARB 26. GL_ARB_vertex_program */
12563 /* ARB 27. GL_ARB_fragment_program */
12564 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
12565 SET_ProgramStringARB(table
, save_ProgramStringARB
);
12566 SET_BindProgramARB(table
, save_BindProgramARB
);
12567 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
12568 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
12569 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
12570 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
12571 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
12572 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
12573 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
12574 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
12576 SET_BeginQuery(table
, save_BeginQueryARB
);
12577 SET_EndQuery(table
, save_EndQueryARB
);
12578 SET_QueryCounter(table
, save_QueryCounter
);
12580 SET_DrawBuffers(table
, save_DrawBuffersARB
);
12582 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
12584 SET_UseProgram(table
, save_UseProgram
);
12585 SET_Uniform1f(table
, save_Uniform1fARB
);
12586 SET_Uniform2f(table
, save_Uniform2fARB
);
12587 SET_Uniform3f(table
, save_Uniform3fARB
);
12588 SET_Uniform4f(table
, save_Uniform4fARB
);
12589 SET_Uniform1fv(table
, save_Uniform1fvARB
);
12590 SET_Uniform2fv(table
, save_Uniform2fvARB
);
12591 SET_Uniform3fv(table
, save_Uniform3fvARB
);
12592 SET_Uniform4fv(table
, save_Uniform4fvARB
);
12593 SET_Uniform1i(table
, save_Uniform1iARB
);
12594 SET_Uniform2i(table
, save_Uniform2iARB
);
12595 SET_Uniform3i(table
, save_Uniform3iARB
);
12596 SET_Uniform4i(table
, save_Uniform4iARB
);
12597 SET_Uniform1iv(table
, save_Uniform1ivARB
);
12598 SET_Uniform2iv(table
, save_Uniform2ivARB
);
12599 SET_Uniform3iv(table
, save_Uniform3ivARB
);
12600 SET_Uniform4iv(table
, save_Uniform4ivARB
);
12601 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
12602 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
12603 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
12604 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
12605 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
12606 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
12607 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
12608 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
12609 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
12611 /* 299. GL_EXT_blend_equation_separate */
12612 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
12614 /* GL_EXT_gpu_program_parameters */
12615 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
12616 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
12618 /* 364. GL_EXT_provoking_vertex */
12619 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
12621 /* GL_EXT_texture_integer */
12622 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
12623 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
12624 SET_TexParameterIiv(table
, save_TexParameterIiv
);
12625 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
12627 /* GL_ARB_clip_control */
12628 SET_ClipControl(table
, save_ClipControl
);
12630 /* GL_ARB_color_buffer_float */
12631 SET_ClampColor(table
, save_ClampColorARB
);
12634 SET_ClearBufferiv(table
, save_ClearBufferiv
);
12635 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
12636 SET_ClearBufferfv(table
, save_ClearBufferfv
);
12637 SET_ClearBufferfi(table
, save_ClearBufferfi
);
12638 SET_Uniform1ui(table
, save_Uniform1ui
);
12639 SET_Uniform2ui(table
, save_Uniform2ui
);
12640 SET_Uniform3ui(table
, save_Uniform3ui
);
12641 SET_Uniform4ui(table
, save_Uniform4ui
);
12642 SET_Uniform1uiv(table
, save_Uniform1uiv
);
12643 SET_Uniform2uiv(table
, save_Uniform2uiv
);
12644 SET_Uniform3uiv(table
, save_Uniform3uiv
);
12645 SET_Uniform4uiv(table
, save_Uniform4uiv
);
12647 /* GL_ARB_gpu_shader_fp64 */
12648 SET_Uniform1d(table
, save_Uniform1d
);
12649 SET_Uniform2d(table
, save_Uniform2d
);
12650 SET_Uniform3d(table
, save_Uniform3d
);
12651 SET_Uniform4d(table
, save_Uniform4d
);
12652 SET_Uniform1dv(table
, save_Uniform1dv
);
12653 SET_Uniform2dv(table
, save_Uniform2dv
);
12654 SET_Uniform3dv(table
, save_Uniform3dv
);
12655 SET_Uniform4dv(table
, save_Uniform4dv
);
12656 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
12657 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
12658 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
12659 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
12660 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
12661 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
12662 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
12663 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
12664 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
12667 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
12668 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
12669 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
12670 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
12671 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
12672 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
12673 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
12674 SET_DrawTransformFeedbackInstanced(table
,
12675 save_DrawTransformFeedbackInstanced
);
12676 SET_DrawTransformFeedbackStreamInstanced(table
,
12677 save_DrawTransformFeedbackStreamInstanced
);
12678 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
12679 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
12681 /* GL_ARB_instanced_arrays */
12682 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
12684 /* GL_NV_texture_barrier */
12685 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
12687 SET_BindSampler(table
, save_BindSampler
);
12688 SET_SamplerParameteri(table
, save_SamplerParameteri
);
12689 SET_SamplerParameterf(table
, save_SamplerParameterf
);
12690 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
12691 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
12692 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
12693 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
12695 /* GL_ARB_draw_buffer_blend */
12696 SET_BlendFunciARB(table
, save_BlendFunci
);
12697 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
12698 SET_BlendEquationiARB(table
, save_BlendEquationi
);
12699 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
12701 /* GL_NV_conditional_render */
12702 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
12703 SET_EndConditionalRender(table
, save_EndConditionalRender
);
12706 SET_WaitSync(table
, save_WaitSync
);
12708 /* GL_ARB_uniform_buffer_object */
12709 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
12711 /* GL_ARB_shader_subroutines */
12712 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
12714 /* GL_ARB_draw_instanced */
12715 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
12716 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
12718 /* GL_ARB_draw_elements_base_vertex */
12719 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
12721 /* GL_ARB_base_instance */
12722 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
12723 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
12724 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
12726 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
12727 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
12728 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
12729 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
12730 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
12732 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
12733 SET_UseProgramStages(table
, save_UseProgramStages
);
12734 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
12735 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
12736 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
12737 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
12738 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
12739 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
12740 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
12741 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
12742 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
12743 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
12744 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
12745 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
12746 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
12747 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
12748 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
12749 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
12750 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
12751 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
12752 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
12753 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
12754 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
12755 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
12756 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
12757 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
12758 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
12759 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
12760 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
12761 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
12762 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
12763 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
12764 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
12765 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
12766 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
12767 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
12768 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
12769 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
12770 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
12771 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
12772 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
12773 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
12774 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
12775 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
12776 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
12777 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
12778 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
12779 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
12780 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
12781 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
12782 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
12783 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
12785 /* GL_{ARB,EXT}_polygon_offset_clamp */
12786 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
12788 /* GL_EXT_window_rectangles */
12789 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
12791 /* GL_NV_conservative_raster */
12792 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
12794 /* GL_NV_conservative_raster_dilate */
12795 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
12797 /* GL_NV_conservative_raster_pre_snap_triangles */
12798 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
12800 /* GL_EXT_direct_state_access */
12801 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
12802 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
12803 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
12804 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
12805 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
12806 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
12807 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
12808 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
12809 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
12810 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
12811 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
12812 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
12813 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
12814 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
12815 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
12816 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
12817 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
12818 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
12819 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
12820 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
12821 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
12822 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
12823 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
12824 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
12825 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
12826 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
12827 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
12828 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
12829 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
12830 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
12831 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
12832 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
12833 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
12834 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
12835 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
12836 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
12837 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
12838 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
12839 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
12840 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
12841 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
12842 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
12843 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
12844 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
12849 static const char *
12850 enum_string(GLenum k
)
12852 return _mesa_enum_to_string(k
);
12857 * Print the commands in a display list. For debugging only.
12858 * TODO: many commands aren't handled yet.
12859 * \param fname filename to write display list to. If null, use stdout.
12861 static void GLAPIENTRY
12862 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
12864 struct gl_display_list
*dlist
;
12870 f
= fopen(fname
, "w");
12875 if (!islist(ctx
, list
)) {
12876 fprintf(f
, "%u is not a display list ID\n", list
);
12880 dlist
= _mesa_lookup_list(ctx
, list
);
12887 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
12889 done
= n
? GL_FALSE
: GL_TRUE
;
12891 const OpCode opcode
= n
[0].opcode
;
12893 if (is_ext_opcode(opcode
)) {
12894 n
+= ext_opcode_print(ctx
, n
, f
);
12899 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
12901 case OPCODE_ACTIVE_TEXTURE
:
12902 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
12904 case OPCODE_BITMAP
:
12905 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
12906 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
12907 get_pointer(&n
[7]));
12909 case OPCODE_BLEND_COLOR
:
12910 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
12911 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12913 case OPCODE_BLEND_EQUATION
:
12914 fprintf(f
, "BlendEquation %s\n",
12915 enum_string(n
[1].e
));
12917 case OPCODE_BLEND_EQUATION_SEPARATE
:
12918 fprintf(f
, "BlendEquationSeparate %s, %s\n",
12919 enum_string(n
[1].e
),
12920 enum_string(n
[2].e
));
12922 case OPCODE_BLEND_FUNC_SEPARATE
:
12923 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
12924 enum_string(n
[1].e
),
12925 enum_string(n
[2].e
),
12926 enum_string(n
[3].e
),
12927 enum_string(n
[4].e
));
12929 case OPCODE_BLEND_EQUATION_I
:
12930 fprintf(f
, "BlendEquationi %u, %s\n",
12931 n
[1].ui
, enum_string(n
[2].e
));
12933 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
12934 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
12935 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12937 case OPCODE_BLEND_FUNC_I
:
12938 fprintf(f
, "BlendFunci %u, %s, %s\n",
12939 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12941 case OPCODE_BLEND_FUNC_SEPARATE_I
:
12942 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
12944 enum_string(n
[2].e
),
12945 enum_string(n
[3].e
),
12946 enum_string(n
[4].e
),
12947 enum_string(n
[5].e
));
12949 case OPCODE_CALL_LIST
:
12950 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
12952 case OPCODE_CALL_LISTS
:
12953 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
12955 case OPCODE_DISABLE
:
12956 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
12958 case OPCODE_ENABLE
:
12959 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
12961 case OPCODE_FRUSTUM
:
12962 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
12963 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12965 case OPCODE_LINE_STIPPLE
:
12966 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
12968 case OPCODE_LINE_WIDTH
:
12969 fprintf(f
, "LineWidth %f\n", n
[1].f
);
12971 case OPCODE_LOAD_IDENTITY
:
12972 fprintf(f
, "LoadIdentity\n");
12974 case OPCODE_LOAD_MATRIX
:
12975 fprintf(f
, "LoadMatrix\n");
12976 fprintf(f
, " %8f %8f %8f %8f\n",
12977 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12978 fprintf(f
, " %8f %8f %8f %8f\n",
12979 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12980 fprintf(f
, " %8f %8f %8f %8f\n",
12981 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12982 fprintf(f
, " %8f %8f %8f %8f\n",
12983 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12985 case OPCODE_MULT_MATRIX
:
12986 fprintf(f
, "MultMatrix (or Rotate)\n");
12987 fprintf(f
, " %8f %8f %8f %8f\n",
12988 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12989 fprintf(f
, " %8f %8f %8f %8f\n",
12990 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12991 fprintf(f
, " %8f %8f %8f %8f\n",
12992 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12993 fprintf(f
, " %8f %8f %8f %8f\n",
12994 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12997 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
12998 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13000 case OPCODE_POINT_SIZE
:
13001 fprintf(f
, "PointSize %f\n", n
[1].f
);
13003 case OPCODE_POP_ATTRIB
:
13004 fprintf(f
, "PopAttrib\n");
13006 case OPCODE_POP_MATRIX
:
13007 fprintf(f
, "PopMatrix\n");
13009 case OPCODE_POP_NAME
:
13010 fprintf(f
, "PopName\n");
13012 case OPCODE_PUSH_ATTRIB
:
13013 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
13015 case OPCODE_PUSH_MATRIX
:
13016 fprintf(f
, "PushMatrix\n");
13018 case OPCODE_PUSH_NAME
:
13019 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
13021 case OPCODE_RASTER_POS
:
13022 fprintf(f
, "RasterPos %g %g %g %g\n",
13023 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13025 case OPCODE_ROTATE
:
13026 fprintf(f
, "Rotate %g %g %g %g\n",
13027 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13030 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13032 case OPCODE_TRANSLATE
:
13033 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13035 case OPCODE_BIND_TEXTURE
:
13036 fprintf(f
, "BindTexture %s %d\n",
13037 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
13039 case OPCODE_SHADE_MODEL
:
13040 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
13043 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
13044 _mesa_enum_to_string(n
[1].ui
),
13045 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
13048 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13049 _mesa_enum_to_string(n
[1].ui
),
13050 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
13051 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
13053 case OPCODE_MAPGRID1
:
13054 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
13056 case OPCODE_MAPGRID2
:
13057 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13058 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
13060 case OPCODE_EVALMESH1
:
13061 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
13063 case OPCODE_EVALMESH2
:
13064 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
13065 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
13068 case OPCODE_ATTR_1F_NV
:
13069 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
13071 case OPCODE_ATTR_2F_NV
:
13072 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
13073 n
[1].i
, n
[2].f
, n
[3].f
);
13075 case OPCODE_ATTR_3F_NV
:
13076 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
13077 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13079 case OPCODE_ATTR_4F_NV
:
13080 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13081 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13083 case OPCODE_ATTR_1F_ARB
:
13084 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
13086 case OPCODE_ATTR_2F_ARB
:
13087 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
13088 n
[1].i
, n
[2].f
, n
[3].f
);
13090 case OPCODE_ATTR_3F_ARB
:
13091 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
13092 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13094 case OPCODE_ATTR_4F_ARB
:
13095 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13096 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13099 case OPCODE_MATERIAL
:
13100 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
13101 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13104 fprintf(f
, "BEGIN %x\n", n
[1].i
);
13107 fprintf(f
, "END\n");
13110 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
13113 case OPCODE_EVAL_C1
:
13114 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
13116 case OPCODE_EVAL_C2
:
13117 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
13119 case OPCODE_EVAL_P1
:
13120 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
13122 case OPCODE_EVAL_P2
:
13123 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
13126 case OPCODE_PROVOKING_VERTEX
:
13127 fprintf(f
, "ProvokingVertex %s\n",
13128 _mesa_enum_to_string(n
[1].ui
));
13132 * meta opcodes/commands
13135 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
13136 (const char *) get_pointer(&n
[2]));
13138 case OPCODE_CONTINUE
:
13139 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
13140 n
= (Node
*) get_pointer(&n
[1]);
13143 fprintf(f
, "NOP\n");
13145 case OPCODE_END_OF_LIST
:
13146 fprintf(f
, "END-LIST %u\n", list
);
13150 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
13152 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13153 opcode
, (void *) n
);
13157 fprintf(f
, "command %d, %u operands\n", opcode
,
13161 /* increment n to point to next compiled command */
13162 if (opcode
!= OPCODE_CONTINUE
) {
13163 assert(InstSize
[opcode
] > 0);
13164 n
+= InstSize
[opcode
];
13178 * Clients may call this function to help debug display list problems.
13179 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
13180 * changed, or break in the future without notice.
13183 mesa_print_display_list(GLuint list
)
13185 GET_CURRENT_CONTEXT(ctx
);
13186 print_list(ctx
, list
, NULL
);
13190 /**********************************************************************/
13191 /***** Initialization *****/
13192 /**********************************************************************/
13195 save_vtxfmt_init(GLvertexformat
* vfmt
)
13197 vfmt
->ArrayElement
= _ae_ArrayElement
;
13199 vfmt
->Begin
= save_Begin
;
13201 vfmt
->CallList
= save_CallList
;
13202 vfmt
->CallLists
= save_CallLists
;
13204 vfmt
->Color3f
= save_Color3f
;
13205 vfmt
->Color3fv
= save_Color3fv
;
13206 vfmt
->Color4f
= save_Color4f
;
13207 vfmt
->Color4fv
= save_Color4fv
;
13208 vfmt
->EdgeFlag
= save_EdgeFlag
;
13209 vfmt
->End
= save_End
;
13211 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13212 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13213 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13214 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13215 vfmt
->EvalPoint1
= save_EvalPoint1
;
13216 vfmt
->EvalPoint2
= save_EvalPoint2
;
13218 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13219 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13220 vfmt
->Indexf
= save_Indexf
;
13221 vfmt
->Indexfv
= save_Indexfv
;
13222 vfmt
->Materialfv
= save_Materialfv
;
13223 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13224 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13225 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13226 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13227 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13228 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13229 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13230 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13231 vfmt
->Normal3f
= save_Normal3f
;
13232 vfmt
->Normal3fv
= save_Normal3fv
;
13233 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13234 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13235 vfmt
->TexCoord1f
= save_TexCoord1f
;
13236 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13237 vfmt
->TexCoord2f
= save_TexCoord2f
;
13238 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13239 vfmt
->TexCoord3f
= save_TexCoord3f
;
13240 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13241 vfmt
->TexCoord4f
= save_TexCoord4f
;
13242 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13243 vfmt
->Vertex2f
= save_Vertex2f
;
13244 vfmt
->Vertex2fv
= save_Vertex2fv
;
13245 vfmt
->Vertex3f
= save_Vertex3f
;
13246 vfmt
->Vertex3fv
= save_Vertex3fv
;
13247 vfmt
->Vertex4f
= save_Vertex4f
;
13248 vfmt
->Vertex4fv
= save_Vertex4fv
;
13249 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13250 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13251 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13252 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13253 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13254 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13255 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13256 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13257 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13258 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13259 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13260 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13261 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13262 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13263 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13264 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13266 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13271 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13272 const GLvertexformat
*vfmt
)
13274 SET_CallList(disp
, vfmt
->CallList
);
13275 SET_CallLists(disp
, vfmt
->CallLists
);
13280 * Initialize display list state for given context.
13283 _mesa_init_display_list(struct gl_context
*ctx
)
13285 static GLboolean tableInitialized
= GL_FALSE
;
13287 /* zero-out the instruction size table, just once */
13288 if (!tableInitialized
) {
13289 memset(InstSize
, 0, sizeof(InstSize
));
13290 tableInitialized
= GL_TRUE
;
13293 /* extension info */
13294 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13297 ctx
->ListState
.CallDepth
= 0;
13298 ctx
->ExecuteFlag
= GL_TRUE
;
13299 ctx
->CompileFlag
= GL_FALSE
;
13300 ctx
->ListState
.CurrentBlock
= NULL
;
13301 ctx
->ListState
.CurrentPos
= 0;
13303 /* Display List group */
13304 ctx
->List
.ListBase
= 0;
13306 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13308 InstSize
[OPCODE_NOP
] = 1;
13313 _mesa_free_display_list_data(struct gl_context
*ctx
)
13315 free(ctx
->ListExt
);
13316 ctx
->ListExt
= NULL
;