2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
586 /* The following three are meta instructions */
587 OPCODE_ERROR
, /* raise compiled-in error */
589 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
599 * Display list instructions are stored as sequences of "nodes". Nodes
600 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
601 * are linked together with a pointer.
603 * Each instruction in the display list is stored as a sequence of
604 * contiguous nodes in memory.
605 * Each node is the union of a variety of data types.
607 * Note, all of these members should be 4 bytes in size or less for the
608 * sake of compact display lists. We store 8-byte pointers in a pair of
609 * these nodes using the save/get_pointer() functions below.
627 typedef union gl_dlist_node Node
;
630 /** How many 4-byte dwords to store a pointer */
631 #define POINTER_DWORDS (sizeof(void *) / 4)
633 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
634 * space for display lists. The following types and functions are
635 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
640 GLuint dwords
[POINTER_DWORDS
];
645 * Save a 4 or 8-byte pointer at dest (and dest+1).
648 save_pointer(Node
*dest
, void *src
)
653 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
654 STATIC_ASSERT(sizeof(Node
) == 4);
658 for (i
= 0; i
< POINTER_DWORDS
; i
++)
659 dest
[i
].ui
= p
.dwords
[i
];
664 * Retrieve a 4 or 8-byte pointer from node (node+1).
667 get_pointer(const Node
*node
)
672 for (i
= 0; i
< POINTER_DWORDS
; i
++)
673 p
.dwords
[i
] = node
[i
].ui
;
680 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
697 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
699 union float64_pair tmp; \
701 n[idx].ui = tmp.uint32[0]; \
702 n[idx+1].ui = tmp.uint32[1]; \
707 * How many nodes to allocate at a time. Note that bulk vertex data
708 * from glBegin/glVertex/glEnd primitives will typically wind up in
709 * a VBO, and not directly in the display list itself.
711 #define BLOCK_SIZE 256
716 * Number of nodes of storage needed for each instruction.
717 * Sizes for dynamically allocated opcodes are stored in the context struct.
719 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
722 void mesa_print_display_list(GLuint list
);
726 * Does the given display list only contain a single glBitmap call?
729 is_bitmap_list(const struct gl_display_list
*dlist
)
731 const Node
*n
= dlist
->Head
;
732 if (n
[0].opcode
== OPCODE_BITMAP
) {
733 n
+= InstSize
[OPCODE_BITMAP
];
734 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
742 * Is the given display list an empty list?
745 is_empty_list(const struct gl_display_list
*dlist
)
747 const Node
*n
= dlist
->Head
;
748 return n
[0].opcode
== OPCODE_END_OF_LIST
;
753 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
756 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
759 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
767 * Lookup a gl_bitmap_atlas by listBase ID.
769 static struct gl_bitmap_atlas
*
770 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
772 struct gl_bitmap_atlas
*atlas
;
774 assert(listBase
> 0);
775 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
781 * Create new bitmap atlas and insert into hash table.
783 static struct gl_bitmap_atlas
*
784 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
786 struct gl_bitmap_atlas
*atlas
;
788 assert(listBase
> 0);
789 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
791 atlas
= calloc(1, sizeof(*atlas
));
793 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
801 * Try to build a bitmap atlas. This involves examining a sequence of
802 * display lists which contain glBitmap commands and putting the bitmap
803 * images into a texture map (the atlas).
804 * If we succeed, gl_bitmap_atlas::complete will be set to true.
805 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
808 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
811 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
816 assert(!atlas
->complete
);
817 assert(atlas
->numBitmaps
> 0);
819 /* We use a rectangle texture (non-normalized coords) for the atlas */
820 assert(ctx
->Extensions
.NV_texture_rectangle
);
821 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
823 atlas
->texWidth
= 1024;
824 atlas
->texHeight
= 0; /* determined below */
826 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
827 if (!atlas
->glyphs
) {
829 atlas
->incomplete
= true;
833 /* Loop over the display lists. They should all contain a single glBitmap
834 * call. If not, bail out. Also, compute the position and sizes of each
835 * bitmap in the atlas to determine the texture atlas size.
837 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
838 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
840 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
841 unsigned bitmap_width
, bitmap_height
;
842 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
844 if (!list
|| is_empty_list(list
)) {
846 atlas
->numBitmaps
= i
;
850 if (!is_bitmap_list(list
)) {
851 /* This list does not contain exactly one glBitmap command. Give up. */
852 atlas
->incomplete
= true;
856 /* get bitmap info from the display list command */
858 assert(n
[0].opcode
== OPCODE_BITMAP
);
859 bitmap_width
= n
[1].i
;
860 bitmap_height
= n
[2].i
;
861 bitmap_xorig
= n
[3].f
;
862 bitmap_yorig
= n
[4].f
;
863 bitmap_xmove
= n
[5].f
;
864 bitmap_ymove
= n
[6].f
;
866 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
867 /* advance to the next row of the texture */
873 /* save the bitmap's position in the atlas */
877 g
->h
= bitmap_height
;
878 g
->xorig
= bitmap_xorig
;
879 g
->yorig
= bitmap_yorig
;
880 g
->xmove
= bitmap_xmove
;
881 g
->ymove
= bitmap_ymove
;
883 xpos
+= bitmap_width
;
885 /* keep track of tallest bitmap in the row */
886 row_height
= MAX2(row_height
, bitmap_height
);
889 /* Now we know the texture height */
890 atlas
->texHeight
= ypos
+ row_height
;
892 if (atlas
->texHeight
== 0) {
893 /* no glyphs found, give up */
896 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
897 /* too large, give up */
901 /* Create atlas texture (texture ID is irrelevant) */
902 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
903 if (!atlas
->texObj
) {
907 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
908 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
909 atlas
->texObj
->MaxLevel
= 0;
910 atlas
->texObj
->Immutable
= GL_TRUE
;
912 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
913 GL_TEXTURE_RECTANGLE
, 0);
914 if (!atlas
->texImage
) {
918 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
919 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
920 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
922 /* alloc image storage */
923 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
927 /* map teximage, load with bitmap glyphs */
928 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
929 0, 0, atlas
->texWidth
, atlas
->texHeight
,
930 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
935 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
936 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
938 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
939 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
940 const Node
*n
= list
->Head
;
942 assert(n
[0].opcode
== OPCODE_BITMAP
||
943 n
[0].opcode
== OPCODE_END_OF_LIST
);
945 if (n
[0].opcode
== OPCODE_BITMAP
) {
946 unsigned bitmap_width
= n
[1].i
;
947 unsigned bitmap_height
= n
[2].i
;
948 unsigned xpos
= atlas
->glyphs
[i
].x
;
949 unsigned ypos
= atlas
->glyphs
[i
].y
;
950 const void *bitmap_image
= get_pointer(&n
[7]);
952 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
953 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
955 /* put the bitmap image into the texture image */
956 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
957 &ctx
->DefaultPacking
, bitmap_image
,
958 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
963 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
965 atlas
->complete
= true;
970 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
973 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
976 atlas
->glyphs
= NULL
;
977 atlas
->incomplete
= true;
982 * Allocate a gl_display_list object with an initial block of storage.
983 * \param count how many display list nodes/tokens to allocate
985 static struct gl_display_list
*
986 make_list(GLuint name
, GLuint count
)
988 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
990 dlist
->Head
= malloc(sizeof(Node
) * count
);
991 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
992 /* All InstSize[] entries must be non-zero */
993 InstSize
[OPCODE_END_OF_LIST
] = 1;
999 * Lookup function to just encapsulate casting.
1001 struct gl_display_list
*
1002 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1004 return (struct gl_display_list
*)
1005 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1009 /** Is the given opcode an extension code? */
1010 static inline GLboolean
1011 is_ext_opcode(OpCode opcode
)
1013 return (opcode
>= OPCODE_EXT_0
);
1017 /** Destroy an extended opcode instruction */
1019 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1021 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1023 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1024 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1029 /** Execute an extended opcode instruction */
1031 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1033 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1035 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1036 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1041 /** Print an extended opcode instruction */
1043 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1045 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1047 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1048 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1054 * Delete the named display list, but don't remove from hash table.
1055 * \param dlist - display list pointer
1058 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1063 n
= block
= dlist
->Head
;
1065 done
= block
? GL_FALSE
: GL_TRUE
;
1067 const OpCode opcode
= n
[0].opcode
;
1069 /* check for extension opcodes first */
1070 if (is_ext_opcode(opcode
)) {
1071 n
+= ext_opcode_destroy(ctx
, n
);
1075 /* for some commands, we need to free malloc'd memory */
1077 free(get_pointer(&n
[6]));
1080 free(get_pointer(&n
[10]));
1082 case OPCODE_CALL_LISTS
:
1083 free(get_pointer(&n
[3]));
1085 case OPCODE_DRAW_PIXELS
:
1086 free(get_pointer(&n
[5]));
1089 free(get_pointer(&n
[7]));
1091 case OPCODE_POLYGON_STIPPLE
:
1092 free(get_pointer(&n
[1]));
1094 case OPCODE_TEX_IMAGE1D
:
1095 free(get_pointer(&n
[8]));
1097 case OPCODE_TEX_IMAGE2D
:
1098 free(get_pointer(&n
[9]));
1100 case OPCODE_TEX_IMAGE3D
:
1101 free(get_pointer(&n
[10]));
1103 case OPCODE_TEX_SUB_IMAGE1D
:
1104 free(get_pointer(&n
[7]));
1106 case OPCODE_TEX_SUB_IMAGE2D
:
1107 free(get_pointer(&n
[9]));
1109 case OPCODE_TEX_SUB_IMAGE3D
:
1110 free(get_pointer(&n
[11]));
1112 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1113 free(get_pointer(&n
[7]));
1115 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1116 free(get_pointer(&n
[8]));
1118 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1119 free(get_pointer(&n
[9]));
1121 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1122 free(get_pointer(&n
[7]));
1124 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1125 free(get_pointer(&n
[9]));
1127 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1128 free(get_pointer(&n
[11]));
1130 case OPCODE_PROGRAM_STRING_ARB
:
1131 free(get_pointer(&n
[4])); /* program string */
1133 case OPCODE_UNIFORM_1FV
:
1134 case OPCODE_UNIFORM_2FV
:
1135 case OPCODE_UNIFORM_3FV
:
1136 case OPCODE_UNIFORM_4FV
:
1137 case OPCODE_UNIFORM_1DV
:
1138 case OPCODE_UNIFORM_2DV
:
1139 case OPCODE_UNIFORM_3DV
:
1140 case OPCODE_UNIFORM_4DV
:
1141 case OPCODE_UNIFORM_1IV
:
1142 case OPCODE_UNIFORM_2IV
:
1143 case OPCODE_UNIFORM_3IV
:
1144 case OPCODE_UNIFORM_4IV
:
1145 case OPCODE_UNIFORM_1UIV
:
1146 case OPCODE_UNIFORM_2UIV
:
1147 case OPCODE_UNIFORM_3UIV
:
1148 case OPCODE_UNIFORM_4UIV
:
1149 free(get_pointer(&n
[3]));
1151 case OPCODE_UNIFORM_MATRIX22
:
1152 case OPCODE_UNIFORM_MATRIX33
:
1153 case OPCODE_UNIFORM_MATRIX44
:
1154 case OPCODE_UNIFORM_MATRIX24
:
1155 case OPCODE_UNIFORM_MATRIX42
:
1156 case OPCODE_UNIFORM_MATRIX23
:
1157 case OPCODE_UNIFORM_MATRIX32
:
1158 case OPCODE_UNIFORM_MATRIX34
:
1159 case OPCODE_UNIFORM_MATRIX43
:
1160 case OPCODE_UNIFORM_MATRIX22D
:
1161 case OPCODE_UNIFORM_MATRIX33D
:
1162 case OPCODE_UNIFORM_MATRIX44D
:
1163 case OPCODE_UNIFORM_MATRIX24D
:
1164 case OPCODE_UNIFORM_MATRIX42D
:
1165 case OPCODE_UNIFORM_MATRIX23D
:
1166 case OPCODE_UNIFORM_MATRIX32D
:
1167 case OPCODE_UNIFORM_MATRIX34D
:
1168 case OPCODE_UNIFORM_MATRIX43D
:
1169 free(get_pointer(&n
[4]));
1171 case OPCODE_PROGRAM_UNIFORM_1FV
:
1172 case OPCODE_PROGRAM_UNIFORM_2FV
:
1173 case OPCODE_PROGRAM_UNIFORM_3FV
:
1174 case OPCODE_PROGRAM_UNIFORM_4FV
:
1175 case OPCODE_PROGRAM_UNIFORM_1DV
:
1176 case OPCODE_PROGRAM_UNIFORM_2DV
:
1177 case OPCODE_PROGRAM_UNIFORM_3DV
:
1178 case OPCODE_PROGRAM_UNIFORM_4DV
:
1179 case OPCODE_PROGRAM_UNIFORM_1IV
:
1180 case OPCODE_PROGRAM_UNIFORM_2IV
:
1181 case OPCODE_PROGRAM_UNIFORM_3IV
:
1182 case OPCODE_PROGRAM_UNIFORM_4IV
:
1183 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1184 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1185 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1186 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1187 free(get_pointer(&n
[4]));
1189 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1190 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1191 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1192 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1193 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1194 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1195 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1196 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1197 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1198 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1199 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1200 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1201 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1202 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1203 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1206 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1207 free(get_pointer(&n
[5]));
1209 case OPCODE_PIXEL_MAP
:
1210 free(get_pointer(&n
[3]));
1212 case OPCODE_VIEWPORT_ARRAY_V
:
1213 case OPCODE_SCISSOR_ARRAY_V
:
1214 case OPCODE_DEPTH_ARRAY_V
:
1215 case OPCODE_UNIFORM_SUBROUTINES
:
1216 case OPCODE_WINDOW_RECTANGLES
:
1217 free(get_pointer(&n
[3]));
1219 case OPCODE_TEXTURE_IMAGE1D
:
1220 free(get_pointer(&n
[9]));
1222 case OPCODE_TEXTURE_IMAGE2D
:
1223 free(get_pointer(&n
[10]));
1225 case OPCODE_TEXTURE_IMAGE3D
:
1226 free(get_pointer(&n
[11]));
1228 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1229 free(get_pointer(&n
[8]));
1231 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1232 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1233 free(get_pointer(&n
[10]));
1235 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1236 free(get_pointer(&n
[12]));
1238 case OPCODE_CONTINUE
:
1239 n
= (Node
*) get_pointer(&n
[1]);
1243 case OPCODE_END_OF_LIST
:
1248 /* just increment 'n' pointer, below */
1252 if (opcode
!= OPCODE_CONTINUE
) {
1253 assert(InstSize
[opcode
] > 0);
1254 n
+= InstSize
[opcode
];
1265 * Called by _mesa_HashWalk() to check if a display list which is being
1266 * deleted belongs to a bitmap texture atlas.
1269 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1271 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1272 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1274 /* See if the list_id falls in the range contained in this texture atlas */
1275 if (atlas
->complete
&&
1276 list_id
>= atlas_id
&&
1277 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1278 /* Mark the atlas as incomplete so it doesn't get used. But don't
1279 * delete it yet since we don't want to try to recreate it in the next
1282 atlas
->complete
= false;
1283 atlas
->incomplete
= true;
1289 * Destroy a display list and remove from hash table.
1290 * \param list - display list number
1293 destroy_list(struct gl_context
*ctx
, GLuint list
)
1295 struct gl_display_list
*dlist
;
1300 dlist
= _mesa_lookup_list(ctx
, list
);
1304 if (is_bitmap_list(dlist
)) {
1305 /* If we're destroying a simple glBitmap display list, there's a
1306 * chance that we're destroying a bitmap image that's in a texture
1307 * atlas. Examine all atlases to see if that's the case. There's
1308 * usually few (if any) atlases so this isn't expensive.
1310 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1311 check_atlas_for_deleted_list
, &list
);
1314 _mesa_delete_list(ctx
, dlist
);
1315 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1320 * Translate the nth element of list from <type> to GLint.
1323 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1335 bptr
= (GLbyte
*) list
;
1336 return (GLint
) bptr
[n
];
1337 case GL_UNSIGNED_BYTE
:
1338 ubptr
= (GLubyte
*) list
;
1339 return (GLint
) ubptr
[n
];
1341 sptr
= (GLshort
*) list
;
1342 return (GLint
) sptr
[n
];
1343 case GL_UNSIGNED_SHORT
:
1344 usptr
= (GLushort
*) list
;
1345 return (GLint
) usptr
[n
];
1347 iptr
= (GLint
*) list
;
1349 case GL_UNSIGNED_INT
:
1350 uiptr
= (GLuint
*) list
;
1351 return (GLint
) uiptr
[n
];
1353 fptr
= (GLfloat
*) list
;
1354 return (GLint
) floorf(fptr
[n
]);
1356 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1357 return (GLint
) ubptr
[0] * 256
1360 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1361 return (GLint
) ubptr
[0] * 65536
1362 + (GLint
) ubptr
[1] * 256
1365 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1366 return (GLint
) ubptr
[0] * 16777216
1367 + (GLint
) ubptr
[1] * 65536
1368 + (GLint
) ubptr
[2] * 256
1377 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1378 * If width < 0 or height < 0 or format or type are invalid we'll just
1379 * return NULL. We will not generate an error since OpenGL command
1380 * arguments aren't error-checked until the command is actually executed
1381 * (not when they're compiled).
1382 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1385 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1386 GLsizei width
, GLsizei height
, GLsizei depth
,
1387 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1388 const struct gl_pixelstore_attrib
*unpack
)
1390 if (width
<= 0 || height
<= 0) {
1394 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1395 /* bad format and/or type */
1399 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1403 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1404 format
, type
, pixels
, unpack
);
1405 if (pixels
&& !image
) {
1406 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1410 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1411 depth
, format
, type
, INT_MAX
, pixels
)) {
1412 const GLubyte
*map
, *src
;
1416 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1417 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1420 /* unable to map src buffer! */
1421 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1425 src
= ADD_POINTERS(map
, pixels
);
1426 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1427 format
, type
, src
, unpack
);
1429 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1432 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1438 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1443 /** Return copy of memory */
1445 memdup(const void *src
, GLsizei bytes
)
1447 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1449 memcpy(b
, src
, bytes
);
1455 * Allocate space for a display list instruction (opcode + payload space).
1456 * \param opcode the instruction opcode (OPCODE_* value)
1457 * \param bytes instruction payload size (not counting opcode)
1458 * \param align8 does the payload need to be 8-byte aligned?
1459 * This is only relevant in 64-bit environments.
1460 * \return pointer to allocated memory (the payload will be at pointer+1)
1463 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1465 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1466 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1470 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1472 if (opcode
< OPCODE_EXT_0
) {
1473 if (InstSize
[opcode
] == 0) {
1474 /* save instruction size now */
1475 InstSize
[opcode
] = numNodes
;
1478 /* make sure instruction size agrees */
1479 assert(numNodes
== InstSize
[opcode
]);
1483 if (sizeof(void *) > sizeof(Node
) && align8
1484 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1485 /* The opcode would get placed at node[0] and the payload would start
1486 * at node[1]. But the payload needs to be at an even offset (8-byte
1495 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1497 /* This block is full. Allocate a new block and chain to it */
1499 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1500 n
[0].opcode
= OPCODE_CONTINUE
;
1501 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1503 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1507 /* a fresh block should be 8-byte aligned on 64-bit systems */
1508 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1510 save_pointer(&n
[1], newblock
);
1511 ctx
->ListState
.CurrentBlock
= newblock
;
1512 ctx
->ListState
.CurrentPos
= 0;
1514 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1515 * we have to insert a NOP so that the payload of the real opcode lands
1516 * on an even location:
1517 * node[0] = OPCODE_NOP
1518 * node[1] = OPCODE_x;
1519 * node[2] = start of payload
1521 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1524 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1526 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1527 n
[0].opcode
= OPCODE_NOP
;
1529 /* The "real" opcode will now be at an odd location and the payload
1530 * will be at an even location.
1533 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1535 n
[0].opcode
= opcode
;
1543 * Allocate space for a display list instruction. Used by callers outside
1544 * this file for things like VBO vertex data.
1546 * \param opcode the instruction opcode (OPCODE_* value)
1547 * \param bytes instruction size in bytes, not counting opcode.
1548 * \return pointer to the usable data area (not including the internal
1552 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1554 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1556 return n
+ 1; /* return pointer to payload area, after opcode */
1563 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1564 * aligned in 64-bit environments, 4-byte aligned otherwise.
1567 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1569 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1571 return n
+ 1; /* return pointer to payload area, after opcode */
1578 * This function allows modules and drivers to get their own opcodes
1579 * for extending display list functionality.
1580 * \param ctx the rendering context
1581 * \param size number of bytes for storing the new display list command
1582 * \param execute function to execute the new display list command
1583 * \param destroy function to destroy the new display list command
1584 * \param print function to print the new display list command
1585 * \return the new opcode number or -1 if error
1588 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1590 void (*execute
) (struct gl_context
*, void *),
1591 void (*destroy
) (struct gl_context
*, void *),
1592 void (*print
) (struct gl_context
*, void *, FILE *))
1594 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1595 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1596 ctx
->ListExt
->Opcode
[i
].Size
=
1597 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1598 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1599 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1600 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1601 return i
+ OPCODE_EXT_0
;
1608 * Allocate space for a display list instruction. The space is basically
1609 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1610 * function parameter, node[2] is the second parameter, etc.
1612 * \param opcode one of OPCODE_x
1613 * \param nparams number of function parameters
1614 * \return pointer to start of instruction space
1616 static inline Node
*
1617 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1619 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1624 * Called by EndList to try to reduce memory used for the list.
1627 trim_list(struct gl_context
*ctx
)
1629 /* If the list we're ending only has one allocated block of nodes/tokens
1630 * and its size isn't a full block size, realloc the block to use less
1631 * memory. This is important for apps that create many small display
1632 * lists and apps that use glXUseXFont (many lists each containing one
1634 * Note: we currently only trim display lists that allocated one block
1635 * of tokens. That hits the short list case which is what we're mainly
1636 * concerned with. Trimming longer lists would involve traversing the
1637 * linked list of blocks.
1639 struct gl_dlist_state
*list
= &ctx
->ListState
;
1641 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1642 (list
->CurrentPos
< BLOCK_SIZE
)) {
1643 /* There's only one block and it's not full, so realloc */
1644 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1645 list
->CurrentList
->Head
=
1646 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1647 if (!list
->CurrentBlock
) {
1648 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1656 * Display List compilation functions
1658 static void GLAPIENTRY
1659 save_Accum(GLenum op
, GLfloat value
)
1661 GET_CURRENT_CONTEXT(ctx
);
1663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1664 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1669 if (ctx
->ExecuteFlag
) {
1670 CALL_Accum(ctx
->Exec
, (op
, value
));
1675 static void GLAPIENTRY
1676 save_AlphaFunc(GLenum func
, GLclampf ref
)
1678 GET_CURRENT_CONTEXT(ctx
);
1680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1681 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1684 n
[2].f
= (GLfloat
) ref
;
1686 if (ctx
->ExecuteFlag
) {
1687 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1692 static void GLAPIENTRY
1693 save_BindTexture(GLenum target
, GLuint texture
)
1695 GET_CURRENT_CONTEXT(ctx
);
1697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1698 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1703 if (ctx
->ExecuteFlag
) {
1704 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1709 static void GLAPIENTRY
1710 save_Bitmap(GLsizei width
, GLsizei height
,
1711 GLfloat xorig
, GLfloat yorig
,
1712 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1714 GET_CURRENT_CONTEXT(ctx
);
1716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1717 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1719 n
[1].i
= (GLint
) width
;
1720 n
[2].i
= (GLint
) height
;
1726 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1727 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1729 if (ctx
->ExecuteFlag
) {
1730 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1731 xorig
, yorig
, xmove
, ymove
, pixels
));
1736 static void GLAPIENTRY
1737 save_BlendEquation(GLenum mode
)
1739 GET_CURRENT_CONTEXT(ctx
);
1741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1742 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1746 if (ctx
->ExecuteFlag
) {
1747 CALL_BlendEquation(ctx
->Exec
, (mode
));
1752 static void GLAPIENTRY
1753 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1755 GET_CURRENT_CONTEXT(ctx
);
1757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1758 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1763 if (ctx
->ExecuteFlag
) {
1764 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1769 static void GLAPIENTRY
1770 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1771 GLenum sfactorA
, GLenum dfactorA
)
1773 GET_CURRENT_CONTEXT(ctx
);
1775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1776 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1778 n
[1].e
= sfactorRGB
;
1779 n
[2].e
= dfactorRGB
;
1783 if (ctx
->ExecuteFlag
) {
1784 CALL_BlendFuncSeparate(ctx
->Exec
,
1785 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1790 static void GLAPIENTRY
1791 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1793 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1797 static void GLAPIENTRY
1798 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1800 GET_CURRENT_CONTEXT(ctx
);
1802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1803 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1810 if (ctx
->ExecuteFlag
) {
1811 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1815 /* GL_ARB_draw_buffers_blend */
1816 static void GLAPIENTRY
1817 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1818 GLenum sfactorA
, GLenum dfactorA
)
1820 GET_CURRENT_CONTEXT(ctx
);
1822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1823 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1826 n
[2].e
= sfactorRGB
;
1827 n
[3].e
= dfactorRGB
;
1831 if (ctx
->ExecuteFlag
) {
1832 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1833 sfactorA
, dfactorA
));
1837 /* GL_ARB_draw_buffers_blend */
1838 static void GLAPIENTRY
1839 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1841 GET_CURRENT_CONTEXT(ctx
);
1843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1844 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1850 if (ctx
->ExecuteFlag
) {
1851 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1855 /* GL_ARB_draw_buffers_blend */
1856 static void GLAPIENTRY
1857 save_BlendEquationi(GLuint buf
, GLenum mode
)
1859 GET_CURRENT_CONTEXT(ctx
);
1861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1862 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1867 if (ctx
->ExecuteFlag
) {
1868 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1872 /* GL_ARB_draw_buffers_blend */
1873 static void GLAPIENTRY
1874 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1876 GET_CURRENT_CONTEXT(ctx
);
1878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1879 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1885 if (ctx
->ExecuteFlag
) {
1886 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1891 /* GL_ARB_draw_instanced. */
1892 static void GLAPIENTRY
1893 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1895 UNUSED GLsizei count
,
1896 UNUSED GLsizei primcount
)
1898 GET_CURRENT_CONTEXT(ctx
);
1899 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1900 "glDrawArraysInstanced() during display list compile");
1903 static void GLAPIENTRY
1904 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1905 UNUSED GLsizei count
,
1907 UNUSED
const GLvoid
*indices
,
1908 UNUSED GLsizei primcount
)
1910 GET_CURRENT_CONTEXT(ctx
);
1911 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1912 "glDrawElementsInstanced() during display list compile");
1915 static void GLAPIENTRY
1916 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1917 UNUSED GLsizei count
,
1919 UNUSED
const GLvoid
*indices
,
1920 UNUSED GLsizei primcount
,
1921 UNUSED GLint basevertex
)
1923 GET_CURRENT_CONTEXT(ctx
);
1924 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1925 "glDrawElementsInstancedBaseVertex() during display list compile");
1928 /* GL_ARB_base_instance. */
1929 static void GLAPIENTRY
1930 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1932 UNUSED GLsizei count
,
1933 UNUSED GLsizei primcount
,
1934 UNUSED GLuint baseinstance
)
1936 GET_CURRENT_CONTEXT(ctx
);
1937 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1938 "glDrawArraysInstancedBaseInstance() during display list compile");
1941 static void APIENTRY
1942 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1943 UNUSED GLsizei count
,
1945 UNUSED
const void *indices
,
1946 UNUSED GLsizei primcount
,
1947 UNUSED GLuint baseinstance
)
1949 GET_CURRENT_CONTEXT(ctx
);
1950 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1951 "glDrawElementsInstancedBaseInstance() during display list compile");
1954 static void APIENTRY
1955 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1956 UNUSED GLsizei count
,
1958 UNUSED
const void *indices
,
1959 UNUSED GLsizei primcount
,
1960 UNUSED GLint basevertex
,
1961 UNUSED GLuint baseinstance
)
1963 GET_CURRENT_CONTEXT(ctx
);
1964 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1965 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1968 static void APIENTRY
1969 save_DrawArraysIndirect(UNUSED GLenum mode
,
1970 UNUSED
const void *indirect
)
1972 GET_CURRENT_CONTEXT(ctx
);
1973 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1974 "glDrawArraysIndirect() during display list compile");
1977 static void APIENTRY
1978 save_DrawElementsIndirect(UNUSED GLenum mode
,
1980 UNUSED
const void *indirect
)
1982 GET_CURRENT_CONTEXT(ctx
);
1983 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1984 "glDrawElementsIndirect() during display list compile");
1987 static void APIENTRY
1988 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
1989 UNUSED
const void *indirect
,
1990 UNUSED GLsizei primcount
,
1991 UNUSED GLsizei stride
)
1993 GET_CURRENT_CONTEXT(ctx
);
1994 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1995 "glMultiDrawArraysIndirect() during display list compile");
1998 static void APIENTRY
1999 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2001 UNUSED
const void *indirect
,
2002 UNUSED GLsizei primcount
,
2003 UNUSED GLsizei stride
)
2005 GET_CURRENT_CONTEXT(ctx
);
2006 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2007 "glMultiDrawElementsIndirect() during display list compile");
2011 * While building a display list we cache some OpenGL state.
2012 * Under some circumstances we need to invalidate that state (immediately
2013 * when we start compiling a list, or after glCallList(s)).
2016 invalidate_saved_current_state(struct gl_context
*ctx
)
2020 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2021 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2023 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2024 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2026 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2028 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2032 static void GLAPIENTRY
2033 save_CallList(GLuint list
)
2035 GET_CURRENT_CONTEXT(ctx
);
2037 SAVE_FLUSH_VERTICES(ctx
);
2039 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2044 /* After this, we don't know what state we're in. Invalidate all
2045 * cached information previously gathered:
2047 invalidate_saved_current_state( ctx
);
2049 if (ctx
->ExecuteFlag
) {
2050 _mesa_CallList(list
);
2055 static void GLAPIENTRY
2056 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2058 GET_CURRENT_CONTEXT(ctx
);
2063 SAVE_FLUSH_VERTICES(ctx
);
2067 case GL_UNSIGNED_BYTE
:
2071 case GL_UNSIGNED_SHORT
:
2079 case GL_UNSIGNED_INT
:
2088 if (num
> 0 && type_size
> 0) {
2089 /* create a copy of the array of list IDs to save in the display list */
2090 lists_copy
= memdup(lists
, num
* type_size
);
2095 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2099 save_pointer(&n
[3], lists_copy
);
2102 /* After this, we don't know what state we're in. Invalidate all
2103 * cached information previously gathered:
2105 invalidate_saved_current_state( ctx
);
2107 if (ctx
->ExecuteFlag
) {
2108 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2113 static void GLAPIENTRY
2114 save_Clear(GLbitfield mask
)
2116 GET_CURRENT_CONTEXT(ctx
);
2118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2119 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2123 if (ctx
->ExecuteFlag
) {
2124 CALL_Clear(ctx
->Exec
, (mask
));
2129 static void GLAPIENTRY
2130 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2132 GET_CURRENT_CONTEXT(ctx
);
2134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2135 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2138 n
[2].i
= drawbuffer
;
2140 if (buffer
== GL_COLOR
) {
2151 if (ctx
->ExecuteFlag
) {
2152 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2157 static void GLAPIENTRY
2158 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2160 GET_CURRENT_CONTEXT(ctx
);
2162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2163 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2166 n
[2].i
= drawbuffer
;
2168 if (buffer
== GL_COLOR
) {
2179 if (ctx
->ExecuteFlag
) {
2180 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2185 static void GLAPIENTRY
2186 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2188 GET_CURRENT_CONTEXT(ctx
);
2190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2191 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2194 n
[2].i
= drawbuffer
;
2196 if (buffer
== GL_COLOR
) {
2207 if (ctx
->ExecuteFlag
) {
2208 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2213 static void GLAPIENTRY
2214 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2215 GLfloat depth
, GLint stencil
)
2217 GET_CURRENT_CONTEXT(ctx
);
2219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2220 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2223 n
[2].i
= drawbuffer
;
2227 if (ctx
->ExecuteFlag
) {
2228 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2233 static void GLAPIENTRY
2234 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2236 GET_CURRENT_CONTEXT(ctx
);
2238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2239 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2246 if (ctx
->ExecuteFlag
) {
2247 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2252 static void GLAPIENTRY
2253 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2255 GET_CURRENT_CONTEXT(ctx
);
2257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2258 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2265 if (ctx
->ExecuteFlag
) {
2266 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2271 static void GLAPIENTRY
2272 save_ClearDepth(GLclampd depth
)
2274 GET_CURRENT_CONTEXT(ctx
);
2276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2277 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2279 n
[1].f
= (GLfloat
) depth
;
2281 if (ctx
->ExecuteFlag
) {
2282 CALL_ClearDepth(ctx
->Exec
, (depth
));
2287 static void GLAPIENTRY
2288 save_ClearIndex(GLfloat c
)
2290 GET_CURRENT_CONTEXT(ctx
);
2292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2293 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_ClearIndex(ctx
->Exec
, (c
));
2303 static void GLAPIENTRY
2304 save_ClearStencil(GLint s
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2313 if (ctx
->ExecuteFlag
) {
2314 CALL_ClearStencil(ctx
->Exec
, (s
));
2319 static void GLAPIENTRY
2320 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2322 GET_CURRENT_CONTEXT(ctx
);
2324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2325 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2328 n
[2].f
= (GLfloat
) equ
[0];
2329 n
[3].f
= (GLfloat
) equ
[1];
2330 n
[4].f
= (GLfloat
) equ
[2];
2331 n
[5].f
= (GLfloat
) equ
[3];
2333 if (ctx
->ExecuteFlag
) {
2334 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2340 static void GLAPIENTRY
2341 save_ColorMask(GLboolean red
, GLboolean green
,
2342 GLboolean blue
, GLboolean alpha
)
2344 GET_CURRENT_CONTEXT(ctx
);
2346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2347 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2354 if (ctx
->ExecuteFlag
) {
2355 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2360 static void GLAPIENTRY
2361 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2362 GLboolean blue
, GLboolean alpha
)
2364 GET_CURRENT_CONTEXT(ctx
);
2366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2367 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2375 if (ctx
->ExecuteFlag
) {
2376 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2381 static void GLAPIENTRY
2382 save_ColorMaterial(GLenum face
, GLenum mode
)
2384 GET_CURRENT_CONTEXT(ctx
);
2386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2388 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2393 if (ctx
->ExecuteFlag
) {
2394 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2399 static void GLAPIENTRY
2400 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2402 GET_CURRENT_CONTEXT(ctx
);
2404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2405 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2409 n
[3].i
= (GLint
) width
;
2410 n
[4].i
= (GLint
) height
;
2413 if (ctx
->ExecuteFlag
) {
2414 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2420 static void GLAPIENTRY
2421 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2422 GLint x
, GLint y
, GLsizei width
, GLint border
)
2424 GET_CURRENT_CONTEXT(ctx
);
2426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2427 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2431 n
[3].e
= internalformat
;
2437 if (ctx
->ExecuteFlag
) {
2438 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2439 x
, y
, width
, border
));
2444 static void GLAPIENTRY
2445 save_CopyTexImage2D(GLenum target
, GLint level
,
2446 GLenum internalformat
,
2447 GLint x
, GLint y
, GLsizei width
,
2448 GLsizei height
, GLint border
)
2450 GET_CURRENT_CONTEXT(ctx
);
2452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2453 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2457 n
[3].e
= internalformat
;
2464 if (ctx
->ExecuteFlag
) {
2465 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2466 x
, y
, width
, height
, border
));
2472 static void GLAPIENTRY
2473 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2474 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2476 GET_CURRENT_CONTEXT(ctx
);
2478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2479 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2488 if (ctx
->ExecuteFlag
) {
2489 CALL_CopyTexSubImage1D(ctx
->Exec
,
2490 (target
, level
, xoffset
, x
, y
, width
));
2495 static void GLAPIENTRY
2496 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2497 GLint xoffset
, GLint yoffset
,
2498 GLint x
, GLint y
, GLsizei width
, GLint height
)
2500 GET_CURRENT_CONTEXT(ctx
);
2502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2503 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2514 if (ctx
->ExecuteFlag
) {
2515 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2516 x
, y
, width
, height
));
2521 static void GLAPIENTRY
2522 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2523 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2524 GLint x
, GLint y
, GLsizei width
, GLint height
)
2526 GET_CURRENT_CONTEXT(ctx
);
2528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2529 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2541 if (ctx
->ExecuteFlag
) {
2542 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2543 xoffset
, yoffset
, zoffset
,
2544 x
, y
, width
, height
));
2549 static void GLAPIENTRY
2550 save_CullFace(GLenum mode
)
2552 GET_CURRENT_CONTEXT(ctx
);
2554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2555 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2559 if (ctx
->ExecuteFlag
) {
2560 CALL_CullFace(ctx
->Exec
, (mode
));
2565 static void GLAPIENTRY
2566 save_DepthFunc(GLenum func
)
2568 GET_CURRENT_CONTEXT(ctx
);
2570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2571 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2575 if (ctx
->ExecuteFlag
) {
2576 CALL_DepthFunc(ctx
->Exec
, (func
));
2581 static void GLAPIENTRY
2582 save_DepthMask(GLboolean mask
)
2584 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2591 if (ctx
->ExecuteFlag
) {
2592 CALL_DepthMask(ctx
->Exec
, (mask
));
2597 static void GLAPIENTRY
2598 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2600 GET_CURRENT_CONTEXT(ctx
);
2602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2603 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2605 n
[1].f
= (GLfloat
) nearval
;
2606 n
[2].f
= (GLfloat
) farval
;
2608 if (ctx
->ExecuteFlag
) {
2609 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2614 static void GLAPIENTRY
2615 save_Disable(GLenum cap
)
2617 GET_CURRENT_CONTEXT(ctx
);
2619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2620 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2624 if (ctx
->ExecuteFlag
) {
2625 CALL_Disable(ctx
->Exec
, (cap
));
2630 static void GLAPIENTRY
2631 save_DisableIndexed(GLuint index
, GLenum cap
)
2633 GET_CURRENT_CONTEXT(ctx
);
2635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2636 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2641 if (ctx
->ExecuteFlag
) {
2642 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2647 static void GLAPIENTRY
2648 save_DrawBuffer(GLenum mode
)
2650 GET_CURRENT_CONTEXT(ctx
);
2652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2653 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2657 if (ctx
->ExecuteFlag
) {
2658 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2663 static void GLAPIENTRY
2664 save_DrawPixels(GLsizei width
, GLsizei height
,
2665 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2667 GET_CURRENT_CONTEXT(ctx
);
2670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2672 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2679 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2680 pixels
, &ctx
->Unpack
));
2682 if (ctx
->ExecuteFlag
) {
2683 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2689 static void GLAPIENTRY
2690 save_Enable(GLenum cap
)
2692 GET_CURRENT_CONTEXT(ctx
);
2694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2695 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2699 if (ctx
->ExecuteFlag
) {
2700 CALL_Enable(ctx
->Exec
, (cap
));
2706 static void GLAPIENTRY
2707 save_EnableIndexed(GLuint index
, GLenum cap
)
2709 GET_CURRENT_CONTEXT(ctx
);
2711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2712 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2717 if (ctx
->ExecuteFlag
) {
2718 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2724 static void GLAPIENTRY
2725 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2727 GET_CURRENT_CONTEXT(ctx
);
2729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2730 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2736 if (ctx
->ExecuteFlag
) {
2737 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2742 static void GLAPIENTRY
2743 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2745 GET_CURRENT_CONTEXT(ctx
);
2747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2748 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2756 if (ctx
->ExecuteFlag
) {
2757 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2764 static void GLAPIENTRY
2765 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2767 GET_CURRENT_CONTEXT(ctx
);
2769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2770 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2778 if (ctx
->ExecuteFlag
) {
2779 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2784 static void GLAPIENTRY
2785 save_Fogf(GLenum pname
, GLfloat param
)
2789 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2790 save_Fogfv(pname
, parray
);
2794 static void GLAPIENTRY
2795 save_Fogiv(GLenum pname
, const GLint
*params
)
2800 case GL_FOG_DENSITY
:
2804 case GL_FOG_COORDINATE_SOURCE
:
2805 p
[0] = (GLfloat
) *params
;
2811 p
[0] = INT_TO_FLOAT(params
[0]);
2812 p
[1] = INT_TO_FLOAT(params
[1]);
2813 p
[2] = INT_TO_FLOAT(params
[2]);
2814 p
[3] = INT_TO_FLOAT(params
[3]);
2817 /* Error will be caught later in gl_Fogfv */
2818 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2820 save_Fogfv(pname
, p
);
2824 static void GLAPIENTRY
2825 save_Fogi(GLenum pname
, GLint param
)
2829 parray
[1] = parray
[2] = parray
[3] = 0;
2830 save_Fogiv(pname
, parray
);
2834 static void GLAPIENTRY
2835 save_FrontFace(GLenum mode
)
2837 GET_CURRENT_CONTEXT(ctx
);
2839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2840 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2844 if (ctx
->ExecuteFlag
) {
2845 CALL_FrontFace(ctx
->Exec
, (mode
));
2850 static void GLAPIENTRY
2851 save_Frustum(GLdouble left
, GLdouble right
,
2852 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2854 GET_CURRENT_CONTEXT(ctx
);
2856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2857 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2859 n
[1].f
= (GLfloat
) left
;
2860 n
[2].f
= (GLfloat
) right
;
2861 n
[3].f
= (GLfloat
) bottom
;
2862 n
[4].f
= (GLfloat
) top
;
2863 n
[5].f
= (GLfloat
) nearval
;
2864 n
[6].f
= (GLfloat
) farval
;
2866 if (ctx
->ExecuteFlag
) {
2867 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2872 static void GLAPIENTRY
2873 save_Hint(GLenum target
, GLenum mode
)
2875 GET_CURRENT_CONTEXT(ctx
);
2877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2878 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2883 if (ctx
->ExecuteFlag
) {
2884 CALL_Hint(ctx
->Exec
, (target
, mode
));
2889 static void GLAPIENTRY
2890 save_IndexMask(GLuint mask
)
2892 GET_CURRENT_CONTEXT(ctx
);
2894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2895 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2899 if (ctx
->ExecuteFlag
) {
2900 CALL_IndexMask(ctx
->Exec
, (mask
));
2905 static void GLAPIENTRY
2906 save_InitNames(void)
2908 GET_CURRENT_CONTEXT(ctx
);
2909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2910 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2911 if (ctx
->ExecuteFlag
) {
2912 CALL_InitNames(ctx
->Exec
, ());
2917 static void GLAPIENTRY
2918 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2920 GET_CURRENT_CONTEXT(ctx
);
2922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2923 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2941 case GL_SPOT_DIRECTION
:
2944 case GL_SPOT_EXPONENT
:
2947 case GL_SPOT_CUTOFF
:
2950 case GL_CONSTANT_ATTENUATION
:
2953 case GL_LINEAR_ATTENUATION
:
2956 case GL_QUADRATIC_ATTENUATION
:
2962 for (i
= 0; i
< nParams
; i
++) {
2963 n
[3 + i
].f
= params
[i
];
2966 if (ctx
->ExecuteFlag
) {
2967 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2972 static void GLAPIENTRY
2973 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2977 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2978 save_Lightfv(light
, pname
, parray
);
2982 static void GLAPIENTRY
2983 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2990 fparam
[0] = INT_TO_FLOAT(params
[0]);
2991 fparam
[1] = INT_TO_FLOAT(params
[1]);
2992 fparam
[2] = INT_TO_FLOAT(params
[2]);
2993 fparam
[3] = INT_TO_FLOAT(params
[3]);
2996 fparam
[0] = (GLfloat
) params
[0];
2997 fparam
[1] = (GLfloat
) params
[1];
2998 fparam
[2] = (GLfloat
) params
[2];
2999 fparam
[3] = (GLfloat
) params
[3];
3001 case GL_SPOT_DIRECTION
:
3002 fparam
[0] = (GLfloat
) params
[0];
3003 fparam
[1] = (GLfloat
) params
[1];
3004 fparam
[2] = (GLfloat
) params
[2];
3006 case GL_SPOT_EXPONENT
:
3007 case GL_SPOT_CUTOFF
:
3008 case GL_CONSTANT_ATTENUATION
:
3009 case GL_LINEAR_ATTENUATION
:
3010 case GL_QUADRATIC_ATTENUATION
:
3011 fparam
[0] = (GLfloat
) params
[0];
3014 /* error will be caught later in gl_Lightfv */
3017 save_Lightfv(light
, pname
, fparam
);
3021 static void GLAPIENTRY
3022 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3026 parray
[1] = parray
[2] = parray
[3] = 0;
3027 save_Lightiv(light
, pname
, parray
);
3031 static void GLAPIENTRY
3032 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3034 GET_CURRENT_CONTEXT(ctx
);
3036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3037 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3045 if (ctx
->ExecuteFlag
) {
3046 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3051 static void GLAPIENTRY
3052 save_LightModelf(GLenum pname
, GLfloat param
)
3056 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3057 save_LightModelfv(pname
, parray
);
3061 static void GLAPIENTRY
3062 save_LightModeliv(GLenum pname
, const GLint
*params
)
3066 case GL_LIGHT_MODEL_AMBIENT
:
3067 fparam
[0] = INT_TO_FLOAT(params
[0]);
3068 fparam
[1] = INT_TO_FLOAT(params
[1]);
3069 fparam
[2] = INT_TO_FLOAT(params
[2]);
3070 fparam
[3] = INT_TO_FLOAT(params
[3]);
3072 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3073 case GL_LIGHT_MODEL_TWO_SIDE
:
3074 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3075 fparam
[0] = (GLfloat
) params
[0];
3081 /* Error will be caught later in gl_LightModelfv */
3082 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3084 save_LightModelfv(pname
, fparam
);
3088 static void GLAPIENTRY
3089 save_LightModeli(GLenum pname
, GLint param
)
3093 parray
[1] = parray
[2] = parray
[3] = 0;
3094 save_LightModeliv(pname
, parray
);
3098 static void GLAPIENTRY
3099 save_LineStipple(GLint factor
, GLushort pattern
)
3101 GET_CURRENT_CONTEXT(ctx
);
3103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3104 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3109 if (ctx
->ExecuteFlag
) {
3110 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3115 static void GLAPIENTRY
3116 save_LineWidth(GLfloat width
)
3118 GET_CURRENT_CONTEXT(ctx
);
3120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3121 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3125 if (ctx
->ExecuteFlag
) {
3126 CALL_LineWidth(ctx
->Exec
, (width
));
3131 static void GLAPIENTRY
3132 save_ListBase(GLuint base
)
3134 GET_CURRENT_CONTEXT(ctx
);
3136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3137 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3141 if (ctx
->ExecuteFlag
) {
3142 CALL_ListBase(ctx
->Exec
, (base
));
3147 static void GLAPIENTRY
3148 save_LoadIdentity(void)
3150 GET_CURRENT_CONTEXT(ctx
);
3151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3152 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3153 if (ctx
->ExecuteFlag
) {
3154 CALL_LoadIdentity(ctx
->Exec
, ());
3159 static void GLAPIENTRY
3160 save_LoadMatrixf(const GLfloat
* m
)
3162 GET_CURRENT_CONTEXT(ctx
);
3164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3165 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3168 for (i
= 0; i
< 16; i
++) {
3172 if (ctx
->ExecuteFlag
) {
3173 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3178 static void GLAPIENTRY
3179 save_LoadMatrixd(const GLdouble
* m
)
3183 for (i
= 0; i
< 16; i
++) {
3184 f
[i
] = (GLfloat
) m
[i
];
3186 save_LoadMatrixf(f
);
3190 static void GLAPIENTRY
3191 save_LoadName(GLuint name
)
3193 GET_CURRENT_CONTEXT(ctx
);
3195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3196 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3200 if (ctx
->ExecuteFlag
) {
3201 CALL_LoadName(ctx
->Exec
, (name
));
3206 static void GLAPIENTRY
3207 save_LogicOp(GLenum opcode
)
3209 GET_CURRENT_CONTEXT(ctx
);
3211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3212 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3216 if (ctx
->ExecuteFlag
) {
3217 CALL_LogicOp(ctx
->Exec
, (opcode
));
3222 static void GLAPIENTRY
3223 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3224 GLint order
, const GLdouble
* points
)
3226 GET_CURRENT_CONTEXT(ctx
);
3228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3229 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3231 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3233 n
[2].f
= (GLfloat
) u1
;
3234 n
[3].f
= (GLfloat
) u2
;
3235 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3237 save_pointer(&n
[6], pnts
);
3239 if (ctx
->ExecuteFlag
) {
3240 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3244 static void GLAPIENTRY
3245 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3246 GLint order
, const GLfloat
* points
)
3248 GET_CURRENT_CONTEXT(ctx
);
3250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3251 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3253 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3257 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3259 save_pointer(&n
[6], pnts
);
3261 if (ctx
->ExecuteFlag
) {
3262 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3267 static void GLAPIENTRY
3268 save_Map2d(GLenum target
,
3269 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3270 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3271 const GLdouble
* points
)
3273 GET_CURRENT_CONTEXT(ctx
);
3275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3276 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3278 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3279 vstride
, vorder
, points
);
3281 n
[2].f
= (GLfloat
) u1
;
3282 n
[3].f
= (GLfloat
) u2
;
3283 n
[4].f
= (GLfloat
) v1
;
3284 n
[5].f
= (GLfloat
) v2
;
3285 /* XXX verify these strides are correct */
3286 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3287 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3290 save_pointer(&n
[10], pnts
);
3292 if (ctx
->ExecuteFlag
) {
3293 CALL_Map2d(ctx
->Exec
, (target
,
3294 u1
, u2
, ustride
, uorder
,
3295 v1
, v2
, vstride
, vorder
, points
));
3300 static void GLAPIENTRY
3301 save_Map2f(GLenum target
,
3302 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3303 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3304 const GLfloat
* points
)
3306 GET_CURRENT_CONTEXT(ctx
);
3308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3309 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3311 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3312 vstride
, vorder
, points
);
3318 /* XXX verify these strides are correct */
3319 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3320 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3323 save_pointer(&n
[10], pnts
);
3325 if (ctx
->ExecuteFlag
) {
3326 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3327 v1
, v2
, vstride
, vorder
, points
));
3332 static void GLAPIENTRY
3333 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3335 GET_CURRENT_CONTEXT(ctx
);
3337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3338 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3344 if (ctx
->ExecuteFlag
) {
3345 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3350 static void GLAPIENTRY
3351 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3353 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3357 static void GLAPIENTRY
3358 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3359 GLint vn
, GLfloat v1
, GLfloat v2
)
3361 GET_CURRENT_CONTEXT(ctx
);
3363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3364 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3373 if (ctx
->ExecuteFlag
) {
3374 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3380 static void GLAPIENTRY
3381 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3382 GLint vn
, GLdouble v1
, GLdouble v2
)
3384 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3385 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3389 static void GLAPIENTRY
3390 save_MatrixMode(GLenum mode
)
3392 GET_CURRENT_CONTEXT(ctx
);
3394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3395 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3399 if (ctx
->ExecuteFlag
) {
3400 CALL_MatrixMode(ctx
->Exec
, (mode
));
3405 static void GLAPIENTRY
3406 save_MultMatrixf(const GLfloat
* m
)
3408 GET_CURRENT_CONTEXT(ctx
);
3410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3411 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3414 for (i
= 0; i
< 16; i
++) {
3418 if (ctx
->ExecuteFlag
) {
3419 CALL_MultMatrixf(ctx
->Exec
, (m
));
3424 static void GLAPIENTRY
3425 save_MultMatrixd(const GLdouble
* m
)
3429 for (i
= 0; i
< 16; i
++) {
3430 f
[i
] = (GLfloat
) m
[i
];
3432 save_MultMatrixf(f
);
3436 static void GLAPIENTRY
3437 save_NewList(GLuint name
, GLenum mode
)
3439 GET_CURRENT_CONTEXT(ctx
);
3440 /* It's an error to call this function while building a display list */
3441 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3448 static void GLAPIENTRY
3449 save_Ortho(GLdouble left
, GLdouble right
,
3450 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3452 GET_CURRENT_CONTEXT(ctx
);
3454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3455 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3457 n
[1].f
= (GLfloat
) left
;
3458 n
[2].f
= (GLfloat
) right
;
3459 n
[3].f
= (GLfloat
) bottom
;
3460 n
[4].f
= (GLfloat
) top
;
3461 n
[5].f
= (GLfloat
) nearval
;
3462 n
[6].f
= (GLfloat
) farval
;
3464 if (ctx
->ExecuteFlag
) {
3465 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3470 static void GLAPIENTRY
3471 save_PatchParameteri(GLenum pname
, const GLint value
)
3473 GET_CURRENT_CONTEXT(ctx
);
3475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3476 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3481 if (ctx
->ExecuteFlag
) {
3482 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3487 static void GLAPIENTRY
3488 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3490 GET_CURRENT_CONTEXT(ctx
);
3492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3494 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3495 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3497 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3498 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3502 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3512 if (ctx
->ExecuteFlag
) {
3513 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3518 static void GLAPIENTRY
3519 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3521 GET_CURRENT_CONTEXT(ctx
);
3523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3524 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3528 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3530 if (ctx
->ExecuteFlag
) {
3531 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3536 static void GLAPIENTRY
3537 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3539 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3541 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3542 for (i
= 0; i
< mapsize
; i
++) {
3543 fvalues
[i
] = (GLfloat
) values
[i
];
3547 for (i
= 0; i
< mapsize
; i
++) {
3548 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3551 save_PixelMapfv(map
, mapsize
, fvalues
);
3555 static void GLAPIENTRY
3556 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3558 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3560 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3561 for (i
= 0; i
< mapsize
; i
++) {
3562 fvalues
[i
] = (GLfloat
) values
[i
];
3566 for (i
= 0; i
< mapsize
; i
++) {
3567 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3570 save_PixelMapfv(map
, mapsize
, fvalues
);
3574 static void GLAPIENTRY
3575 save_PixelTransferf(GLenum pname
, GLfloat param
)
3577 GET_CURRENT_CONTEXT(ctx
);
3579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3580 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3585 if (ctx
->ExecuteFlag
) {
3586 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3591 static void GLAPIENTRY
3592 save_PixelTransferi(GLenum pname
, GLint param
)
3594 save_PixelTransferf(pname
, (GLfloat
) param
);
3598 static void GLAPIENTRY
3599 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3601 GET_CURRENT_CONTEXT(ctx
);
3603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3604 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3609 if (ctx
->ExecuteFlag
) {
3610 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3615 static void GLAPIENTRY
3616 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3618 GET_CURRENT_CONTEXT(ctx
);
3620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3621 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3628 if (ctx
->ExecuteFlag
) {
3629 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3634 static void GLAPIENTRY
3635 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3639 parray
[1] = parray
[2] = 0.0F
;
3640 save_PointParameterfvEXT(pname
, parray
);
3643 static void GLAPIENTRY
3644 save_PointParameteriNV(GLenum pname
, GLint param
)
3647 parray
[0] = (GLfloat
) param
;
3648 parray
[1] = parray
[2] = 0.0F
;
3649 save_PointParameterfvEXT(pname
, parray
);
3652 static void GLAPIENTRY
3653 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3656 parray
[0] = (GLfloat
) param
[0];
3657 parray
[1] = parray
[2] = 0.0F
;
3658 save_PointParameterfvEXT(pname
, parray
);
3662 static void GLAPIENTRY
3663 save_PointSize(GLfloat size
)
3665 GET_CURRENT_CONTEXT(ctx
);
3667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3668 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3672 if (ctx
->ExecuteFlag
) {
3673 CALL_PointSize(ctx
->Exec
, (size
));
3678 static void GLAPIENTRY
3679 save_PolygonMode(GLenum face
, GLenum mode
)
3681 GET_CURRENT_CONTEXT(ctx
);
3683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3684 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3689 if (ctx
->ExecuteFlag
) {
3690 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3695 static void GLAPIENTRY
3696 save_PolygonStipple(const GLubyte
* pattern
)
3698 GET_CURRENT_CONTEXT(ctx
);
3701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3703 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3706 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3707 pattern
, &ctx
->Unpack
));
3709 if (ctx
->ExecuteFlag
) {
3710 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3715 static void GLAPIENTRY
3716 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3718 GET_CURRENT_CONTEXT(ctx
);
3720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3721 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3726 if (ctx
->ExecuteFlag
) {
3727 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3732 static void GLAPIENTRY
3733 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3735 GET_CURRENT_CONTEXT(ctx
);
3737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3738 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3744 if (ctx
->ExecuteFlag
) {
3745 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3749 static void GLAPIENTRY
3750 save_PopAttrib(void)
3752 GET_CURRENT_CONTEXT(ctx
);
3753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3754 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3755 if (ctx
->ExecuteFlag
) {
3756 CALL_PopAttrib(ctx
->Exec
, ());
3761 static void GLAPIENTRY
3762 save_PopMatrix(void)
3764 GET_CURRENT_CONTEXT(ctx
);
3765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3766 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3767 if (ctx
->ExecuteFlag
) {
3768 CALL_PopMatrix(ctx
->Exec
, ());
3773 static void GLAPIENTRY
3776 GET_CURRENT_CONTEXT(ctx
);
3777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3778 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3779 if (ctx
->ExecuteFlag
) {
3780 CALL_PopName(ctx
->Exec
, ());
3785 static void GLAPIENTRY
3786 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3787 const GLclampf
* priorities
)
3789 GET_CURRENT_CONTEXT(ctx
);
3791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3793 for (i
= 0; i
< num
; i
++) {
3795 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3797 n
[1].ui
= textures
[i
];
3798 n
[2].f
= priorities
[i
];
3801 if (ctx
->ExecuteFlag
) {
3802 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3807 static void GLAPIENTRY
3808 save_PushAttrib(GLbitfield mask
)
3810 GET_CURRENT_CONTEXT(ctx
);
3812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3813 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3817 if (ctx
->ExecuteFlag
) {
3818 CALL_PushAttrib(ctx
->Exec
, (mask
));
3823 static void GLAPIENTRY
3824 save_PushMatrix(void)
3826 GET_CURRENT_CONTEXT(ctx
);
3827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3828 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3829 if (ctx
->ExecuteFlag
) {
3830 CALL_PushMatrix(ctx
->Exec
, ());
3835 static void GLAPIENTRY
3836 save_PushName(GLuint name
)
3838 GET_CURRENT_CONTEXT(ctx
);
3840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3841 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3845 if (ctx
->ExecuteFlag
) {
3846 CALL_PushName(ctx
->Exec
, (name
));
3851 static void GLAPIENTRY
3852 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3854 GET_CURRENT_CONTEXT(ctx
);
3856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3857 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3864 if (ctx
->ExecuteFlag
) {
3865 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3869 static void GLAPIENTRY
3870 save_RasterPos2d(GLdouble x
, GLdouble y
)
3872 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3875 static void GLAPIENTRY
3876 save_RasterPos2f(GLfloat x
, GLfloat y
)
3878 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3881 static void GLAPIENTRY
3882 save_RasterPos2i(GLint x
, GLint y
)
3884 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3887 static void GLAPIENTRY
3888 save_RasterPos2s(GLshort x
, GLshort y
)
3890 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3893 static void GLAPIENTRY
3894 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3896 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3899 static void GLAPIENTRY
3900 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3902 save_RasterPos4f(x
, y
, z
, 1.0F
);
3905 static void GLAPIENTRY
3906 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3908 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3911 static void GLAPIENTRY
3912 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3914 save_RasterPos4f(x
, y
, z
, 1.0F
);
3917 static void GLAPIENTRY
3918 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3920 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3923 static void GLAPIENTRY
3924 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3926 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3929 static void GLAPIENTRY
3930 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3932 save_RasterPos4f(x
, y
, z
, w
);
3935 static void GLAPIENTRY
3936 save_RasterPos2dv(const GLdouble
* v
)
3938 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3941 static void GLAPIENTRY
3942 save_RasterPos2fv(const GLfloat
* v
)
3944 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3947 static void GLAPIENTRY
3948 save_RasterPos2iv(const GLint
* v
)
3950 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3953 static void GLAPIENTRY
3954 save_RasterPos2sv(const GLshort
* v
)
3956 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3959 static void GLAPIENTRY
3960 save_RasterPos3dv(const GLdouble
* v
)
3962 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3965 static void GLAPIENTRY
3966 save_RasterPos3fv(const GLfloat
* v
)
3968 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3971 static void GLAPIENTRY
3972 save_RasterPos3iv(const GLint
* v
)
3974 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3977 static void GLAPIENTRY
3978 save_RasterPos3sv(const GLshort
* v
)
3980 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3983 static void GLAPIENTRY
3984 save_RasterPos4dv(const GLdouble
* v
)
3986 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3987 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3990 static void GLAPIENTRY
3991 save_RasterPos4fv(const GLfloat
* v
)
3993 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3996 static void GLAPIENTRY
3997 save_RasterPos4iv(const GLint
* v
)
3999 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4000 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4003 static void GLAPIENTRY
4004 save_RasterPos4sv(const GLshort
* v
)
4006 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4010 static void GLAPIENTRY
4011 save_PassThrough(GLfloat token
)
4013 GET_CURRENT_CONTEXT(ctx
);
4015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4016 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4020 if (ctx
->ExecuteFlag
) {
4021 CALL_PassThrough(ctx
->Exec
, (token
));
4026 static void GLAPIENTRY
4027 save_ReadBuffer(GLenum mode
)
4029 GET_CURRENT_CONTEXT(ctx
);
4031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4032 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4036 if (ctx
->ExecuteFlag
) {
4037 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4042 static void GLAPIENTRY
4043 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4045 GET_CURRENT_CONTEXT(ctx
);
4047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4048 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4055 if (ctx
->ExecuteFlag
) {
4056 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4061 static void GLAPIENTRY
4062 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4064 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4068 static void GLAPIENTRY
4069 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4071 GET_CURRENT_CONTEXT(ctx
);
4073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4074 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4080 if (ctx
->ExecuteFlag
) {
4081 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4086 static void GLAPIENTRY
4087 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4089 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4093 static void GLAPIENTRY
4094 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4096 GET_CURRENT_CONTEXT(ctx
);
4098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4099 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4106 if (ctx
->ExecuteFlag
) {
4107 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4112 static void GLAPIENTRY
4113 save_ShadeModel(GLenum mode
)
4115 GET_CURRENT_CONTEXT(ctx
);
4117 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4119 if (ctx
->ExecuteFlag
) {
4120 CALL_ShadeModel(ctx
->Exec
, (mode
));
4123 /* Don't compile this call if it's a no-op.
4124 * By avoiding this state change we have a better chance of
4125 * coalescing subsequent drawing commands into one batch.
4127 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4130 SAVE_FLUSH_VERTICES(ctx
);
4132 ctx
->ListState
.Current
.ShadeModel
= mode
;
4134 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4141 static void GLAPIENTRY
4142 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4144 GET_CURRENT_CONTEXT(ctx
);
4146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4147 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4153 if (ctx
->ExecuteFlag
) {
4154 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4159 static void GLAPIENTRY
4160 save_StencilMask(GLuint mask
)
4162 GET_CURRENT_CONTEXT(ctx
);
4164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4165 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4169 if (ctx
->ExecuteFlag
) {
4170 CALL_StencilMask(ctx
->Exec
, (mask
));
4175 static void GLAPIENTRY
4176 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4178 GET_CURRENT_CONTEXT(ctx
);
4180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4181 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4187 if (ctx
->ExecuteFlag
) {
4188 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4193 static void GLAPIENTRY
4194 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4196 GET_CURRENT_CONTEXT(ctx
);
4198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4199 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4206 if (ctx
->ExecuteFlag
) {
4207 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4212 static void GLAPIENTRY
4213 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4216 GET_CURRENT_CONTEXT(ctx
);
4218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4220 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4228 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4235 if (ctx
->ExecuteFlag
) {
4236 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4237 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4242 static void GLAPIENTRY
4243 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4245 GET_CURRENT_CONTEXT(ctx
);
4247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4248 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4253 if (ctx
->ExecuteFlag
) {
4254 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4259 static void GLAPIENTRY
4260 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4262 GET_CURRENT_CONTEXT(ctx
);
4264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4265 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4272 if (ctx
->ExecuteFlag
) {
4273 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4278 static void GLAPIENTRY
4279 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4281 GET_CURRENT_CONTEXT(ctx
);
4283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4284 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4288 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4296 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4299 if (ctx
->ExecuteFlag
) {
4300 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4305 static void GLAPIENTRY
4306 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4309 parray
[0] = (GLfloat
) param
;
4310 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4311 save_TexEnvfv(target
, pname
, parray
);
4315 static void GLAPIENTRY
4316 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4319 p
[0] = (GLfloat
) param
;
4320 p
[1] = p
[2] = p
[3] = 0.0F
;
4321 save_TexEnvfv(target
, pname
, p
);
4325 static void GLAPIENTRY
4326 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4329 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4330 p
[0] = INT_TO_FLOAT(param
[0]);
4331 p
[1] = INT_TO_FLOAT(param
[1]);
4332 p
[2] = INT_TO_FLOAT(param
[2]);
4333 p
[3] = INT_TO_FLOAT(param
[3]);
4336 p
[0] = (GLfloat
) param
[0];
4337 p
[1] = p
[2] = p
[3] = 0.0F
;
4339 save_TexEnvfv(target
, pname
, p
);
4343 static void GLAPIENTRY
4344 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4346 GET_CURRENT_CONTEXT(ctx
);
4348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4349 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4358 if (ctx
->ExecuteFlag
) {
4359 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4364 static void GLAPIENTRY
4365 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4368 p
[0] = (GLfloat
) params
[0];
4369 p
[1] = (GLfloat
) params
[1];
4370 p
[2] = (GLfloat
) params
[2];
4371 p
[3] = (GLfloat
) params
[3];
4372 save_TexGenfv(coord
, pname
, p
);
4376 static void GLAPIENTRY
4377 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4380 parray
[0] = (GLfloat
) param
;
4381 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4382 save_TexGenfv(coord
, pname
, parray
);
4386 static void GLAPIENTRY
4387 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4390 p
[0] = (GLfloat
) params
[0];
4391 p
[1] = (GLfloat
) params
[1];
4392 p
[2] = (GLfloat
) params
[2];
4393 p
[3] = (GLfloat
) params
[3];
4394 save_TexGenfv(coord
, pname
, p
);
4398 static void GLAPIENTRY
4399 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4403 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4404 save_TexGenfv(coord
, pname
, parray
);
4408 static void GLAPIENTRY
4409 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4413 parray
[1] = parray
[2] = parray
[3] = 0;
4414 save_TexGeniv(coord
, pname
, parray
);
4418 static void GLAPIENTRY
4419 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4421 GET_CURRENT_CONTEXT(ctx
);
4423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4424 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4433 if (ctx
->ExecuteFlag
) {
4434 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4439 static void GLAPIENTRY
4440 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4444 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4445 save_TexParameterfv(target
, pname
, parray
);
4449 static void GLAPIENTRY
4450 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4453 fparam
[0] = (GLfloat
) param
;
4454 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4455 save_TexParameterfv(target
, pname
, fparam
);
4459 static void GLAPIENTRY
4460 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4463 fparam
[0] = (GLfloat
) params
[0];
4464 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4465 save_TexParameterfv(target
, pname
, fparam
);
4469 static void GLAPIENTRY
4470 save_TexImage1D(GLenum target
,
4471 GLint level
, GLint components
,
4472 GLsizei width
, GLint border
,
4473 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4475 GET_CURRENT_CONTEXT(ctx
);
4476 if (target
== GL_PROXY_TEXTURE_1D
) {
4477 /* don't compile, execute immediately */
4478 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4479 border
, format
, type
, pixels
));
4483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4484 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4488 n
[3].i
= components
;
4489 n
[4].i
= (GLint
) width
;
4494 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4495 pixels
, &ctx
->Unpack
));
4497 if (ctx
->ExecuteFlag
) {
4498 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4499 border
, format
, type
, pixels
));
4505 static void GLAPIENTRY
4506 save_TexImage2D(GLenum target
,
4507 GLint level
, GLint components
,
4508 GLsizei width
, GLsizei height
, GLint border
,
4509 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4511 GET_CURRENT_CONTEXT(ctx
);
4512 if (target
== GL_PROXY_TEXTURE_2D
) {
4513 /* don't compile, execute immediately */
4514 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4515 height
, border
, format
, type
, pixels
));
4519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4520 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4524 n
[3].i
= components
;
4525 n
[4].i
= (GLint
) width
;
4526 n
[5].i
= (GLint
) height
;
4531 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4532 pixels
, &ctx
->Unpack
));
4534 if (ctx
->ExecuteFlag
) {
4535 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4536 height
, border
, format
, type
, pixels
));
4542 static void GLAPIENTRY
4543 save_TexImage3D(GLenum target
,
4544 GLint level
, GLint internalFormat
,
4545 GLsizei width
, GLsizei height
, GLsizei depth
,
4547 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4549 GET_CURRENT_CONTEXT(ctx
);
4550 if (target
== GL_PROXY_TEXTURE_3D
) {
4551 /* don't compile, execute immediately */
4552 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4553 height
, depth
, border
, format
, type
,
4558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4559 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4563 n
[3].i
= (GLint
) internalFormat
;
4564 n
[4].i
= (GLint
) width
;
4565 n
[5].i
= (GLint
) height
;
4566 n
[6].i
= (GLint
) depth
;
4570 save_pointer(&n
[10],
4571 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4572 pixels
, &ctx
->Unpack
));
4574 if (ctx
->ExecuteFlag
) {
4575 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4576 height
, depth
, border
, format
, type
,
4583 static void GLAPIENTRY
4584 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4585 GLsizei width
, GLenum format
, GLenum type
,
4586 const GLvoid
* pixels
)
4588 GET_CURRENT_CONTEXT(ctx
);
4591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4593 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4598 n
[4].i
= (GLint
) width
;
4602 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4603 pixels
, &ctx
->Unpack
));
4605 if (ctx
->ExecuteFlag
) {
4606 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4607 format
, type
, pixels
));
4612 static void GLAPIENTRY
4613 save_TexSubImage2D(GLenum target
, GLint level
,
4614 GLint xoffset
, GLint yoffset
,
4615 GLsizei width
, GLsizei height
,
4616 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4618 GET_CURRENT_CONTEXT(ctx
);
4621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4623 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4629 n
[5].i
= (GLint
) width
;
4630 n
[6].i
= (GLint
) height
;
4634 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4635 pixels
, &ctx
->Unpack
));
4637 if (ctx
->ExecuteFlag
) {
4638 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4639 width
, height
, format
, type
, pixels
));
4644 static void GLAPIENTRY
4645 save_TexSubImage3D(GLenum target
, GLint level
,
4646 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4647 GLsizei width
, GLsizei height
, GLsizei depth
,
4648 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4650 GET_CURRENT_CONTEXT(ctx
);
4653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4655 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4662 n
[6].i
= (GLint
) width
;
4663 n
[7].i
= (GLint
) height
;
4664 n
[8].i
= (GLint
) depth
;
4667 save_pointer(&n
[11],
4668 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4669 pixels
, &ctx
->Unpack
));
4671 if (ctx
->ExecuteFlag
) {
4672 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4673 xoffset
, yoffset
, zoffset
,
4674 width
, height
, depth
, format
, type
,
4680 static void GLAPIENTRY
4681 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4683 GET_CURRENT_CONTEXT(ctx
);
4685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4686 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4692 if (ctx
->ExecuteFlag
) {
4693 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4698 static void GLAPIENTRY
4699 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4701 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4706 static void GLAPIENTRY
4707 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4709 GET_CURRENT_CONTEXT(ctx
);
4711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4712 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4716 n
[3].i
= (GLint
) width
;
4717 n
[4].i
= (GLint
) height
;
4719 if (ctx
->ExecuteFlag
) {
4720 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4724 static void GLAPIENTRY
4725 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4728 GET_CURRENT_CONTEXT(ctx
);
4730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4731 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4739 if (ctx
->ExecuteFlag
) {
4740 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4744 static void GLAPIENTRY
4745 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4747 GET_CURRENT_CONTEXT(ctx
);
4749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4750 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4758 if (ctx
->ExecuteFlag
) {
4759 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4763 static void GLAPIENTRY
4764 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4766 GET_CURRENT_CONTEXT(ctx
);
4768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4769 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4773 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4775 if (ctx
->ExecuteFlag
) {
4776 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4780 static void GLAPIENTRY
4781 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4784 GET_CURRENT_CONTEXT(ctx
);
4786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4787 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4795 if (ctx
->ExecuteFlag
) {
4796 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4800 static void GLAPIENTRY
4801 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4803 GET_CURRENT_CONTEXT(ctx
);
4805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4806 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4814 if (ctx
->ExecuteFlag
) {
4815 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4819 static void GLAPIENTRY
4820 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4822 GET_CURRENT_CONTEXT(ctx
);
4824 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4825 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4829 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4831 if (ctx
->ExecuteFlag
) {
4832 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4836 static void GLAPIENTRY
4837 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4839 GET_CURRENT_CONTEXT(ctx
);
4841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4842 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4845 /* Mesa stores these as floats internally so we deliberately convert
4846 * them to a float here.
4851 if (ctx
->ExecuteFlag
) {
4852 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4856 static void GLAPIENTRY
4857 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4859 GET_CURRENT_CONTEXT(ctx
);
4861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4862 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4866 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4868 if (ctx
->ExecuteFlag
) {
4869 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4873 static void GLAPIENTRY
4874 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4876 GET_CURRENT_CONTEXT(ctx
);
4878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4879 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4886 if (ctx
->ExecuteFlag
) {
4887 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4891 static void GLAPIENTRY
4892 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4894 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4897 static void GLAPIENTRY
4898 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4900 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4903 static void GLAPIENTRY
4904 save_WindowPos2iMESA(GLint x
, GLint y
)
4906 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4909 static void GLAPIENTRY
4910 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4912 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4915 static void GLAPIENTRY
4916 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4918 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4921 static void GLAPIENTRY
4922 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4924 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4927 static void GLAPIENTRY
4928 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4930 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4933 static void GLAPIENTRY
4934 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4936 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4939 static void GLAPIENTRY
4940 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4942 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4945 static void GLAPIENTRY
4946 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4948 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4951 static void GLAPIENTRY
4952 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4954 save_WindowPos4fMESA(x
, y
, z
, w
);
4957 static void GLAPIENTRY
4958 save_WindowPos2dvMESA(const GLdouble
* v
)
4960 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4963 static void GLAPIENTRY
4964 save_WindowPos2fvMESA(const GLfloat
* v
)
4966 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4969 static void GLAPIENTRY
4970 save_WindowPos2ivMESA(const GLint
* v
)
4972 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4975 static void GLAPIENTRY
4976 save_WindowPos2svMESA(const GLshort
* v
)
4978 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4981 static void GLAPIENTRY
4982 save_WindowPos3dvMESA(const GLdouble
* v
)
4984 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4987 static void GLAPIENTRY
4988 save_WindowPos3fvMESA(const GLfloat
* v
)
4990 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4993 static void GLAPIENTRY
4994 save_WindowPos3ivMESA(const GLint
* v
)
4996 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4999 static void GLAPIENTRY
5000 save_WindowPos3svMESA(const GLshort
* v
)
5002 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5005 static void GLAPIENTRY
5006 save_WindowPos4dvMESA(const GLdouble
* v
)
5008 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5009 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5012 static void GLAPIENTRY
5013 save_WindowPos4fvMESA(const GLfloat
* v
)
5015 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5018 static void GLAPIENTRY
5019 save_WindowPos4ivMESA(const GLint
* v
)
5021 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5022 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5025 static void GLAPIENTRY
5026 save_WindowPos4svMESA(const GLshort
* v
)
5028 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5033 /* GL_ARB_multitexture */
5034 static void GLAPIENTRY
5035 save_ActiveTextureARB(GLenum target
)
5037 GET_CURRENT_CONTEXT(ctx
);
5039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5040 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5044 if (ctx
->ExecuteFlag
) {
5045 CALL_ActiveTexture(ctx
->Exec
, (target
));
5050 /* GL_ARB_transpose_matrix */
5052 static void GLAPIENTRY
5053 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5056 _math_transposefd(tm
, m
);
5057 save_LoadMatrixf(tm
);
5061 static void GLAPIENTRY
5062 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5065 _math_transposef(tm
, m
);
5066 save_LoadMatrixf(tm
);
5070 static void GLAPIENTRY
5071 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5074 _math_transposefd(tm
, m
);
5075 save_MultMatrixf(tm
);
5079 static void GLAPIENTRY
5080 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5083 _math_transposef(tm
, m
);
5084 save_MultMatrixf(tm
);
5087 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5089 GET_CURRENT_CONTEXT(ctx
);
5095 image
= malloc(size
);
5097 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5100 memcpy(image
, data
, size
);
5106 /* GL_ARB_texture_compression */
5107 static void GLAPIENTRY
5108 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5109 GLenum internalFormat
, GLsizei width
,
5110 GLint border
, GLsizei imageSize
,
5111 const GLvoid
* data
)
5113 GET_CURRENT_CONTEXT(ctx
);
5114 if (target
== GL_PROXY_TEXTURE_1D
) {
5115 /* don't compile, execute immediately */
5116 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5117 width
, border
, imageSize
,
5122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5124 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5125 6 + POINTER_DWORDS
);
5129 n
[3].e
= internalFormat
;
5130 n
[4].i
= (GLint
) width
;
5134 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5136 if (ctx
->ExecuteFlag
) {
5137 CALL_CompressedTexImage1D(ctx
->Exec
,
5138 (target
, level
, internalFormat
, width
,
5139 border
, imageSize
, data
));
5145 static void GLAPIENTRY
5146 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5147 GLenum internalFormat
, GLsizei width
,
5148 GLsizei height
, GLint border
, GLsizei imageSize
,
5149 const GLvoid
* data
)
5151 GET_CURRENT_CONTEXT(ctx
);
5152 if (target
== GL_PROXY_TEXTURE_2D
) {
5153 /* don't compile, execute immediately */
5154 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5155 width
, height
, border
,
5160 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5162 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5163 7 + POINTER_DWORDS
);
5167 n
[3].e
= internalFormat
;
5168 n
[4].i
= (GLint
) width
;
5169 n
[5].i
= (GLint
) height
;
5173 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5175 if (ctx
->ExecuteFlag
) {
5176 CALL_CompressedTexImage2D(ctx
->Exec
,
5177 (target
, level
, internalFormat
, width
,
5178 height
, border
, imageSize
, data
));
5184 static void GLAPIENTRY
5185 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5186 GLenum internalFormat
, GLsizei width
,
5187 GLsizei height
, GLsizei depth
, GLint border
,
5188 GLsizei imageSize
, const GLvoid
* data
)
5190 GET_CURRENT_CONTEXT(ctx
);
5191 if (target
== GL_PROXY_TEXTURE_3D
) {
5192 /* don't compile, execute immediately */
5193 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5194 width
, height
, depth
, border
,
5199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5201 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5202 8 + POINTER_DWORDS
);
5206 n
[3].e
= internalFormat
;
5207 n
[4].i
= (GLint
) width
;
5208 n
[5].i
= (GLint
) height
;
5209 n
[6].i
= (GLint
) depth
;
5213 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5215 if (ctx
->ExecuteFlag
) {
5216 CALL_CompressedTexImage3D(ctx
->Exec
,
5217 (target
, level
, internalFormat
, width
,
5218 height
, depth
, border
, imageSize
,
5225 static void GLAPIENTRY
5226 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5227 GLsizei width
, GLenum format
,
5228 GLsizei imageSize
, const GLvoid
* data
)
5231 GET_CURRENT_CONTEXT(ctx
);
5232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5234 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5235 6 + POINTER_DWORDS
);
5240 n
[4].i
= (GLint
) width
;
5244 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5246 if (ctx
->ExecuteFlag
) {
5247 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5248 width
, format
, imageSize
,
5254 static void GLAPIENTRY
5255 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5256 GLint yoffset
, GLsizei width
, GLsizei height
,
5257 GLenum format
, GLsizei imageSize
,
5258 const GLvoid
* data
)
5261 GET_CURRENT_CONTEXT(ctx
);
5262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5264 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5265 8 + POINTER_DWORDS
);
5271 n
[5].i
= (GLint
) width
;
5272 n
[6].i
= (GLint
) height
;
5276 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5278 if (ctx
->ExecuteFlag
) {
5279 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5280 (target
, level
, xoffset
, yoffset
, width
,
5281 height
, format
, imageSize
, data
));
5286 static void GLAPIENTRY
5287 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5288 GLint yoffset
, GLint zoffset
, GLsizei width
,
5289 GLsizei height
, GLsizei depth
, GLenum format
,
5290 GLsizei imageSize
, const GLvoid
* data
)
5293 GET_CURRENT_CONTEXT(ctx
);
5294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5296 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5297 10 + POINTER_DWORDS
);
5304 n
[6].i
= (GLint
) width
;
5305 n
[7].i
= (GLint
) height
;
5306 n
[8].i
= (GLint
) depth
;
5308 n
[10].i
= imageSize
;
5309 save_pointer(&n
[11],
5310 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5312 if (ctx
->ExecuteFlag
) {
5313 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5314 (target
, level
, xoffset
, yoffset
,
5315 zoffset
, width
, height
, depth
, format
,
5321 /* GL_ARB_multisample */
5322 static void GLAPIENTRY
5323 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5325 GET_CURRENT_CONTEXT(ctx
);
5327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5328 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5333 if (ctx
->ExecuteFlag
) {
5334 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5340 * GL_ARB_vertex_program
5342 static void GLAPIENTRY
5343 save_BindProgramARB(GLenum target
, GLuint id
)
5345 GET_CURRENT_CONTEXT(ctx
);
5347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5348 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5353 if (ctx
->ExecuteFlag
) {
5354 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5358 static void GLAPIENTRY
5359 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5360 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5362 GET_CURRENT_CONTEXT(ctx
);
5364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5365 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5374 if (ctx
->ExecuteFlag
) {
5375 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5380 static void GLAPIENTRY
5381 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5382 const GLfloat
*params
)
5384 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5385 params
[2], params
[3]);
5389 static void GLAPIENTRY
5390 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5391 const GLfloat
* params
)
5393 GET_CURRENT_CONTEXT(ctx
);
5395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5399 const GLfloat
* p
= params
;
5401 for (i
= 0 ; i
< count
; i
++) {
5402 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5415 if (ctx
->ExecuteFlag
) {
5416 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5421 static void GLAPIENTRY
5422 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5423 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5425 save_ProgramEnvParameter4fARB(target
, index
,
5427 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5431 static void GLAPIENTRY
5432 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5433 const GLdouble
*params
)
5435 save_ProgramEnvParameter4fARB(target
, index
,
5436 (GLfloat
) params
[0],
5437 (GLfloat
) params
[1],
5438 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5442 static void GLAPIENTRY
5443 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5444 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5446 GET_CURRENT_CONTEXT(ctx
);
5448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5449 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5458 if (ctx
->ExecuteFlag
) {
5459 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5464 static void GLAPIENTRY
5465 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5466 const GLfloat
*params
)
5468 GET_CURRENT_CONTEXT(ctx
);
5470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5471 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5480 if (ctx
->ExecuteFlag
) {
5481 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5486 static void GLAPIENTRY
5487 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5488 const GLfloat
*params
)
5490 GET_CURRENT_CONTEXT(ctx
);
5492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5496 const GLfloat
* p
= params
;
5498 for (i
= 0 ; i
< count
; i
++) {
5499 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5512 if (ctx
->ExecuteFlag
) {
5513 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5518 static void GLAPIENTRY
5519 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5520 GLdouble x
, GLdouble y
,
5521 GLdouble z
, GLdouble w
)
5523 GET_CURRENT_CONTEXT(ctx
);
5525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5526 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5530 n
[3].f
= (GLfloat
) x
;
5531 n
[4].f
= (GLfloat
) y
;
5532 n
[5].f
= (GLfloat
) z
;
5533 n
[6].f
= (GLfloat
) w
;
5535 if (ctx
->ExecuteFlag
) {
5536 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5541 static void GLAPIENTRY
5542 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5543 const GLdouble
*params
)
5545 GET_CURRENT_CONTEXT(ctx
);
5547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5548 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5552 n
[3].f
= (GLfloat
) params
[0];
5553 n
[4].f
= (GLfloat
) params
[1];
5554 n
[5].f
= (GLfloat
) params
[2];
5555 n
[6].f
= (GLfloat
) params
[3];
5557 if (ctx
->ExecuteFlag
) {
5558 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5563 /* GL_EXT_stencil_two_side */
5564 static void GLAPIENTRY
5565 save_ActiveStencilFaceEXT(GLenum face
)
5567 GET_CURRENT_CONTEXT(ctx
);
5569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5570 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5574 if (ctx
->ExecuteFlag
) {
5575 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5580 /* GL_EXT_depth_bounds_test */
5581 static void GLAPIENTRY
5582 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5584 GET_CURRENT_CONTEXT(ctx
);
5586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5587 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5589 n
[1].f
= (GLfloat
) zmin
;
5590 n
[2].f
= (GLfloat
) zmax
;
5592 if (ctx
->ExecuteFlag
) {
5593 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5599 static void GLAPIENTRY
5600 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5601 const GLvoid
* string
)
5603 GET_CURRENT_CONTEXT(ctx
);
5606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5608 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5610 GLubyte
*programCopy
= malloc(len
);
5612 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5615 memcpy(programCopy
, string
, len
);
5619 save_pointer(&n
[4], programCopy
);
5621 if (ctx
->ExecuteFlag
) {
5622 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5627 static void GLAPIENTRY
5628 save_BeginQueryARB(GLenum target
, GLuint id
)
5630 GET_CURRENT_CONTEXT(ctx
);
5632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5633 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5638 if (ctx
->ExecuteFlag
) {
5639 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5643 static void GLAPIENTRY
5644 save_EndQueryARB(GLenum target
)
5646 GET_CURRENT_CONTEXT(ctx
);
5648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5649 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5653 if (ctx
->ExecuteFlag
) {
5654 CALL_EndQuery(ctx
->Exec
, (target
));
5658 static void GLAPIENTRY
5659 save_QueryCounter(GLuint id
, GLenum target
)
5661 GET_CURRENT_CONTEXT(ctx
);
5663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5664 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5669 if (ctx
->ExecuteFlag
) {
5670 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5674 static void GLAPIENTRY
5675 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5677 GET_CURRENT_CONTEXT(ctx
);
5679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5680 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5686 if (ctx
->ExecuteFlag
) {
5687 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5691 static void GLAPIENTRY
5692 save_EndQueryIndexed(GLenum target
, GLuint index
)
5694 GET_CURRENT_CONTEXT(ctx
);
5696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5697 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5702 if (ctx
->ExecuteFlag
) {
5703 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5708 static void GLAPIENTRY
5709 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5711 GET_CURRENT_CONTEXT(ctx
);
5713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5714 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5718 if (count
> MAX_DRAW_BUFFERS
)
5719 count
= MAX_DRAW_BUFFERS
;
5720 for (i
= 0; i
< count
; i
++) {
5721 n
[2 + i
].e
= buffers
[i
];
5724 if (ctx
->ExecuteFlag
) {
5725 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5729 static void GLAPIENTRY
5730 save_BindFragmentShaderATI(GLuint id
)
5732 GET_CURRENT_CONTEXT(ctx
);
5735 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5739 if (ctx
->ExecuteFlag
) {
5740 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5744 static void GLAPIENTRY
5745 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5747 GET_CURRENT_CONTEXT(ctx
);
5750 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5758 if (ctx
->ExecuteFlag
) {
5759 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5763 static void GLAPIENTRY
5764 save_Attr1fNV(GLenum attr
, GLfloat x
)
5766 GET_CURRENT_CONTEXT(ctx
);
5768 SAVE_FLUSH_VERTICES(ctx
);
5769 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5775 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5776 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5777 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5779 if (ctx
->ExecuteFlag
) {
5780 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5784 static void GLAPIENTRY
5785 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5787 GET_CURRENT_CONTEXT(ctx
);
5789 SAVE_FLUSH_VERTICES(ctx
);
5790 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5797 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5798 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5799 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5801 if (ctx
->ExecuteFlag
) {
5802 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5806 static void GLAPIENTRY
5807 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5809 GET_CURRENT_CONTEXT(ctx
);
5811 SAVE_FLUSH_VERTICES(ctx
);
5812 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5820 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5821 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5822 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5824 if (ctx
->ExecuteFlag
) {
5825 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5829 static void GLAPIENTRY
5830 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5832 GET_CURRENT_CONTEXT(ctx
);
5834 SAVE_FLUSH_VERTICES(ctx
);
5835 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5844 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5845 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5846 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5848 if (ctx
->ExecuteFlag
) {
5849 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5854 static void GLAPIENTRY
5855 save_Attr1fARB(GLenum attr
, GLfloat x
)
5857 GET_CURRENT_CONTEXT(ctx
);
5859 SAVE_FLUSH_VERTICES(ctx
);
5860 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5866 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5867 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5868 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5870 if (ctx
->ExecuteFlag
) {
5871 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5875 static void GLAPIENTRY
5876 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5878 GET_CURRENT_CONTEXT(ctx
);
5880 SAVE_FLUSH_VERTICES(ctx
);
5881 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5888 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5889 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5890 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5892 if (ctx
->ExecuteFlag
) {
5893 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5897 static void GLAPIENTRY
5898 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5900 GET_CURRENT_CONTEXT(ctx
);
5902 SAVE_FLUSH_VERTICES(ctx
);
5903 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5911 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5912 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5913 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5915 if (ctx
->ExecuteFlag
) {
5916 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5920 static void GLAPIENTRY
5921 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5923 GET_CURRENT_CONTEXT(ctx
);
5925 SAVE_FLUSH_VERTICES(ctx
);
5926 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5935 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5936 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5937 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5939 if (ctx
->ExecuteFlag
) {
5940 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5945 static void GLAPIENTRY
5946 save_EvalCoord1f(GLfloat x
)
5948 GET_CURRENT_CONTEXT(ctx
);
5950 SAVE_FLUSH_VERTICES(ctx
);
5951 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5955 if (ctx
->ExecuteFlag
) {
5956 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5960 static void GLAPIENTRY
5961 save_EvalCoord1fv(const GLfloat
* v
)
5963 save_EvalCoord1f(v
[0]);
5966 static void GLAPIENTRY
5967 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5969 GET_CURRENT_CONTEXT(ctx
);
5971 SAVE_FLUSH_VERTICES(ctx
);
5972 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5977 if (ctx
->ExecuteFlag
) {
5978 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5982 static void GLAPIENTRY
5983 save_EvalCoord2fv(const GLfloat
* v
)
5985 save_EvalCoord2f(v
[0], v
[1]);
5989 static void GLAPIENTRY
5990 save_EvalPoint1(GLint x
)
5992 GET_CURRENT_CONTEXT(ctx
);
5994 SAVE_FLUSH_VERTICES(ctx
);
5995 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5999 if (ctx
->ExecuteFlag
) {
6000 CALL_EvalPoint1(ctx
->Exec
, (x
));
6004 static void GLAPIENTRY
6005 save_EvalPoint2(GLint x
, GLint y
)
6007 GET_CURRENT_CONTEXT(ctx
);
6009 SAVE_FLUSH_VERTICES(ctx
);
6010 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6015 if (ctx
->ExecuteFlag
) {
6016 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6020 static void GLAPIENTRY
6021 save_Indexf(GLfloat x
)
6023 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6026 static void GLAPIENTRY
6027 save_Indexfv(const GLfloat
* v
)
6029 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6032 static void GLAPIENTRY
6033 save_EdgeFlag(GLboolean x
)
6035 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6040 * Compare 'count' elements of vectors 'a' and 'b'.
6041 * \return GL_TRUE if equal, GL_FALSE if different.
6043 static inline GLboolean
6044 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6046 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6051 * This glMaterial function is used for glMaterial calls that are outside
6052 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6054 static void GLAPIENTRY
6055 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6057 GET_CURRENT_CONTEXT(ctx
);
6065 case GL_FRONT_AND_BACK
:
6068 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6077 case GL_AMBIENT_AND_DIFFUSE
:
6083 case GL_COLOR_INDEXES
:
6087 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6091 if (ctx
->ExecuteFlag
) {
6092 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6095 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6097 /* Try to eliminate redundant statechanges. Because it is legal to
6098 * call glMaterial even inside begin/end calls, don't need to worry
6099 * about ctx->Driver.CurrentSavePrimitive here.
6101 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6102 if (bitmask
& (1 << i
)) {
6103 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6104 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6105 /* no change in material value */
6106 bitmask
&= ~(1 << i
);
6109 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6110 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6115 /* If this call has no effect, return early */
6119 SAVE_FLUSH_VERTICES(ctx
);
6121 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6125 for (i
= 0; i
< args
; i
++)
6126 n
[3 + i
].f
= param
[i
];
6130 static void GLAPIENTRY
6131 save_Begin(GLenum mode
)
6133 GET_CURRENT_CONTEXT(ctx
);
6135 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6136 /* compile this error into the display list */
6137 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6139 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6140 /* compile this error into the display list */
6141 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6144 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6146 vbo_save_NotifyBegin(ctx
, mode
, false);
6150 static void GLAPIENTRY
6153 GET_CURRENT_CONTEXT(ctx
);
6154 SAVE_FLUSH_VERTICES(ctx
);
6155 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6156 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6157 if (ctx
->ExecuteFlag
) {
6158 CALL_End(ctx
->Exec
, ());
6162 static void GLAPIENTRY
6163 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6165 GET_CURRENT_CONTEXT(ctx
);
6167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6168 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6175 if (ctx
->ExecuteFlag
) {
6176 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6181 static void GLAPIENTRY
6182 save_Vertex2f(GLfloat x
, GLfloat y
)
6184 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6187 static void GLAPIENTRY
6188 save_Vertex2fv(const GLfloat
* v
)
6190 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6193 static void GLAPIENTRY
6194 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6196 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6199 static void GLAPIENTRY
6200 save_Vertex3fv(const GLfloat
* v
)
6202 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6205 static void GLAPIENTRY
6206 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6208 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6211 static void GLAPIENTRY
6212 save_Vertex4fv(const GLfloat
* v
)
6214 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6217 static void GLAPIENTRY
6218 save_TexCoord1f(GLfloat x
)
6220 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6223 static void GLAPIENTRY
6224 save_TexCoord1fv(const GLfloat
* v
)
6226 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6229 static void GLAPIENTRY
6230 save_TexCoord2f(GLfloat x
, GLfloat y
)
6232 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6235 static void GLAPIENTRY
6236 save_TexCoord2fv(const GLfloat
* v
)
6238 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6241 static void GLAPIENTRY
6242 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6244 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6247 static void GLAPIENTRY
6248 save_TexCoord3fv(const GLfloat
* v
)
6250 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6253 static void GLAPIENTRY
6254 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6256 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6259 static void GLAPIENTRY
6260 save_TexCoord4fv(const GLfloat
* v
)
6262 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6265 static void GLAPIENTRY
6266 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6268 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6271 static void GLAPIENTRY
6272 save_Normal3fv(const GLfloat
* v
)
6274 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6277 static void GLAPIENTRY
6278 save_FogCoordfEXT(GLfloat x
)
6280 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6283 static void GLAPIENTRY
6284 save_FogCoordfvEXT(const GLfloat
* v
)
6286 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6289 static void GLAPIENTRY
6290 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6292 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6295 static void GLAPIENTRY
6296 save_Color3fv(const GLfloat
* v
)
6298 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6301 static void GLAPIENTRY
6302 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6304 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6307 static void GLAPIENTRY
6308 save_Color4fv(const GLfloat
* v
)
6310 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6313 static void GLAPIENTRY
6314 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6316 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6319 static void GLAPIENTRY
6320 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6322 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6326 /* Just call the respective ATTR for texcoord
6328 static void GLAPIENTRY
6329 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6331 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6332 save_Attr1fNV(attr
, x
);
6335 static void GLAPIENTRY
6336 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6338 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6339 save_Attr1fNV(attr
, v
[0]);
6342 static void GLAPIENTRY
6343 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6345 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6346 save_Attr2fNV(attr
, x
, y
);
6349 static void GLAPIENTRY
6350 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6352 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6353 save_Attr2fNV(attr
, v
[0], v
[1]);
6356 static void GLAPIENTRY
6357 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6359 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6360 save_Attr3fNV(attr
, x
, y
, z
);
6363 static void GLAPIENTRY
6364 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6366 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6367 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6370 static void GLAPIENTRY
6371 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6372 GLfloat z
, GLfloat w
)
6374 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6375 save_Attr4fNV(attr
, x
, y
, z
, w
);
6378 static void GLAPIENTRY
6379 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6381 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6382 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6387 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6393 GET_CURRENT_CONTEXT(ctx
);
6394 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6399 static void GLAPIENTRY
6400 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6402 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6403 save_Attr1fARB(index
, x
);
6408 static void GLAPIENTRY
6409 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6411 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6412 save_Attr1fARB(index
, v
[0]);
6417 static void GLAPIENTRY
6418 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6420 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6421 save_Attr2fARB(index
, x
, y
);
6426 static void GLAPIENTRY
6427 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6429 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6430 save_Attr2fARB(index
, v
[0], v
[1]);
6435 static void GLAPIENTRY
6436 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6438 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6439 save_Attr3fARB(index
, x
, y
, z
);
6444 static void GLAPIENTRY
6445 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6447 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6448 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6453 static void GLAPIENTRY
6454 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6457 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6458 save_Attr4fARB(index
, x
, y
, z
, w
);
6463 static void GLAPIENTRY
6464 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6466 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6467 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6472 static void GLAPIENTRY
6473 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6475 GET_CURRENT_CONTEXT(ctx
);
6477 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6479 SAVE_FLUSH_VERTICES(ctx
);
6480 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6483 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6486 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6487 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6489 if (ctx
->ExecuteFlag
) {
6490 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6497 static void GLAPIENTRY
6498 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6500 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6501 save_VertexAttribL1d(index
, v
[0]);
6506 static void GLAPIENTRY
6507 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6509 GET_CURRENT_CONTEXT(ctx
);
6511 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6513 SAVE_FLUSH_VERTICES(ctx
);
6514 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6517 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6518 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6521 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6522 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6523 2 * sizeof(GLdouble
));
6525 if (ctx
->ExecuteFlag
) {
6526 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6533 static void GLAPIENTRY
6534 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6536 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6537 save_VertexAttribL2d(index
, v
[0], v
[1]);
6542 static void GLAPIENTRY
6543 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6545 GET_CURRENT_CONTEXT(ctx
);
6547 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6549 SAVE_FLUSH_VERTICES(ctx
);
6550 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6553 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6554 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6555 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6558 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6559 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6560 3 * sizeof(GLdouble
));
6562 if (ctx
->ExecuteFlag
) {
6563 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6570 static void GLAPIENTRY
6571 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6573 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6574 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6579 static void GLAPIENTRY
6580 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6583 GET_CURRENT_CONTEXT(ctx
);
6585 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6587 SAVE_FLUSH_VERTICES(ctx
);
6588 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6591 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6592 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6593 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6594 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6597 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6598 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6599 4 * sizeof(GLdouble
));
6601 if (ctx
->ExecuteFlag
) {
6602 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6609 static void GLAPIENTRY
6610 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6612 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6613 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6618 static void GLAPIENTRY
6619 save_PrimitiveRestartNV(void)
6621 /* Note: this is used when outside a glBegin/End pair in a display list */
6622 GET_CURRENT_CONTEXT(ctx
);
6623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6624 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6625 if (ctx
->ExecuteFlag
) {
6626 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6631 static void GLAPIENTRY
6632 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6633 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6634 GLbitfield mask
, GLenum filter
)
6636 GET_CURRENT_CONTEXT(ctx
);
6638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6639 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6652 if (ctx
->ExecuteFlag
) {
6653 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6654 dstX0
, dstY0
, dstX1
, dstY1
,
6660 /** GL_EXT_provoking_vertex */
6661 static void GLAPIENTRY
6662 save_ProvokingVertexEXT(GLenum mode
)
6664 GET_CURRENT_CONTEXT(ctx
);
6666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6667 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6671 if (ctx
->ExecuteFlag
) {
6672 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6673 _mesa_ProvokingVertex(mode
);
6678 /** GL_EXT_transform_feedback */
6679 static void GLAPIENTRY
6680 save_BeginTransformFeedback(GLenum mode
)
6682 GET_CURRENT_CONTEXT(ctx
);
6684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6685 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6689 if (ctx
->ExecuteFlag
) {
6690 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6695 /** GL_EXT_transform_feedback */
6696 static void GLAPIENTRY
6697 save_EndTransformFeedback(void)
6699 GET_CURRENT_CONTEXT(ctx
);
6700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6701 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6702 if (ctx
->ExecuteFlag
) {
6703 CALL_EndTransformFeedback(ctx
->Exec
, ());
6707 static void GLAPIENTRY
6708 save_BindTransformFeedback(GLenum target
, GLuint name
)
6710 GET_CURRENT_CONTEXT(ctx
);
6712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6713 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6718 if (ctx
->ExecuteFlag
) {
6719 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6723 static void GLAPIENTRY
6724 save_PauseTransformFeedback(void)
6726 GET_CURRENT_CONTEXT(ctx
);
6727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6728 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6729 if (ctx
->ExecuteFlag
) {
6730 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6734 static void GLAPIENTRY
6735 save_ResumeTransformFeedback(void)
6737 GET_CURRENT_CONTEXT(ctx
);
6738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6739 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6740 if (ctx
->ExecuteFlag
) {
6741 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6745 static void GLAPIENTRY
6746 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6748 GET_CURRENT_CONTEXT(ctx
);
6750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6751 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6756 if (ctx
->ExecuteFlag
) {
6757 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6761 static void GLAPIENTRY
6762 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6764 GET_CURRENT_CONTEXT(ctx
);
6766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6767 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6773 if (ctx
->ExecuteFlag
) {
6774 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6778 static void GLAPIENTRY
6779 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6782 GET_CURRENT_CONTEXT(ctx
);
6784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6785 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6789 n
[3].si
= primcount
;
6791 if (ctx
->ExecuteFlag
) {
6792 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6796 static void GLAPIENTRY
6797 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6798 GLuint stream
, GLsizei primcount
)
6800 GET_CURRENT_CONTEXT(ctx
);
6802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6803 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6808 n
[4].si
= primcount
;
6810 if (ctx
->ExecuteFlag
) {
6811 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6816 static void GLAPIENTRY
6817 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6818 GLuint num_groups_z
)
6820 GET_CURRENT_CONTEXT(ctx
);
6822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6823 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6825 n
[1].ui
= num_groups_x
;
6826 n
[2].ui
= num_groups_y
;
6827 n
[3].ui
= num_groups_z
;
6829 if (ctx
->ExecuteFlag
) {
6830 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6835 static void GLAPIENTRY
6836 save_DispatchComputeIndirect(GLintptr indirect
)
6838 GET_CURRENT_CONTEXT(ctx
);
6839 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6840 "glDispatchComputeIndirect() during display list compile");
6843 static void GLAPIENTRY
6844 save_UseProgram(GLuint program
)
6846 GET_CURRENT_CONTEXT(ctx
);
6848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6849 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6853 if (ctx
->ExecuteFlag
) {
6854 CALL_UseProgram(ctx
->Exec
, (program
));
6859 static void GLAPIENTRY
6860 save_Uniform1fARB(GLint location
, GLfloat x
)
6862 GET_CURRENT_CONTEXT(ctx
);
6864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6865 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6870 if (ctx
->ExecuteFlag
) {
6871 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6876 static void GLAPIENTRY
6877 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6879 GET_CURRENT_CONTEXT(ctx
);
6881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6882 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6888 if (ctx
->ExecuteFlag
) {
6889 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6894 static void GLAPIENTRY
6895 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6897 GET_CURRENT_CONTEXT(ctx
);
6899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6900 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6907 if (ctx
->ExecuteFlag
) {
6908 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6913 static void GLAPIENTRY
6914 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6916 GET_CURRENT_CONTEXT(ctx
);
6918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6919 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6927 if (ctx
->ExecuteFlag
) {
6928 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6933 static void GLAPIENTRY
6934 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6936 GET_CURRENT_CONTEXT(ctx
);
6938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6939 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6943 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6945 if (ctx
->ExecuteFlag
) {
6946 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6950 static void GLAPIENTRY
6951 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6953 GET_CURRENT_CONTEXT(ctx
);
6955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6956 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6960 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6962 if (ctx
->ExecuteFlag
) {
6963 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6967 static void GLAPIENTRY
6968 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6970 GET_CURRENT_CONTEXT(ctx
);
6972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6973 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6977 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6979 if (ctx
->ExecuteFlag
) {
6980 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6984 static void GLAPIENTRY
6985 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6987 GET_CURRENT_CONTEXT(ctx
);
6989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6990 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6994 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6996 if (ctx
->ExecuteFlag
) {
6997 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7002 static void GLAPIENTRY
7003 save_Uniform1d(GLint location
, GLdouble x
)
7005 GET_CURRENT_CONTEXT(ctx
);
7007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7008 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7011 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7013 if (ctx
->ExecuteFlag
) {
7014 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7019 static void GLAPIENTRY
7020 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7022 GET_CURRENT_CONTEXT(ctx
);
7024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7025 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7028 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7029 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7031 if (ctx
->ExecuteFlag
) {
7032 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7037 static void GLAPIENTRY
7038 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7040 GET_CURRENT_CONTEXT(ctx
);
7042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7043 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7046 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7047 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7048 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7050 if (ctx
->ExecuteFlag
) {
7051 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7056 static void GLAPIENTRY
7057 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7059 GET_CURRENT_CONTEXT(ctx
);
7061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7062 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7065 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7066 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7067 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7068 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7070 if (ctx
->ExecuteFlag
) {
7071 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7076 static void GLAPIENTRY
7077 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7079 GET_CURRENT_CONTEXT(ctx
);
7081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7082 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7086 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7088 if (ctx
->ExecuteFlag
) {
7089 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7094 static void GLAPIENTRY
7095 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7097 GET_CURRENT_CONTEXT(ctx
);
7099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7100 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7104 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7106 if (ctx
->ExecuteFlag
) {
7107 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7112 static void GLAPIENTRY
7113 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7115 GET_CURRENT_CONTEXT(ctx
);
7117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7118 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7122 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7124 if (ctx
->ExecuteFlag
) {
7125 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7130 static void GLAPIENTRY
7131 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7133 GET_CURRENT_CONTEXT(ctx
);
7135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7136 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7140 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7142 if (ctx
->ExecuteFlag
) {
7143 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7148 static void GLAPIENTRY
7149 save_Uniform1iARB(GLint location
, GLint x
)
7151 GET_CURRENT_CONTEXT(ctx
);
7153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7154 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7159 if (ctx
->ExecuteFlag
) {
7160 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7164 static void GLAPIENTRY
7165 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7167 GET_CURRENT_CONTEXT(ctx
);
7169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7170 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7176 if (ctx
->ExecuteFlag
) {
7177 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7181 static void GLAPIENTRY
7182 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7184 GET_CURRENT_CONTEXT(ctx
);
7186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7187 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7194 if (ctx
->ExecuteFlag
) {
7195 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7199 static void GLAPIENTRY
7200 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7202 GET_CURRENT_CONTEXT(ctx
);
7204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7205 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7213 if (ctx
->ExecuteFlag
) {
7214 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7220 static void GLAPIENTRY
7221 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7223 GET_CURRENT_CONTEXT(ctx
);
7225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7226 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7230 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7232 if (ctx
->ExecuteFlag
) {
7233 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7237 static void GLAPIENTRY
7238 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7240 GET_CURRENT_CONTEXT(ctx
);
7242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7243 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7247 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7249 if (ctx
->ExecuteFlag
) {
7250 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7254 static void GLAPIENTRY
7255 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7257 GET_CURRENT_CONTEXT(ctx
);
7259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7260 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7264 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7266 if (ctx
->ExecuteFlag
) {
7267 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7271 static void GLAPIENTRY
7272 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7274 GET_CURRENT_CONTEXT(ctx
);
7276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7277 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7281 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7283 if (ctx
->ExecuteFlag
) {
7284 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7290 static void GLAPIENTRY
7291 save_Uniform1ui(GLint location
, GLuint x
)
7293 GET_CURRENT_CONTEXT(ctx
);
7295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7296 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7301 if (ctx
->ExecuteFlag
) {
7302 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7306 static void GLAPIENTRY
7307 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7309 GET_CURRENT_CONTEXT(ctx
);
7311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7312 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7318 if (ctx
->ExecuteFlag
) {
7319 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7323 static void GLAPIENTRY
7324 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7326 GET_CURRENT_CONTEXT(ctx
);
7328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7329 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7336 if (ctx
->ExecuteFlag
) {
7337 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7341 static void GLAPIENTRY
7342 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7344 GET_CURRENT_CONTEXT(ctx
);
7346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7347 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7355 if (ctx
->ExecuteFlag
) {
7356 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7362 static void GLAPIENTRY
7363 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7365 GET_CURRENT_CONTEXT(ctx
);
7367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7368 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7372 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7374 if (ctx
->ExecuteFlag
) {
7375 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7379 static void GLAPIENTRY
7380 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7382 GET_CURRENT_CONTEXT(ctx
);
7384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7385 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7389 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7391 if (ctx
->ExecuteFlag
) {
7392 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7396 static void GLAPIENTRY
7397 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7399 GET_CURRENT_CONTEXT(ctx
);
7401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7402 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7406 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7408 if (ctx
->ExecuteFlag
) {
7409 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7413 static void GLAPIENTRY
7414 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7416 GET_CURRENT_CONTEXT(ctx
);
7418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7419 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7423 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7425 if (ctx
->ExecuteFlag
) {
7426 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7432 static void GLAPIENTRY
7433 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7436 GET_CURRENT_CONTEXT(ctx
);
7438 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7439 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7444 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7446 if (ctx
->ExecuteFlag
) {
7447 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7451 static void GLAPIENTRY
7452 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7455 GET_CURRENT_CONTEXT(ctx
);
7457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7458 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7463 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7465 if (ctx
->ExecuteFlag
) {
7466 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7470 static void GLAPIENTRY
7471 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7474 GET_CURRENT_CONTEXT(ctx
);
7476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7477 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7482 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7484 if (ctx
->ExecuteFlag
) {
7485 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7490 static void GLAPIENTRY
7491 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7494 GET_CURRENT_CONTEXT(ctx
);
7496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7497 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7502 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7504 if (ctx
->ExecuteFlag
) {
7505 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7509 static void GLAPIENTRY
7510 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7513 GET_CURRENT_CONTEXT(ctx
);
7515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7516 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7521 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7523 if (ctx
->ExecuteFlag
) {
7524 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7529 static void GLAPIENTRY
7530 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7533 GET_CURRENT_CONTEXT(ctx
);
7535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7536 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7541 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7543 if (ctx
->ExecuteFlag
) {
7544 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7548 static void GLAPIENTRY
7549 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7552 GET_CURRENT_CONTEXT(ctx
);
7554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7555 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7560 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7562 if (ctx
->ExecuteFlag
) {
7563 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7568 static void GLAPIENTRY
7569 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7572 GET_CURRENT_CONTEXT(ctx
);
7574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7575 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7580 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7582 if (ctx
->ExecuteFlag
) {
7583 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7587 static void GLAPIENTRY
7588 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7591 GET_CURRENT_CONTEXT(ctx
);
7593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7594 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7599 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7601 if (ctx
->ExecuteFlag
) {
7602 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7607 static void GLAPIENTRY
7608 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7611 GET_CURRENT_CONTEXT(ctx
);
7613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7614 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7619 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7621 if (ctx
->ExecuteFlag
) {
7622 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7626 static void GLAPIENTRY
7627 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7630 GET_CURRENT_CONTEXT(ctx
);
7632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7633 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7638 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7640 if (ctx
->ExecuteFlag
) {
7641 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7645 static void GLAPIENTRY
7646 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7649 GET_CURRENT_CONTEXT(ctx
);
7651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7652 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7657 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7659 if (ctx
->ExecuteFlag
) {
7660 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7665 static void GLAPIENTRY
7666 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7669 GET_CURRENT_CONTEXT(ctx
);
7671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7672 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7677 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7679 if (ctx
->ExecuteFlag
) {
7680 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7685 static void GLAPIENTRY
7686 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7689 GET_CURRENT_CONTEXT(ctx
);
7691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7692 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7697 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7699 if (ctx
->ExecuteFlag
) {
7700 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7705 static void GLAPIENTRY
7706 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7709 GET_CURRENT_CONTEXT(ctx
);
7711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7712 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7717 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7719 if (ctx
->ExecuteFlag
) {
7720 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7724 static void GLAPIENTRY
7725 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7728 GET_CURRENT_CONTEXT(ctx
);
7730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7731 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7736 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7738 if (ctx
->ExecuteFlag
) {
7739 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7744 static void GLAPIENTRY
7745 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7748 GET_CURRENT_CONTEXT(ctx
);
7750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7751 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7756 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7758 if (ctx
->ExecuteFlag
) {
7759 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7764 static void GLAPIENTRY
7765 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7768 GET_CURRENT_CONTEXT(ctx
);
7770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7771 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7776 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7778 if (ctx
->ExecuteFlag
) {
7779 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7784 static void GLAPIENTRY
7785 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7787 GET_CURRENT_CONTEXT(ctx
);
7789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7790 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7796 if (ctx
->ExecuteFlag
) {
7797 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7801 static void GLAPIENTRY
7802 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7804 GET_CURRENT_CONTEXT(ctx
);
7806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7807 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7813 if (ctx
->ExecuteFlag
) {
7814 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7818 static void GLAPIENTRY
7819 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7821 GET_CURRENT_CONTEXT(ctx
);
7823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7824 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7831 if (ctx
->ExecuteFlag
) {
7832 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7836 static void GLAPIENTRY
7837 save_ProgramUniform3f(GLuint program
, GLint location
,
7838 GLfloat x
, GLfloat y
, GLfloat z
)
7840 GET_CURRENT_CONTEXT(ctx
);
7842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7843 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7851 if (ctx
->ExecuteFlag
) {
7852 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7856 static void GLAPIENTRY
7857 save_ProgramUniform4f(GLuint program
, GLint location
,
7858 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7860 GET_CURRENT_CONTEXT(ctx
);
7862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7863 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7872 if (ctx
->ExecuteFlag
) {
7873 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7877 static void GLAPIENTRY
7878 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7881 GET_CURRENT_CONTEXT(ctx
);
7883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7884 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7889 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7891 if (ctx
->ExecuteFlag
) {
7892 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7896 static void GLAPIENTRY
7897 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7900 GET_CURRENT_CONTEXT(ctx
);
7902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7903 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7908 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7910 if (ctx
->ExecuteFlag
) {
7911 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7915 static void GLAPIENTRY
7916 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7919 GET_CURRENT_CONTEXT(ctx
);
7921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7922 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7927 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7929 if (ctx
->ExecuteFlag
) {
7930 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7934 static void GLAPIENTRY
7935 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7938 GET_CURRENT_CONTEXT(ctx
);
7940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7941 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7946 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7948 if (ctx
->ExecuteFlag
) {
7949 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7953 static void GLAPIENTRY
7954 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7956 GET_CURRENT_CONTEXT(ctx
);
7958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7959 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7963 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7965 if (ctx
->ExecuteFlag
) {
7966 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7970 static void GLAPIENTRY
7971 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7973 GET_CURRENT_CONTEXT(ctx
);
7975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7976 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
7980 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7981 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
7983 if (ctx
->ExecuteFlag
) {
7984 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
7988 static void GLAPIENTRY
7989 save_ProgramUniform3d(GLuint program
, GLint location
,
7990 GLdouble x
, GLdouble y
, GLdouble z
)
7992 GET_CURRENT_CONTEXT(ctx
);
7994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7995 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
7999 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8000 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8001 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8003 if (ctx
->ExecuteFlag
) {
8004 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8008 static void GLAPIENTRY
8009 save_ProgramUniform4d(GLuint program
, GLint location
,
8010 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8012 GET_CURRENT_CONTEXT(ctx
);
8014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8015 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8019 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8020 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8021 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8022 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8024 if (ctx
->ExecuteFlag
) {
8025 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8029 static void GLAPIENTRY
8030 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8033 GET_CURRENT_CONTEXT(ctx
);
8035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8036 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8041 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8043 if (ctx
->ExecuteFlag
) {
8044 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8048 static void GLAPIENTRY
8049 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8052 GET_CURRENT_CONTEXT(ctx
);
8054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8055 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8060 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8062 if (ctx
->ExecuteFlag
) {
8063 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8067 static void GLAPIENTRY
8068 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8071 GET_CURRENT_CONTEXT(ctx
);
8073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8074 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8079 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8081 if (ctx
->ExecuteFlag
) {
8082 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8086 static void GLAPIENTRY
8087 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8090 GET_CURRENT_CONTEXT(ctx
);
8092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8093 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8098 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8100 if (ctx
->ExecuteFlag
) {
8101 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8105 static void GLAPIENTRY
8106 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8108 GET_CURRENT_CONTEXT(ctx
);
8110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8111 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8117 if (ctx
->ExecuteFlag
) {
8118 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8122 static void GLAPIENTRY
8123 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8125 GET_CURRENT_CONTEXT(ctx
);
8127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8128 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8135 if (ctx
->ExecuteFlag
) {
8136 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8140 static void GLAPIENTRY
8141 save_ProgramUniform3i(GLuint program
, GLint location
,
8142 GLint x
, GLint y
, GLint z
)
8144 GET_CURRENT_CONTEXT(ctx
);
8146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8147 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8155 if (ctx
->ExecuteFlag
) {
8156 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8160 static void GLAPIENTRY
8161 save_ProgramUniform4i(GLuint program
, GLint location
,
8162 GLint x
, GLint y
, GLint z
, GLint w
)
8164 GET_CURRENT_CONTEXT(ctx
);
8166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8167 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8176 if (ctx
->ExecuteFlag
) {
8177 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8181 static void GLAPIENTRY
8182 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8185 GET_CURRENT_CONTEXT(ctx
);
8187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8188 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8193 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8195 if (ctx
->ExecuteFlag
) {
8196 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8200 static void GLAPIENTRY
8201 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8204 GET_CURRENT_CONTEXT(ctx
);
8206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8207 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8212 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8214 if (ctx
->ExecuteFlag
) {
8215 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8219 static void GLAPIENTRY
8220 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8223 GET_CURRENT_CONTEXT(ctx
);
8225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8226 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8231 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8233 if (ctx
->ExecuteFlag
) {
8234 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8238 static void GLAPIENTRY
8239 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8242 GET_CURRENT_CONTEXT(ctx
);
8244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8245 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8250 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8252 if (ctx
->ExecuteFlag
) {
8253 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8257 static void GLAPIENTRY
8258 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8260 GET_CURRENT_CONTEXT(ctx
);
8262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8263 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8269 if (ctx
->ExecuteFlag
) {
8270 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8274 static void GLAPIENTRY
8275 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8277 GET_CURRENT_CONTEXT(ctx
);
8279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8280 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8287 if (ctx
->ExecuteFlag
) {
8288 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8292 static void GLAPIENTRY
8293 save_ProgramUniform3ui(GLuint program
, GLint location
,
8294 GLuint x
, GLuint y
, GLuint z
)
8296 GET_CURRENT_CONTEXT(ctx
);
8298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8299 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8307 if (ctx
->ExecuteFlag
) {
8308 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8312 static void GLAPIENTRY
8313 save_ProgramUniform4ui(GLuint program
, GLint location
,
8314 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8316 GET_CURRENT_CONTEXT(ctx
);
8318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8319 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8328 if (ctx
->ExecuteFlag
) {
8329 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8333 static void GLAPIENTRY
8334 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8337 GET_CURRENT_CONTEXT(ctx
);
8339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8340 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8345 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8347 if (ctx
->ExecuteFlag
) {
8348 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8352 static void GLAPIENTRY
8353 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8356 GET_CURRENT_CONTEXT(ctx
);
8358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8359 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8364 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8366 if (ctx
->ExecuteFlag
) {
8367 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8371 static void GLAPIENTRY
8372 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8375 GET_CURRENT_CONTEXT(ctx
);
8377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8378 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8383 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8385 if (ctx
->ExecuteFlag
) {
8386 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8390 static void GLAPIENTRY
8391 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8394 GET_CURRENT_CONTEXT(ctx
);
8396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8397 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8402 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8404 if (ctx
->ExecuteFlag
) {
8405 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8409 static void GLAPIENTRY
8410 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8411 GLboolean transpose
, const GLfloat
*v
)
8413 GET_CURRENT_CONTEXT(ctx
);
8415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8416 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8417 4 + POINTER_DWORDS
);
8423 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8425 if (ctx
->ExecuteFlag
) {
8426 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8427 (program
, location
, count
, transpose
, v
));
8431 static void GLAPIENTRY
8432 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8433 GLboolean transpose
, const GLfloat
*v
)
8435 GET_CURRENT_CONTEXT(ctx
);
8437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8438 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8439 4 + POINTER_DWORDS
);
8445 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8447 if (ctx
->ExecuteFlag
) {
8448 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8449 (program
, location
, count
, transpose
, v
));
8453 static void GLAPIENTRY
8454 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8455 GLboolean transpose
, const GLfloat
*v
)
8457 GET_CURRENT_CONTEXT(ctx
);
8459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8460 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8461 4 + POINTER_DWORDS
);
8467 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8469 if (ctx
->ExecuteFlag
) {
8470 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8471 (program
, location
, count
, transpose
, v
));
8475 static void GLAPIENTRY
8476 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8477 GLboolean transpose
, const GLfloat
*v
)
8479 GET_CURRENT_CONTEXT(ctx
);
8481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8482 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8483 4 + POINTER_DWORDS
);
8489 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8491 if (ctx
->ExecuteFlag
) {
8492 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8493 (program
, location
, count
, transpose
, v
));
8497 static void GLAPIENTRY
8498 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8499 GLboolean transpose
, const GLfloat
*v
)
8501 GET_CURRENT_CONTEXT(ctx
);
8503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8504 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8505 4 + POINTER_DWORDS
);
8511 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8513 if (ctx
->ExecuteFlag
) {
8514 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8515 (program
, location
, count
, transpose
, v
));
8519 static void GLAPIENTRY
8520 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8521 GLboolean transpose
, const GLfloat
*v
)
8523 GET_CURRENT_CONTEXT(ctx
);
8525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8526 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8527 4 + POINTER_DWORDS
);
8533 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8535 if (ctx
->ExecuteFlag
) {
8536 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8537 (program
, location
, count
, transpose
, v
));
8541 static void GLAPIENTRY
8542 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8543 GLboolean transpose
, const GLfloat
*v
)
8545 GET_CURRENT_CONTEXT(ctx
);
8547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8548 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8549 4 + POINTER_DWORDS
);
8555 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8557 if (ctx
->ExecuteFlag
) {
8558 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8559 (program
, location
, count
, transpose
, v
));
8563 static void GLAPIENTRY
8564 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8565 GLboolean transpose
, const GLfloat
*v
)
8567 GET_CURRENT_CONTEXT(ctx
);
8569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8570 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8571 4 + POINTER_DWORDS
);
8577 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8579 if (ctx
->ExecuteFlag
) {
8580 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8581 (program
, location
, count
, transpose
, v
));
8585 static void GLAPIENTRY
8586 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8587 GLboolean transpose
, const GLfloat
*v
)
8589 GET_CURRENT_CONTEXT(ctx
);
8591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8592 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8593 4 + POINTER_DWORDS
);
8599 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8601 if (ctx
->ExecuteFlag
) {
8602 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8603 (program
, location
, count
, transpose
, v
));
8607 static void GLAPIENTRY
8608 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8609 GLboolean transpose
, const GLdouble
*v
)
8611 GET_CURRENT_CONTEXT(ctx
);
8613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8614 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8615 4 + POINTER_DWORDS
);
8621 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8623 if (ctx
->ExecuteFlag
) {
8624 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8625 (program
, location
, count
, transpose
, v
));
8629 static void GLAPIENTRY
8630 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8631 GLboolean transpose
, const GLdouble
*v
)
8633 GET_CURRENT_CONTEXT(ctx
);
8635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8636 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8637 4 + POINTER_DWORDS
);
8643 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8645 if (ctx
->ExecuteFlag
) {
8646 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8647 (program
, location
, count
, transpose
, v
));
8651 static void GLAPIENTRY
8652 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8653 GLboolean transpose
, const GLdouble
*v
)
8655 GET_CURRENT_CONTEXT(ctx
);
8657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8658 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8659 4 + POINTER_DWORDS
);
8665 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8667 if (ctx
->ExecuteFlag
) {
8668 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8669 (program
, location
, count
, transpose
, v
));
8673 static void GLAPIENTRY
8674 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8675 GLboolean transpose
, const GLdouble
*v
)
8677 GET_CURRENT_CONTEXT(ctx
);
8679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8680 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8681 4 + POINTER_DWORDS
);
8687 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8689 if (ctx
->ExecuteFlag
) {
8690 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8691 (program
, location
, count
, transpose
, v
));
8695 static void GLAPIENTRY
8696 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8697 GLboolean transpose
, const GLdouble
*v
)
8699 GET_CURRENT_CONTEXT(ctx
);
8701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8702 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8703 4 + POINTER_DWORDS
);
8709 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8711 if (ctx
->ExecuteFlag
) {
8712 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8713 (program
, location
, count
, transpose
, v
));
8717 static void GLAPIENTRY
8718 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8719 GLboolean transpose
, const GLdouble
*v
)
8721 GET_CURRENT_CONTEXT(ctx
);
8723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8724 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8725 4 + POINTER_DWORDS
);
8731 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8733 if (ctx
->ExecuteFlag
) {
8734 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8735 (program
, location
, count
, transpose
, v
));
8739 static void GLAPIENTRY
8740 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8741 GLboolean transpose
, const GLdouble
*v
)
8743 GET_CURRENT_CONTEXT(ctx
);
8745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8746 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8747 4 + POINTER_DWORDS
);
8753 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8755 if (ctx
->ExecuteFlag
) {
8756 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8757 (program
, location
, count
, transpose
, v
));
8761 static void GLAPIENTRY
8762 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8763 GLboolean transpose
, const GLdouble
*v
)
8765 GET_CURRENT_CONTEXT(ctx
);
8767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8768 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8769 4 + POINTER_DWORDS
);
8775 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8777 if (ctx
->ExecuteFlag
) {
8778 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8779 (program
, location
, count
, transpose
, v
));
8783 static void GLAPIENTRY
8784 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8785 GLboolean transpose
, const GLdouble
*v
)
8787 GET_CURRENT_CONTEXT(ctx
);
8789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8790 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8791 4 + POINTER_DWORDS
);
8797 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8799 if (ctx
->ExecuteFlag
) {
8800 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8801 (program
, location
, count
, transpose
, v
));
8805 static void GLAPIENTRY
8806 save_ClipControl(GLenum origin
, GLenum depth
)
8808 GET_CURRENT_CONTEXT(ctx
);
8810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8811 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8816 if (ctx
->ExecuteFlag
) {
8817 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8821 static void GLAPIENTRY
8822 save_ClampColorARB(GLenum target
, GLenum clamp
)
8824 GET_CURRENT_CONTEXT(ctx
);
8826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8827 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8832 if (ctx
->ExecuteFlag
) {
8833 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8837 /** GL_EXT_texture_integer */
8838 static void GLAPIENTRY
8839 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8841 GET_CURRENT_CONTEXT(ctx
);
8843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8844 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8851 if (ctx
->ExecuteFlag
) {
8852 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8856 /** GL_EXT_texture_integer */
8857 static void GLAPIENTRY
8858 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8860 GET_CURRENT_CONTEXT(ctx
);
8862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8863 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8870 if (ctx
->ExecuteFlag
) {
8871 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8875 /** GL_EXT_texture_integer */
8876 static void GLAPIENTRY
8877 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8879 GET_CURRENT_CONTEXT(ctx
);
8881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8882 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8891 if (ctx
->ExecuteFlag
) {
8892 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8896 /** GL_EXT_texture_integer */
8897 static void GLAPIENTRY
8898 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8900 GET_CURRENT_CONTEXT(ctx
);
8902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8903 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8907 n
[3].ui
= params
[0];
8908 n
[4].ui
= params
[1];
8909 n
[5].ui
= params
[2];
8910 n
[6].ui
= params
[3];
8912 if (ctx
->ExecuteFlag
) {
8913 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8917 /* GL_ARB_instanced_arrays */
8918 static void GLAPIENTRY
8919 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8921 GET_CURRENT_CONTEXT(ctx
);
8923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8924 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8929 if (ctx
->ExecuteFlag
) {
8930 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8935 /* GL_NV_texture_barrier */
8936 static void GLAPIENTRY
8937 save_TextureBarrierNV(void)
8939 GET_CURRENT_CONTEXT(ctx
);
8940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8941 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8942 if (ctx
->ExecuteFlag
) {
8943 CALL_TextureBarrierNV(ctx
->Exec
, ());
8948 /* GL_ARB_sampler_objects */
8949 static void GLAPIENTRY
8950 save_BindSampler(GLuint unit
, GLuint sampler
)
8953 GET_CURRENT_CONTEXT(ctx
);
8954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8955 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8960 if (ctx
->ExecuteFlag
) {
8961 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8965 static void GLAPIENTRY
8966 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8969 GET_CURRENT_CONTEXT(ctx
);
8970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8971 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8976 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
8982 n
[4].i
= n
[5].i
= n
[6].i
= 0;
8985 if (ctx
->ExecuteFlag
) {
8986 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
8990 static void GLAPIENTRY
8991 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
8995 parray
[1] = parray
[2] = parray
[3] = 0;
8996 save_SamplerParameteriv(sampler
, pname
, parray
);
8999 static void GLAPIENTRY
9000 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9003 GET_CURRENT_CONTEXT(ctx
);
9004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9005 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9010 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9016 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9019 if (ctx
->ExecuteFlag
) {
9020 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9024 static void GLAPIENTRY
9025 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9029 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9030 save_SamplerParameterfv(sampler
, pname
, parray
);
9033 static void GLAPIENTRY
9034 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9037 GET_CURRENT_CONTEXT(ctx
);
9038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9039 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9044 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9050 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9053 if (ctx
->ExecuteFlag
) {
9054 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9058 static void GLAPIENTRY
9059 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9062 GET_CURRENT_CONTEXT(ctx
);
9063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9064 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9068 n
[3].ui
= params
[0];
9069 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9070 n
[4].ui
= params
[1];
9071 n
[5].ui
= params
[2];
9072 n
[6].ui
= params
[3];
9075 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9078 if (ctx
->ExecuteFlag
) {
9079 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9083 static void GLAPIENTRY
9084 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9087 GET_CURRENT_CONTEXT(ctx
);
9088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9089 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9091 union uint64_pair p
;
9094 n
[2].ui
= p
.uint32
[0];
9095 n
[3].ui
= p
.uint32
[1];
9096 save_pointer(&n
[4], sync
);
9098 if (ctx
->ExecuteFlag
) {
9099 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9104 /** GL_NV_conditional_render */
9105 static void GLAPIENTRY
9106 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9108 GET_CURRENT_CONTEXT(ctx
);
9110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9111 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9116 if (ctx
->ExecuteFlag
) {
9117 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9121 static void GLAPIENTRY
9122 save_EndConditionalRender(void)
9124 GET_CURRENT_CONTEXT(ctx
);
9125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9126 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9127 if (ctx
->ExecuteFlag
) {
9128 CALL_EndConditionalRender(ctx
->Exec
, ());
9132 static void GLAPIENTRY
9133 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9135 GET_CURRENT_CONTEXT(ctx
);
9137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9138 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9144 if (ctx
->ExecuteFlag
) {
9145 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9149 static void GLAPIENTRY
9150 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9151 const GLuint
*indices
)
9153 GET_CURRENT_CONTEXT(ctx
);
9155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9156 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9158 GLint
*indices_copy
= NULL
;
9161 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9162 n
[1].e
= shadertype
;
9164 save_pointer(&n
[3], indices_copy
);
9166 if (ctx
->ExecuteFlag
) {
9167 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9171 /** GL_EXT_window_rectangles */
9172 static void GLAPIENTRY
9173 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9175 GET_CURRENT_CONTEXT(ctx
);
9177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9178 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9180 GLint
*box_copy
= NULL
;
9183 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9186 save_pointer(&n
[3], box_copy
);
9188 if (ctx
->ExecuteFlag
) {
9189 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9194 /** GL_NV_conservative_raster */
9195 static void GLAPIENTRY
9196 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9198 GET_CURRENT_CONTEXT(ctx
);
9200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9201 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9206 if (ctx
->ExecuteFlag
) {
9207 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9211 /** GL_NV_conservative_raster_dilate */
9212 static void GLAPIENTRY
9213 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9215 GET_CURRENT_CONTEXT(ctx
);
9217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9218 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9223 if (ctx
->ExecuteFlag
) {
9224 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9228 /** GL_NV_conservative_raster_pre_snap_triangles */
9229 static void GLAPIENTRY
9230 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9232 GET_CURRENT_CONTEXT(ctx
);
9234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9235 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9240 if (ctx
->ExecuteFlag
) {
9241 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9245 /** GL_EXT_direct_state_access */
9247 static void GLAPIENTRY
9248 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9250 GET_CURRENT_CONTEXT(ctx
);
9252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9253 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9255 n
[1].e
= matrixMode
;
9256 for (unsigned i
= 0; i
< 16; i
++) {
9260 if (ctx
->ExecuteFlag
) {
9261 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9265 static void GLAPIENTRY
9266 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9269 for (unsigned i
= 0; i
< 16; i
++) {
9270 f
[i
] = (GLfloat
) m
[i
];
9272 save_MatrixLoadfEXT(matrixMode
, f
);
9275 static void GLAPIENTRY
9276 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9278 GET_CURRENT_CONTEXT(ctx
);
9280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9281 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9283 n
[1].e
= matrixMode
;
9284 for (unsigned i
= 0; i
< 16; i
++) {
9288 if (ctx
->ExecuteFlag
) {
9289 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9293 static void GLAPIENTRY
9294 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9297 for (unsigned i
= 0; i
< 16; i
++) {
9298 f
[i
] = (GLfloat
) m
[i
];
9300 save_MatrixMultfEXT(matrixMode
, f
);
9303 static void GLAPIENTRY
9304 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9306 GET_CURRENT_CONTEXT(ctx
);
9308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9309 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9311 n
[1].e
= matrixMode
;
9317 if (ctx
->ExecuteFlag
) {
9318 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9322 static void GLAPIENTRY
9323 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9325 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9328 static void GLAPIENTRY
9329 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9331 GET_CURRENT_CONTEXT(ctx
);
9333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9334 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9336 n
[1].e
= matrixMode
;
9341 if (ctx
->ExecuteFlag
) {
9342 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9346 static void GLAPIENTRY
9347 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9349 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9352 static void GLAPIENTRY
9353 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9355 GET_CURRENT_CONTEXT(ctx
);
9357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9358 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9360 n
[1].e
= matrixMode
;
9365 if (ctx
->ExecuteFlag
) {
9366 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9370 static void GLAPIENTRY
9371 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9373 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9376 static void GLAPIENTRY
9377 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9379 GET_CURRENT_CONTEXT(ctx
);
9381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9382 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9384 n
[1].e
= matrixMode
;
9386 if (ctx
->ExecuteFlag
) {
9387 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9391 static void GLAPIENTRY
9392 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9393 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9395 GET_CURRENT_CONTEXT(ctx
);
9397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9398 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9400 n
[1].e
= matrixMode
;
9401 n
[2].f
= (GLfloat
) left
;
9402 n
[3].f
= (GLfloat
) right
;
9403 n
[4].f
= (GLfloat
) bottom
;
9404 n
[5].f
= (GLfloat
) top
;
9405 n
[6].f
= (GLfloat
) nearval
;
9406 n
[7].f
= (GLfloat
) farval
;
9408 if (ctx
->ExecuteFlag
) {
9409 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9414 static void GLAPIENTRY
9415 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9416 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9418 GET_CURRENT_CONTEXT(ctx
);
9420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9421 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9423 n
[1].e
= matrixMode
;
9424 n
[2].f
= (GLfloat
) left
;
9425 n
[3].f
= (GLfloat
) right
;
9426 n
[4].f
= (GLfloat
) bottom
;
9427 n
[5].f
= (GLfloat
) top
;
9428 n
[6].f
= (GLfloat
) nearval
;
9429 n
[7].f
= (GLfloat
) farval
;
9431 if (ctx
->ExecuteFlag
) {
9432 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9436 static void GLAPIENTRY
9437 save_MatrixPushEXT(GLenum matrixMode
)
9439 GET_CURRENT_CONTEXT(ctx
);
9441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9442 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9444 n
[1].e
= matrixMode
;
9446 if (ctx
->ExecuteFlag
) {
9447 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9451 static void GLAPIENTRY
9452 save_MatrixPopEXT(GLenum matrixMode
)
9454 GET_CURRENT_CONTEXT(ctx
);
9456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9457 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9459 n
[1].e
= matrixMode
;
9461 if (ctx
->ExecuteFlag
) {
9462 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9466 static void GLAPIENTRY
9467 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9470 _math_transposef(tm
, m
);
9471 save_MatrixLoadfEXT(matrixMode
, tm
);
9474 static void GLAPIENTRY
9475 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9478 _math_transposefd(tm
, m
);
9479 save_MatrixLoadfEXT(matrixMode
, tm
);
9482 static void GLAPIENTRY
9483 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9486 _math_transposef(tm
, m
);
9487 save_MatrixMultfEXT(matrixMode
, tm
);
9490 static void GLAPIENTRY
9491 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9494 _math_transposefd(tm
, m
);
9495 save_MatrixMultfEXT(matrixMode
, tm
);
9498 static void GLAPIENTRY
9499 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9500 const GLfloat
*params
)
9502 GET_CURRENT_CONTEXT(ctx
);
9504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9505 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9515 if (ctx
->ExecuteFlag
) {
9516 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9521 static void GLAPIENTRY
9522 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9526 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9527 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9530 static void GLAPIENTRY
9531 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9533 GET_CURRENT_CONTEXT(ctx
);
9535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9536 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9546 if (ctx
->ExecuteFlag
) {
9547 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9551 static void GLAPIENTRY
9552 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9556 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9557 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9560 static void GLAPIENTRY
9561 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9562 GLint level
, GLint components
,
9563 GLsizei width
, GLint border
,
9564 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9566 GET_CURRENT_CONTEXT(ctx
);
9567 if (target
== GL_PROXY_TEXTURE_1D
) {
9568 /* don't compile, execute immediately */
9569 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9570 border
, format
, type
, pixels
));
9574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9575 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9580 n
[4].i
= components
;
9581 n
[5].i
= (GLint
) width
;
9586 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9587 pixels
, &ctx
->Unpack
));
9589 if (ctx
->ExecuteFlag
) {
9590 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9591 border
, format
, type
, pixels
));
9597 static void GLAPIENTRY
9598 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9599 GLint level
, GLint components
,
9600 GLsizei width
, GLsizei height
, GLint border
,
9601 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9603 GET_CURRENT_CONTEXT(ctx
);
9604 if (target
== GL_PROXY_TEXTURE_2D
) {
9605 /* don't compile, execute immediately */
9606 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9607 height
, border
, format
, type
, pixels
));
9611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9612 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9617 n
[4].i
= components
;
9618 n
[5].i
= (GLint
) width
;
9619 n
[6].i
= (GLint
) height
;
9623 save_pointer(&n
[10],
9624 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9625 pixels
, &ctx
->Unpack
));
9627 if (ctx
->ExecuteFlag
) {
9628 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9629 height
, border
, format
, type
, pixels
));
9635 static void GLAPIENTRY
9636 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9637 GLint level
, GLint internalFormat
,
9638 GLsizei width
, GLsizei height
, GLsizei depth
,
9640 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9642 GET_CURRENT_CONTEXT(ctx
);
9643 if (target
== GL_PROXY_TEXTURE_3D
) {
9644 /* don't compile, execute immediately */
9645 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9646 height
, depth
, border
, format
, type
,
9651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9652 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9657 n
[4].i
= (GLint
) internalFormat
;
9658 n
[5].i
= (GLint
) width
;
9659 n
[6].i
= (GLint
) height
;
9660 n
[7].i
= (GLint
) depth
;
9664 save_pointer(&n
[11],
9665 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9666 pixels
, &ctx
->Unpack
));
9668 if (ctx
->ExecuteFlag
) {
9669 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9670 width
, height
, depth
, border
, format
,
9677 static void GLAPIENTRY
9678 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9679 GLsizei width
, GLenum format
, GLenum type
,
9680 const GLvoid
* pixels
)
9682 GET_CURRENT_CONTEXT(ctx
);
9685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9687 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9693 n
[5].i
= (GLint
) width
;
9697 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9698 pixels
, &ctx
->Unpack
));
9700 if (ctx
->ExecuteFlag
) {
9701 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9702 format
, type
, pixels
));
9707 static void GLAPIENTRY
9708 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9709 GLint xoffset
, GLint yoffset
,
9710 GLsizei width
, GLsizei height
,
9711 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9713 GET_CURRENT_CONTEXT(ctx
);
9716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9718 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9725 n
[6].i
= (GLint
) width
;
9726 n
[7].i
= (GLint
) height
;
9729 save_pointer(&n
[10],
9730 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9731 pixels
, &ctx
->Unpack
));
9733 if (ctx
->ExecuteFlag
) {
9734 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9735 width
, height
, format
, type
, pixels
));
9740 static void GLAPIENTRY
9741 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9742 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9743 GLsizei width
, GLsizei height
, GLsizei depth
,
9744 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9746 GET_CURRENT_CONTEXT(ctx
);
9749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9751 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9759 n
[7].i
= (GLint
) width
;
9760 n
[8].i
= (GLint
) height
;
9761 n
[9].i
= (GLint
) depth
;
9764 save_pointer(&n
[12],
9765 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9766 pixels
, &ctx
->Unpack
));
9768 if (ctx
->ExecuteFlag
) {
9769 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9770 xoffset
, yoffset
, zoffset
,
9771 width
, height
, depth
, format
, type
,
9776 static void GLAPIENTRY
9777 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9778 GLenum internalformat
, GLint x
, GLint y
,
9779 GLsizei width
, GLint border
)
9781 GET_CURRENT_CONTEXT(ctx
);
9783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9784 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9789 n
[4].e
= internalformat
;
9795 if (ctx
->ExecuteFlag
) {
9796 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9797 internalformat
, x
, y
,
9802 static void GLAPIENTRY
9803 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9804 GLenum internalformat
,
9805 GLint x
, GLint y
, GLsizei width
,
9806 GLsizei height
, GLint border
)
9808 GET_CURRENT_CONTEXT(ctx
);
9810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9811 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9816 n
[4].e
= internalformat
;
9823 if (ctx
->ExecuteFlag
) {
9824 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9825 internalformat
, x
, y
,
9826 width
, height
, border
));
9830 static void GLAPIENTRY
9831 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9832 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9834 GET_CURRENT_CONTEXT(ctx
);
9836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9837 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9847 if (ctx
->ExecuteFlag
) {
9848 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9849 (texture
, target
, level
, xoffset
, x
, y
, width
));
9853 static void GLAPIENTRY
9854 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9855 GLint xoffset
, GLint yoffset
,
9856 GLint x
, GLint y
, GLsizei width
, GLint height
)
9858 GET_CURRENT_CONTEXT(ctx
);
9860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9861 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9873 if (ctx
->ExecuteFlag
) {
9874 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9876 x
, y
, width
, height
));
9881 static void GLAPIENTRY
9882 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9883 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9884 GLint x
, GLint y
, GLsizei width
, GLint height
)
9886 GET_CURRENT_CONTEXT(ctx
);
9888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9889 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9902 if (ctx
->ExecuteFlag
) {
9903 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9904 xoffset
, yoffset
, zoffset
,
9905 x
, y
, width
, height
));
9909 static void GLAPIENTRY
9910 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9911 GLint yoffset
, GLsizei width
, GLsizei height
,
9912 GLenum format
, GLsizei imageSize
,
9913 const GLvoid
* data
)
9916 GET_CURRENT_CONTEXT(ctx
);
9917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9919 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
9920 9 + POINTER_DWORDS
);
9927 n
[6].i
= (GLint
) width
;
9928 n
[7].i
= (GLint
) height
;
9931 save_pointer(&n
[10],
9932 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
9934 if (ctx
->ExecuteFlag
) {
9935 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
9936 (texture
, target
, level
, xoffset
, yoffset
,
9937 width
, height
, format
, imageSize
, data
));
9943 * Save an error-generating command into display list.
9945 * KW: Will appear in the list before the vertex buffer containing the
9946 * command that provoked the error. I don't see this as a problem.
9949 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9952 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
9955 save_pointer(&n
[2], (void *) s
);
9956 /* note: the data/string here doesn't have to be freed in
9957 * _mesa_delete_list() since the string is never dynamically
9965 * Compile an error into current display list.
9968 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
9970 if (ctx
->CompileFlag
)
9971 save_error(ctx
, error
, s
);
9972 if (ctx
->ExecuteFlag
)
9973 _mesa_error(ctx
, error
, "%s", s
);
9978 * Test if ID names a display list.
9981 islist(struct gl_context
*ctx
, GLuint list
)
9983 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
9993 /**********************************************************************/
9994 /* Display list execution */
9995 /**********************************************************************/
9999 * Execute a display list. Note that the ListBase offset must have already
10000 * been added before calling this function. I.e. the list argument is
10001 * the absolute list number, not relative to ListBase.
10002 * \param list - display list number
10005 execute_list(struct gl_context
*ctx
, GLuint list
)
10007 struct gl_display_list
*dlist
;
10011 if (list
== 0 || !islist(ctx
, list
))
10014 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10015 /* raise an error? */
10019 dlist
= _mesa_lookup_list(ctx
, list
);
10023 ctx
->ListState
.CallDepth
++;
10025 vbo_save_BeginCallList(ctx
, dlist
);
10031 const OpCode opcode
= n
[0].opcode
;
10033 if (is_ext_opcode(opcode
)) {
10034 n
+= ext_opcode_execute(ctx
, n
);
10039 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10042 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10044 case OPCODE_ALPHA_FUNC
:
10045 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10047 case OPCODE_BIND_TEXTURE
:
10048 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10050 case OPCODE_BITMAP
:
10052 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10053 ctx
->Unpack
= ctx
->DefaultPacking
;
10054 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10055 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10056 get_pointer(&n
[7])));
10057 ctx
->Unpack
= save
; /* restore */
10060 case OPCODE_BLEND_COLOR
:
10061 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10063 case OPCODE_BLEND_EQUATION
:
10064 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10066 case OPCODE_BLEND_EQUATION_SEPARATE
:
10067 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10069 case OPCODE_BLEND_FUNC_SEPARATE
:
10070 CALL_BlendFuncSeparate(ctx
->Exec
,
10071 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10074 case OPCODE_BLEND_FUNC_I
:
10075 /* GL_ARB_draw_buffers_blend */
10076 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10078 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10079 /* GL_ARB_draw_buffers_blend */
10080 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10083 case OPCODE_BLEND_EQUATION_I
:
10084 /* GL_ARB_draw_buffers_blend */
10085 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10087 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10088 /* GL_ARB_draw_buffers_blend */
10089 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10090 (n
[1].ui
, n
[2].e
, n
[3].e
));
10093 case OPCODE_CALL_LIST
:
10094 /* Generated by glCallList(), don't add ListBase */
10095 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10096 execute_list(ctx
, n
[1].ui
);
10099 case OPCODE_CALL_LISTS
:
10100 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10101 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10105 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10107 case OPCODE_CLEAR_BUFFER_IV
:
10114 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10117 case OPCODE_CLEAR_BUFFER_UIV
:
10120 value
[0] = n
[3].ui
;
10121 value
[1] = n
[4].ui
;
10122 value
[2] = n
[5].ui
;
10123 value
[3] = n
[6].ui
;
10124 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10127 case OPCODE_CLEAR_BUFFER_FV
:
10134 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10137 case OPCODE_CLEAR_BUFFER_FI
:
10138 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10140 case OPCODE_CLEAR_COLOR
:
10141 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10143 case OPCODE_CLEAR_ACCUM
:
10144 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10146 case OPCODE_CLEAR_DEPTH
:
10147 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10149 case OPCODE_CLEAR_INDEX
:
10150 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10152 case OPCODE_CLEAR_STENCIL
:
10153 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10155 case OPCODE_CLIP_PLANE
:
10162 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10165 case OPCODE_COLOR_MASK
:
10166 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10168 case OPCODE_COLOR_MASK_INDEXED
:
10169 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10172 case OPCODE_COLOR_MATERIAL
:
10173 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10175 case OPCODE_COPY_PIXELS
:
10176 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10177 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10180 case OPCODE_COPY_TEX_IMAGE1D
:
10181 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10182 n
[5].i
, n
[6].i
, n
[7].i
));
10184 case OPCODE_COPY_TEX_IMAGE2D
:
10185 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10186 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10188 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10189 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10190 n
[4].i
, n
[5].i
, n
[6].i
));
10192 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10193 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10194 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10197 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10198 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10199 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10202 case OPCODE_CULL_FACE
:
10203 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10205 case OPCODE_DEPTH_FUNC
:
10206 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10208 case OPCODE_DEPTH_MASK
:
10209 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10211 case OPCODE_DEPTH_RANGE
:
10212 CALL_DepthRange(ctx
->Exec
,
10213 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10215 case OPCODE_DISABLE
:
10216 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10218 case OPCODE_DISABLE_INDEXED
:
10219 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10221 case OPCODE_DRAW_BUFFER
:
10222 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10224 case OPCODE_DRAW_PIXELS
:
10226 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10227 ctx
->Unpack
= ctx
->DefaultPacking
;
10228 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10229 get_pointer(&n
[5])));
10230 ctx
->Unpack
= save
; /* restore */
10233 case OPCODE_ENABLE
:
10234 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10236 case OPCODE_ENABLE_INDEXED
:
10237 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10239 case OPCODE_EVALMESH1
:
10240 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10242 case OPCODE_EVALMESH2
:
10243 CALL_EvalMesh2(ctx
->Exec
,
10244 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10253 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10256 case OPCODE_FRONT_FACE
:
10257 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10259 case OPCODE_FRUSTUM
:
10260 CALL_Frustum(ctx
->Exec
,
10261 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10264 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10266 case OPCODE_INDEX_MASK
:
10267 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10269 case OPCODE_INIT_NAMES
:
10270 CALL_InitNames(ctx
->Exec
, ());
10279 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10282 case OPCODE_LIGHT_MODEL
:
10289 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10292 case OPCODE_LINE_STIPPLE
:
10293 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10295 case OPCODE_LINE_WIDTH
:
10296 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10298 case OPCODE_LIST_BASE
:
10299 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10301 case OPCODE_LOAD_IDENTITY
:
10302 CALL_LoadIdentity(ctx
->Exec
, ());
10304 case OPCODE_LOAD_MATRIX
:
10305 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10306 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10308 case OPCODE_LOAD_NAME
:
10309 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10311 case OPCODE_LOGIC_OP
:
10312 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10316 GLenum target
= n
[1].e
;
10317 GLint ustride
= _mesa_evaluator_components(target
);
10318 GLint uorder
= n
[5].i
;
10319 GLfloat u1
= n
[2].f
;
10320 GLfloat u2
= n
[3].f
;
10321 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10322 (GLfloat
*) get_pointer(&n
[6])));
10327 GLenum target
= n
[1].e
;
10328 GLfloat u1
= n
[2].f
;
10329 GLfloat u2
= n
[3].f
;
10330 GLfloat v1
= n
[4].f
;
10331 GLfloat v2
= n
[5].f
;
10332 GLint ustride
= n
[6].i
;
10333 GLint vstride
= n
[7].i
;
10334 GLint uorder
= n
[8].i
;
10335 GLint vorder
= n
[9].i
;
10336 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10337 v1
, v2
, vstride
, vorder
,
10338 (GLfloat
*) get_pointer(&n
[10])));
10341 case OPCODE_MAPGRID1
:
10342 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10344 case OPCODE_MAPGRID2
:
10345 CALL_MapGrid2f(ctx
->Exec
,
10346 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10348 case OPCODE_MATRIX_MODE
:
10349 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10351 case OPCODE_MULT_MATRIX
:
10352 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10355 CALL_Ortho(ctx
->Exec
,
10356 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10358 case OPCODE_PASSTHROUGH
:
10359 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10361 case OPCODE_PATCH_PARAMETER_I
:
10362 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10364 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10367 params
[0] = n
[2].f
;
10368 params
[1] = n
[3].f
;
10369 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10372 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10375 params
[0] = n
[2].f
;
10376 params
[1] = n
[3].f
;
10377 params
[2] = n
[4].f
;
10378 params
[3] = n
[5].f
;
10379 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10382 case OPCODE_PIXEL_MAP
:
10383 CALL_PixelMapfv(ctx
->Exec
,
10384 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10386 case OPCODE_PIXEL_TRANSFER
:
10387 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10389 case OPCODE_PIXEL_ZOOM
:
10390 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10392 case OPCODE_POINT_SIZE
:
10393 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10395 case OPCODE_POINT_PARAMETERS
:
10398 params
[0] = n
[2].f
;
10399 params
[1] = n
[3].f
;
10400 params
[2] = n
[4].f
;
10401 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10404 case OPCODE_POLYGON_MODE
:
10405 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10407 case OPCODE_POLYGON_STIPPLE
:
10409 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10410 ctx
->Unpack
= ctx
->DefaultPacking
;
10411 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10412 ctx
->Unpack
= save
; /* restore */
10415 case OPCODE_POLYGON_OFFSET
:
10416 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10418 case OPCODE_POLYGON_OFFSET_CLAMP
:
10419 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10421 case OPCODE_POP_ATTRIB
:
10422 CALL_PopAttrib(ctx
->Exec
, ());
10424 case OPCODE_POP_MATRIX
:
10425 CALL_PopMatrix(ctx
->Exec
, ());
10427 case OPCODE_POP_NAME
:
10428 CALL_PopName(ctx
->Exec
, ());
10430 case OPCODE_PRIORITIZE_TEXTURE
:
10431 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10433 case OPCODE_PUSH_ATTRIB
:
10434 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10436 case OPCODE_PUSH_MATRIX
:
10437 CALL_PushMatrix(ctx
->Exec
, ());
10439 case OPCODE_PUSH_NAME
:
10440 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10442 case OPCODE_RASTER_POS
:
10443 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10445 case OPCODE_READ_BUFFER
:
10446 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10448 case OPCODE_ROTATE
:
10449 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10452 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10454 case OPCODE_SCISSOR
:
10455 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10457 case OPCODE_SHADE_MODEL
:
10458 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10460 case OPCODE_PROVOKING_VERTEX
:
10461 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10463 case OPCODE_STENCIL_FUNC
:
10464 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10466 case OPCODE_STENCIL_MASK
:
10467 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10469 case OPCODE_STENCIL_OP
:
10470 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10472 case OPCODE_STENCIL_FUNC_SEPARATE
:
10473 CALL_StencilFuncSeparate(ctx
->Exec
,
10474 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10476 case OPCODE_STENCIL_MASK_SEPARATE
:
10477 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10479 case OPCODE_STENCIL_OP_SEPARATE
:
10480 CALL_StencilOpSeparate(ctx
->Exec
,
10481 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10483 case OPCODE_TEXENV
:
10486 params
[0] = n
[3].f
;
10487 params
[1] = n
[4].f
;
10488 params
[2] = n
[5].f
;
10489 params
[3] = n
[6].f
;
10490 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10493 case OPCODE_TEXGEN
:
10496 params
[0] = n
[3].f
;
10497 params
[1] = n
[4].f
;
10498 params
[2] = n
[5].f
;
10499 params
[3] = n
[6].f
;
10500 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10503 case OPCODE_TEXPARAMETER
:
10506 params
[0] = n
[3].f
;
10507 params
[1] = n
[4].f
;
10508 params
[2] = n
[5].f
;
10509 params
[3] = n
[6].f
;
10510 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
10513 case OPCODE_TEX_IMAGE1D
:
10515 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10516 ctx
->Unpack
= ctx
->DefaultPacking
;
10517 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
10518 n
[2].i
, /* level */
10519 n
[3].i
, /* components */
10520 n
[4].i
, /* width */
10521 n
[5].e
, /* border */
10522 n
[6].e
, /* format */
10524 get_pointer(&n
[8])));
10525 ctx
->Unpack
= save
; /* restore */
10528 case OPCODE_TEX_IMAGE2D
:
10530 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10531 ctx
->Unpack
= ctx
->DefaultPacking
;
10532 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
10533 n
[2].i
, /* level */
10534 n
[3].i
, /* components */
10535 n
[4].i
, /* width */
10536 n
[5].i
, /* height */
10537 n
[6].e
, /* border */
10538 n
[7].e
, /* format */
10540 get_pointer(&n
[9])));
10541 ctx
->Unpack
= save
; /* restore */
10544 case OPCODE_TEX_IMAGE3D
:
10546 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10547 ctx
->Unpack
= ctx
->DefaultPacking
;
10548 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
10549 n
[2].i
, /* level */
10550 n
[3].i
, /* components */
10551 n
[4].i
, /* width */
10552 n
[5].i
, /* height */
10553 n
[6].i
, /* depth */
10554 n
[7].e
, /* border */
10555 n
[8].e
, /* format */
10557 get_pointer(&n
[10])));
10558 ctx
->Unpack
= save
; /* restore */
10561 case OPCODE_TEX_SUB_IMAGE1D
:
10563 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10564 ctx
->Unpack
= ctx
->DefaultPacking
;
10565 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10567 n
[6].e
, get_pointer(&n
[7])));
10568 ctx
->Unpack
= save
; /* restore */
10571 case OPCODE_TEX_SUB_IMAGE2D
:
10573 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10574 ctx
->Unpack
= ctx
->DefaultPacking
;
10575 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10577 n
[6].i
, n
[7].e
, n
[8].e
,
10578 get_pointer(&n
[9])));
10579 ctx
->Unpack
= save
; /* restore */
10582 case OPCODE_TEX_SUB_IMAGE3D
:
10584 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10585 ctx
->Unpack
= ctx
->DefaultPacking
;
10586 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10587 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10588 n
[8].i
, n
[9].e
, n
[10].e
,
10589 get_pointer(&n
[11])));
10590 ctx
->Unpack
= save
; /* restore */
10593 case OPCODE_TRANSLATE
:
10594 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10596 case OPCODE_VIEWPORT
:
10597 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10598 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
10600 case OPCODE_WINDOW_POS
:
10601 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10603 case OPCODE_VIEWPORT_ARRAY_V
:
10604 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10605 get_pointer(&n
[3])));
10607 case OPCODE_VIEWPORT_INDEXED_F
:
10608 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
10611 case OPCODE_VIEWPORT_INDEXED_FV
: {
10617 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
10620 case OPCODE_SCISSOR_ARRAY_V
:
10621 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10622 get_pointer(&n
[3])));
10624 case OPCODE_SCISSOR_INDEXED
:
10625 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
10628 case OPCODE_SCISSOR_INDEXED_V
: {
10634 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
10637 case OPCODE_DEPTH_ARRAY_V
:
10638 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
10639 get_pointer(&n
[3])));
10641 case OPCODE_DEPTH_INDEXED
:
10642 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
10644 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
10645 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
10647 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
10648 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10649 n
[4].i
, n
[5].i
, n
[6].i
,
10650 get_pointer(&n
[7])));
10652 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
10653 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10654 n
[4].i
, n
[5].i
, n
[6].i
,
10655 n
[7].i
, get_pointer(&n
[8])));
10657 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
10658 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
10659 n
[4].i
, n
[5].i
, n
[6].i
,
10661 get_pointer(&n
[9])));
10663 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
10664 CALL_CompressedTexSubImage1D(ctx
->Exec
,
10665 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10667 get_pointer(&n
[7])));
10669 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
10670 CALL_CompressedTexSubImage2D(ctx
->Exec
,
10671 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10672 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
10673 get_pointer(&n
[9])));
10675 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
10676 CALL_CompressedTexSubImage3D(ctx
->Exec
,
10677 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
10678 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10680 get_pointer(&n
[11])));
10682 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
10683 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
10685 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
10686 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10688 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
10689 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10691 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
10692 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
10693 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
10696 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
10697 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
10699 case OPCODE_DEPTH_BOUNDS_EXT
:
10700 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10702 case OPCODE_PROGRAM_STRING_ARB
:
10703 CALL_ProgramStringARB(ctx
->Exec
,
10704 (n
[1].e
, n
[2].e
, n
[3].i
,
10705 get_pointer(&n
[4])));
10707 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
10708 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
10712 case OPCODE_BEGIN_QUERY_ARB
:
10713 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10715 case OPCODE_END_QUERY_ARB
:
10716 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
10718 case OPCODE_QUERY_COUNTER
:
10719 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10721 case OPCODE_BEGIN_QUERY_INDEXED
:
10722 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
10724 case OPCODE_END_QUERY_INDEXED
:
10725 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10727 case OPCODE_DRAW_BUFFERS_ARB
:
10729 GLenum buffers
[MAX_DRAW_BUFFERS
];
10730 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
10731 for (i
= 0; i
< count
; i
++)
10732 buffers
[i
] = n
[2 + i
].e
;
10733 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
10736 case OPCODE_BLIT_FRAMEBUFFER
:
10737 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
10738 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
10741 case OPCODE_PRIMITIVE_RESTART_NV
:
10742 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
10745 case OPCODE_USE_PROGRAM
:
10746 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
10748 case OPCODE_UNIFORM_1F
:
10749 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
10751 case OPCODE_UNIFORM_2F
:
10752 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10754 case OPCODE_UNIFORM_3F
:
10755 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
10757 case OPCODE_UNIFORM_4F
:
10758 CALL_Uniform4f(ctx
->Exec
,
10759 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
10761 case OPCODE_UNIFORM_1FV
:
10762 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10764 case OPCODE_UNIFORM_2FV
:
10765 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10767 case OPCODE_UNIFORM_3FV
:
10768 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10770 case OPCODE_UNIFORM_4FV
:
10771 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10773 case OPCODE_UNIFORM_1D
: {
10774 union float64_pair x
;
10776 x
.uint32
[0] = n
[2].ui
;
10777 x
.uint32
[1] = n
[3].ui
;
10779 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
10782 case OPCODE_UNIFORM_2D
: {
10783 union float64_pair x
;
10784 union float64_pair y
;
10786 x
.uint32
[0] = n
[2].ui
;
10787 x
.uint32
[1] = n
[3].ui
;
10788 y
.uint32
[0] = n
[4].ui
;
10789 y
.uint32
[1] = n
[5].ui
;
10791 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
10794 case OPCODE_UNIFORM_3D
: {
10795 union float64_pair x
;
10796 union float64_pair y
;
10797 union float64_pair z
;
10799 x
.uint32
[0] = n
[2].ui
;
10800 x
.uint32
[1] = n
[3].ui
;
10801 y
.uint32
[0] = n
[4].ui
;
10802 y
.uint32
[1] = n
[5].ui
;
10803 z
.uint32
[0] = n
[6].ui
;
10804 z
.uint32
[1] = n
[7].ui
;
10806 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
10809 case OPCODE_UNIFORM_4D
: {
10810 union float64_pair x
;
10811 union float64_pair y
;
10812 union float64_pair z
;
10813 union float64_pair w
;
10815 x
.uint32
[0] = n
[2].ui
;
10816 x
.uint32
[1] = n
[3].ui
;
10817 y
.uint32
[0] = n
[4].ui
;
10818 y
.uint32
[1] = n
[5].ui
;
10819 z
.uint32
[0] = n
[6].ui
;
10820 z
.uint32
[1] = n
[7].ui
;
10821 w
.uint32
[0] = n
[8].ui
;
10822 w
.uint32
[1] = n
[9].ui
;
10824 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
10827 case OPCODE_UNIFORM_1DV
:
10828 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10830 case OPCODE_UNIFORM_2DV
:
10831 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10833 case OPCODE_UNIFORM_3DV
:
10834 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10836 case OPCODE_UNIFORM_4DV
:
10837 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10839 case OPCODE_UNIFORM_1I
:
10840 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10842 case OPCODE_UNIFORM_2I
:
10843 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10845 case OPCODE_UNIFORM_3I
:
10846 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10848 case OPCODE_UNIFORM_4I
:
10849 CALL_Uniform4i(ctx
->Exec
,
10850 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10852 case OPCODE_UNIFORM_1IV
:
10853 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10855 case OPCODE_UNIFORM_2IV
:
10856 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10858 case OPCODE_UNIFORM_3IV
:
10859 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10861 case OPCODE_UNIFORM_4IV
:
10862 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10864 case OPCODE_UNIFORM_1UI
:
10865 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
10867 case OPCODE_UNIFORM_2UI
:
10868 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
10870 case OPCODE_UNIFORM_3UI
:
10871 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10873 case OPCODE_UNIFORM_4UI
:
10874 CALL_Uniform4ui(ctx
->Exec
,
10875 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10877 case OPCODE_UNIFORM_1UIV
:
10878 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10880 case OPCODE_UNIFORM_2UIV
:
10881 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10883 case OPCODE_UNIFORM_3UIV
:
10884 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10886 case OPCODE_UNIFORM_4UIV
:
10887 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
10889 case OPCODE_UNIFORM_MATRIX22
:
10890 CALL_UniformMatrix2fv(ctx
->Exec
,
10891 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10893 case OPCODE_UNIFORM_MATRIX33
:
10894 CALL_UniformMatrix3fv(ctx
->Exec
,
10895 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10897 case OPCODE_UNIFORM_MATRIX44
:
10898 CALL_UniformMatrix4fv(ctx
->Exec
,
10899 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10901 case OPCODE_UNIFORM_MATRIX23
:
10902 CALL_UniformMatrix2x3fv(ctx
->Exec
,
10903 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10905 case OPCODE_UNIFORM_MATRIX32
:
10906 CALL_UniformMatrix3x2fv(ctx
->Exec
,
10907 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10909 case OPCODE_UNIFORM_MATRIX24
:
10910 CALL_UniformMatrix2x4fv(ctx
->Exec
,
10911 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10913 case OPCODE_UNIFORM_MATRIX42
:
10914 CALL_UniformMatrix4x2fv(ctx
->Exec
,
10915 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10917 case OPCODE_UNIFORM_MATRIX34
:
10918 CALL_UniformMatrix3x4fv(ctx
->Exec
,
10919 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10921 case OPCODE_UNIFORM_MATRIX43
:
10922 CALL_UniformMatrix4x3fv(ctx
->Exec
,
10923 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10925 case OPCODE_UNIFORM_MATRIX22D
:
10926 CALL_UniformMatrix2dv(ctx
->Exec
,
10927 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10929 case OPCODE_UNIFORM_MATRIX33D
:
10930 CALL_UniformMatrix3dv(ctx
->Exec
,
10931 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10933 case OPCODE_UNIFORM_MATRIX44D
:
10934 CALL_UniformMatrix4dv(ctx
->Exec
,
10935 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10937 case OPCODE_UNIFORM_MATRIX23D
:
10938 CALL_UniformMatrix2x3dv(ctx
->Exec
,
10939 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10941 case OPCODE_UNIFORM_MATRIX32D
:
10942 CALL_UniformMatrix3x2dv(ctx
->Exec
,
10943 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10945 case OPCODE_UNIFORM_MATRIX24D
:
10946 CALL_UniformMatrix2x4dv(ctx
->Exec
,
10947 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10949 case OPCODE_UNIFORM_MATRIX42D
:
10950 CALL_UniformMatrix4x2dv(ctx
->Exec
,
10951 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10953 case OPCODE_UNIFORM_MATRIX34D
:
10954 CALL_UniformMatrix3x4dv(ctx
->Exec
,
10955 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10957 case OPCODE_UNIFORM_MATRIX43D
:
10958 CALL_UniformMatrix4x3dv(ctx
->Exec
,
10959 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
10962 case OPCODE_USE_PROGRAM_STAGES
:
10963 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
10965 case OPCODE_PROGRAM_UNIFORM_1F
:
10966 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
10968 case OPCODE_PROGRAM_UNIFORM_2F
:
10969 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
10971 case OPCODE_PROGRAM_UNIFORM_3F
:
10972 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10973 n
[3].f
, n
[4].f
, n
[5].f
));
10975 case OPCODE_PROGRAM_UNIFORM_4F
:
10976 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
10977 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10979 case OPCODE_PROGRAM_UNIFORM_1FV
:
10980 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10981 get_pointer(&n
[4])));
10983 case OPCODE_PROGRAM_UNIFORM_2FV
:
10984 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10985 get_pointer(&n
[4])));
10987 case OPCODE_PROGRAM_UNIFORM_3FV
:
10988 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10989 get_pointer(&n
[4])));
10991 case OPCODE_PROGRAM_UNIFORM_4FV
:
10992 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
10993 get_pointer(&n
[4])));
10995 case OPCODE_PROGRAM_UNIFORM_1D
: {
10996 union float64_pair x
;
10998 x
.uint32
[0] = n
[3].ui
;
10999 x
.uint32
[1] = n
[4].ui
;
11001 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11004 case OPCODE_PROGRAM_UNIFORM_2D
: {
11005 union float64_pair x
;
11006 union float64_pair y
;
11008 x
.uint32
[0] = n
[3].ui
;
11009 x
.uint32
[1] = n
[4].ui
;
11010 y
.uint32
[0] = n
[5].ui
;
11011 y
.uint32
[1] = n
[6].ui
;
11013 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11016 case OPCODE_PROGRAM_UNIFORM_3D
: {
11017 union float64_pair x
;
11018 union float64_pair y
;
11019 union float64_pair z
;
11021 x
.uint32
[0] = n
[3].ui
;
11022 x
.uint32
[1] = n
[4].ui
;
11023 y
.uint32
[0] = n
[5].ui
;
11024 y
.uint32
[1] = n
[6].ui
;
11025 z
.uint32
[0] = n
[7].ui
;
11026 z
.uint32
[1] = n
[8].ui
;
11028 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11032 case OPCODE_PROGRAM_UNIFORM_4D
: {
11033 union float64_pair x
;
11034 union float64_pair y
;
11035 union float64_pair z
;
11036 union float64_pair w
;
11038 x
.uint32
[0] = n
[3].ui
;
11039 x
.uint32
[1] = n
[4].ui
;
11040 y
.uint32
[0] = n
[5].ui
;
11041 y
.uint32
[1] = n
[6].ui
;
11042 z
.uint32
[0] = n
[7].ui
;
11043 z
.uint32
[1] = n
[8].ui
;
11044 w
.uint32
[0] = n
[9].ui
;
11045 w
.uint32
[1] = n
[10].ui
;
11047 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11048 x
.d
, y
.d
, z
.d
, w
.d
));
11051 case OPCODE_PROGRAM_UNIFORM_1DV
:
11052 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11053 get_pointer(&n
[4])));
11055 case OPCODE_PROGRAM_UNIFORM_2DV
:
11056 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11057 get_pointer(&n
[4])));
11059 case OPCODE_PROGRAM_UNIFORM_3DV
:
11060 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11061 get_pointer(&n
[4])));
11063 case OPCODE_PROGRAM_UNIFORM_4DV
:
11064 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11065 get_pointer(&n
[4])));
11067 case OPCODE_PROGRAM_UNIFORM_1I
:
11068 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11070 case OPCODE_PROGRAM_UNIFORM_2I
:
11071 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11073 case OPCODE_PROGRAM_UNIFORM_3I
:
11074 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11075 n
[3].i
, n
[4].i
, n
[5].i
));
11077 case OPCODE_PROGRAM_UNIFORM_4I
:
11078 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11079 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11081 case OPCODE_PROGRAM_UNIFORM_1IV
:
11082 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11083 get_pointer(&n
[4])));
11085 case OPCODE_PROGRAM_UNIFORM_2IV
:
11086 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11087 get_pointer(&n
[4])));
11089 case OPCODE_PROGRAM_UNIFORM_3IV
:
11090 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11091 get_pointer(&n
[4])));
11093 case OPCODE_PROGRAM_UNIFORM_4IV
:
11094 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11095 get_pointer(&n
[4])));
11097 case OPCODE_PROGRAM_UNIFORM_1UI
:
11098 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11100 case OPCODE_PROGRAM_UNIFORM_2UI
:
11101 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11102 n
[3].ui
, n
[4].ui
));
11104 case OPCODE_PROGRAM_UNIFORM_3UI
:
11105 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11106 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11108 case OPCODE_PROGRAM_UNIFORM_4UI
:
11109 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11111 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11113 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11114 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11115 get_pointer(&n
[4])));
11117 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11118 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11119 get_pointer(&n
[4])));
11121 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11122 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11123 get_pointer(&n
[4])));
11125 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11126 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11127 get_pointer(&n
[4])));
11129 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11130 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11131 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11132 get_pointer(&n
[5])));
11134 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11135 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11136 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11137 get_pointer(&n
[5])));
11139 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11140 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11141 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11142 get_pointer(&n
[5])));
11144 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11145 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11146 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11147 get_pointer(&n
[5])));
11149 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11150 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11151 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11152 get_pointer(&n
[5])));
11154 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11155 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11156 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11157 get_pointer(&n
[5])));
11159 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11160 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11161 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11162 get_pointer(&n
[5])));
11164 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11165 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11166 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11167 get_pointer(&n
[5])));
11169 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11170 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11171 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11172 get_pointer(&n
[5])));
11174 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11175 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11176 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11177 get_pointer(&n
[5])));
11179 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11180 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11181 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11182 get_pointer(&n
[5])));
11184 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11185 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11186 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11187 get_pointer(&n
[5])));
11189 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11190 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11191 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11192 get_pointer(&n
[5])));
11194 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11195 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11196 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11197 get_pointer(&n
[5])));
11199 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11200 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11201 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11202 get_pointer(&n
[5])));
11204 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11205 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11206 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11207 get_pointer(&n
[5])));
11209 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11210 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11211 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11212 get_pointer(&n
[5])));
11214 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11215 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11216 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11217 get_pointer(&n
[5])));
11220 case OPCODE_CLIP_CONTROL
:
11221 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11224 case OPCODE_CLAMP_COLOR
:
11225 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11228 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11229 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11231 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11232 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11234 case OPCODE_ATTR_1F_NV
:
11235 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11237 case OPCODE_ATTR_2F_NV
:
11238 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11240 case OPCODE_ATTR_3F_NV
:
11241 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11243 case OPCODE_ATTR_4F_NV
:
11244 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11246 case OPCODE_ATTR_1F_ARB
:
11247 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11249 case OPCODE_ATTR_2F_ARB
:
11250 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11252 case OPCODE_ATTR_3F_ARB
:
11253 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11255 case OPCODE_ATTR_4F_ARB
:
11256 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11258 case OPCODE_ATTR_1D
: {
11259 GLdouble
*d
= (GLdouble
*) &n
[2];
11260 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11263 case OPCODE_ATTR_2D
: {
11264 GLdouble
*d
= (GLdouble
*) &n
[2];
11265 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11268 case OPCODE_ATTR_3D
: {
11269 GLdouble
*d
= (GLdouble
*) &n
[2];
11270 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11273 case OPCODE_ATTR_4D
: {
11274 GLdouble
*d
= (GLdouble
*) &n
[2];
11275 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11278 case OPCODE_MATERIAL
:
11279 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11282 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11285 CALL_End(ctx
->Exec
, ());
11288 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11290 case OPCODE_EVAL_C1
:
11291 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11293 case OPCODE_EVAL_C2
:
11294 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11296 case OPCODE_EVAL_P1
:
11297 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11299 case OPCODE_EVAL_P2
:
11300 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11303 /* GL_EXT_texture_integer */
11304 case OPCODE_CLEARCOLOR_I
:
11305 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11307 case OPCODE_CLEARCOLOR_UI
:
11308 CALL_ClearColorIuiEXT(ctx
->Exec
,
11309 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11311 case OPCODE_TEXPARAMETER_I
:
11314 params
[0] = n
[3].i
;
11315 params
[1] = n
[4].i
;
11316 params
[2] = n
[5].i
;
11317 params
[3] = n
[6].i
;
11318 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11321 case OPCODE_TEXPARAMETER_UI
:
11324 params
[0] = n
[3].ui
;
11325 params
[1] = n
[4].ui
;
11326 params
[2] = n
[5].ui
;
11327 params
[3] = n
[6].ui
;
11328 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11332 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11333 /* GL_ARB_instanced_arrays */
11334 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11337 case OPCODE_TEXTURE_BARRIER_NV
:
11338 CALL_TextureBarrierNV(ctx
->Exec
, ());
11341 /* GL_EXT/ARB_transform_feedback */
11342 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11343 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11345 case OPCODE_END_TRANSFORM_FEEDBACK
:
11346 CALL_EndTransformFeedback(ctx
->Exec
, ());
11348 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11349 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11351 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11352 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11354 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11355 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11357 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11358 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11360 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11361 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11362 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11364 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11365 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11366 (n
[1].e
, n
[2].ui
, n
[3].si
));
11368 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11369 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11370 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11374 case OPCODE_BIND_SAMPLER
:
11375 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11377 case OPCODE_SAMPLER_PARAMETERIV
:
11380 params
[0] = n
[3].i
;
11381 params
[1] = n
[4].i
;
11382 params
[2] = n
[5].i
;
11383 params
[3] = n
[6].i
;
11384 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11387 case OPCODE_SAMPLER_PARAMETERFV
:
11390 params
[0] = n
[3].f
;
11391 params
[1] = n
[4].f
;
11392 params
[2] = n
[5].f
;
11393 params
[3] = n
[6].f
;
11394 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11397 case OPCODE_SAMPLER_PARAMETERIIV
:
11400 params
[0] = n
[3].i
;
11401 params
[1] = n
[4].i
;
11402 params
[2] = n
[5].i
;
11403 params
[3] = n
[6].i
;
11404 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11407 case OPCODE_SAMPLER_PARAMETERUIV
:
11410 params
[0] = n
[3].ui
;
11411 params
[1] = n
[4].ui
;
11412 params
[2] = n
[5].ui
;
11413 params
[3] = n
[6].ui
;
11414 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11418 /* ARB_compute_shader */
11419 case OPCODE_DISPATCH_COMPUTE
:
11420 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11424 case OPCODE_WAIT_SYNC
:
11426 union uint64_pair p
;
11427 p
.uint32
[0] = n
[2].ui
;
11428 p
.uint32
[1] = n
[3].ui
;
11429 CALL_WaitSync(ctx
->Exec
,
11430 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11434 /* GL_NV_conditional_render */
11435 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11436 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11438 case OPCODE_END_CONDITIONAL_RENDER
:
11439 CALL_EndConditionalRender(ctx
->Exec
, ());
11442 case OPCODE_UNIFORM_BLOCK_BINDING
:
11443 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11446 case OPCODE_UNIFORM_SUBROUTINES
:
11447 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11448 get_pointer(&n
[3])));
11451 /* GL_EXT_window_rectangles */
11452 case OPCODE_WINDOW_RECTANGLES
:
11453 CALL_WindowRectanglesEXT(
11454 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11457 /* GL_NV_conservative_raster */
11458 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11459 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11462 /* GL_NV_conservative_raster_dilate */
11463 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11464 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11467 /* GL_NV_conservative_raster_pre_snap_triangles */
11468 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11469 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11472 /* GL_EXT_direct_state_access */
11473 case OPCODE_MATRIX_LOAD
:
11474 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11476 case OPCODE_MATRIX_MULT
:
11477 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11479 case OPCODE_MATRIX_ROTATE
:
11480 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11482 case OPCODE_MATRIX_SCALE
:
11483 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11485 case OPCODE_MATRIX_TRANSLATE
:
11486 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
11488 case OPCODE_MATRIX_LOAD_IDENTITY
:
11489 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
11491 case OPCODE_MATRIX_ORTHO
:
11492 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
11493 n
[2].f
, n
[3].f
, n
[4].f
,
11494 n
[5].f
, n
[6].f
, n
[7].f
));
11496 case OPCODE_MATRIX_FRUSTUM
:
11497 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
11498 n
[2].f
, n
[3].f
, n
[4].f
,
11499 n
[5].f
, n
[6].f
, n
[7].f
));
11501 case OPCODE_MATRIX_PUSH
:
11502 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
11504 case OPCODE_MATRIX_POP
:
11505 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
11507 case OPCODE_TEXTUREPARAMETER_F
:
11510 params
[0] = n
[4].f
;
11511 params
[1] = n
[5].f
;
11512 params
[2] = n
[6].f
;
11513 params
[3] = n
[7].f
;
11514 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11517 case OPCODE_TEXTUREPARAMETER_I
:
11520 params
[0] = n
[4].i
;
11521 params
[1] = n
[5].i
;
11522 params
[2] = n
[6].i
;
11523 params
[3] = n
[7].i
;
11524 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
11527 case OPCODE_TEXTURE_IMAGE1D
:
11529 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11530 ctx
->Unpack
= ctx
->DefaultPacking
;
11531 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11532 n
[2].e
, /* target */
11533 n
[3].i
, /* level */
11534 n
[4].i
, /* components */
11535 n
[5].i
, /* width */
11536 n
[6].e
, /* border */
11537 n
[7].e
, /* format */
11539 get_pointer(&n
[9])));
11540 ctx
->Unpack
= save
; /* restore */
11543 case OPCODE_TEXTURE_IMAGE2D
:
11545 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11546 ctx
->Unpack
= ctx
->DefaultPacking
;
11547 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11548 n
[2].e
, /* target */
11549 n
[3].i
, /* level */
11550 n
[4].i
, /* components */
11551 n
[5].i
, /* width */
11552 n
[6].i
, /* height */
11553 n
[7].e
, /* border */
11554 n
[8].e
, /* format */
11556 get_pointer(&n
[10])));
11557 ctx
->Unpack
= save
; /* restore */
11560 case OPCODE_TEXTURE_IMAGE3D
:
11562 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11563 ctx
->Unpack
= ctx
->DefaultPacking
;
11564 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
11565 n
[2].e
, /* target */
11566 n
[3].i
, /* level */
11567 n
[4].i
, /* components */
11568 n
[5].i
, /* width */
11569 n
[6].i
, /* height */
11570 n
[7].i
, /* depth */
11571 n
[8].e
, /* border */
11572 n
[9].e
, /* format */
11573 n
[10].e
, /* type */
11574 get_pointer(&n
[11])));
11575 ctx
->Unpack
= save
; /* restore */
11578 case OPCODE_TEXTURE_SUB_IMAGE1D
:
11580 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11581 ctx
->Unpack
= ctx
->DefaultPacking
;
11582 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11583 n
[4].i
, n
[5].i
, n
[6].e
,
11584 n
[7].e
, get_pointer(&n
[8])));
11585 ctx
->Unpack
= save
; /* restore */
11588 case OPCODE_TEXTURE_SUB_IMAGE2D
:
11590 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11591 ctx
->Unpack
= ctx
->DefaultPacking
;
11592 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11593 n
[4].i
, n
[5].i
, n
[6].e
,
11594 n
[7].i
, n
[8].e
, n
[9].e
,
11595 get_pointer(&n
[10])));
11596 ctx
->Unpack
= save
;
11599 case OPCODE_TEXTURE_SUB_IMAGE3D
:
11601 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11602 ctx
->Unpack
= ctx
->DefaultPacking
;
11603 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11604 n
[4].i
, n
[5].i
, n
[6].i
,
11605 n
[7].i
, n
[8].i
, n
[9].i
,
11607 get_pointer(&n
[12])));
11608 ctx
->Unpack
= save
; /* restore */
11611 case OPCODE_COPY_TEXTURE_IMAGE1D
:
11612 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11613 n
[4].e
, n
[5].i
, n
[6].i
,
11616 case OPCODE_COPY_TEXTURE_IMAGE2D
:
11617 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11618 n
[4].e
, n
[5].i
, n
[6].i
,
11619 n
[7].i
, n
[8].i
, n
[9].i
));
11621 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
11622 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11623 n
[4].i
, n
[5].i
, n
[6].i
,
11626 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
11627 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11628 n
[4].i
, n
[5].i
, n
[6].i
,
11629 n
[7].i
, n
[8].i
, n
[9].i
));
11631 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
11632 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
11633 n
[4].i
, n
[5].i
, n
[6].i
,
11634 n
[7].i
, n
[8].i
, n
[9].i
,
11637 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
11638 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
11639 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
11640 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
11641 n
[9].i
, get_pointer(&n
[10])));
11644 case OPCODE_CONTINUE
:
11645 n
= (Node
*) get_pointer(&n
[1]);
11650 case OPCODE_END_OF_LIST
:
11656 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
11658 _mesa_problem(ctx
, "%s", msg
);
11663 /* increment n to point to next compiled command */
11664 if (opcode
!= OPCODE_CONTINUE
) {
11665 assert(InstSize
[opcode
] > 0);
11666 n
+= InstSize
[opcode
];
11671 vbo_save_EndCallList(ctx
);
11673 ctx
->ListState
.CallDepth
--;
11678 /**********************************************************************/
11680 /**********************************************************************/
11683 * Test if a display list number is valid.
11685 GLboolean GLAPIENTRY
11686 _mesa_IsList(GLuint list
)
11688 GET_CURRENT_CONTEXT(ctx
);
11689 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11690 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
11691 return islist(ctx
, list
);
11696 * Delete a sequence of consecutive display lists.
11699 _mesa_DeleteLists(GLuint list
, GLsizei range
)
11701 GET_CURRENT_CONTEXT(ctx
);
11703 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11704 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11707 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
11712 /* We may be deleting a set of bitmap lists. See if there's a
11713 * bitmap atlas to free.
11715 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
11717 _mesa_delete_bitmap_atlas(ctx
, atlas
);
11718 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
11722 for (i
= list
; i
< list
+ range
; i
++) {
11723 destroy_list(ctx
, i
);
11729 * Return a display list number, n, such that lists n through n+range-1
11733 _mesa_GenLists(GLsizei range
)
11735 GET_CURRENT_CONTEXT(ctx
);
11737 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
11738 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
11741 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
11749 * Make this an atomic operation
11751 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
11753 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
11755 /* reserve the list IDs by with empty/dummy lists */
11757 for (i
= 0; i
< range
; i
++) {
11758 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
11759 make_list(base
+ i
, 1));
11763 if (USE_BITMAP_ATLAS
&&
11765 ctx
->Driver
.DrawAtlasBitmaps
) {
11766 /* "range > 16" is a rough heuristic to guess when glGenLists might be
11767 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
11768 * Create the empty atlas now.
11770 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
11772 atlas
= alloc_bitmap_atlas(ctx
, base
);
11775 /* Atlas _should_ be new/empty now, but clobbering is OK */
11776 assert(atlas
->numBitmaps
== 0);
11777 atlas
->numBitmaps
= range
;
11781 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
11788 * Begin a new display list.
11791 _mesa_NewList(GLuint name
, GLenum mode
)
11793 GET_CURRENT_CONTEXT(ctx
);
11795 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
11796 ASSERT_OUTSIDE_BEGIN_END(ctx
);
11798 if (MESA_VERBOSE
& VERBOSE_API
)
11799 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
11800 _mesa_enum_to_string(mode
));
11803 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
11807 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
11808 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
11812 if (ctx
->ListState
.CurrentList
) {
11813 /* already compiling a display list */
11814 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
11818 ctx
->CompileFlag
= GL_TRUE
;
11819 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
11821 /* Reset accumulated list state */
11822 invalidate_saved_current_state( ctx
);
11824 /* Allocate new display list */
11825 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
11826 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
11827 ctx
->ListState
.CurrentPos
= 0;
11829 vbo_save_NewList(ctx
, name
, mode
);
11831 ctx
->CurrentServerDispatch
= ctx
->Save
;
11832 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11833 if (ctx
->MarshalExec
== NULL
) {
11834 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11840 * End definition of current display list.
11843 _mesa_EndList(void)
11845 GET_CURRENT_CONTEXT(ctx
);
11846 SAVE_FLUSH_VERTICES(ctx
);
11847 FLUSH_VERTICES(ctx
, 0);
11849 if (MESA_VERBOSE
& VERBOSE_API
)
11850 _mesa_debug(ctx
, "glEndList\n");
11852 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
11853 _mesa_error(ctx
, GL_INVALID_OPERATION
,
11854 "glEndList() called inside glBegin/End");
11857 /* Check that a list is under construction */
11858 if (!ctx
->ListState
.CurrentList
) {
11859 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
11863 /* Call before emitting END_OF_LIST, in case the driver wants to
11864 * emit opcodes itself.
11866 vbo_save_EndList(ctx
);
11868 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
11872 /* Destroy old list, if any */
11873 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
11875 /* Install the new list */
11876 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
11877 ctx
->ListState
.CurrentList
->Name
,
11878 ctx
->ListState
.CurrentList
);
11881 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
11882 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
11884 ctx
->ListState
.CurrentList
= NULL
;
11885 ctx
->ListState
.CurrentBlock
= NULL
;
11886 ctx
->ListState
.CurrentPos
= 0;
11887 ctx
->ExecuteFlag
= GL_TRUE
;
11888 ctx
->CompileFlag
= GL_FALSE
;
11890 ctx
->CurrentServerDispatch
= ctx
->Exec
;
11891 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11892 if (ctx
->MarshalExec
== NULL
) {
11893 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11899 _mesa_CallList(GLuint list
)
11901 GLboolean save_compile_flag
;
11902 GET_CURRENT_CONTEXT(ctx
);
11903 FLUSH_CURRENT(ctx
, 0);
11905 if (MESA_VERBOSE
& VERBOSE_API
)
11906 _mesa_debug(ctx
, "glCallList %d\n", list
);
11909 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
11914 mesa_print_display_list( list
);
11916 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
11917 * execute the display list, and restore the CompileFlag.
11919 save_compile_flag
= ctx
->CompileFlag
;
11920 if (save_compile_flag
) {
11921 ctx
->CompileFlag
= GL_FALSE
;
11924 execute_list(ctx
, list
);
11925 ctx
->CompileFlag
= save_compile_flag
;
11927 /* also restore API function pointers to point to "save" versions */
11928 if (save_compile_flag
) {
11929 ctx
->CurrentServerDispatch
= ctx
->Save
;
11930 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
11931 if (ctx
->MarshalExec
== NULL
) {
11932 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
11939 * Try to execute a glCallLists() command where the display lists contain
11940 * glBitmap commands with a texture atlas.
11941 * \return true for success, false otherwise
11944 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
11947 struct gl_bitmap_atlas
*atlas
;
11950 if (!USE_BITMAP_ATLAS
||
11951 !ctx
->Current
.RasterPosValid
||
11952 ctx
->List
.ListBase
== 0 ||
11953 type
!= GL_UNSIGNED_BYTE
||
11954 !ctx
->Driver
.DrawAtlasBitmaps
) {
11959 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11962 /* Even if glGenLists wasn't called, we can still try to create
11965 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
11968 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
11969 /* Try to build the bitmap atlas now.
11970 * If the atlas was created in glGenLists, we'll have recorded the
11971 * number of lists (bitmaps). Otherwise, take a guess at 256.
11973 if (atlas
->numBitmaps
== 0)
11974 atlas
->numBitmaps
= 256;
11975 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
11978 if (!atlas
|| !atlas
->complete
) {
11982 /* check that all display list IDs are in the atlas */
11983 for (i
= 0; i
< n
; i
++) {
11984 const GLubyte
*ids
= (const GLubyte
*) lists
;
11986 if (ids
[i
] >= atlas
->numBitmaps
) {
11991 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
11998 * Execute glCallLists: call multiple display lists.
12001 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12003 GET_CURRENT_CONTEXT(ctx
);
12005 GLboolean save_compile_flag
;
12007 if (MESA_VERBOSE
& VERBOSE_API
)
12008 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12012 case GL_UNSIGNED_BYTE
:
12014 case GL_UNSIGNED_SHORT
:
12016 case GL_UNSIGNED_INT
:
12024 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12029 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12031 } else if (n
== 0 || lists
== NULL
) {
12032 /* nothing to do */
12036 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12040 /* Save the CompileFlag status, turn it off, execute display list,
12041 * and restore the CompileFlag.
12043 save_compile_flag
= ctx
->CompileFlag
;
12044 ctx
->CompileFlag
= GL_FALSE
;
12046 for (i
= 0; i
< n
; i
++) {
12047 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12048 execute_list(ctx
, list
);
12051 ctx
->CompileFlag
= save_compile_flag
;
12053 /* also restore API function pointers to point to "save" versions */
12054 if (save_compile_flag
) {
12055 ctx
->CurrentServerDispatch
= ctx
->Save
;
12056 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12057 if (ctx
->MarshalExec
== NULL
) {
12058 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12065 * Set the offset added to list numbers in glCallLists.
12068 _mesa_ListBase(GLuint base
)
12070 GET_CURRENT_CONTEXT(ctx
);
12071 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12072 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12073 ctx
->List
.ListBase
= base
;
12077 * Setup the given dispatch table to point to Mesa's display list
12078 * building functions.
12080 * This does not include any of the tnl functions - they are
12081 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12085 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12087 struct _glapi_table
*table
= ctx
->Save
;
12088 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12090 /* Initially populate the dispatch table with the contents of the
12091 * normal-execution dispatch table. This lets us skip populating functions
12092 * that should be called directly instead of compiled into display lists.
12094 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12096 _mesa_loopback_init_api_table(ctx
, table
);
12098 /* VBO functions */
12099 vbo_initialize_save_dispatch(ctx
, table
);
12102 SET_Accum(table
, save_Accum
);
12103 SET_AlphaFunc(table
, save_AlphaFunc
);
12104 SET_Bitmap(table
, save_Bitmap
);
12105 SET_BlendFunc(table
, save_BlendFunc
);
12106 SET_CallList(table
, save_CallList
);
12107 SET_CallLists(table
, save_CallLists
);
12108 SET_Clear(table
, save_Clear
);
12109 SET_ClearAccum(table
, save_ClearAccum
);
12110 SET_ClearColor(table
, save_ClearColor
);
12111 SET_ClearDepth(table
, save_ClearDepth
);
12112 SET_ClearIndex(table
, save_ClearIndex
);
12113 SET_ClearStencil(table
, save_ClearStencil
);
12114 SET_ClipPlane(table
, save_ClipPlane
);
12115 SET_ColorMask(table
, save_ColorMask
);
12116 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12117 SET_ColorMaterial(table
, save_ColorMaterial
);
12118 SET_CopyPixels(table
, save_CopyPixels
);
12119 SET_CullFace(table
, save_CullFace
);
12120 SET_DepthFunc(table
, save_DepthFunc
);
12121 SET_DepthMask(table
, save_DepthMask
);
12122 SET_DepthRange(table
, save_DepthRange
);
12123 SET_Disable(table
, save_Disable
);
12124 SET_Disablei(table
, save_DisableIndexed
);
12125 SET_DrawBuffer(table
, save_DrawBuffer
);
12126 SET_DrawPixels(table
, save_DrawPixels
);
12127 SET_Enable(table
, save_Enable
);
12128 SET_Enablei(table
, save_EnableIndexed
);
12129 SET_EvalMesh1(table
, save_EvalMesh1
);
12130 SET_EvalMesh2(table
, save_EvalMesh2
);
12131 SET_Fogf(table
, save_Fogf
);
12132 SET_Fogfv(table
, save_Fogfv
);
12133 SET_Fogi(table
, save_Fogi
);
12134 SET_Fogiv(table
, save_Fogiv
);
12135 SET_FrontFace(table
, save_FrontFace
);
12136 SET_Frustum(table
, save_Frustum
);
12137 SET_Hint(table
, save_Hint
);
12138 SET_IndexMask(table
, save_IndexMask
);
12139 SET_InitNames(table
, save_InitNames
);
12140 SET_LightModelf(table
, save_LightModelf
);
12141 SET_LightModelfv(table
, save_LightModelfv
);
12142 SET_LightModeli(table
, save_LightModeli
);
12143 SET_LightModeliv(table
, save_LightModeliv
);
12144 SET_Lightf(table
, save_Lightf
);
12145 SET_Lightfv(table
, save_Lightfv
);
12146 SET_Lighti(table
, save_Lighti
);
12147 SET_Lightiv(table
, save_Lightiv
);
12148 SET_LineStipple(table
, save_LineStipple
);
12149 SET_LineWidth(table
, save_LineWidth
);
12150 SET_ListBase(table
, save_ListBase
);
12151 SET_LoadIdentity(table
, save_LoadIdentity
);
12152 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12153 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12154 SET_LoadName(table
, save_LoadName
);
12155 SET_LogicOp(table
, save_LogicOp
);
12156 SET_Map1d(table
, save_Map1d
);
12157 SET_Map1f(table
, save_Map1f
);
12158 SET_Map2d(table
, save_Map2d
);
12159 SET_Map2f(table
, save_Map2f
);
12160 SET_MapGrid1d(table
, save_MapGrid1d
);
12161 SET_MapGrid1f(table
, save_MapGrid1f
);
12162 SET_MapGrid2d(table
, save_MapGrid2d
);
12163 SET_MapGrid2f(table
, save_MapGrid2f
);
12164 SET_MatrixMode(table
, save_MatrixMode
);
12165 SET_MultMatrixd(table
, save_MultMatrixd
);
12166 SET_MultMatrixf(table
, save_MultMatrixf
);
12167 SET_NewList(table
, save_NewList
);
12168 SET_Ortho(table
, save_Ortho
);
12169 SET_PassThrough(table
, save_PassThrough
);
12170 SET_PixelMapfv(table
, save_PixelMapfv
);
12171 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12172 SET_PixelMapusv(table
, save_PixelMapusv
);
12173 SET_PixelTransferf(table
, save_PixelTransferf
);
12174 SET_PixelTransferi(table
, save_PixelTransferi
);
12175 SET_PixelZoom(table
, save_PixelZoom
);
12176 SET_PointSize(table
, save_PointSize
);
12177 SET_PolygonMode(table
, save_PolygonMode
);
12178 SET_PolygonOffset(table
, save_PolygonOffset
);
12179 SET_PolygonStipple(table
, save_PolygonStipple
);
12180 SET_PopAttrib(table
, save_PopAttrib
);
12181 SET_PopMatrix(table
, save_PopMatrix
);
12182 SET_PopName(table
, save_PopName
);
12183 SET_PushAttrib(table
, save_PushAttrib
);
12184 SET_PushMatrix(table
, save_PushMatrix
);
12185 SET_PushName(table
, save_PushName
);
12186 SET_RasterPos2d(table
, save_RasterPos2d
);
12187 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12188 SET_RasterPos2f(table
, save_RasterPos2f
);
12189 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12190 SET_RasterPos2i(table
, save_RasterPos2i
);
12191 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12192 SET_RasterPos2s(table
, save_RasterPos2s
);
12193 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12194 SET_RasterPos3d(table
, save_RasterPos3d
);
12195 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12196 SET_RasterPos3f(table
, save_RasterPos3f
);
12197 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12198 SET_RasterPos3i(table
, save_RasterPos3i
);
12199 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12200 SET_RasterPos3s(table
, save_RasterPos3s
);
12201 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12202 SET_RasterPos4d(table
, save_RasterPos4d
);
12203 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12204 SET_RasterPos4f(table
, save_RasterPos4f
);
12205 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12206 SET_RasterPos4i(table
, save_RasterPos4i
);
12207 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12208 SET_RasterPos4s(table
, save_RasterPos4s
);
12209 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12210 SET_ReadBuffer(table
, save_ReadBuffer
);
12211 SET_Rectf(table
, save_Rectf
);
12212 SET_Rotated(table
, save_Rotated
);
12213 SET_Rotatef(table
, save_Rotatef
);
12214 SET_Scaled(table
, save_Scaled
);
12215 SET_Scalef(table
, save_Scalef
);
12216 SET_Scissor(table
, save_Scissor
);
12217 SET_ShadeModel(table
, save_ShadeModel
);
12218 SET_StencilFunc(table
, save_StencilFunc
);
12219 SET_StencilMask(table
, save_StencilMask
);
12220 SET_StencilOp(table
, save_StencilOp
);
12221 SET_TexEnvf(table
, save_TexEnvf
);
12222 SET_TexEnvfv(table
, save_TexEnvfv
);
12223 SET_TexEnvi(table
, save_TexEnvi
);
12224 SET_TexEnviv(table
, save_TexEnviv
);
12225 SET_TexGend(table
, save_TexGend
);
12226 SET_TexGendv(table
, save_TexGendv
);
12227 SET_TexGenf(table
, save_TexGenf
);
12228 SET_TexGenfv(table
, save_TexGenfv
);
12229 SET_TexGeni(table
, save_TexGeni
);
12230 SET_TexGeniv(table
, save_TexGeniv
);
12231 SET_TexImage1D(table
, save_TexImage1D
);
12232 SET_TexImage2D(table
, save_TexImage2D
);
12233 SET_TexParameterf(table
, save_TexParameterf
);
12234 SET_TexParameterfv(table
, save_TexParameterfv
);
12235 SET_TexParameteri(table
, save_TexParameteri
);
12236 SET_TexParameteriv(table
, save_TexParameteriv
);
12237 SET_Translated(table
, save_Translated
);
12238 SET_Translatef(table
, save_Translatef
);
12239 SET_Viewport(table
, save_Viewport
);
12242 SET_BindTexture(table
, save_BindTexture
);
12243 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12244 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12245 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12246 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12247 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12248 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12249 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12252 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12253 SET_TexImage3D(table
, save_TexImage3D
);
12254 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12257 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12258 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12259 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12261 /* ATI_separate_stencil */
12262 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12264 /* GL_ARB_imaging */
12265 /* Not all are supported */
12266 SET_BlendColor(table
, save_BlendColor
);
12267 SET_BlendEquation(table
, save_BlendEquation
);
12269 /* 2. GL_EXT_blend_color */
12271 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12274 /* 6. GL_EXT_texture3d */
12276 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12277 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12278 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12281 /* 37. GL_EXT_blend_minmax */
12283 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12286 /* 54. GL_EXT_point_parameters */
12287 SET_PointParameterf(table
, save_PointParameterfEXT
);
12288 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12290 /* 91. GL_ARB_tessellation_shader */
12291 SET_PatchParameteri(table
, save_PatchParameteri
);
12292 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12294 /* 100. ARB_viewport_array */
12295 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12296 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12297 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12298 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12299 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12300 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12301 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12302 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12304 /* 122. ARB_compute_shader */
12305 SET_DispatchCompute(table
, save_DispatchCompute
);
12306 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12308 /* 173. GL_EXT_blend_func_separate */
12309 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12311 /* 197. GL_MESA_window_pos */
12312 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12313 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12314 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12315 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12316 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12317 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12318 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12319 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12320 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12321 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12322 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12323 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12324 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12325 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12326 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12327 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12328 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12329 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12330 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12331 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12332 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12333 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
12334 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
12335 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
12337 /* 245. GL_ATI_fragment_shader */
12338 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
12339 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
12341 /* 262. GL_NV_point_sprite */
12342 SET_PointParameteri(table
, save_PointParameteriNV
);
12343 SET_PointParameteriv(table
, save_PointParameterivNV
);
12345 /* 268. GL_EXT_stencil_two_side */
12346 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
12348 /* ???. GL_EXT_depth_bounds_test */
12349 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
12351 /* ARB 1. GL_ARB_multitexture */
12352 SET_ActiveTexture(table
, save_ActiveTextureARB
);
12354 /* ARB 3. GL_ARB_transpose_matrix */
12355 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
12356 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
12357 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
12358 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
12360 /* ARB 5. GL_ARB_multisample */
12361 SET_SampleCoverage(table
, save_SampleCoverageARB
);
12363 /* ARB 12. GL_ARB_texture_compression */
12364 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
12365 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
12366 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
12367 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
12368 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
12369 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
12371 /* ARB 14. GL_ARB_point_parameters */
12372 /* aliased with EXT_point_parameters functions */
12374 /* ARB 25. GL_ARB_window_pos */
12375 /* aliased with MESA_window_pos functions */
12377 /* ARB 26. GL_ARB_vertex_program */
12378 /* ARB 27. GL_ARB_fragment_program */
12379 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
12380 SET_ProgramStringARB(table
, save_ProgramStringARB
);
12381 SET_BindProgramARB(table
, save_BindProgramARB
);
12382 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
12383 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
12384 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
12385 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
12386 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
12387 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
12388 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
12389 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
12391 SET_BeginQuery(table
, save_BeginQueryARB
);
12392 SET_EndQuery(table
, save_EndQueryARB
);
12393 SET_QueryCounter(table
, save_QueryCounter
);
12395 SET_DrawBuffers(table
, save_DrawBuffersARB
);
12397 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
12399 SET_UseProgram(table
, save_UseProgram
);
12400 SET_Uniform1f(table
, save_Uniform1fARB
);
12401 SET_Uniform2f(table
, save_Uniform2fARB
);
12402 SET_Uniform3f(table
, save_Uniform3fARB
);
12403 SET_Uniform4f(table
, save_Uniform4fARB
);
12404 SET_Uniform1fv(table
, save_Uniform1fvARB
);
12405 SET_Uniform2fv(table
, save_Uniform2fvARB
);
12406 SET_Uniform3fv(table
, save_Uniform3fvARB
);
12407 SET_Uniform4fv(table
, save_Uniform4fvARB
);
12408 SET_Uniform1i(table
, save_Uniform1iARB
);
12409 SET_Uniform2i(table
, save_Uniform2iARB
);
12410 SET_Uniform3i(table
, save_Uniform3iARB
);
12411 SET_Uniform4i(table
, save_Uniform4iARB
);
12412 SET_Uniform1iv(table
, save_Uniform1ivARB
);
12413 SET_Uniform2iv(table
, save_Uniform2ivARB
);
12414 SET_Uniform3iv(table
, save_Uniform3ivARB
);
12415 SET_Uniform4iv(table
, save_Uniform4ivARB
);
12416 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
12417 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
12418 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
12419 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
12420 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
12421 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
12422 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
12423 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
12424 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
12426 /* 299. GL_EXT_blend_equation_separate */
12427 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
12429 /* GL_EXT_gpu_program_parameters */
12430 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
12431 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
12433 /* 364. GL_EXT_provoking_vertex */
12434 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
12436 /* GL_EXT_texture_integer */
12437 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
12438 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
12439 SET_TexParameterIiv(table
, save_TexParameterIiv
);
12440 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
12442 /* GL_ARB_clip_control */
12443 SET_ClipControl(table
, save_ClipControl
);
12445 /* GL_ARB_color_buffer_float */
12446 SET_ClampColor(table
, save_ClampColorARB
);
12449 SET_ClearBufferiv(table
, save_ClearBufferiv
);
12450 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
12451 SET_ClearBufferfv(table
, save_ClearBufferfv
);
12452 SET_ClearBufferfi(table
, save_ClearBufferfi
);
12453 SET_Uniform1ui(table
, save_Uniform1ui
);
12454 SET_Uniform2ui(table
, save_Uniform2ui
);
12455 SET_Uniform3ui(table
, save_Uniform3ui
);
12456 SET_Uniform4ui(table
, save_Uniform4ui
);
12457 SET_Uniform1uiv(table
, save_Uniform1uiv
);
12458 SET_Uniform2uiv(table
, save_Uniform2uiv
);
12459 SET_Uniform3uiv(table
, save_Uniform3uiv
);
12460 SET_Uniform4uiv(table
, save_Uniform4uiv
);
12462 /* GL_ARB_gpu_shader_fp64 */
12463 SET_Uniform1d(table
, save_Uniform1d
);
12464 SET_Uniform2d(table
, save_Uniform2d
);
12465 SET_Uniform3d(table
, save_Uniform3d
);
12466 SET_Uniform4d(table
, save_Uniform4d
);
12467 SET_Uniform1dv(table
, save_Uniform1dv
);
12468 SET_Uniform2dv(table
, save_Uniform2dv
);
12469 SET_Uniform3dv(table
, save_Uniform3dv
);
12470 SET_Uniform4dv(table
, save_Uniform4dv
);
12471 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
12472 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
12473 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
12474 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
12475 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
12476 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
12477 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
12478 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
12479 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
12482 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
12483 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
12484 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
12485 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
12486 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
12487 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
12488 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
12489 SET_DrawTransformFeedbackInstanced(table
,
12490 save_DrawTransformFeedbackInstanced
);
12491 SET_DrawTransformFeedbackStreamInstanced(table
,
12492 save_DrawTransformFeedbackStreamInstanced
);
12493 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
12494 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
12496 /* GL_ARB_instanced_arrays */
12497 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
12499 /* GL_NV_texture_barrier */
12500 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
12502 SET_BindSampler(table
, save_BindSampler
);
12503 SET_SamplerParameteri(table
, save_SamplerParameteri
);
12504 SET_SamplerParameterf(table
, save_SamplerParameterf
);
12505 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
12506 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
12507 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
12508 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
12510 /* GL_ARB_draw_buffer_blend */
12511 SET_BlendFunciARB(table
, save_BlendFunci
);
12512 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
12513 SET_BlendEquationiARB(table
, save_BlendEquationi
);
12514 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
12516 /* GL_NV_conditional_render */
12517 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
12518 SET_EndConditionalRender(table
, save_EndConditionalRender
);
12521 SET_WaitSync(table
, save_WaitSync
);
12523 /* GL_ARB_uniform_buffer_object */
12524 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
12526 /* GL_ARB_shader_subroutines */
12527 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
12529 /* GL_ARB_draw_instanced */
12530 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
12531 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
12533 /* GL_ARB_draw_elements_base_vertex */
12534 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
12536 /* GL_ARB_base_instance */
12537 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
12538 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
12539 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
12541 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
12542 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
12543 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
12544 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
12545 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
12547 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
12548 SET_UseProgramStages(table
, save_UseProgramStages
);
12549 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
12550 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
12551 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
12552 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
12553 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
12554 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
12555 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
12556 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
12557 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
12558 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
12559 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
12560 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
12561 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
12562 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
12563 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
12564 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
12565 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
12566 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
12567 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
12568 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
12569 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
12570 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
12571 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
12572 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
12573 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
12574 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
12575 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
12576 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
12577 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
12578 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
12579 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
12580 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
12581 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
12582 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
12583 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
12584 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
12585 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
12586 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
12587 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
12588 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
12589 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
12590 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
12591 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
12592 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
12593 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
12594 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
12595 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
12596 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
12597 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
12598 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
12600 /* GL_{ARB,EXT}_polygon_offset_clamp */
12601 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
12603 /* GL_EXT_window_rectangles */
12604 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
12606 /* GL_NV_conservative_raster */
12607 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
12609 /* GL_NV_conservative_raster_dilate */
12610 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
12612 /* GL_NV_conservative_raster_pre_snap_triangles */
12613 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
12615 /* GL_EXT_direct_state_access */
12616 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
12617 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
12618 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
12619 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
12620 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
12621 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
12622 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
12623 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
12624 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
12625 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
12626 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
12627 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
12628 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
12629 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
12630 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
12631 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
12632 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
12633 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
12634 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
12635 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
12636 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
12637 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
12638 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
12639 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
12640 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
12641 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
12642 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
12643 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
12644 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
12645 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
12646 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
12647 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
12648 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
12649 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
12650 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
12655 static const char *
12656 enum_string(GLenum k
)
12658 return _mesa_enum_to_string(k
);
12663 * Print the commands in a display list. For debugging only.
12664 * TODO: many commands aren't handled yet.
12665 * \param fname filename to write display list to. If null, use stdout.
12667 static void GLAPIENTRY
12668 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
12670 struct gl_display_list
*dlist
;
12676 f
= fopen(fname
, "w");
12681 if (!islist(ctx
, list
)) {
12682 fprintf(f
, "%u is not a display list ID\n", list
);
12686 dlist
= _mesa_lookup_list(ctx
, list
);
12693 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
12695 done
= n
? GL_FALSE
: GL_TRUE
;
12697 const OpCode opcode
= n
[0].opcode
;
12699 if (is_ext_opcode(opcode
)) {
12700 n
+= ext_opcode_print(ctx
, n
, f
);
12705 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
12707 case OPCODE_ACTIVE_TEXTURE
:
12708 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
12710 case OPCODE_BITMAP
:
12711 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
12712 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
12713 get_pointer(&n
[7]));
12715 case OPCODE_BLEND_COLOR
:
12716 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
12717 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12719 case OPCODE_BLEND_EQUATION
:
12720 fprintf(f
, "BlendEquation %s\n",
12721 enum_string(n
[1].e
));
12723 case OPCODE_BLEND_EQUATION_SEPARATE
:
12724 fprintf(f
, "BlendEquationSeparate %s, %s\n",
12725 enum_string(n
[1].e
),
12726 enum_string(n
[2].e
));
12728 case OPCODE_BLEND_FUNC_SEPARATE
:
12729 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
12730 enum_string(n
[1].e
),
12731 enum_string(n
[2].e
),
12732 enum_string(n
[3].e
),
12733 enum_string(n
[4].e
));
12735 case OPCODE_BLEND_EQUATION_I
:
12736 fprintf(f
, "BlendEquationi %u, %s\n",
12737 n
[1].ui
, enum_string(n
[2].e
));
12739 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
12740 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
12741 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12743 case OPCODE_BLEND_FUNC_I
:
12744 fprintf(f
, "BlendFunci %u, %s, %s\n",
12745 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
12747 case OPCODE_BLEND_FUNC_SEPARATE_I
:
12748 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
12750 enum_string(n
[2].e
),
12751 enum_string(n
[3].e
),
12752 enum_string(n
[4].e
),
12753 enum_string(n
[5].e
));
12755 case OPCODE_CALL_LIST
:
12756 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
12758 case OPCODE_CALL_LISTS
:
12759 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
12761 case OPCODE_DISABLE
:
12762 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
12764 case OPCODE_ENABLE
:
12765 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
12767 case OPCODE_FRUSTUM
:
12768 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
12769 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12771 case OPCODE_LINE_STIPPLE
:
12772 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
12774 case OPCODE_LINE_WIDTH
:
12775 fprintf(f
, "LineWidth %f\n", n
[1].f
);
12777 case OPCODE_LOAD_IDENTITY
:
12778 fprintf(f
, "LoadIdentity\n");
12780 case OPCODE_LOAD_MATRIX
:
12781 fprintf(f
, "LoadMatrix\n");
12782 fprintf(f
, " %8f %8f %8f %8f\n",
12783 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12784 fprintf(f
, " %8f %8f %8f %8f\n",
12785 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12786 fprintf(f
, " %8f %8f %8f %8f\n",
12787 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12788 fprintf(f
, " %8f %8f %8f %8f\n",
12789 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12791 case OPCODE_MULT_MATRIX
:
12792 fprintf(f
, "MultMatrix (or Rotate)\n");
12793 fprintf(f
, " %8f %8f %8f %8f\n",
12794 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
12795 fprintf(f
, " %8f %8f %8f %8f\n",
12796 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
12797 fprintf(f
, " %8f %8f %8f %8f\n",
12798 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
12799 fprintf(f
, " %8f %8f %8f %8f\n",
12800 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
12803 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
12804 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12806 case OPCODE_POINT_SIZE
:
12807 fprintf(f
, "PointSize %f\n", n
[1].f
);
12809 case OPCODE_POP_ATTRIB
:
12810 fprintf(f
, "PopAttrib\n");
12812 case OPCODE_POP_MATRIX
:
12813 fprintf(f
, "PopMatrix\n");
12815 case OPCODE_POP_NAME
:
12816 fprintf(f
, "PopName\n");
12818 case OPCODE_PUSH_ATTRIB
:
12819 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
12821 case OPCODE_PUSH_MATRIX
:
12822 fprintf(f
, "PushMatrix\n");
12824 case OPCODE_PUSH_NAME
:
12825 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
12827 case OPCODE_RASTER_POS
:
12828 fprintf(f
, "RasterPos %g %g %g %g\n",
12829 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12831 case OPCODE_ROTATE
:
12832 fprintf(f
, "Rotate %g %g %g %g\n",
12833 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
12836 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12838 case OPCODE_TRANSLATE
:
12839 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
12841 case OPCODE_BIND_TEXTURE
:
12842 fprintf(f
, "BindTexture %s %d\n",
12843 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
12845 case OPCODE_SHADE_MODEL
:
12846 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
12849 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
12850 _mesa_enum_to_string(n
[1].ui
),
12851 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
12854 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
12855 _mesa_enum_to_string(n
[1].ui
),
12856 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
12857 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
12859 case OPCODE_MAPGRID1
:
12860 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
12862 case OPCODE_MAPGRID2
:
12863 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
12864 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
12866 case OPCODE_EVALMESH1
:
12867 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
12869 case OPCODE_EVALMESH2
:
12870 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
12871 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
12874 case OPCODE_ATTR_1F_NV
:
12875 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
12877 case OPCODE_ATTR_2F_NV
:
12878 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
12879 n
[1].i
, n
[2].f
, n
[3].f
);
12881 case OPCODE_ATTR_3F_NV
:
12882 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
12883 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12885 case OPCODE_ATTR_4F_NV
:
12886 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
12887 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12889 case OPCODE_ATTR_1F_ARB
:
12890 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
12892 case OPCODE_ATTR_2F_ARB
:
12893 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
12894 n
[1].i
, n
[2].f
, n
[3].f
);
12896 case OPCODE_ATTR_3F_ARB
:
12897 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
12898 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
12900 case OPCODE_ATTR_4F_ARB
:
12901 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
12902 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
12905 case OPCODE_MATERIAL
:
12906 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
12907 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
12910 fprintf(f
, "BEGIN %x\n", n
[1].i
);
12913 fprintf(f
, "END\n");
12916 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
12919 case OPCODE_EVAL_C1
:
12920 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
12922 case OPCODE_EVAL_C2
:
12923 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
12925 case OPCODE_EVAL_P1
:
12926 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
12928 case OPCODE_EVAL_P2
:
12929 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
12932 case OPCODE_PROVOKING_VERTEX
:
12933 fprintf(f
, "ProvokingVertex %s\n",
12934 _mesa_enum_to_string(n
[1].ui
));
12938 * meta opcodes/commands
12941 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
12942 (const char *) get_pointer(&n
[2]));
12944 case OPCODE_CONTINUE
:
12945 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
12946 n
= (Node
*) get_pointer(&n
[1]);
12949 fprintf(f
, "NOP\n");
12951 case OPCODE_END_OF_LIST
:
12952 fprintf(f
, "END-LIST %u\n", list
);
12956 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
12958 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
12959 opcode
, (void *) n
);
12963 fprintf(f
, "command %d, %u operands\n", opcode
,
12967 /* increment n to point to next compiled command */
12968 if (opcode
!= OPCODE_CONTINUE
) {
12969 assert(InstSize
[opcode
] > 0);
12970 n
+= InstSize
[opcode
];
12984 * Clients may call this function to help debug display list problems.
12985 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
12986 * changed, or break in the future without notice.
12989 mesa_print_display_list(GLuint list
)
12991 GET_CURRENT_CONTEXT(ctx
);
12992 print_list(ctx
, list
, NULL
);
12996 /**********************************************************************/
12997 /***** Initialization *****/
12998 /**********************************************************************/
13001 save_vtxfmt_init(GLvertexformat
* vfmt
)
13003 vfmt
->ArrayElement
= _ae_ArrayElement
;
13005 vfmt
->Begin
= save_Begin
;
13007 vfmt
->CallList
= save_CallList
;
13008 vfmt
->CallLists
= save_CallLists
;
13010 vfmt
->Color3f
= save_Color3f
;
13011 vfmt
->Color3fv
= save_Color3fv
;
13012 vfmt
->Color4f
= save_Color4f
;
13013 vfmt
->Color4fv
= save_Color4fv
;
13014 vfmt
->EdgeFlag
= save_EdgeFlag
;
13015 vfmt
->End
= save_End
;
13017 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13018 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13019 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13020 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13021 vfmt
->EvalPoint1
= save_EvalPoint1
;
13022 vfmt
->EvalPoint2
= save_EvalPoint2
;
13024 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13025 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13026 vfmt
->Indexf
= save_Indexf
;
13027 vfmt
->Indexfv
= save_Indexfv
;
13028 vfmt
->Materialfv
= save_Materialfv
;
13029 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13030 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13031 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13032 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13033 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13034 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13035 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13036 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13037 vfmt
->Normal3f
= save_Normal3f
;
13038 vfmt
->Normal3fv
= save_Normal3fv
;
13039 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13040 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13041 vfmt
->TexCoord1f
= save_TexCoord1f
;
13042 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13043 vfmt
->TexCoord2f
= save_TexCoord2f
;
13044 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13045 vfmt
->TexCoord3f
= save_TexCoord3f
;
13046 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13047 vfmt
->TexCoord4f
= save_TexCoord4f
;
13048 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13049 vfmt
->Vertex2f
= save_Vertex2f
;
13050 vfmt
->Vertex2fv
= save_Vertex2fv
;
13051 vfmt
->Vertex3f
= save_Vertex3f
;
13052 vfmt
->Vertex3fv
= save_Vertex3fv
;
13053 vfmt
->Vertex4f
= save_Vertex4f
;
13054 vfmt
->Vertex4fv
= save_Vertex4fv
;
13055 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13056 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13057 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13058 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13059 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13060 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13061 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13062 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13063 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13064 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13065 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13066 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13067 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13068 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13069 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13070 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13072 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13077 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13078 const GLvertexformat
*vfmt
)
13080 SET_CallList(disp
, vfmt
->CallList
);
13081 SET_CallLists(disp
, vfmt
->CallLists
);
13086 * Initialize display list state for given context.
13089 _mesa_init_display_list(struct gl_context
*ctx
)
13091 static GLboolean tableInitialized
= GL_FALSE
;
13093 /* zero-out the instruction size table, just once */
13094 if (!tableInitialized
) {
13095 memset(InstSize
, 0, sizeof(InstSize
));
13096 tableInitialized
= GL_TRUE
;
13099 /* extension info */
13100 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13103 ctx
->ListState
.CallDepth
= 0;
13104 ctx
->ExecuteFlag
= GL_TRUE
;
13105 ctx
->CompileFlag
= GL_FALSE
;
13106 ctx
->ListState
.CurrentBlock
= NULL
;
13107 ctx
->ListState
.CurrentPos
= 0;
13109 /* Display List group */
13110 ctx
->List
.ListBase
= 0;
13112 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13114 InstSize
[OPCODE_NOP
] = 1;
13119 _mesa_free_display_list_data(struct gl_context
*ctx
)
13121 free(ctx
->ListExt
);
13122 ctx
->ListExt
= NULL
;