2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_BIND_MULTITEXTURE
,
585 OPCODE_MULTITEXPARAMETER_F
,
586 OPCODE_MULTITEXPARAMETER_I
,
587 OPCODE_MULTITEX_IMAGE1D
,
588 OPCODE_MULTITEX_IMAGE2D
,
589 OPCODE_MULTITEX_IMAGE3D
,
590 OPCODE_MULTITEX_SUB_IMAGE1D
,
591 OPCODE_MULTITEX_SUB_IMAGE2D
,
592 OPCODE_MULTITEX_SUB_IMAGE3D
,
593 OPCODE_COPY_MULTITEX_IMAGE1D
,
594 OPCODE_COPY_MULTITEX_IMAGE2D
,
595 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
596 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
597 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
599 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
600 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
601 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
602 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
603 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
604 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
606 /* The following three are meta instructions */
607 OPCODE_ERROR
, /* raise compiled-in error */
609 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
619 * Display list instructions are stored as sequences of "nodes". Nodes
620 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
621 * are linked together with a pointer.
623 * Each instruction in the display list is stored as a sequence of
624 * contiguous nodes in memory.
625 * Each node is the union of a variety of data types.
627 * Note, all of these members should be 4 bytes in size or less for the
628 * sake of compact display lists. We store 8-byte pointers in a pair of
629 * these nodes using the save/get_pointer() functions below.
647 typedef union gl_dlist_node Node
;
650 /** How many 4-byte dwords to store a pointer */
651 #define POINTER_DWORDS (sizeof(void *) / 4)
653 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
654 * space for display lists. The following types and functions are
655 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
660 GLuint dwords
[POINTER_DWORDS
];
665 * Save a 4 or 8-byte pointer at dest (and dest+1).
668 save_pointer(Node
*dest
, void *src
)
673 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
674 STATIC_ASSERT(sizeof(Node
) == 4);
678 for (i
= 0; i
< POINTER_DWORDS
; i
++)
679 dest
[i
].ui
= p
.dwords
[i
];
684 * Retrieve a 4 or 8-byte pointer from node (node+1).
687 get_pointer(const Node
*node
)
692 for (i
= 0; i
< POINTER_DWORDS
; i
++)
693 p
.dwords
[i
] = node
[i
].ui
;
700 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
717 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
719 union float64_pair tmp; \
721 n[idx].ui = tmp.uint32[0]; \
722 n[idx+1].ui = tmp.uint32[1]; \
727 * How many nodes to allocate at a time. Note that bulk vertex data
728 * from glBegin/glVertex/glEnd primitives will typically wind up in
729 * a VBO, and not directly in the display list itself.
731 #define BLOCK_SIZE 256
736 * Number of nodes of storage needed for each instruction.
737 * Sizes for dynamically allocated opcodes are stored in the context struct.
739 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
742 void mesa_print_display_list(GLuint list
);
746 * Does the given display list only contain a single glBitmap call?
749 is_bitmap_list(const struct gl_display_list
*dlist
)
751 const Node
*n
= dlist
->Head
;
752 if (n
[0].opcode
== OPCODE_BITMAP
) {
753 n
+= InstSize
[OPCODE_BITMAP
];
754 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
762 * Is the given display list an empty list?
765 is_empty_list(const struct gl_display_list
*dlist
)
767 const Node
*n
= dlist
->Head
;
768 return n
[0].opcode
== OPCODE_END_OF_LIST
;
773 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
776 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
779 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
787 * Lookup a gl_bitmap_atlas by listBase ID.
789 static struct gl_bitmap_atlas
*
790 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
792 struct gl_bitmap_atlas
*atlas
;
794 assert(listBase
> 0);
795 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
801 * Create new bitmap atlas and insert into hash table.
803 static struct gl_bitmap_atlas
*
804 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
806 struct gl_bitmap_atlas
*atlas
;
808 assert(listBase
> 0);
809 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
811 atlas
= calloc(1, sizeof(*atlas
));
813 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
821 * Try to build a bitmap atlas. This involves examining a sequence of
822 * display lists which contain glBitmap commands and putting the bitmap
823 * images into a texture map (the atlas).
824 * If we succeed, gl_bitmap_atlas::complete will be set to true.
825 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
828 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
831 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
836 assert(!atlas
->complete
);
837 assert(atlas
->numBitmaps
> 0);
839 /* We use a rectangle texture (non-normalized coords) for the atlas */
840 assert(ctx
->Extensions
.NV_texture_rectangle
);
841 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
843 atlas
->texWidth
= 1024;
844 atlas
->texHeight
= 0; /* determined below */
846 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
847 if (!atlas
->glyphs
) {
849 atlas
->incomplete
= true;
853 /* Loop over the display lists. They should all contain a single glBitmap
854 * call. If not, bail out. Also, compute the position and sizes of each
855 * bitmap in the atlas to determine the texture atlas size.
857 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
858 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
860 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
861 unsigned bitmap_width
, bitmap_height
;
862 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
864 if (!list
|| is_empty_list(list
)) {
866 atlas
->numBitmaps
= i
;
870 if (!is_bitmap_list(list
)) {
871 /* This list does not contain exactly one glBitmap command. Give up. */
872 atlas
->incomplete
= true;
876 /* get bitmap info from the display list command */
878 assert(n
[0].opcode
== OPCODE_BITMAP
);
879 bitmap_width
= n
[1].i
;
880 bitmap_height
= n
[2].i
;
881 bitmap_xorig
= n
[3].f
;
882 bitmap_yorig
= n
[4].f
;
883 bitmap_xmove
= n
[5].f
;
884 bitmap_ymove
= n
[6].f
;
886 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
887 /* advance to the next row of the texture */
893 /* save the bitmap's position in the atlas */
897 g
->h
= bitmap_height
;
898 g
->xorig
= bitmap_xorig
;
899 g
->yorig
= bitmap_yorig
;
900 g
->xmove
= bitmap_xmove
;
901 g
->ymove
= bitmap_ymove
;
903 xpos
+= bitmap_width
;
905 /* keep track of tallest bitmap in the row */
906 row_height
= MAX2(row_height
, bitmap_height
);
909 /* Now we know the texture height */
910 atlas
->texHeight
= ypos
+ row_height
;
912 if (atlas
->texHeight
== 0) {
913 /* no glyphs found, give up */
916 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
917 /* too large, give up */
921 /* Create atlas texture (texture ID is irrelevant) */
922 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
923 if (!atlas
->texObj
) {
927 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
928 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
929 atlas
->texObj
->MaxLevel
= 0;
930 atlas
->texObj
->Immutable
= GL_TRUE
;
932 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
933 GL_TEXTURE_RECTANGLE
, 0);
934 if (!atlas
->texImage
) {
938 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
939 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
940 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
942 /* alloc image storage */
943 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
947 /* map teximage, load with bitmap glyphs */
948 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
949 0, 0, atlas
->texWidth
, atlas
->texHeight
,
950 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
955 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
956 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
958 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
959 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
960 const Node
*n
= list
->Head
;
962 assert(n
[0].opcode
== OPCODE_BITMAP
||
963 n
[0].opcode
== OPCODE_END_OF_LIST
);
965 if (n
[0].opcode
== OPCODE_BITMAP
) {
966 unsigned bitmap_width
= n
[1].i
;
967 unsigned bitmap_height
= n
[2].i
;
968 unsigned xpos
= atlas
->glyphs
[i
].x
;
969 unsigned ypos
= atlas
->glyphs
[i
].y
;
970 const void *bitmap_image
= get_pointer(&n
[7]);
972 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
973 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
975 /* put the bitmap image into the texture image */
976 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
977 &ctx
->DefaultPacking
, bitmap_image
,
978 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
983 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
985 atlas
->complete
= true;
990 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
993 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
996 atlas
->glyphs
= NULL
;
997 atlas
->incomplete
= true;
1002 * Allocate a gl_display_list object with an initial block of storage.
1003 * \param count how many display list nodes/tokens to allocate
1005 static struct gl_display_list
*
1006 make_list(GLuint name
, GLuint count
)
1008 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1010 dlist
->Head
= malloc(sizeof(Node
) * count
);
1011 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1012 /* All InstSize[] entries must be non-zero */
1013 InstSize
[OPCODE_END_OF_LIST
] = 1;
1019 * Lookup function to just encapsulate casting.
1021 struct gl_display_list
*
1022 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1024 return (struct gl_display_list
*)
1025 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1029 /** Is the given opcode an extension code? */
1030 static inline GLboolean
1031 is_ext_opcode(OpCode opcode
)
1033 return (opcode
>= OPCODE_EXT_0
);
1037 /** Destroy an extended opcode instruction */
1039 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1041 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1043 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1044 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1049 /** Execute an extended opcode instruction */
1051 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1053 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1055 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1056 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1061 /** Print an extended opcode instruction */
1063 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1065 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1067 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1068 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1074 * Delete the named display list, but don't remove from hash table.
1075 * \param dlist - display list pointer
1078 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1083 n
= block
= dlist
->Head
;
1085 done
= block
? GL_FALSE
: GL_TRUE
;
1087 const OpCode opcode
= n
[0].opcode
;
1089 /* check for extension opcodes first */
1090 if (is_ext_opcode(opcode
)) {
1091 n
+= ext_opcode_destroy(ctx
, n
);
1095 /* for some commands, we need to free malloc'd memory */
1097 free(get_pointer(&n
[6]));
1100 free(get_pointer(&n
[10]));
1102 case OPCODE_CALL_LISTS
:
1103 free(get_pointer(&n
[3]));
1105 case OPCODE_DRAW_PIXELS
:
1106 free(get_pointer(&n
[5]));
1109 free(get_pointer(&n
[7]));
1111 case OPCODE_POLYGON_STIPPLE
:
1112 free(get_pointer(&n
[1]));
1114 case OPCODE_TEX_IMAGE1D
:
1115 free(get_pointer(&n
[8]));
1117 case OPCODE_TEX_IMAGE2D
:
1118 free(get_pointer(&n
[9]));
1120 case OPCODE_TEX_IMAGE3D
:
1121 free(get_pointer(&n
[10]));
1123 case OPCODE_TEX_SUB_IMAGE1D
:
1124 free(get_pointer(&n
[7]));
1126 case OPCODE_TEX_SUB_IMAGE2D
:
1127 free(get_pointer(&n
[9]));
1129 case OPCODE_TEX_SUB_IMAGE3D
:
1130 free(get_pointer(&n
[11]));
1132 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1133 free(get_pointer(&n
[7]));
1135 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1136 free(get_pointer(&n
[8]));
1138 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1139 free(get_pointer(&n
[9]));
1141 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1142 free(get_pointer(&n
[7]));
1144 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1145 free(get_pointer(&n
[9]));
1147 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1148 free(get_pointer(&n
[11]));
1150 case OPCODE_PROGRAM_STRING_ARB
:
1151 free(get_pointer(&n
[4])); /* program string */
1153 case OPCODE_UNIFORM_1FV
:
1154 case OPCODE_UNIFORM_2FV
:
1155 case OPCODE_UNIFORM_3FV
:
1156 case OPCODE_UNIFORM_4FV
:
1157 case OPCODE_UNIFORM_1DV
:
1158 case OPCODE_UNIFORM_2DV
:
1159 case OPCODE_UNIFORM_3DV
:
1160 case OPCODE_UNIFORM_4DV
:
1161 case OPCODE_UNIFORM_1IV
:
1162 case OPCODE_UNIFORM_2IV
:
1163 case OPCODE_UNIFORM_3IV
:
1164 case OPCODE_UNIFORM_4IV
:
1165 case OPCODE_UNIFORM_1UIV
:
1166 case OPCODE_UNIFORM_2UIV
:
1167 case OPCODE_UNIFORM_3UIV
:
1168 case OPCODE_UNIFORM_4UIV
:
1169 free(get_pointer(&n
[3]));
1171 case OPCODE_UNIFORM_MATRIX22
:
1172 case OPCODE_UNIFORM_MATRIX33
:
1173 case OPCODE_UNIFORM_MATRIX44
:
1174 case OPCODE_UNIFORM_MATRIX24
:
1175 case OPCODE_UNIFORM_MATRIX42
:
1176 case OPCODE_UNIFORM_MATRIX23
:
1177 case OPCODE_UNIFORM_MATRIX32
:
1178 case OPCODE_UNIFORM_MATRIX34
:
1179 case OPCODE_UNIFORM_MATRIX43
:
1180 case OPCODE_UNIFORM_MATRIX22D
:
1181 case OPCODE_UNIFORM_MATRIX33D
:
1182 case OPCODE_UNIFORM_MATRIX44D
:
1183 case OPCODE_UNIFORM_MATRIX24D
:
1184 case OPCODE_UNIFORM_MATRIX42D
:
1185 case OPCODE_UNIFORM_MATRIX23D
:
1186 case OPCODE_UNIFORM_MATRIX32D
:
1187 case OPCODE_UNIFORM_MATRIX34D
:
1188 case OPCODE_UNIFORM_MATRIX43D
:
1189 free(get_pointer(&n
[4]));
1191 case OPCODE_PROGRAM_UNIFORM_1FV
:
1192 case OPCODE_PROGRAM_UNIFORM_2FV
:
1193 case OPCODE_PROGRAM_UNIFORM_3FV
:
1194 case OPCODE_PROGRAM_UNIFORM_4FV
:
1195 case OPCODE_PROGRAM_UNIFORM_1DV
:
1196 case OPCODE_PROGRAM_UNIFORM_2DV
:
1197 case OPCODE_PROGRAM_UNIFORM_3DV
:
1198 case OPCODE_PROGRAM_UNIFORM_4DV
:
1199 case OPCODE_PROGRAM_UNIFORM_1IV
:
1200 case OPCODE_PROGRAM_UNIFORM_2IV
:
1201 case OPCODE_PROGRAM_UNIFORM_3IV
:
1202 case OPCODE_PROGRAM_UNIFORM_4IV
:
1203 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1204 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1205 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1206 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1207 free(get_pointer(&n
[4]));
1209 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1210 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1211 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1212 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1213 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1214 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1215 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1216 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1217 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1218 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1219 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1220 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1221 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1222 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1223 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1224 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1225 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1226 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1227 free(get_pointer(&n
[5]));
1229 case OPCODE_PIXEL_MAP
:
1230 free(get_pointer(&n
[3]));
1232 case OPCODE_VIEWPORT_ARRAY_V
:
1233 case OPCODE_SCISSOR_ARRAY_V
:
1234 case OPCODE_DEPTH_ARRAY_V
:
1235 case OPCODE_UNIFORM_SUBROUTINES
:
1236 case OPCODE_WINDOW_RECTANGLES
:
1237 free(get_pointer(&n
[3]));
1239 case OPCODE_TEXTURE_IMAGE1D
:
1240 case OPCODE_MULTITEX_IMAGE1D
:
1241 free(get_pointer(&n
[9]));
1243 case OPCODE_TEXTURE_IMAGE2D
:
1244 case OPCODE_MULTITEX_IMAGE2D
:
1245 free(get_pointer(&n
[10]));
1247 case OPCODE_TEXTURE_IMAGE3D
:
1248 case OPCODE_MULTITEX_IMAGE3D
:
1249 free(get_pointer(&n
[11]));
1251 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1252 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1253 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1254 free(get_pointer(&n
[8]));
1256 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1257 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1258 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1259 free(get_pointer(&n
[10]));
1261 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1262 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1263 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1264 free(get_pointer(&n
[12]));
1266 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1267 free(get_pointer(&n
[8]));
1269 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1270 free(get_pointer(&n
[9]));
1272 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1273 free(get_pointer(&n
[10]));
1275 case OPCODE_CONTINUE
:
1276 n
= (Node
*) get_pointer(&n
[1]);
1280 case OPCODE_END_OF_LIST
:
1285 /* just increment 'n' pointer, below */
1289 if (opcode
!= OPCODE_CONTINUE
) {
1290 assert(InstSize
[opcode
] > 0);
1291 n
+= InstSize
[opcode
];
1302 * Called by _mesa_HashWalk() to check if a display list which is being
1303 * deleted belongs to a bitmap texture atlas.
1306 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1308 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1309 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1311 /* See if the list_id falls in the range contained in this texture atlas */
1312 if (atlas
->complete
&&
1313 list_id
>= atlas_id
&&
1314 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1315 /* Mark the atlas as incomplete so it doesn't get used. But don't
1316 * delete it yet since we don't want to try to recreate it in the next
1319 atlas
->complete
= false;
1320 atlas
->incomplete
= true;
1326 * Destroy a display list and remove from hash table.
1327 * \param list - display list number
1330 destroy_list(struct gl_context
*ctx
, GLuint list
)
1332 struct gl_display_list
*dlist
;
1337 dlist
= _mesa_lookup_list(ctx
, list
);
1341 if (is_bitmap_list(dlist
)) {
1342 /* If we're destroying a simple glBitmap display list, there's a
1343 * chance that we're destroying a bitmap image that's in a texture
1344 * atlas. Examine all atlases to see if that's the case. There's
1345 * usually few (if any) atlases so this isn't expensive.
1347 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1348 check_atlas_for_deleted_list
, &list
);
1351 _mesa_delete_list(ctx
, dlist
);
1352 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1357 * Translate the nth element of list from <type> to GLint.
1360 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1372 bptr
= (GLbyte
*) list
;
1373 return (GLint
) bptr
[n
];
1374 case GL_UNSIGNED_BYTE
:
1375 ubptr
= (GLubyte
*) list
;
1376 return (GLint
) ubptr
[n
];
1378 sptr
= (GLshort
*) list
;
1379 return (GLint
) sptr
[n
];
1380 case GL_UNSIGNED_SHORT
:
1381 usptr
= (GLushort
*) list
;
1382 return (GLint
) usptr
[n
];
1384 iptr
= (GLint
*) list
;
1386 case GL_UNSIGNED_INT
:
1387 uiptr
= (GLuint
*) list
;
1388 return (GLint
) uiptr
[n
];
1390 fptr
= (GLfloat
*) list
;
1391 return (GLint
) floorf(fptr
[n
]);
1393 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1394 return (GLint
) ubptr
[0] * 256
1397 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1398 return (GLint
) ubptr
[0] * 65536
1399 + (GLint
) ubptr
[1] * 256
1402 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1403 return (GLint
) ubptr
[0] * 16777216
1404 + (GLint
) ubptr
[1] * 65536
1405 + (GLint
) ubptr
[2] * 256
1414 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1415 * If width < 0 or height < 0 or format or type are invalid we'll just
1416 * return NULL. We will not generate an error since OpenGL command
1417 * arguments aren't error-checked until the command is actually executed
1418 * (not when they're compiled).
1419 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1422 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1423 GLsizei width
, GLsizei height
, GLsizei depth
,
1424 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1425 const struct gl_pixelstore_attrib
*unpack
)
1427 if (width
<= 0 || height
<= 0) {
1431 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1432 /* bad format and/or type */
1436 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1440 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1441 format
, type
, pixels
, unpack
);
1442 if (pixels
&& !image
) {
1443 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1447 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1448 depth
, format
, type
, INT_MAX
, pixels
)) {
1449 const GLubyte
*map
, *src
;
1453 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1454 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1457 /* unable to map src buffer! */
1458 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1462 src
= ADD_POINTERS(map
, pixels
);
1463 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1464 format
, type
, src
, unpack
);
1466 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1469 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1475 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1480 /** Return copy of memory */
1482 memdup(const void *src
, GLsizei bytes
)
1484 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1486 memcpy(b
, src
, bytes
);
1492 * Allocate space for a display list instruction (opcode + payload space).
1493 * \param opcode the instruction opcode (OPCODE_* value)
1494 * \param bytes instruction payload size (not counting opcode)
1495 * \param align8 does the payload need to be 8-byte aligned?
1496 * This is only relevant in 64-bit environments.
1497 * \return pointer to allocated memory (the payload will be at pointer+1)
1500 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1502 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1503 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1507 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1509 if (opcode
< OPCODE_EXT_0
) {
1510 if (InstSize
[opcode
] == 0) {
1511 /* save instruction size now */
1512 InstSize
[opcode
] = numNodes
;
1515 /* make sure instruction size agrees */
1516 assert(numNodes
== InstSize
[opcode
]);
1520 if (sizeof(void *) > sizeof(Node
) && align8
1521 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1522 /* The opcode would get placed at node[0] and the payload would start
1523 * at node[1]. But the payload needs to be at an even offset (8-byte
1532 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1534 /* This block is full. Allocate a new block and chain to it */
1536 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1537 n
[0].opcode
= OPCODE_CONTINUE
;
1538 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1540 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1544 /* a fresh block should be 8-byte aligned on 64-bit systems */
1545 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1547 save_pointer(&n
[1], newblock
);
1548 ctx
->ListState
.CurrentBlock
= newblock
;
1549 ctx
->ListState
.CurrentPos
= 0;
1551 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1552 * we have to insert a NOP so that the payload of the real opcode lands
1553 * on an even location:
1554 * node[0] = OPCODE_NOP
1555 * node[1] = OPCODE_x;
1556 * node[2] = start of payload
1558 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1561 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1563 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1564 n
[0].opcode
= OPCODE_NOP
;
1566 /* The "real" opcode will now be at an odd location and the payload
1567 * will be at an even location.
1570 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1572 n
[0].opcode
= opcode
;
1580 * Allocate space for a display list instruction. Used by callers outside
1581 * this file for things like VBO vertex data.
1583 * \param opcode the instruction opcode (OPCODE_* value)
1584 * \param bytes instruction size in bytes, not counting opcode.
1585 * \return pointer to the usable data area (not including the internal
1589 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1591 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1593 return n
+ 1; /* return pointer to payload area, after opcode */
1600 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1601 * aligned in 64-bit environments, 4-byte aligned otherwise.
1604 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1606 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1608 return n
+ 1; /* return pointer to payload area, after opcode */
1615 * This function allows modules and drivers to get their own opcodes
1616 * for extending display list functionality.
1617 * \param ctx the rendering context
1618 * \param size number of bytes for storing the new display list command
1619 * \param execute function to execute the new display list command
1620 * \param destroy function to destroy the new display list command
1621 * \param print function to print the new display list command
1622 * \return the new opcode number or -1 if error
1625 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1627 void (*execute
) (struct gl_context
*, void *),
1628 void (*destroy
) (struct gl_context
*, void *),
1629 void (*print
) (struct gl_context
*, void *, FILE *))
1631 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1632 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1633 ctx
->ListExt
->Opcode
[i
].Size
=
1634 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1635 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1636 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1637 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1638 return i
+ OPCODE_EXT_0
;
1645 * Allocate space for a display list instruction. The space is basically
1646 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1647 * function parameter, node[2] is the second parameter, etc.
1649 * \param opcode one of OPCODE_x
1650 * \param nparams number of function parameters
1651 * \return pointer to start of instruction space
1653 static inline Node
*
1654 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1656 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1661 * Called by EndList to try to reduce memory used for the list.
1664 trim_list(struct gl_context
*ctx
)
1666 /* If the list we're ending only has one allocated block of nodes/tokens
1667 * and its size isn't a full block size, realloc the block to use less
1668 * memory. This is important for apps that create many small display
1669 * lists and apps that use glXUseXFont (many lists each containing one
1671 * Note: we currently only trim display lists that allocated one block
1672 * of tokens. That hits the short list case which is what we're mainly
1673 * concerned with. Trimming longer lists would involve traversing the
1674 * linked list of blocks.
1676 struct gl_dlist_state
*list
= &ctx
->ListState
;
1678 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1679 (list
->CurrentPos
< BLOCK_SIZE
)) {
1680 /* There's only one block and it's not full, so realloc */
1681 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1682 list
->CurrentList
->Head
=
1683 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1684 if (!list
->CurrentBlock
) {
1685 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1693 * Display List compilation functions
1695 static void GLAPIENTRY
1696 save_Accum(GLenum op
, GLfloat value
)
1698 GET_CURRENT_CONTEXT(ctx
);
1700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1701 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1706 if (ctx
->ExecuteFlag
) {
1707 CALL_Accum(ctx
->Exec
, (op
, value
));
1712 static void GLAPIENTRY
1713 save_AlphaFunc(GLenum func
, GLclampf ref
)
1715 GET_CURRENT_CONTEXT(ctx
);
1717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1718 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1721 n
[2].f
= (GLfloat
) ref
;
1723 if (ctx
->ExecuteFlag
) {
1724 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1729 static void GLAPIENTRY
1730 save_BindTexture(GLenum target
, GLuint texture
)
1732 GET_CURRENT_CONTEXT(ctx
);
1734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1735 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1740 if (ctx
->ExecuteFlag
) {
1741 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1746 static void GLAPIENTRY
1747 save_Bitmap(GLsizei width
, GLsizei height
,
1748 GLfloat xorig
, GLfloat yorig
,
1749 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1751 GET_CURRENT_CONTEXT(ctx
);
1753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1754 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1756 n
[1].i
= (GLint
) width
;
1757 n
[2].i
= (GLint
) height
;
1763 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1764 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1766 if (ctx
->ExecuteFlag
) {
1767 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1768 xorig
, yorig
, xmove
, ymove
, pixels
));
1773 static void GLAPIENTRY
1774 save_BlendEquation(GLenum mode
)
1776 GET_CURRENT_CONTEXT(ctx
);
1778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1779 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1783 if (ctx
->ExecuteFlag
) {
1784 CALL_BlendEquation(ctx
->Exec
, (mode
));
1789 static void GLAPIENTRY
1790 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1792 GET_CURRENT_CONTEXT(ctx
);
1794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1795 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1800 if (ctx
->ExecuteFlag
) {
1801 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1806 static void GLAPIENTRY
1807 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1808 GLenum sfactorA
, GLenum dfactorA
)
1810 GET_CURRENT_CONTEXT(ctx
);
1812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1813 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1815 n
[1].e
= sfactorRGB
;
1816 n
[2].e
= dfactorRGB
;
1820 if (ctx
->ExecuteFlag
) {
1821 CALL_BlendFuncSeparate(ctx
->Exec
,
1822 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1827 static void GLAPIENTRY
1828 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1830 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1834 static void GLAPIENTRY
1835 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1837 GET_CURRENT_CONTEXT(ctx
);
1839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1840 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1847 if (ctx
->ExecuteFlag
) {
1848 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1852 /* GL_ARB_draw_buffers_blend */
1853 static void GLAPIENTRY
1854 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1855 GLenum sfactorA
, GLenum dfactorA
)
1857 GET_CURRENT_CONTEXT(ctx
);
1859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1860 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1863 n
[2].e
= sfactorRGB
;
1864 n
[3].e
= dfactorRGB
;
1868 if (ctx
->ExecuteFlag
) {
1869 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1870 sfactorA
, dfactorA
));
1874 /* GL_ARB_draw_buffers_blend */
1875 static void GLAPIENTRY
1876 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1878 GET_CURRENT_CONTEXT(ctx
);
1880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1881 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1887 if (ctx
->ExecuteFlag
) {
1888 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1892 /* GL_ARB_draw_buffers_blend */
1893 static void GLAPIENTRY
1894 save_BlendEquationi(GLuint buf
, GLenum mode
)
1896 GET_CURRENT_CONTEXT(ctx
);
1898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1899 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1904 if (ctx
->ExecuteFlag
) {
1905 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1909 /* GL_ARB_draw_buffers_blend */
1910 static void GLAPIENTRY
1911 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1913 GET_CURRENT_CONTEXT(ctx
);
1915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1916 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1922 if (ctx
->ExecuteFlag
) {
1923 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1928 /* GL_ARB_draw_instanced. */
1929 static void GLAPIENTRY
1930 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1932 UNUSED GLsizei count
,
1933 UNUSED GLsizei primcount
)
1935 GET_CURRENT_CONTEXT(ctx
);
1936 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1937 "glDrawArraysInstanced() during display list compile");
1940 static void GLAPIENTRY
1941 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1942 UNUSED GLsizei count
,
1944 UNUSED
const GLvoid
*indices
,
1945 UNUSED GLsizei primcount
)
1947 GET_CURRENT_CONTEXT(ctx
);
1948 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1949 "glDrawElementsInstanced() during display list compile");
1952 static void GLAPIENTRY
1953 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1954 UNUSED GLsizei count
,
1956 UNUSED
const GLvoid
*indices
,
1957 UNUSED GLsizei primcount
,
1958 UNUSED GLint basevertex
)
1960 GET_CURRENT_CONTEXT(ctx
);
1961 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1962 "glDrawElementsInstancedBaseVertex() during display list compile");
1965 /* GL_ARB_base_instance. */
1966 static void GLAPIENTRY
1967 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1969 UNUSED GLsizei count
,
1970 UNUSED GLsizei primcount
,
1971 UNUSED GLuint baseinstance
)
1973 GET_CURRENT_CONTEXT(ctx
);
1974 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1975 "glDrawArraysInstancedBaseInstance() during display list compile");
1978 static void APIENTRY
1979 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1980 UNUSED GLsizei count
,
1982 UNUSED
const void *indices
,
1983 UNUSED GLsizei primcount
,
1984 UNUSED GLuint baseinstance
)
1986 GET_CURRENT_CONTEXT(ctx
);
1987 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1988 "glDrawElementsInstancedBaseInstance() during display list compile");
1991 static void APIENTRY
1992 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1993 UNUSED GLsizei count
,
1995 UNUSED
const void *indices
,
1996 UNUSED GLsizei primcount
,
1997 UNUSED GLint basevertex
,
1998 UNUSED GLuint baseinstance
)
2000 GET_CURRENT_CONTEXT(ctx
);
2001 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2002 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2005 static void APIENTRY
2006 save_DrawArraysIndirect(UNUSED GLenum mode
,
2007 UNUSED
const void *indirect
)
2009 GET_CURRENT_CONTEXT(ctx
);
2010 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2011 "glDrawArraysIndirect() during display list compile");
2014 static void APIENTRY
2015 save_DrawElementsIndirect(UNUSED GLenum mode
,
2017 UNUSED
const void *indirect
)
2019 GET_CURRENT_CONTEXT(ctx
);
2020 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2021 "glDrawElementsIndirect() during display list compile");
2024 static void APIENTRY
2025 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2026 UNUSED
const void *indirect
,
2027 UNUSED GLsizei primcount
,
2028 UNUSED GLsizei stride
)
2030 GET_CURRENT_CONTEXT(ctx
);
2031 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2032 "glMultiDrawArraysIndirect() during display list compile");
2035 static void APIENTRY
2036 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2038 UNUSED
const void *indirect
,
2039 UNUSED GLsizei primcount
,
2040 UNUSED GLsizei stride
)
2042 GET_CURRENT_CONTEXT(ctx
);
2043 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2044 "glMultiDrawElementsIndirect() during display list compile");
2048 * While building a display list we cache some OpenGL state.
2049 * Under some circumstances we need to invalidate that state (immediately
2050 * when we start compiling a list, or after glCallList(s)).
2053 invalidate_saved_current_state(struct gl_context
*ctx
)
2057 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2058 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2060 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2061 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2063 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2065 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2069 static void GLAPIENTRY
2070 save_CallList(GLuint list
)
2072 GET_CURRENT_CONTEXT(ctx
);
2074 SAVE_FLUSH_VERTICES(ctx
);
2076 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2081 /* After this, we don't know what state we're in. Invalidate all
2082 * cached information previously gathered:
2084 invalidate_saved_current_state( ctx
);
2086 if (ctx
->ExecuteFlag
) {
2087 _mesa_CallList(list
);
2092 static void GLAPIENTRY
2093 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2095 GET_CURRENT_CONTEXT(ctx
);
2100 SAVE_FLUSH_VERTICES(ctx
);
2104 case GL_UNSIGNED_BYTE
:
2108 case GL_UNSIGNED_SHORT
:
2116 case GL_UNSIGNED_INT
:
2125 if (num
> 0 && type_size
> 0) {
2126 /* create a copy of the array of list IDs to save in the display list */
2127 lists_copy
= memdup(lists
, num
* type_size
);
2132 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2136 save_pointer(&n
[3], lists_copy
);
2139 /* After this, we don't know what state we're in. Invalidate all
2140 * cached information previously gathered:
2142 invalidate_saved_current_state( ctx
);
2144 if (ctx
->ExecuteFlag
) {
2145 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2150 static void GLAPIENTRY
2151 save_Clear(GLbitfield mask
)
2153 GET_CURRENT_CONTEXT(ctx
);
2155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2156 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2160 if (ctx
->ExecuteFlag
) {
2161 CALL_Clear(ctx
->Exec
, (mask
));
2166 static void GLAPIENTRY
2167 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2169 GET_CURRENT_CONTEXT(ctx
);
2171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2172 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2175 n
[2].i
= drawbuffer
;
2177 if (buffer
== GL_COLOR
) {
2188 if (ctx
->ExecuteFlag
) {
2189 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2194 static void GLAPIENTRY
2195 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2197 GET_CURRENT_CONTEXT(ctx
);
2199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2200 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2203 n
[2].i
= drawbuffer
;
2205 if (buffer
== GL_COLOR
) {
2216 if (ctx
->ExecuteFlag
) {
2217 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2222 static void GLAPIENTRY
2223 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2225 GET_CURRENT_CONTEXT(ctx
);
2227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2228 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2231 n
[2].i
= drawbuffer
;
2233 if (buffer
== GL_COLOR
) {
2244 if (ctx
->ExecuteFlag
) {
2245 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2250 static void GLAPIENTRY
2251 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2252 GLfloat depth
, GLint stencil
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2260 n
[2].i
= drawbuffer
;
2264 if (ctx
->ExecuteFlag
) {
2265 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2270 static void GLAPIENTRY
2271 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2273 GET_CURRENT_CONTEXT(ctx
);
2275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2276 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2283 if (ctx
->ExecuteFlag
) {
2284 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2289 static void GLAPIENTRY
2290 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2292 GET_CURRENT_CONTEXT(ctx
);
2294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2295 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2302 if (ctx
->ExecuteFlag
) {
2303 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2308 static void GLAPIENTRY
2309 save_ClearDepth(GLclampd depth
)
2311 GET_CURRENT_CONTEXT(ctx
);
2313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2314 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2316 n
[1].f
= (GLfloat
) depth
;
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_ClearDepth(ctx
->Exec
, (depth
));
2324 static void GLAPIENTRY
2325 save_ClearIndex(GLfloat c
)
2327 GET_CURRENT_CONTEXT(ctx
);
2329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2334 if (ctx
->ExecuteFlag
) {
2335 CALL_ClearIndex(ctx
->Exec
, (c
));
2340 static void GLAPIENTRY
2341 save_ClearStencil(GLint s
)
2343 GET_CURRENT_CONTEXT(ctx
);
2345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2346 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2350 if (ctx
->ExecuteFlag
) {
2351 CALL_ClearStencil(ctx
->Exec
, (s
));
2356 static void GLAPIENTRY
2357 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2359 GET_CURRENT_CONTEXT(ctx
);
2361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2362 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2365 n
[2].f
= (GLfloat
) equ
[0];
2366 n
[3].f
= (GLfloat
) equ
[1];
2367 n
[4].f
= (GLfloat
) equ
[2];
2368 n
[5].f
= (GLfloat
) equ
[3];
2370 if (ctx
->ExecuteFlag
) {
2371 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2377 static void GLAPIENTRY
2378 save_ColorMask(GLboolean red
, GLboolean green
,
2379 GLboolean blue
, GLboolean alpha
)
2381 GET_CURRENT_CONTEXT(ctx
);
2383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2384 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2391 if (ctx
->ExecuteFlag
) {
2392 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2397 static void GLAPIENTRY
2398 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2399 GLboolean blue
, GLboolean alpha
)
2401 GET_CURRENT_CONTEXT(ctx
);
2403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2404 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2412 if (ctx
->ExecuteFlag
) {
2413 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2418 static void GLAPIENTRY
2419 save_ColorMaterial(GLenum face
, GLenum mode
)
2421 GET_CURRENT_CONTEXT(ctx
);
2423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2425 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2430 if (ctx
->ExecuteFlag
) {
2431 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2436 static void GLAPIENTRY
2437 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2439 GET_CURRENT_CONTEXT(ctx
);
2441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2442 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2446 n
[3].i
= (GLint
) width
;
2447 n
[4].i
= (GLint
) height
;
2450 if (ctx
->ExecuteFlag
) {
2451 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2457 static void GLAPIENTRY
2458 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2459 GLint x
, GLint y
, GLsizei width
, GLint border
)
2461 GET_CURRENT_CONTEXT(ctx
);
2463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2464 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2468 n
[3].e
= internalformat
;
2474 if (ctx
->ExecuteFlag
) {
2475 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2476 x
, y
, width
, border
));
2481 static void GLAPIENTRY
2482 save_CopyTexImage2D(GLenum target
, GLint level
,
2483 GLenum internalformat
,
2484 GLint x
, GLint y
, GLsizei width
,
2485 GLsizei height
, GLint border
)
2487 GET_CURRENT_CONTEXT(ctx
);
2489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2490 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2494 n
[3].e
= internalformat
;
2501 if (ctx
->ExecuteFlag
) {
2502 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2503 x
, y
, width
, height
, border
));
2509 static void GLAPIENTRY
2510 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2511 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2513 GET_CURRENT_CONTEXT(ctx
);
2515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2516 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2525 if (ctx
->ExecuteFlag
) {
2526 CALL_CopyTexSubImage1D(ctx
->Exec
,
2527 (target
, level
, xoffset
, x
, y
, width
));
2532 static void GLAPIENTRY
2533 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2534 GLint xoffset
, GLint yoffset
,
2535 GLint x
, GLint y
, GLsizei width
, GLint height
)
2537 GET_CURRENT_CONTEXT(ctx
);
2539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2540 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2551 if (ctx
->ExecuteFlag
) {
2552 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2553 x
, y
, width
, height
));
2558 static void GLAPIENTRY
2559 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2560 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2561 GLint x
, GLint y
, GLsizei width
, GLint height
)
2563 GET_CURRENT_CONTEXT(ctx
);
2565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2566 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2578 if (ctx
->ExecuteFlag
) {
2579 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2580 xoffset
, yoffset
, zoffset
,
2581 x
, y
, width
, height
));
2586 static void GLAPIENTRY
2587 save_CullFace(GLenum mode
)
2589 GET_CURRENT_CONTEXT(ctx
);
2591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2592 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2596 if (ctx
->ExecuteFlag
) {
2597 CALL_CullFace(ctx
->Exec
, (mode
));
2602 static void GLAPIENTRY
2603 save_DepthFunc(GLenum func
)
2605 GET_CURRENT_CONTEXT(ctx
);
2607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2608 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2612 if (ctx
->ExecuteFlag
) {
2613 CALL_DepthFunc(ctx
->Exec
, (func
));
2618 static void GLAPIENTRY
2619 save_DepthMask(GLboolean mask
)
2621 GET_CURRENT_CONTEXT(ctx
);
2623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2624 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2628 if (ctx
->ExecuteFlag
) {
2629 CALL_DepthMask(ctx
->Exec
, (mask
));
2634 static void GLAPIENTRY
2635 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2637 GET_CURRENT_CONTEXT(ctx
);
2639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2640 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2642 n
[1].f
= (GLfloat
) nearval
;
2643 n
[2].f
= (GLfloat
) farval
;
2645 if (ctx
->ExecuteFlag
) {
2646 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2651 static void GLAPIENTRY
2652 save_Disable(GLenum cap
)
2654 GET_CURRENT_CONTEXT(ctx
);
2656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2657 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2661 if (ctx
->ExecuteFlag
) {
2662 CALL_Disable(ctx
->Exec
, (cap
));
2667 static void GLAPIENTRY
2668 save_DisableIndexed(GLuint index
, GLenum cap
)
2670 GET_CURRENT_CONTEXT(ctx
);
2672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2673 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2678 if (ctx
->ExecuteFlag
) {
2679 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2684 static void GLAPIENTRY
2685 save_DrawBuffer(GLenum mode
)
2687 GET_CURRENT_CONTEXT(ctx
);
2689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2690 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2694 if (ctx
->ExecuteFlag
) {
2695 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2700 static void GLAPIENTRY
2701 save_DrawPixels(GLsizei width
, GLsizei height
,
2702 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2704 GET_CURRENT_CONTEXT(ctx
);
2707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2709 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2716 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2717 pixels
, &ctx
->Unpack
));
2719 if (ctx
->ExecuteFlag
) {
2720 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2726 static void GLAPIENTRY
2727 save_Enable(GLenum cap
)
2729 GET_CURRENT_CONTEXT(ctx
);
2731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2732 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2736 if (ctx
->ExecuteFlag
) {
2737 CALL_Enable(ctx
->Exec
, (cap
));
2743 static void GLAPIENTRY
2744 save_EnableIndexed(GLuint index
, GLenum cap
)
2746 GET_CURRENT_CONTEXT(ctx
);
2748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2749 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2754 if (ctx
->ExecuteFlag
) {
2755 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2761 static void GLAPIENTRY
2762 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2764 GET_CURRENT_CONTEXT(ctx
);
2766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2767 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2773 if (ctx
->ExecuteFlag
) {
2774 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2779 static void GLAPIENTRY
2780 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2782 GET_CURRENT_CONTEXT(ctx
);
2784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2785 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2793 if (ctx
->ExecuteFlag
) {
2794 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2801 static void GLAPIENTRY
2802 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2804 GET_CURRENT_CONTEXT(ctx
);
2806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2807 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2821 static void GLAPIENTRY
2822 save_Fogf(GLenum pname
, GLfloat param
)
2826 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2827 save_Fogfv(pname
, parray
);
2831 static void GLAPIENTRY
2832 save_Fogiv(GLenum pname
, const GLint
*params
)
2837 case GL_FOG_DENSITY
:
2841 case GL_FOG_COORDINATE_SOURCE
:
2842 p
[0] = (GLfloat
) *params
;
2848 p
[0] = INT_TO_FLOAT(params
[0]);
2849 p
[1] = INT_TO_FLOAT(params
[1]);
2850 p
[2] = INT_TO_FLOAT(params
[2]);
2851 p
[3] = INT_TO_FLOAT(params
[3]);
2854 /* Error will be caught later in gl_Fogfv */
2855 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2857 save_Fogfv(pname
, p
);
2861 static void GLAPIENTRY
2862 save_Fogi(GLenum pname
, GLint param
)
2866 parray
[1] = parray
[2] = parray
[3] = 0;
2867 save_Fogiv(pname
, parray
);
2871 static void GLAPIENTRY
2872 save_FrontFace(GLenum mode
)
2874 GET_CURRENT_CONTEXT(ctx
);
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2877 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2881 if (ctx
->ExecuteFlag
) {
2882 CALL_FrontFace(ctx
->Exec
, (mode
));
2887 static void GLAPIENTRY
2888 save_Frustum(GLdouble left
, GLdouble right
,
2889 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2891 GET_CURRENT_CONTEXT(ctx
);
2893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2894 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2896 n
[1].f
= (GLfloat
) left
;
2897 n
[2].f
= (GLfloat
) right
;
2898 n
[3].f
= (GLfloat
) bottom
;
2899 n
[4].f
= (GLfloat
) top
;
2900 n
[5].f
= (GLfloat
) nearval
;
2901 n
[6].f
= (GLfloat
) farval
;
2903 if (ctx
->ExecuteFlag
) {
2904 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2909 static void GLAPIENTRY
2910 save_Hint(GLenum target
, GLenum mode
)
2912 GET_CURRENT_CONTEXT(ctx
);
2914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2915 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2920 if (ctx
->ExecuteFlag
) {
2921 CALL_Hint(ctx
->Exec
, (target
, mode
));
2926 static void GLAPIENTRY
2927 save_IndexMask(GLuint mask
)
2929 GET_CURRENT_CONTEXT(ctx
);
2931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2932 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2936 if (ctx
->ExecuteFlag
) {
2937 CALL_IndexMask(ctx
->Exec
, (mask
));
2942 static void GLAPIENTRY
2943 save_InitNames(void)
2945 GET_CURRENT_CONTEXT(ctx
);
2946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2947 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2948 if (ctx
->ExecuteFlag
) {
2949 CALL_InitNames(ctx
->Exec
, ());
2954 static void GLAPIENTRY
2955 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2957 GET_CURRENT_CONTEXT(ctx
);
2959 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2960 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2978 case GL_SPOT_DIRECTION
:
2981 case GL_SPOT_EXPONENT
:
2984 case GL_SPOT_CUTOFF
:
2987 case GL_CONSTANT_ATTENUATION
:
2990 case GL_LINEAR_ATTENUATION
:
2993 case GL_QUADRATIC_ATTENUATION
:
2999 for (i
= 0; i
< nParams
; i
++) {
3000 n
[3 + i
].f
= params
[i
];
3003 if (ctx
->ExecuteFlag
) {
3004 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3009 static void GLAPIENTRY
3010 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3014 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3015 save_Lightfv(light
, pname
, parray
);
3019 static void GLAPIENTRY
3020 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3027 fparam
[0] = INT_TO_FLOAT(params
[0]);
3028 fparam
[1] = INT_TO_FLOAT(params
[1]);
3029 fparam
[2] = INT_TO_FLOAT(params
[2]);
3030 fparam
[3] = INT_TO_FLOAT(params
[3]);
3033 fparam
[0] = (GLfloat
) params
[0];
3034 fparam
[1] = (GLfloat
) params
[1];
3035 fparam
[2] = (GLfloat
) params
[2];
3036 fparam
[3] = (GLfloat
) params
[3];
3038 case GL_SPOT_DIRECTION
:
3039 fparam
[0] = (GLfloat
) params
[0];
3040 fparam
[1] = (GLfloat
) params
[1];
3041 fparam
[2] = (GLfloat
) params
[2];
3043 case GL_SPOT_EXPONENT
:
3044 case GL_SPOT_CUTOFF
:
3045 case GL_CONSTANT_ATTENUATION
:
3046 case GL_LINEAR_ATTENUATION
:
3047 case GL_QUADRATIC_ATTENUATION
:
3048 fparam
[0] = (GLfloat
) params
[0];
3051 /* error will be caught later in gl_Lightfv */
3054 save_Lightfv(light
, pname
, fparam
);
3058 static void GLAPIENTRY
3059 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3063 parray
[1] = parray
[2] = parray
[3] = 0;
3064 save_Lightiv(light
, pname
, parray
);
3068 static void GLAPIENTRY
3069 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3071 GET_CURRENT_CONTEXT(ctx
);
3073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3074 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3082 if (ctx
->ExecuteFlag
) {
3083 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3088 static void GLAPIENTRY
3089 save_LightModelf(GLenum pname
, GLfloat param
)
3093 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3094 save_LightModelfv(pname
, parray
);
3098 static void GLAPIENTRY
3099 save_LightModeliv(GLenum pname
, const GLint
*params
)
3103 case GL_LIGHT_MODEL_AMBIENT
:
3104 fparam
[0] = INT_TO_FLOAT(params
[0]);
3105 fparam
[1] = INT_TO_FLOAT(params
[1]);
3106 fparam
[2] = INT_TO_FLOAT(params
[2]);
3107 fparam
[3] = INT_TO_FLOAT(params
[3]);
3109 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3110 case GL_LIGHT_MODEL_TWO_SIDE
:
3111 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3112 fparam
[0] = (GLfloat
) params
[0];
3118 /* Error will be caught later in gl_LightModelfv */
3119 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3121 save_LightModelfv(pname
, fparam
);
3125 static void GLAPIENTRY
3126 save_LightModeli(GLenum pname
, GLint param
)
3130 parray
[1] = parray
[2] = parray
[3] = 0;
3131 save_LightModeliv(pname
, parray
);
3135 static void GLAPIENTRY
3136 save_LineStipple(GLint factor
, GLushort pattern
)
3138 GET_CURRENT_CONTEXT(ctx
);
3140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3141 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3146 if (ctx
->ExecuteFlag
) {
3147 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3152 static void GLAPIENTRY
3153 save_LineWidth(GLfloat width
)
3155 GET_CURRENT_CONTEXT(ctx
);
3157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3158 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3162 if (ctx
->ExecuteFlag
) {
3163 CALL_LineWidth(ctx
->Exec
, (width
));
3168 static void GLAPIENTRY
3169 save_ListBase(GLuint base
)
3171 GET_CURRENT_CONTEXT(ctx
);
3173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3174 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3178 if (ctx
->ExecuteFlag
) {
3179 CALL_ListBase(ctx
->Exec
, (base
));
3184 static void GLAPIENTRY
3185 save_LoadIdentity(void)
3187 GET_CURRENT_CONTEXT(ctx
);
3188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3189 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3190 if (ctx
->ExecuteFlag
) {
3191 CALL_LoadIdentity(ctx
->Exec
, ());
3196 static void GLAPIENTRY
3197 save_LoadMatrixf(const GLfloat
* m
)
3199 GET_CURRENT_CONTEXT(ctx
);
3201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3202 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3205 for (i
= 0; i
< 16; i
++) {
3209 if (ctx
->ExecuteFlag
) {
3210 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3215 static void GLAPIENTRY
3216 save_LoadMatrixd(const GLdouble
* m
)
3220 for (i
= 0; i
< 16; i
++) {
3221 f
[i
] = (GLfloat
) m
[i
];
3223 save_LoadMatrixf(f
);
3227 static void GLAPIENTRY
3228 save_LoadName(GLuint name
)
3230 GET_CURRENT_CONTEXT(ctx
);
3232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3233 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3237 if (ctx
->ExecuteFlag
) {
3238 CALL_LoadName(ctx
->Exec
, (name
));
3243 static void GLAPIENTRY
3244 save_LogicOp(GLenum opcode
)
3246 GET_CURRENT_CONTEXT(ctx
);
3248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3249 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3253 if (ctx
->ExecuteFlag
) {
3254 CALL_LogicOp(ctx
->Exec
, (opcode
));
3259 static void GLAPIENTRY
3260 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3261 GLint order
, const GLdouble
* points
)
3263 GET_CURRENT_CONTEXT(ctx
);
3265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3266 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3268 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3270 n
[2].f
= (GLfloat
) u1
;
3271 n
[3].f
= (GLfloat
) u2
;
3272 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3274 save_pointer(&n
[6], pnts
);
3276 if (ctx
->ExecuteFlag
) {
3277 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3281 static void GLAPIENTRY
3282 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3283 GLint order
, const GLfloat
* points
)
3285 GET_CURRENT_CONTEXT(ctx
);
3287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3288 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3290 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3294 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3296 save_pointer(&n
[6], pnts
);
3298 if (ctx
->ExecuteFlag
) {
3299 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3304 static void GLAPIENTRY
3305 save_Map2d(GLenum target
,
3306 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3307 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3308 const GLdouble
* points
)
3310 GET_CURRENT_CONTEXT(ctx
);
3312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3313 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3315 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3316 vstride
, vorder
, points
);
3318 n
[2].f
= (GLfloat
) u1
;
3319 n
[3].f
= (GLfloat
) u2
;
3320 n
[4].f
= (GLfloat
) v1
;
3321 n
[5].f
= (GLfloat
) v2
;
3322 /* XXX verify these strides are correct */
3323 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3324 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3327 save_pointer(&n
[10], pnts
);
3329 if (ctx
->ExecuteFlag
) {
3330 CALL_Map2d(ctx
->Exec
, (target
,
3331 u1
, u2
, ustride
, uorder
,
3332 v1
, v2
, vstride
, vorder
, points
));
3337 static void GLAPIENTRY
3338 save_Map2f(GLenum target
,
3339 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3340 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3341 const GLfloat
* points
)
3343 GET_CURRENT_CONTEXT(ctx
);
3345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3346 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3348 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3349 vstride
, vorder
, points
);
3355 /* XXX verify these strides are correct */
3356 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3357 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3360 save_pointer(&n
[10], pnts
);
3362 if (ctx
->ExecuteFlag
) {
3363 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3364 v1
, v2
, vstride
, vorder
, points
));
3369 static void GLAPIENTRY
3370 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3372 GET_CURRENT_CONTEXT(ctx
);
3374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3375 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3381 if (ctx
->ExecuteFlag
) {
3382 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3387 static void GLAPIENTRY
3388 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3390 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3394 static void GLAPIENTRY
3395 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3396 GLint vn
, GLfloat v1
, GLfloat v2
)
3398 GET_CURRENT_CONTEXT(ctx
);
3400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3401 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3410 if (ctx
->ExecuteFlag
) {
3411 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3417 static void GLAPIENTRY
3418 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3419 GLint vn
, GLdouble v1
, GLdouble v2
)
3421 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3422 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3426 static void GLAPIENTRY
3427 save_MatrixMode(GLenum mode
)
3429 GET_CURRENT_CONTEXT(ctx
);
3431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3432 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3436 if (ctx
->ExecuteFlag
) {
3437 CALL_MatrixMode(ctx
->Exec
, (mode
));
3442 static void GLAPIENTRY
3443 save_MultMatrixf(const GLfloat
* m
)
3445 GET_CURRENT_CONTEXT(ctx
);
3447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3448 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3451 for (i
= 0; i
< 16; i
++) {
3455 if (ctx
->ExecuteFlag
) {
3456 CALL_MultMatrixf(ctx
->Exec
, (m
));
3461 static void GLAPIENTRY
3462 save_MultMatrixd(const GLdouble
* m
)
3466 for (i
= 0; i
< 16; i
++) {
3467 f
[i
] = (GLfloat
) m
[i
];
3469 save_MultMatrixf(f
);
3473 static void GLAPIENTRY
3474 save_NewList(GLuint name
, GLenum mode
)
3476 GET_CURRENT_CONTEXT(ctx
);
3477 /* It's an error to call this function while building a display list */
3478 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3485 static void GLAPIENTRY
3486 save_Ortho(GLdouble left
, GLdouble right
,
3487 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3489 GET_CURRENT_CONTEXT(ctx
);
3491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3492 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3494 n
[1].f
= (GLfloat
) left
;
3495 n
[2].f
= (GLfloat
) right
;
3496 n
[3].f
= (GLfloat
) bottom
;
3497 n
[4].f
= (GLfloat
) top
;
3498 n
[5].f
= (GLfloat
) nearval
;
3499 n
[6].f
= (GLfloat
) farval
;
3501 if (ctx
->ExecuteFlag
) {
3502 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3507 static void GLAPIENTRY
3508 save_PatchParameteri(GLenum pname
, const GLint value
)
3510 GET_CURRENT_CONTEXT(ctx
);
3512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3513 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3518 if (ctx
->ExecuteFlag
) {
3519 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3524 static void GLAPIENTRY
3525 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3527 GET_CURRENT_CONTEXT(ctx
);
3529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3531 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3532 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3534 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3535 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3539 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3549 if (ctx
->ExecuteFlag
) {
3550 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3555 static void GLAPIENTRY
3556 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3558 GET_CURRENT_CONTEXT(ctx
);
3560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3561 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3565 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3567 if (ctx
->ExecuteFlag
) {
3568 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3573 static void GLAPIENTRY
3574 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3576 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3578 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3579 for (i
= 0; i
< mapsize
; i
++) {
3580 fvalues
[i
] = (GLfloat
) values
[i
];
3584 for (i
= 0; i
< mapsize
; i
++) {
3585 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3588 save_PixelMapfv(map
, mapsize
, fvalues
);
3592 static void GLAPIENTRY
3593 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3595 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3597 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3598 for (i
= 0; i
< mapsize
; i
++) {
3599 fvalues
[i
] = (GLfloat
) values
[i
];
3603 for (i
= 0; i
< mapsize
; i
++) {
3604 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3607 save_PixelMapfv(map
, mapsize
, fvalues
);
3611 static void GLAPIENTRY
3612 save_PixelTransferf(GLenum pname
, GLfloat param
)
3614 GET_CURRENT_CONTEXT(ctx
);
3616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3617 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3622 if (ctx
->ExecuteFlag
) {
3623 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3628 static void GLAPIENTRY
3629 save_PixelTransferi(GLenum pname
, GLint param
)
3631 save_PixelTransferf(pname
, (GLfloat
) param
);
3635 static void GLAPIENTRY
3636 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3638 GET_CURRENT_CONTEXT(ctx
);
3640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3641 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3646 if (ctx
->ExecuteFlag
) {
3647 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3652 static void GLAPIENTRY
3653 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3655 GET_CURRENT_CONTEXT(ctx
);
3657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3658 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3665 if (ctx
->ExecuteFlag
) {
3666 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3671 static void GLAPIENTRY
3672 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3676 parray
[1] = parray
[2] = 0.0F
;
3677 save_PointParameterfvEXT(pname
, parray
);
3680 static void GLAPIENTRY
3681 save_PointParameteriNV(GLenum pname
, GLint param
)
3684 parray
[0] = (GLfloat
) param
;
3685 parray
[1] = parray
[2] = 0.0F
;
3686 save_PointParameterfvEXT(pname
, parray
);
3689 static void GLAPIENTRY
3690 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3693 parray
[0] = (GLfloat
) param
[0];
3694 parray
[1] = parray
[2] = 0.0F
;
3695 save_PointParameterfvEXT(pname
, parray
);
3699 static void GLAPIENTRY
3700 save_PointSize(GLfloat size
)
3702 GET_CURRENT_CONTEXT(ctx
);
3704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3705 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3709 if (ctx
->ExecuteFlag
) {
3710 CALL_PointSize(ctx
->Exec
, (size
));
3715 static void GLAPIENTRY
3716 save_PolygonMode(GLenum face
, GLenum mode
)
3718 GET_CURRENT_CONTEXT(ctx
);
3720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3721 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3726 if (ctx
->ExecuteFlag
) {
3727 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3732 static void GLAPIENTRY
3733 save_PolygonStipple(const GLubyte
* pattern
)
3735 GET_CURRENT_CONTEXT(ctx
);
3738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3740 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3743 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3744 pattern
, &ctx
->Unpack
));
3746 if (ctx
->ExecuteFlag
) {
3747 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3752 static void GLAPIENTRY
3753 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3755 GET_CURRENT_CONTEXT(ctx
);
3757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3758 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3763 if (ctx
->ExecuteFlag
) {
3764 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3769 static void GLAPIENTRY
3770 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3772 GET_CURRENT_CONTEXT(ctx
);
3774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3775 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3781 if (ctx
->ExecuteFlag
) {
3782 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3786 static void GLAPIENTRY
3787 save_PopAttrib(void)
3789 GET_CURRENT_CONTEXT(ctx
);
3790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3791 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3792 if (ctx
->ExecuteFlag
) {
3793 CALL_PopAttrib(ctx
->Exec
, ());
3798 static void GLAPIENTRY
3799 save_PopMatrix(void)
3801 GET_CURRENT_CONTEXT(ctx
);
3802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3803 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3804 if (ctx
->ExecuteFlag
) {
3805 CALL_PopMatrix(ctx
->Exec
, ());
3810 static void GLAPIENTRY
3813 GET_CURRENT_CONTEXT(ctx
);
3814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3815 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3816 if (ctx
->ExecuteFlag
) {
3817 CALL_PopName(ctx
->Exec
, ());
3822 static void GLAPIENTRY
3823 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3824 const GLclampf
* priorities
)
3826 GET_CURRENT_CONTEXT(ctx
);
3828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3830 for (i
= 0; i
< num
; i
++) {
3832 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3834 n
[1].ui
= textures
[i
];
3835 n
[2].f
= priorities
[i
];
3838 if (ctx
->ExecuteFlag
) {
3839 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3844 static void GLAPIENTRY
3845 save_PushAttrib(GLbitfield mask
)
3847 GET_CURRENT_CONTEXT(ctx
);
3849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3850 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3854 if (ctx
->ExecuteFlag
) {
3855 CALL_PushAttrib(ctx
->Exec
, (mask
));
3860 static void GLAPIENTRY
3861 save_PushMatrix(void)
3863 GET_CURRENT_CONTEXT(ctx
);
3864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3865 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3866 if (ctx
->ExecuteFlag
) {
3867 CALL_PushMatrix(ctx
->Exec
, ());
3872 static void GLAPIENTRY
3873 save_PushName(GLuint name
)
3875 GET_CURRENT_CONTEXT(ctx
);
3877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3878 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3882 if (ctx
->ExecuteFlag
) {
3883 CALL_PushName(ctx
->Exec
, (name
));
3888 static void GLAPIENTRY
3889 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3891 GET_CURRENT_CONTEXT(ctx
);
3893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3894 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3901 if (ctx
->ExecuteFlag
) {
3902 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3906 static void GLAPIENTRY
3907 save_RasterPos2d(GLdouble x
, GLdouble y
)
3909 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3912 static void GLAPIENTRY
3913 save_RasterPos2f(GLfloat x
, GLfloat y
)
3915 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3918 static void GLAPIENTRY
3919 save_RasterPos2i(GLint x
, GLint y
)
3921 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3924 static void GLAPIENTRY
3925 save_RasterPos2s(GLshort x
, GLshort y
)
3927 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3930 static void GLAPIENTRY
3931 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3933 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3936 static void GLAPIENTRY
3937 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3939 save_RasterPos4f(x
, y
, z
, 1.0F
);
3942 static void GLAPIENTRY
3943 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3945 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3948 static void GLAPIENTRY
3949 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3951 save_RasterPos4f(x
, y
, z
, 1.0F
);
3954 static void GLAPIENTRY
3955 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3957 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3960 static void GLAPIENTRY
3961 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3963 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3966 static void GLAPIENTRY
3967 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3969 save_RasterPos4f(x
, y
, z
, w
);
3972 static void GLAPIENTRY
3973 save_RasterPos2dv(const GLdouble
* v
)
3975 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3978 static void GLAPIENTRY
3979 save_RasterPos2fv(const GLfloat
* v
)
3981 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3984 static void GLAPIENTRY
3985 save_RasterPos2iv(const GLint
* v
)
3987 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3990 static void GLAPIENTRY
3991 save_RasterPos2sv(const GLshort
* v
)
3993 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3996 static void GLAPIENTRY
3997 save_RasterPos3dv(const GLdouble
* v
)
3999 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4002 static void GLAPIENTRY
4003 save_RasterPos3fv(const GLfloat
* v
)
4005 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4008 static void GLAPIENTRY
4009 save_RasterPos3iv(const GLint
* v
)
4011 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4014 static void GLAPIENTRY
4015 save_RasterPos3sv(const GLshort
* v
)
4017 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4020 static void GLAPIENTRY
4021 save_RasterPos4dv(const GLdouble
* v
)
4023 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4024 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4027 static void GLAPIENTRY
4028 save_RasterPos4fv(const GLfloat
* v
)
4030 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4033 static void GLAPIENTRY
4034 save_RasterPos4iv(const GLint
* v
)
4036 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4037 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4040 static void GLAPIENTRY
4041 save_RasterPos4sv(const GLshort
* v
)
4043 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4047 static void GLAPIENTRY
4048 save_PassThrough(GLfloat token
)
4050 GET_CURRENT_CONTEXT(ctx
);
4052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4053 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4057 if (ctx
->ExecuteFlag
) {
4058 CALL_PassThrough(ctx
->Exec
, (token
));
4063 static void GLAPIENTRY
4064 save_ReadBuffer(GLenum mode
)
4066 GET_CURRENT_CONTEXT(ctx
);
4068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4069 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4073 if (ctx
->ExecuteFlag
) {
4074 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4079 static void GLAPIENTRY
4080 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4082 GET_CURRENT_CONTEXT(ctx
);
4084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4085 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4092 if (ctx
->ExecuteFlag
) {
4093 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4098 static void GLAPIENTRY
4099 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4101 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4105 static void GLAPIENTRY
4106 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4108 GET_CURRENT_CONTEXT(ctx
);
4110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4111 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4117 if (ctx
->ExecuteFlag
) {
4118 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4123 static void GLAPIENTRY
4124 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4126 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4130 static void GLAPIENTRY
4131 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4133 GET_CURRENT_CONTEXT(ctx
);
4135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4136 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4143 if (ctx
->ExecuteFlag
) {
4144 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4149 static void GLAPIENTRY
4150 save_ShadeModel(GLenum mode
)
4152 GET_CURRENT_CONTEXT(ctx
);
4154 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4156 if (ctx
->ExecuteFlag
) {
4157 CALL_ShadeModel(ctx
->Exec
, (mode
));
4160 /* Don't compile this call if it's a no-op.
4161 * By avoiding this state change we have a better chance of
4162 * coalescing subsequent drawing commands into one batch.
4164 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4167 SAVE_FLUSH_VERTICES(ctx
);
4169 ctx
->ListState
.Current
.ShadeModel
= mode
;
4171 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4178 static void GLAPIENTRY
4179 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4181 GET_CURRENT_CONTEXT(ctx
);
4183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4184 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4190 if (ctx
->ExecuteFlag
) {
4191 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4196 static void GLAPIENTRY
4197 save_StencilMask(GLuint mask
)
4199 GET_CURRENT_CONTEXT(ctx
);
4201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4202 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4206 if (ctx
->ExecuteFlag
) {
4207 CALL_StencilMask(ctx
->Exec
, (mask
));
4212 static void GLAPIENTRY
4213 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4215 GET_CURRENT_CONTEXT(ctx
);
4217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4218 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4224 if (ctx
->ExecuteFlag
) {
4225 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4230 static void GLAPIENTRY
4231 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4233 GET_CURRENT_CONTEXT(ctx
);
4235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4236 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4243 if (ctx
->ExecuteFlag
) {
4244 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4249 static void GLAPIENTRY
4250 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4253 GET_CURRENT_CONTEXT(ctx
);
4255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4257 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4265 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4272 if (ctx
->ExecuteFlag
) {
4273 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4274 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4279 static void GLAPIENTRY
4280 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4282 GET_CURRENT_CONTEXT(ctx
);
4284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4285 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4290 if (ctx
->ExecuteFlag
) {
4291 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4296 static void GLAPIENTRY
4297 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4299 GET_CURRENT_CONTEXT(ctx
);
4301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4302 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4309 if (ctx
->ExecuteFlag
) {
4310 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4315 static void GLAPIENTRY
4316 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4318 GET_CURRENT_CONTEXT(ctx
);
4320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4321 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4325 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4333 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4336 if (ctx
->ExecuteFlag
) {
4337 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4342 static void GLAPIENTRY
4343 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4346 parray
[0] = (GLfloat
) param
;
4347 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4348 save_TexEnvfv(target
, pname
, parray
);
4352 static void GLAPIENTRY
4353 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4356 p
[0] = (GLfloat
) param
;
4357 p
[1] = p
[2] = p
[3] = 0.0F
;
4358 save_TexEnvfv(target
, pname
, p
);
4362 static void GLAPIENTRY
4363 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4366 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4367 p
[0] = INT_TO_FLOAT(param
[0]);
4368 p
[1] = INT_TO_FLOAT(param
[1]);
4369 p
[2] = INT_TO_FLOAT(param
[2]);
4370 p
[3] = INT_TO_FLOAT(param
[3]);
4373 p
[0] = (GLfloat
) param
[0];
4374 p
[1] = p
[2] = p
[3] = 0.0F
;
4376 save_TexEnvfv(target
, pname
, p
);
4380 static void GLAPIENTRY
4381 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4383 GET_CURRENT_CONTEXT(ctx
);
4385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4386 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4395 if (ctx
->ExecuteFlag
) {
4396 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4401 static void GLAPIENTRY
4402 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4405 p
[0] = (GLfloat
) params
[0];
4406 p
[1] = (GLfloat
) params
[1];
4407 p
[2] = (GLfloat
) params
[2];
4408 p
[3] = (GLfloat
) params
[3];
4409 save_TexGenfv(coord
, pname
, p
);
4413 static void GLAPIENTRY
4414 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4417 parray
[0] = (GLfloat
) param
;
4418 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4419 save_TexGenfv(coord
, pname
, parray
);
4423 static void GLAPIENTRY
4424 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4427 p
[0] = (GLfloat
) params
[0];
4428 p
[1] = (GLfloat
) params
[1];
4429 p
[2] = (GLfloat
) params
[2];
4430 p
[3] = (GLfloat
) params
[3];
4431 save_TexGenfv(coord
, pname
, p
);
4435 static void GLAPIENTRY
4436 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4440 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4441 save_TexGenfv(coord
, pname
, parray
);
4445 static void GLAPIENTRY
4446 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4450 parray
[1] = parray
[2] = parray
[3] = 0;
4451 save_TexGeniv(coord
, pname
, parray
);
4455 static void GLAPIENTRY
4456 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4458 GET_CURRENT_CONTEXT(ctx
);
4460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4461 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4470 if (ctx
->ExecuteFlag
) {
4471 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4476 static void GLAPIENTRY
4477 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4481 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4482 save_TexParameterfv(target
, pname
, parray
);
4486 static void GLAPIENTRY
4487 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4490 fparam
[0] = (GLfloat
) param
;
4491 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4492 save_TexParameterfv(target
, pname
, fparam
);
4496 static void GLAPIENTRY
4497 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4500 fparam
[0] = (GLfloat
) params
[0];
4501 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4502 save_TexParameterfv(target
, pname
, fparam
);
4506 static void GLAPIENTRY
4507 save_TexImage1D(GLenum target
,
4508 GLint level
, GLint components
,
4509 GLsizei width
, GLint border
,
4510 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4512 GET_CURRENT_CONTEXT(ctx
);
4513 if (target
== GL_PROXY_TEXTURE_1D
) {
4514 /* don't compile, execute immediately */
4515 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4516 border
, format
, type
, pixels
));
4520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4521 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4525 n
[3].i
= components
;
4526 n
[4].i
= (GLint
) width
;
4531 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4532 pixels
, &ctx
->Unpack
));
4534 if (ctx
->ExecuteFlag
) {
4535 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4536 border
, format
, type
, pixels
));
4542 static void GLAPIENTRY
4543 save_TexImage2D(GLenum target
,
4544 GLint level
, GLint components
,
4545 GLsizei width
, GLsizei height
, GLint border
,
4546 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4548 GET_CURRENT_CONTEXT(ctx
);
4549 if (target
== GL_PROXY_TEXTURE_2D
) {
4550 /* don't compile, execute immediately */
4551 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4552 height
, border
, format
, type
, pixels
));
4556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4557 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4561 n
[3].i
= components
;
4562 n
[4].i
= (GLint
) width
;
4563 n
[5].i
= (GLint
) height
;
4568 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4569 pixels
, &ctx
->Unpack
));
4571 if (ctx
->ExecuteFlag
) {
4572 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4573 height
, border
, format
, type
, pixels
));
4579 static void GLAPIENTRY
4580 save_TexImage3D(GLenum target
,
4581 GLint level
, GLint internalFormat
,
4582 GLsizei width
, GLsizei height
, GLsizei depth
,
4584 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4586 GET_CURRENT_CONTEXT(ctx
);
4587 if (target
== GL_PROXY_TEXTURE_3D
) {
4588 /* don't compile, execute immediately */
4589 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4590 height
, depth
, border
, format
, type
,
4595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4596 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4600 n
[3].i
= (GLint
) internalFormat
;
4601 n
[4].i
= (GLint
) width
;
4602 n
[5].i
= (GLint
) height
;
4603 n
[6].i
= (GLint
) depth
;
4607 save_pointer(&n
[10],
4608 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4609 pixels
, &ctx
->Unpack
));
4611 if (ctx
->ExecuteFlag
) {
4612 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4613 height
, depth
, border
, format
, type
,
4620 static void GLAPIENTRY
4621 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4622 GLsizei width
, GLenum format
, GLenum type
,
4623 const GLvoid
* pixels
)
4625 GET_CURRENT_CONTEXT(ctx
);
4628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4630 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4635 n
[4].i
= (GLint
) width
;
4639 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4640 pixels
, &ctx
->Unpack
));
4642 if (ctx
->ExecuteFlag
) {
4643 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4644 format
, type
, pixels
));
4649 static void GLAPIENTRY
4650 save_TexSubImage2D(GLenum target
, GLint level
,
4651 GLint xoffset
, GLint yoffset
,
4652 GLsizei width
, GLsizei height
,
4653 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4655 GET_CURRENT_CONTEXT(ctx
);
4658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4666 n
[5].i
= (GLint
) width
;
4667 n
[6].i
= (GLint
) height
;
4671 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4672 pixels
, &ctx
->Unpack
));
4674 if (ctx
->ExecuteFlag
) {
4675 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4676 width
, height
, format
, type
, pixels
));
4681 static void GLAPIENTRY
4682 save_TexSubImage3D(GLenum target
, GLint level
,
4683 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4684 GLsizei width
, GLsizei height
, GLsizei depth
,
4685 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4687 GET_CURRENT_CONTEXT(ctx
);
4690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4692 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4699 n
[6].i
= (GLint
) width
;
4700 n
[7].i
= (GLint
) height
;
4701 n
[8].i
= (GLint
) depth
;
4704 save_pointer(&n
[11],
4705 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4706 pixels
, &ctx
->Unpack
));
4708 if (ctx
->ExecuteFlag
) {
4709 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4710 xoffset
, yoffset
, zoffset
,
4711 width
, height
, depth
, format
, type
,
4717 static void GLAPIENTRY
4718 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4720 GET_CURRENT_CONTEXT(ctx
);
4722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4723 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4729 if (ctx
->ExecuteFlag
) {
4730 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4735 static void GLAPIENTRY
4736 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4738 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4743 static void GLAPIENTRY
4744 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4746 GET_CURRENT_CONTEXT(ctx
);
4748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4749 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4753 n
[3].i
= (GLint
) width
;
4754 n
[4].i
= (GLint
) height
;
4756 if (ctx
->ExecuteFlag
) {
4757 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4761 static void GLAPIENTRY
4762 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4765 GET_CURRENT_CONTEXT(ctx
);
4767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4768 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4776 if (ctx
->ExecuteFlag
) {
4777 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4781 static void GLAPIENTRY
4782 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4784 GET_CURRENT_CONTEXT(ctx
);
4786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4787 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4795 if (ctx
->ExecuteFlag
) {
4796 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4800 static void GLAPIENTRY
4801 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4803 GET_CURRENT_CONTEXT(ctx
);
4805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4806 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4810 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4812 if (ctx
->ExecuteFlag
) {
4813 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4817 static void GLAPIENTRY
4818 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4821 GET_CURRENT_CONTEXT(ctx
);
4823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4824 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4832 if (ctx
->ExecuteFlag
) {
4833 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4837 static void GLAPIENTRY
4838 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4840 GET_CURRENT_CONTEXT(ctx
);
4842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4843 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4851 if (ctx
->ExecuteFlag
) {
4852 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4856 static void GLAPIENTRY
4857 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4859 GET_CURRENT_CONTEXT(ctx
);
4861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4862 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4866 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4868 if (ctx
->ExecuteFlag
) {
4869 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4873 static void GLAPIENTRY
4874 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4876 GET_CURRENT_CONTEXT(ctx
);
4878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4879 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4882 /* Mesa stores these as floats internally so we deliberately convert
4883 * them to a float here.
4888 if (ctx
->ExecuteFlag
) {
4889 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4893 static void GLAPIENTRY
4894 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4896 GET_CURRENT_CONTEXT(ctx
);
4898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4899 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4903 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4905 if (ctx
->ExecuteFlag
) {
4906 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4910 static void GLAPIENTRY
4911 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4913 GET_CURRENT_CONTEXT(ctx
);
4915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4916 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4923 if (ctx
->ExecuteFlag
) {
4924 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4928 static void GLAPIENTRY
4929 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4931 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4934 static void GLAPIENTRY
4935 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4937 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4940 static void GLAPIENTRY
4941 save_WindowPos2iMESA(GLint x
, GLint y
)
4943 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4946 static void GLAPIENTRY
4947 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4949 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4952 static void GLAPIENTRY
4953 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4955 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4958 static void GLAPIENTRY
4959 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4961 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4964 static void GLAPIENTRY
4965 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4967 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4970 static void GLAPIENTRY
4971 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4973 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4976 static void GLAPIENTRY
4977 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4979 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4982 static void GLAPIENTRY
4983 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4985 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4988 static void GLAPIENTRY
4989 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4991 save_WindowPos4fMESA(x
, y
, z
, w
);
4994 static void GLAPIENTRY
4995 save_WindowPos2dvMESA(const GLdouble
* v
)
4997 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5000 static void GLAPIENTRY
5001 save_WindowPos2fvMESA(const GLfloat
* v
)
5003 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5006 static void GLAPIENTRY
5007 save_WindowPos2ivMESA(const GLint
* v
)
5009 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5012 static void GLAPIENTRY
5013 save_WindowPos2svMESA(const GLshort
* v
)
5015 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5018 static void GLAPIENTRY
5019 save_WindowPos3dvMESA(const GLdouble
* v
)
5021 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5024 static void GLAPIENTRY
5025 save_WindowPos3fvMESA(const GLfloat
* v
)
5027 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5030 static void GLAPIENTRY
5031 save_WindowPos3ivMESA(const GLint
* v
)
5033 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5036 static void GLAPIENTRY
5037 save_WindowPos3svMESA(const GLshort
* v
)
5039 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5042 static void GLAPIENTRY
5043 save_WindowPos4dvMESA(const GLdouble
* v
)
5045 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5046 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5049 static void GLAPIENTRY
5050 save_WindowPos4fvMESA(const GLfloat
* v
)
5052 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5055 static void GLAPIENTRY
5056 save_WindowPos4ivMESA(const GLint
* v
)
5058 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5059 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5062 static void GLAPIENTRY
5063 save_WindowPos4svMESA(const GLshort
* v
)
5065 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5070 /* GL_ARB_multitexture */
5071 static void GLAPIENTRY
5072 save_ActiveTextureARB(GLenum target
)
5074 GET_CURRENT_CONTEXT(ctx
);
5076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5077 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5081 if (ctx
->ExecuteFlag
) {
5082 CALL_ActiveTexture(ctx
->Exec
, (target
));
5087 /* GL_ARB_transpose_matrix */
5089 static void GLAPIENTRY
5090 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5093 _math_transposefd(tm
, m
);
5094 save_LoadMatrixf(tm
);
5098 static void GLAPIENTRY
5099 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5102 _math_transposef(tm
, m
);
5103 save_LoadMatrixf(tm
);
5107 static void GLAPIENTRY
5108 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5111 _math_transposefd(tm
, m
);
5112 save_MultMatrixf(tm
);
5116 static void GLAPIENTRY
5117 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5120 _math_transposef(tm
, m
);
5121 save_MultMatrixf(tm
);
5124 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5126 GET_CURRENT_CONTEXT(ctx
);
5132 image
= malloc(size
);
5134 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5137 memcpy(image
, data
, size
);
5143 /* GL_ARB_texture_compression */
5144 static void GLAPIENTRY
5145 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5146 GLenum internalFormat
, GLsizei width
,
5147 GLint border
, GLsizei imageSize
,
5148 const GLvoid
* data
)
5150 GET_CURRENT_CONTEXT(ctx
);
5151 if (target
== GL_PROXY_TEXTURE_1D
) {
5152 /* don't compile, execute immediately */
5153 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5154 width
, border
, imageSize
,
5159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5161 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5162 6 + POINTER_DWORDS
);
5166 n
[3].e
= internalFormat
;
5167 n
[4].i
= (GLint
) width
;
5171 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5173 if (ctx
->ExecuteFlag
) {
5174 CALL_CompressedTexImage1D(ctx
->Exec
,
5175 (target
, level
, internalFormat
, width
,
5176 border
, imageSize
, data
));
5182 static void GLAPIENTRY
5183 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5184 GLenum internalFormat
, GLsizei width
,
5185 GLsizei height
, GLint border
, GLsizei imageSize
,
5186 const GLvoid
* data
)
5188 GET_CURRENT_CONTEXT(ctx
);
5189 if (target
== GL_PROXY_TEXTURE_2D
) {
5190 /* don't compile, execute immediately */
5191 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5192 width
, height
, border
,
5197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5199 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5200 7 + POINTER_DWORDS
);
5204 n
[3].e
= internalFormat
;
5205 n
[4].i
= (GLint
) width
;
5206 n
[5].i
= (GLint
) height
;
5210 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5212 if (ctx
->ExecuteFlag
) {
5213 CALL_CompressedTexImage2D(ctx
->Exec
,
5214 (target
, level
, internalFormat
, width
,
5215 height
, border
, imageSize
, data
));
5221 static void GLAPIENTRY
5222 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5223 GLenum internalFormat
, GLsizei width
,
5224 GLsizei height
, GLsizei depth
, GLint border
,
5225 GLsizei imageSize
, const GLvoid
* data
)
5227 GET_CURRENT_CONTEXT(ctx
);
5228 if (target
== GL_PROXY_TEXTURE_3D
) {
5229 /* don't compile, execute immediately */
5230 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5231 width
, height
, depth
, border
,
5236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5238 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5239 8 + POINTER_DWORDS
);
5243 n
[3].e
= internalFormat
;
5244 n
[4].i
= (GLint
) width
;
5245 n
[5].i
= (GLint
) height
;
5246 n
[6].i
= (GLint
) depth
;
5250 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5252 if (ctx
->ExecuteFlag
) {
5253 CALL_CompressedTexImage3D(ctx
->Exec
,
5254 (target
, level
, internalFormat
, width
,
5255 height
, depth
, border
, imageSize
,
5262 static void GLAPIENTRY
5263 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5264 GLsizei width
, GLenum format
,
5265 GLsizei imageSize
, const GLvoid
* data
)
5268 GET_CURRENT_CONTEXT(ctx
);
5269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5271 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5272 6 + POINTER_DWORDS
);
5277 n
[4].i
= (GLint
) width
;
5281 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5283 if (ctx
->ExecuteFlag
) {
5284 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5285 width
, format
, imageSize
,
5291 static void GLAPIENTRY
5292 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5293 GLint yoffset
, GLsizei width
, GLsizei height
,
5294 GLenum format
, GLsizei imageSize
,
5295 const GLvoid
* data
)
5298 GET_CURRENT_CONTEXT(ctx
);
5299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5301 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5302 8 + POINTER_DWORDS
);
5308 n
[5].i
= (GLint
) width
;
5309 n
[6].i
= (GLint
) height
;
5313 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5315 if (ctx
->ExecuteFlag
) {
5316 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5317 (target
, level
, xoffset
, yoffset
, width
,
5318 height
, format
, imageSize
, data
));
5323 static void GLAPIENTRY
5324 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5325 GLint yoffset
, GLint zoffset
, GLsizei width
,
5326 GLsizei height
, GLsizei depth
, GLenum format
,
5327 GLsizei imageSize
, const GLvoid
* data
)
5330 GET_CURRENT_CONTEXT(ctx
);
5331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5333 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5334 10 + POINTER_DWORDS
);
5341 n
[6].i
= (GLint
) width
;
5342 n
[7].i
= (GLint
) height
;
5343 n
[8].i
= (GLint
) depth
;
5345 n
[10].i
= imageSize
;
5346 save_pointer(&n
[11],
5347 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5349 if (ctx
->ExecuteFlag
) {
5350 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5351 (target
, level
, xoffset
, yoffset
,
5352 zoffset
, width
, height
, depth
, format
,
5358 /* GL_ARB_multisample */
5359 static void GLAPIENTRY
5360 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5362 GET_CURRENT_CONTEXT(ctx
);
5364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5365 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5370 if (ctx
->ExecuteFlag
) {
5371 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5377 * GL_ARB_vertex_program
5379 static void GLAPIENTRY
5380 save_BindProgramARB(GLenum target
, GLuint id
)
5382 GET_CURRENT_CONTEXT(ctx
);
5384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5385 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5390 if (ctx
->ExecuteFlag
) {
5391 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5395 static void GLAPIENTRY
5396 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5397 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5399 GET_CURRENT_CONTEXT(ctx
);
5401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5402 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5411 if (ctx
->ExecuteFlag
) {
5412 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5417 static void GLAPIENTRY
5418 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5419 const GLfloat
*params
)
5421 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5422 params
[2], params
[3]);
5426 static void GLAPIENTRY
5427 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5428 const GLfloat
* params
)
5430 GET_CURRENT_CONTEXT(ctx
);
5432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5436 const GLfloat
* p
= params
;
5438 for (i
= 0 ; i
< count
; i
++) {
5439 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5452 if (ctx
->ExecuteFlag
) {
5453 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5458 static void GLAPIENTRY
5459 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5460 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5462 save_ProgramEnvParameter4fARB(target
, index
,
5464 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5468 static void GLAPIENTRY
5469 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5470 const GLdouble
*params
)
5472 save_ProgramEnvParameter4fARB(target
, index
,
5473 (GLfloat
) params
[0],
5474 (GLfloat
) params
[1],
5475 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5479 static void GLAPIENTRY
5480 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5481 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5483 GET_CURRENT_CONTEXT(ctx
);
5485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5486 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5495 if (ctx
->ExecuteFlag
) {
5496 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5501 static void GLAPIENTRY
5502 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5503 const GLfloat
*params
)
5505 GET_CURRENT_CONTEXT(ctx
);
5507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5508 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5517 if (ctx
->ExecuteFlag
) {
5518 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5523 static void GLAPIENTRY
5524 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5525 const GLfloat
*params
)
5527 GET_CURRENT_CONTEXT(ctx
);
5529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5533 const GLfloat
* p
= params
;
5535 for (i
= 0 ; i
< count
; i
++) {
5536 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5549 if (ctx
->ExecuteFlag
) {
5550 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5555 static void GLAPIENTRY
5556 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5557 GLdouble x
, GLdouble y
,
5558 GLdouble z
, GLdouble w
)
5560 GET_CURRENT_CONTEXT(ctx
);
5562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5563 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5567 n
[3].f
= (GLfloat
) x
;
5568 n
[4].f
= (GLfloat
) y
;
5569 n
[5].f
= (GLfloat
) z
;
5570 n
[6].f
= (GLfloat
) w
;
5572 if (ctx
->ExecuteFlag
) {
5573 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5578 static void GLAPIENTRY
5579 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5580 const GLdouble
*params
)
5582 GET_CURRENT_CONTEXT(ctx
);
5584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5585 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5589 n
[3].f
= (GLfloat
) params
[0];
5590 n
[4].f
= (GLfloat
) params
[1];
5591 n
[5].f
= (GLfloat
) params
[2];
5592 n
[6].f
= (GLfloat
) params
[3];
5594 if (ctx
->ExecuteFlag
) {
5595 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5600 /* GL_EXT_stencil_two_side */
5601 static void GLAPIENTRY
5602 save_ActiveStencilFaceEXT(GLenum face
)
5604 GET_CURRENT_CONTEXT(ctx
);
5606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5607 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5611 if (ctx
->ExecuteFlag
) {
5612 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5617 /* GL_EXT_depth_bounds_test */
5618 static void GLAPIENTRY
5619 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5621 GET_CURRENT_CONTEXT(ctx
);
5623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5624 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5626 n
[1].f
= (GLfloat
) zmin
;
5627 n
[2].f
= (GLfloat
) zmax
;
5629 if (ctx
->ExecuteFlag
) {
5630 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5636 static void GLAPIENTRY
5637 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5638 const GLvoid
* string
)
5640 GET_CURRENT_CONTEXT(ctx
);
5643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5645 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5647 GLubyte
*programCopy
= malloc(len
);
5649 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5652 memcpy(programCopy
, string
, len
);
5656 save_pointer(&n
[4], programCopy
);
5658 if (ctx
->ExecuteFlag
) {
5659 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5664 static void GLAPIENTRY
5665 save_BeginQueryARB(GLenum target
, GLuint id
)
5667 GET_CURRENT_CONTEXT(ctx
);
5669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5670 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5675 if (ctx
->ExecuteFlag
) {
5676 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5680 static void GLAPIENTRY
5681 save_EndQueryARB(GLenum target
)
5683 GET_CURRENT_CONTEXT(ctx
);
5685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5686 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_EndQuery(ctx
->Exec
, (target
));
5695 static void GLAPIENTRY
5696 save_QueryCounter(GLuint id
, GLenum target
)
5698 GET_CURRENT_CONTEXT(ctx
);
5700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5701 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5706 if (ctx
->ExecuteFlag
) {
5707 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5711 static void GLAPIENTRY
5712 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5714 GET_CURRENT_CONTEXT(ctx
);
5716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5717 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5723 if (ctx
->ExecuteFlag
) {
5724 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5728 static void GLAPIENTRY
5729 save_EndQueryIndexed(GLenum target
, GLuint index
)
5731 GET_CURRENT_CONTEXT(ctx
);
5733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5734 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5739 if (ctx
->ExecuteFlag
) {
5740 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5745 static void GLAPIENTRY
5746 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5748 GET_CURRENT_CONTEXT(ctx
);
5750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5751 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5755 if (count
> MAX_DRAW_BUFFERS
)
5756 count
= MAX_DRAW_BUFFERS
;
5757 for (i
= 0; i
< count
; i
++) {
5758 n
[2 + i
].e
= buffers
[i
];
5761 if (ctx
->ExecuteFlag
) {
5762 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5766 static void GLAPIENTRY
5767 save_BindFragmentShaderATI(GLuint id
)
5769 GET_CURRENT_CONTEXT(ctx
);
5772 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5776 if (ctx
->ExecuteFlag
) {
5777 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5781 static void GLAPIENTRY
5782 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5784 GET_CURRENT_CONTEXT(ctx
);
5787 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5795 if (ctx
->ExecuteFlag
) {
5796 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5800 static void GLAPIENTRY
5801 save_Attr1fNV(GLenum attr
, GLfloat x
)
5803 GET_CURRENT_CONTEXT(ctx
);
5805 SAVE_FLUSH_VERTICES(ctx
);
5806 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5812 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5813 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5814 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5816 if (ctx
->ExecuteFlag
) {
5817 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5821 static void GLAPIENTRY
5822 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5824 GET_CURRENT_CONTEXT(ctx
);
5826 SAVE_FLUSH_VERTICES(ctx
);
5827 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5834 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5835 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5836 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5838 if (ctx
->ExecuteFlag
) {
5839 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5843 static void GLAPIENTRY
5844 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5846 GET_CURRENT_CONTEXT(ctx
);
5848 SAVE_FLUSH_VERTICES(ctx
);
5849 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5857 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5858 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5859 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5861 if (ctx
->ExecuteFlag
) {
5862 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5866 static void GLAPIENTRY
5867 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5869 GET_CURRENT_CONTEXT(ctx
);
5871 SAVE_FLUSH_VERTICES(ctx
);
5872 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5881 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5882 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5883 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5885 if (ctx
->ExecuteFlag
) {
5886 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5891 static void GLAPIENTRY
5892 save_Attr1fARB(GLenum attr
, GLfloat x
)
5894 GET_CURRENT_CONTEXT(ctx
);
5896 SAVE_FLUSH_VERTICES(ctx
);
5897 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5903 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5904 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5905 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5907 if (ctx
->ExecuteFlag
) {
5908 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5912 static void GLAPIENTRY
5913 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5915 GET_CURRENT_CONTEXT(ctx
);
5917 SAVE_FLUSH_VERTICES(ctx
);
5918 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5925 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5926 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5927 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5929 if (ctx
->ExecuteFlag
) {
5930 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5934 static void GLAPIENTRY
5935 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5937 GET_CURRENT_CONTEXT(ctx
);
5939 SAVE_FLUSH_VERTICES(ctx
);
5940 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5948 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5949 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5950 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5952 if (ctx
->ExecuteFlag
) {
5953 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5957 static void GLAPIENTRY
5958 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5960 GET_CURRENT_CONTEXT(ctx
);
5962 SAVE_FLUSH_VERTICES(ctx
);
5963 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5972 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5973 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5974 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5976 if (ctx
->ExecuteFlag
) {
5977 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5982 static void GLAPIENTRY
5983 save_EvalCoord1f(GLfloat x
)
5985 GET_CURRENT_CONTEXT(ctx
);
5987 SAVE_FLUSH_VERTICES(ctx
);
5988 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5992 if (ctx
->ExecuteFlag
) {
5993 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5997 static void GLAPIENTRY
5998 save_EvalCoord1fv(const GLfloat
* v
)
6000 save_EvalCoord1f(v
[0]);
6003 static void GLAPIENTRY
6004 save_EvalCoord2f(GLfloat x
, GLfloat y
)
6006 GET_CURRENT_CONTEXT(ctx
);
6008 SAVE_FLUSH_VERTICES(ctx
);
6009 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
6014 if (ctx
->ExecuteFlag
) {
6015 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
6019 static void GLAPIENTRY
6020 save_EvalCoord2fv(const GLfloat
* v
)
6022 save_EvalCoord2f(v
[0], v
[1]);
6026 static void GLAPIENTRY
6027 save_EvalPoint1(GLint x
)
6029 GET_CURRENT_CONTEXT(ctx
);
6031 SAVE_FLUSH_VERTICES(ctx
);
6032 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6036 if (ctx
->ExecuteFlag
) {
6037 CALL_EvalPoint1(ctx
->Exec
, (x
));
6041 static void GLAPIENTRY
6042 save_EvalPoint2(GLint x
, GLint y
)
6044 GET_CURRENT_CONTEXT(ctx
);
6046 SAVE_FLUSH_VERTICES(ctx
);
6047 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6052 if (ctx
->ExecuteFlag
) {
6053 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6057 static void GLAPIENTRY
6058 save_Indexf(GLfloat x
)
6060 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6063 static void GLAPIENTRY
6064 save_Indexfv(const GLfloat
* v
)
6066 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6069 static void GLAPIENTRY
6070 save_EdgeFlag(GLboolean x
)
6072 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6077 * Compare 'count' elements of vectors 'a' and 'b'.
6078 * \return GL_TRUE if equal, GL_FALSE if different.
6080 static inline GLboolean
6081 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6083 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6088 * This glMaterial function is used for glMaterial calls that are outside
6089 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6091 static void GLAPIENTRY
6092 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6094 GET_CURRENT_CONTEXT(ctx
);
6102 case GL_FRONT_AND_BACK
:
6105 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6114 case GL_AMBIENT_AND_DIFFUSE
:
6120 case GL_COLOR_INDEXES
:
6124 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6128 if (ctx
->ExecuteFlag
) {
6129 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6132 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6134 /* Try to eliminate redundant statechanges. Because it is legal to
6135 * call glMaterial even inside begin/end calls, don't need to worry
6136 * about ctx->Driver.CurrentSavePrimitive here.
6138 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6139 if (bitmask
& (1 << i
)) {
6140 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6141 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6142 /* no change in material value */
6143 bitmask
&= ~(1 << i
);
6146 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6147 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6152 /* If this call has no effect, return early */
6156 SAVE_FLUSH_VERTICES(ctx
);
6158 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6162 for (i
= 0; i
< args
; i
++)
6163 n
[3 + i
].f
= param
[i
];
6167 static void GLAPIENTRY
6168 save_Begin(GLenum mode
)
6170 GET_CURRENT_CONTEXT(ctx
);
6172 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6173 /* compile this error into the display list */
6174 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6176 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6177 /* compile this error into the display list */
6178 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6181 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6183 vbo_save_NotifyBegin(ctx
, mode
, false);
6187 static void GLAPIENTRY
6190 GET_CURRENT_CONTEXT(ctx
);
6191 SAVE_FLUSH_VERTICES(ctx
);
6192 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6193 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6194 if (ctx
->ExecuteFlag
) {
6195 CALL_End(ctx
->Exec
, ());
6199 static void GLAPIENTRY
6200 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6202 GET_CURRENT_CONTEXT(ctx
);
6204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6205 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6212 if (ctx
->ExecuteFlag
) {
6213 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6218 static void GLAPIENTRY
6219 save_Vertex2f(GLfloat x
, GLfloat y
)
6221 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6224 static void GLAPIENTRY
6225 save_Vertex2fv(const GLfloat
* v
)
6227 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6230 static void GLAPIENTRY
6231 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6233 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6236 static void GLAPIENTRY
6237 save_Vertex3fv(const GLfloat
* v
)
6239 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6242 static void GLAPIENTRY
6243 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6245 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6248 static void GLAPIENTRY
6249 save_Vertex4fv(const GLfloat
* v
)
6251 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6254 static void GLAPIENTRY
6255 save_TexCoord1f(GLfloat x
)
6257 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6260 static void GLAPIENTRY
6261 save_TexCoord1fv(const GLfloat
* v
)
6263 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6266 static void GLAPIENTRY
6267 save_TexCoord2f(GLfloat x
, GLfloat y
)
6269 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6272 static void GLAPIENTRY
6273 save_TexCoord2fv(const GLfloat
* v
)
6275 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6278 static void GLAPIENTRY
6279 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6281 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6284 static void GLAPIENTRY
6285 save_TexCoord3fv(const GLfloat
* v
)
6287 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6290 static void GLAPIENTRY
6291 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6293 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6296 static void GLAPIENTRY
6297 save_TexCoord4fv(const GLfloat
* v
)
6299 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6302 static void GLAPIENTRY
6303 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6305 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6308 static void GLAPIENTRY
6309 save_Normal3fv(const GLfloat
* v
)
6311 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6314 static void GLAPIENTRY
6315 save_FogCoordfEXT(GLfloat x
)
6317 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6320 static void GLAPIENTRY
6321 save_FogCoordfvEXT(const GLfloat
* v
)
6323 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6326 static void GLAPIENTRY
6327 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6329 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6332 static void GLAPIENTRY
6333 save_Color3fv(const GLfloat
* v
)
6335 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6338 static void GLAPIENTRY
6339 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6341 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6344 static void GLAPIENTRY
6345 save_Color4fv(const GLfloat
* v
)
6347 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6350 static void GLAPIENTRY
6351 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6353 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6356 static void GLAPIENTRY
6357 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6359 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6363 /* Just call the respective ATTR for texcoord
6365 static void GLAPIENTRY
6366 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6368 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6369 save_Attr1fNV(attr
, x
);
6372 static void GLAPIENTRY
6373 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6375 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6376 save_Attr1fNV(attr
, v
[0]);
6379 static void GLAPIENTRY
6380 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6382 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6383 save_Attr2fNV(attr
, x
, y
);
6386 static void GLAPIENTRY
6387 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6389 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6390 save_Attr2fNV(attr
, v
[0], v
[1]);
6393 static void GLAPIENTRY
6394 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6396 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6397 save_Attr3fNV(attr
, x
, y
, z
);
6400 static void GLAPIENTRY
6401 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6403 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6404 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6407 static void GLAPIENTRY
6408 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6409 GLfloat z
, GLfloat w
)
6411 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6412 save_Attr4fNV(attr
, x
, y
, z
, w
);
6415 static void GLAPIENTRY
6416 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6418 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6419 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6424 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6430 GET_CURRENT_CONTEXT(ctx
);
6431 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6436 static void GLAPIENTRY
6437 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6439 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6440 save_Attr1fARB(index
, x
);
6445 static void GLAPIENTRY
6446 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6448 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6449 save_Attr1fARB(index
, v
[0]);
6454 static void GLAPIENTRY
6455 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6457 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6458 save_Attr2fARB(index
, x
, y
);
6463 static void GLAPIENTRY
6464 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6466 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6467 save_Attr2fARB(index
, v
[0], v
[1]);
6472 static void GLAPIENTRY
6473 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6475 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6476 save_Attr3fARB(index
, x
, y
, z
);
6481 static void GLAPIENTRY
6482 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6484 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6485 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6490 static void GLAPIENTRY
6491 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6494 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6495 save_Attr4fARB(index
, x
, y
, z
, w
);
6500 static void GLAPIENTRY
6501 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6503 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6504 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6509 static void GLAPIENTRY
6510 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6512 GET_CURRENT_CONTEXT(ctx
);
6514 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6516 SAVE_FLUSH_VERTICES(ctx
);
6517 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6520 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6523 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6524 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6526 if (ctx
->ExecuteFlag
) {
6527 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6534 static void GLAPIENTRY
6535 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6537 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6538 save_VertexAttribL1d(index
, v
[0]);
6543 static void GLAPIENTRY
6544 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6546 GET_CURRENT_CONTEXT(ctx
);
6548 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6550 SAVE_FLUSH_VERTICES(ctx
);
6551 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6554 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6555 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6558 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6559 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6560 2 * sizeof(GLdouble
));
6562 if (ctx
->ExecuteFlag
) {
6563 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6570 static void GLAPIENTRY
6571 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6573 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6574 save_VertexAttribL2d(index
, v
[0], v
[1]);
6579 static void GLAPIENTRY
6580 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6582 GET_CURRENT_CONTEXT(ctx
);
6584 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6586 SAVE_FLUSH_VERTICES(ctx
);
6587 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6590 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6591 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6592 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6595 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6596 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6597 3 * sizeof(GLdouble
));
6599 if (ctx
->ExecuteFlag
) {
6600 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6607 static void GLAPIENTRY
6608 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6610 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6611 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6616 static void GLAPIENTRY
6617 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6620 GET_CURRENT_CONTEXT(ctx
);
6622 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6624 SAVE_FLUSH_VERTICES(ctx
);
6625 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6628 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6629 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6630 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6631 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6634 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6635 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6636 4 * sizeof(GLdouble
));
6638 if (ctx
->ExecuteFlag
) {
6639 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6646 static void GLAPIENTRY
6647 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6649 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6650 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6655 static void GLAPIENTRY
6656 save_PrimitiveRestartNV(void)
6658 /* Note: this is used when outside a glBegin/End pair in a display list */
6659 GET_CURRENT_CONTEXT(ctx
);
6660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6661 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6662 if (ctx
->ExecuteFlag
) {
6663 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6668 static void GLAPIENTRY
6669 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6670 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6671 GLbitfield mask
, GLenum filter
)
6673 GET_CURRENT_CONTEXT(ctx
);
6675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6676 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6689 if (ctx
->ExecuteFlag
) {
6690 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6691 dstX0
, dstY0
, dstX1
, dstY1
,
6697 /** GL_EXT_provoking_vertex */
6698 static void GLAPIENTRY
6699 save_ProvokingVertexEXT(GLenum mode
)
6701 GET_CURRENT_CONTEXT(ctx
);
6703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6704 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6708 if (ctx
->ExecuteFlag
) {
6709 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6710 _mesa_ProvokingVertex(mode
);
6715 /** GL_EXT_transform_feedback */
6716 static void GLAPIENTRY
6717 save_BeginTransformFeedback(GLenum mode
)
6719 GET_CURRENT_CONTEXT(ctx
);
6721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6722 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6726 if (ctx
->ExecuteFlag
) {
6727 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6732 /** GL_EXT_transform_feedback */
6733 static void GLAPIENTRY
6734 save_EndTransformFeedback(void)
6736 GET_CURRENT_CONTEXT(ctx
);
6737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6738 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6739 if (ctx
->ExecuteFlag
) {
6740 CALL_EndTransformFeedback(ctx
->Exec
, ());
6744 static void GLAPIENTRY
6745 save_BindTransformFeedback(GLenum target
, GLuint name
)
6747 GET_CURRENT_CONTEXT(ctx
);
6749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6750 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6755 if (ctx
->ExecuteFlag
) {
6756 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6760 static void GLAPIENTRY
6761 save_PauseTransformFeedback(void)
6763 GET_CURRENT_CONTEXT(ctx
);
6764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6765 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6766 if (ctx
->ExecuteFlag
) {
6767 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6771 static void GLAPIENTRY
6772 save_ResumeTransformFeedback(void)
6774 GET_CURRENT_CONTEXT(ctx
);
6775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6776 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6777 if (ctx
->ExecuteFlag
) {
6778 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6782 static void GLAPIENTRY
6783 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6785 GET_CURRENT_CONTEXT(ctx
);
6787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6788 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6793 if (ctx
->ExecuteFlag
) {
6794 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6798 static void GLAPIENTRY
6799 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6801 GET_CURRENT_CONTEXT(ctx
);
6803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6804 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6810 if (ctx
->ExecuteFlag
) {
6811 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6815 static void GLAPIENTRY
6816 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6819 GET_CURRENT_CONTEXT(ctx
);
6821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6822 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6826 n
[3].si
= primcount
;
6828 if (ctx
->ExecuteFlag
) {
6829 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6833 static void GLAPIENTRY
6834 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6835 GLuint stream
, GLsizei primcount
)
6837 GET_CURRENT_CONTEXT(ctx
);
6839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6840 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6845 n
[4].si
= primcount
;
6847 if (ctx
->ExecuteFlag
) {
6848 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6853 static void GLAPIENTRY
6854 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6855 GLuint num_groups_z
)
6857 GET_CURRENT_CONTEXT(ctx
);
6859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6860 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6862 n
[1].ui
= num_groups_x
;
6863 n
[2].ui
= num_groups_y
;
6864 n
[3].ui
= num_groups_z
;
6866 if (ctx
->ExecuteFlag
) {
6867 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6872 static void GLAPIENTRY
6873 save_DispatchComputeIndirect(GLintptr indirect
)
6875 GET_CURRENT_CONTEXT(ctx
);
6876 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6877 "glDispatchComputeIndirect() during display list compile");
6880 static void GLAPIENTRY
6881 save_UseProgram(GLuint program
)
6883 GET_CURRENT_CONTEXT(ctx
);
6885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6886 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6890 if (ctx
->ExecuteFlag
) {
6891 CALL_UseProgram(ctx
->Exec
, (program
));
6896 static void GLAPIENTRY
6897 save_Uniform1fARB(GLint location
, GLfloat x
)
6899 GET_CURRENT_CONTEXT(ctx
);
6901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6902 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6907 if (ctx
->ExecuteFlag
) {
6908 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6913 static void GLAPIENTRY
6914 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6916 GET_CURRENT_CONTEXT(ctx
);
6918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6919 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6925 if (ctx
->ExecuteFlag
) {
6926 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6931 static void GLAPIENTRY
6932 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6934 GET_CURRENT_CONTEXT(ctx
);
6936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6937 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6944 if (ctx
->ExecuteFlag
) {
6945 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6950 static void GLAPIENTRY
6951 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6953 GET_CURRENT_CONTEXT(ctx
);
6955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6956 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6964 if (ctx
->ExecuteFlag
) {
6965 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6970 static void GLAPIENTRY
6971 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6973 GET_CURRENT_CONTEXT(ctx
);
6975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6976 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6980 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6982 if (ctx
->ExecuteFlag
) {
6983 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6987 static void GLAPIENTRY
6988 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6990 GET_CURRENT_CONTEXT(ctx
);
6992 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6993 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6997 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6999 if (ctx
->ExecuteFlag
) {
7000 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
7004 static void GLAPIENTRY
7005 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7007 GET_CURRENT_CONTEXT(ctx
);
7009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7010 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
7014 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7016 if (ctx
->ExecuteFlag
) {
7017 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7021 static void GLAPIENTRY
7022 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7024 GET_CURRENT_CONTEXT(ctx
);
7026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7027 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7031 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7033 if (ctx
->ExecuteFlag
) {
7034 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7039 static void GLAPIENTRY
7040 save_Uniform1d(GLint location
, GLdouble x
)
7042 GET_CURRENT_CONTEXT(ctx
);
7044 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7045 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7048 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7050 if (ctx
->ExecuteFlag
) {
7051 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7056 static void GLAPIENTRY
7057 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7059 GET_CURRENT_CONTEXT(ctx
);
7061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7062 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7065 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7066 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7068 if (ctx
->ExecuteFlag
) {
7069 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7074 static void GLAPIENTRY
7075 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7077 GET_CURRENT_CONTEXT(ctx
);
7079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7080 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7083 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7084 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7085 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7087 if (ctx
->ExecuteFlag
) {
7088 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7093 static void GLAPIENTRY
7094 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7096 GET_CURRENT_CONTEXT(ctx
);
7098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7099 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7102 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7103 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7104 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7105 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7107 if (ctx
->ExecuteFlag
) {
7108 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7113 static void GLAPIENTRY
7114 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7116 GET_CURRENT_CONTEXT(ctx
);
7118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7119 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7123 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7125 if (ctx
->ExecuteFlag
) {
7126 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7131 static void GLAPIENTRY
7132 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7134 GET_CURRENT_CONTEXT(ctx
);
7136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7137 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7141 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7143 if (ctx
->ExecuteFlag
) {
7144 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7149 static void GLAPIENTRY
7150 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7152 GET_CURRENT_CONTEXT(ctx
);
7154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7155 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7159 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7161 if (ctx
->ExecuteFlag
) {
7162 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7167 static void GLAPIENTRY
7168 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7170 GET_CURRENT_CONTEXT(ctx
);
7172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7173 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7177 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7179 if (ctx
->ExecuteFlag
) {
7180 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7185 static void GLAPIENTRY
7186 save_Uniform1iARB(GLint location
, GLint x
)
7188 GET_CURRENT_CONTEXT(ctx
);
7190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7191 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7196 if (ctx
->ExecuteFlag
) {
7197 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7201 static void GLAPIENTRY
7202 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7204 GET_CURRENT_CONTEXT(ctx
);
7206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7207 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7213 if (ctx
->ExecuteFlag
) {
7214 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7218 static void GLAPIENTRY
7219 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7221 GET_CURRENT_CONTEXT(ctx
);
7223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7224 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7231 if (ctx
->ExecuteFlag
) {
7232 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7236 static void GLAPIENTRY
7237 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7239 GET_CURRENT_CONTEXT(ctx
);
7241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7242 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7250 if (ctx
->ExecuteFlag
) {
7251 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7257 static void GLAPIENTRY
7258 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7260 GET_CURRENT_CONTEXT(ctx
);
7262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7263 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7267 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7269 if (ctx
->ExecuteFlag
) {
7270 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7274 static void GLAPIENTRY
7275 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7277 GET_CURRENT_CONTEXT(ctx
);
7279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7280 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7284 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7286 if (ctx
->ExecuteFlag
) {
7287 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7291 static void GLAPIENTRY
7292 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7294 GET_CURRENT_CONTEXT(ctx
);
7296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7297 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7301 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7303 if (ctx
->ExecuteFlag
) {
7304 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7308 static void GLAPIENTRY
7309 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7311 GET_CURRENT_CONTEXT(ctx
);
7313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7314 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7318 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7320 if (ctx
->ExecuteFlag
) {
7321 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7327 static void GLAPIENTRY
7328 save_Uniform1ui(GLint location
, GLuint x
)
7330 GET_CURRENT_CONTEXT(ctx
);
7332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7333 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7338 if (ctx
->ExecuteFlag
) {
7339 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7343 static void GLAPIENTRY
7344 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7346 GET_CURRENT_CONTEXT(ctx
);
7348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7349 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7355 if (ctx
->ExecuteFlag
) {
7356 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7360 static void GLAPIENTRY
7361 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7363 GET_CURRENT_CONTEXT(ctx
);
7365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7366 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7373 if (ctx
->ExecuteFlag
) {
7374 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7378 static void GLAPIENTRY
7379 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7381 GET_CURRENT_CONTEXT(ctx
);
7383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7384 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7392 if (ctx
->ExecuteFlag
) {
7393 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7399 static void GLAPIENTRY
7400 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7402 GET_CURRENT_CONTEXT(ctx
);
7404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7405 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7409 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7411 if (ctx
->ExecuteFlag
) {
7412 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7416 static void GLAPIENTRY
7417 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7419 GET_CURRENT_CONTEXT(ctx
);
7421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7422 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7426 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7428 if (ctx
->ExecuteFlag
) {
7429 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7433 static void GLAPIENTRY
7434 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7436 GET_CURRENT_CONTEXT(ctx
);
7438 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7439 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7443 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7445 if (ctx
->ExecuteFlag
) {
7446 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7450 static void GLAPIENTRY
7451 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7453 GET_CURRENT_CONTEXT(ctx
);
7455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7456 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7460 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7462 if (ctx
->ExecuteFlag
) {
7463 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7469 static void GLAPIENTRY
7470 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7473 GET_CURRENT_CONTEXT(ctx
);
7475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7476 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7481 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7483 if (ctx
->ExecuteFlag
) {
7484 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7488 static void GLAPIENTRY
7489 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7492 GET_CURRENT_CONTEXT(ctx
);
7494 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7495 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7500 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7502 if (ctx
->ExecuteFlag
) {
7503 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7507 static void GLAPIENTRY
7508 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7511 GET_CURRENT_CONTEXT(ctx
);
7513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7514 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7519 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7521 if (ctx
->ExecuteFlag
) {
7522 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7527 static void GLAPIENTRY
7528 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7531 GET_CURRENT_CONTEXT(ctx
);
7533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7534 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7539 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7541 if (ctx
->ExecuteFlag
) {
7542 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7546 static void GLAPIENTRY
7547 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7550 GET_CURRENT_CONTEXT(ctx
);
7552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7553 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7558 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7560 if (ctx
->ExecuteFlag
) {
7561 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7566 static void GLAPIENTRY
7567 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7570 GET_CURRENT_CONTEXT(ctx
);
7572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7573 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7578 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7580 if (ctx
->ExecuteFlag
) {
7581 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7585 static void GLAPIENTRY
7586 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7589 GET_CURRENT_CONTEXT(ctx
);
7591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7592 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7597 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7599 if (ctx
->ExecuteFlag
) {
7600 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7605 static void GLAPIENTRY
7606 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7609 GET_CURRENT_CONTEXT(ctx
);
7611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7612 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7617 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7619 if (ctx
->ExecuteFlag
) {
7620 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7624 static void GLAPIENTRY
7625 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7628 GET_CURRENT_CONTEXT(ctx
);
7630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7631 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7636 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7638 if (ctx
->ExecuteFlag
) {
7639 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7644 static void GLAPIENTRY
7645 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7648 GET_CURRENT_CONTEXT(ctx
);
7650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7651 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7656 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7658 if (ctx
->ExecuteFlag
) {
7659 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7663 static void GLAPIENTRY
7664 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7667 GET_CURRENT_CONTEXT(ctx
);
7669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7670 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7675 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7677 if (ctx
->ExecuteFlag
) {
7678 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7682 static void GLAPIENTRY
7683 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7686 GET_CURRENT_CONTEXT(ctx
);
7688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7689 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7694 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7696 if (ctx
->ExecuteFlag
) {
7697 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7702 static void GLAPIENTRY
7703 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7706 GET_CURRENT_CONTEXT(ctx
);
7708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7709 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7714 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7716 if (ctx
->ExecuteFlag
) {
7717 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7722 static void GLAPIENTRY
7723 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7726 GET_CURRENT_CONTEXT(ctx
);
7728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7729 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7734 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7736 if (ctx
->ExecuteFlag
) {
7737 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7742 static void GLAPIENTRY
7743 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7746 GET_CURRENT_CONTEXT(ctx
);
7748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7749 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7754 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7756 if (ctx
->ExecuteFlag
) {
7757 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7761 static void GLAPIENTRY
7762 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7765 GET_CURRENT_CONTEXT(ctx
);
7767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7768 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7773 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7775 if (ctx
->ExecuteFlag
) {
7776 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7781 static void GLAPIENTRY
7782 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7785 GET_CURRENT_CONTEXT(ctx
);
7787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7788 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7793 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7795 if (ctx
->ExecuteFlag
) {
7796 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7801 static void GLAPIENTRY
7802 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7805 GET_CURRENT_CONTEXT(ctx
);
7807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7808 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7813 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7815 if (ctx
->ExecuteFlag
) {
7816 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7821 static void GLAPIENTRY
7822 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7824 GET_CURRENT_CONTEXT(ctx
);
7826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7827 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7833 if (ctx
->ExecuteFlag
) {
7834 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7838 static void GLAPIENTRY
7839 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7841 GET_CURRENT_CONTEXT(ctx
);
7843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7844 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7850 if (ctx
->ExecuteFlag
) {
7851 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7855 static void GLAPIENTRY
7856 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7858 GET_CURRENT_CONTEXT(ctx
);
7860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7861 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7868 if (ctx
->ExecuteFlag
) {
7869 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7873 static void GLAPIENTRY
7874 save_ProgramUniform3f(GLuint program
, GLint location
,
7875 GLfloat x
, GLfloat y
, GLfloat z
)
7877 GET_CURRENT_CONTEXT(ctx
);
7879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7880 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7888 if (ctx
->ExecuteFlag
) {
7889 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7893 static void GLAPIENTRY
7894 save_ProgramUniform4f(GLuint program
, GLint location
,
7895 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7897 GET_CURRENT_CONTEXT(ctx
);
7899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7900 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7909 if (ctx
->ExecuteFlag
) {
7910 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7914 static void GLAPIENTRY
7915 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7918 GET_CURRENT_CONTEXT(ctx
);
7920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7921 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7926 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7928 if (ctx
->ExecuteFlag
) {
7929 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7933 static void GLAPIENTRY
7934 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7937 GET_CURRENT_CONTEXT(ctx
);
7939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7940 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7945 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7947 if (ctx
->ExecuteFlag
) {
7948 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7952 static void GLAPIENTRY
7953 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7956 GET_CURRENT_CONTEXT(ctx
);
7958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7959 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7964 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7966 if (ctx
->ExecuteFlag
) {
7967 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7971 static void GLAPIENTRY
7972 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7975 GET_CURRENT_CONTEXT(ctx
);
7977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7978 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7983 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7985 if (ctx
->ExecuteFlag
) {
7986 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7990 static void GLAPIENTRY
7991 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7993 GET_CURRENT_CONTEXT(ctx
);
7995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7996 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8000 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8002 if (ctx
->ExecuteFlag
) {
8003 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8007 static void GLAPIENTRY
8008 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8010 GET_CURRENT_CONTEXT(ctx
);
8012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8013 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8017 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8018 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8020 if (ctx
->ExecuteFlag
) {
8021 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8025 static void GLAPIENTRY
8026 save_ProgramUniform3d(GLuint program
, GLint location
,
8027 GLdouble x
, GLdouble y
, GLdouble z
)
8029 GET_CURRENT_CONTEXT(ctx
);
8031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8032 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8036 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8037 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8038 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8040 if (ctx
->ExecuteFlag
) {
8041 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8045 static void GLAPIENTRY
8046 save_ProgramUniform4d(GLuint program
, GLint location
,
8047 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8049 GET_CURRENT_CONTEXT(ctx
);
8051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8052 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8056 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8057 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8058 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8059 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8061 if (ctx
->ExecuteFlag
) {
8062 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8066 static void GLAPIENTRY
8067 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8070 GET_CURRENT_CONTEXT(ctx
);
8072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8073 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8078 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8080 if (ctx
->ExecuteFlag
) {
8081 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8085 static void GLAPIENTRY
8086 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8089 GET_CURRENT_CONTEXT(ctx
);
8091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8092 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8097 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8099 if (ctx
->ExecuteFlag
) {
8100 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8104 static void GLAPIENTRY
8105 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8108 GET_CURRENT_CONTEXT(ctx
);
8110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8111 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8116 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8118 if (ctx
->ExecuteFlag
) {
8119 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8123 static void GLAPIENTRY
8124 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8127 GET_CURRENT_CONTEXT(ctx
);
8129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8130 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8135 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8137 if (ctx
->ExecuteFlag
) {
8138 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8142 static void GLAPIENTRY
8143 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8145 GET_CURRENT_CONTEXT(ctx
);
8147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8148 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8154 if (ctx
->ExecuteFlag
) {
8155 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8159 static void GLAPIENTRY
8160 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8162 GET_CURRENT_CONTEXT(ctx
);
8164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8165 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8172 if (ctx
->ExecuteFlag
) {
8173 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8177 static void GLAPIENTRY
8178 save_ProgramUniform3i(GLuint program
, GLint location
,
8179 GLint x
, GLint y
, GLint z
)
8181 GET_CURRENT_CONTEXT(ctx
);
8183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8184 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8192 if (ctx
->ExecuteFlag
) {
8193 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8197 static void GLAPIENTRY
8198 save_ProgramUniform4i(GLuint program
, GLint location
,
8199 GLint x
, GLint y
, GLint z
, GLint w
)
8201 GET_CURRENT_CONTEXT(ctx
);
8203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8204 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8213 if (ctx
->ExecuteFlag
) {
8214 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8218 static void GLAPIENTRY
8219 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8222 GET_CURRENT_CONTEXT(ctx
);
8224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8225 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8230 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8232 if (ctx
->ExecuteFlag
) {
8233 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8237 static void GLAPIENTRY
8238 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8241 GET_CURRENT_CONTEXT(ctx
);
8243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8244 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8249 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8251 if (ctx
->ExecuteFlag
) {
8252 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8256 static void GLAPIENTRY
8257 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8260 GET_CURRENT_CONTEXT(ctx
);
8262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8263 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8268 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8270 if (ctx
->ExecuteFlag
) {
8271 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8275 static void GLAPIENTRY
8276 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8279 GET_CURRENT_CONTEXT(ctx
);
8281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8282 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8287 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8289 if (ctx
->ExecuteFlag
) {
8290 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8294 static void GLAPIENTRY
8295 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8297 GET_CURRENT_CONTEXT(ctx
);
8299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8300 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8306 if (ctx
->ExecuteFlag
) {
8307 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8311 static void GLAPIENTRY
8312 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8314 GET_CURRENT_CONTEXT(ctx
);
8316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8317 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8324 if (ctx
->ExecuteFlag
) {
8325 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8329 static void GLAPIENTRY
8330 save_ProgramUniform3ui(GLuint program
, GLint location
,
8331 GLuint x
, GLuint y
, GLuint z
)
8333 GET_CURRENT_CONTEXT(ctx
);
8335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8336 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8344 if (ctx
->ExecuteFlag
) {
8345 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8349 static void GLAPIENTRY
8350 save_ProgramUniform4ui(GLuint program
, GLint location
,
8351 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8353 GET_CURRENT_CONTEXT(ctx
);
8355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8356 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8365 if (ctx
->ExecuteFlag
) {
8366 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8370 static void GLAPIENTRY
8371 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8374 GET_CURRENT_CONTEXT(ctx
);
8376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8377 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8382 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8384 if (ctx
->ExecuteFlag
) {
8385 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8389 static void GLAPIENTRY
8390 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8393 GET_CURRENT_CONTEXT(ctx
);
8395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8396 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8401 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8403 if (ctx
->ExecuteFlag
) {
8404 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8408 static void GLAPIENTRY
8409 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8412 GET_CURRENT_CONTEXT(ctx
);
8414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8415 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8420 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8422 if (ctx
->ExecuteFlag
) {
8423 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8427 static void GLAPIENTRY
8428 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8431 GET_CURRENT_CONTEXT(ctx
);
8433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8434 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8439 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8441 if (ctx
->ExecuteFlag
) {
8442 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8446 static void GLAPIENTRY
8447 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8448 GLboolean transpose
, const GLfloat
*v
)
8450 GET_CURRENT_CONTEXT(ctx
);
8452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8453 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8454 4 + POINTER_DWORDS
);
8460 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8462 if (ctx
->ExecuteFlag
) {
8463 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8464 (program
, location
, count
, transpose
, v
));
8468 static void GLAPIENTRY
8469 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8470 GLboolean transpose
, const GLfloat
*v
)
8472 GET_CURRENT_CONTEXT(ctx
);
8474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8475 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8476 4 + POINTER_DWORDS
);
8482 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8484 if (ctx
->ExecuteFlag
) {
8485 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8486 (program
, location
, count
, transpose
, v
));
8490 static void GLAPIENTRY
8491 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8492 GLboolean transpose
, const GLfloat
*v
)
8494 GET_CURRENT_CONTEXT(ctx
);
8496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8497 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8498 4 + POINTER_DWORDS
);
8504 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8506 if (ctx
->ExecuteFlag
) {
8507 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8508 (program
, location
, count
, transpose
, v
));
8512 static void GLAPIENTRY
8513 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8514 GLboolean transpose
, const GLfloat
*v
)
8516 GET_CURRENT_CONTEXT(ctx
);
8518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8519 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8520 4 + POINTER_DWORDS
);
8526 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8528 if (ctx
->ExecuteFlag
) {
8529 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8530 (program
, location
, count
, transpose
, v
));
8534 static void GLAPIENTRY
8535 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8536 GLboolean transpose
, const GLfloat
*v
)
8538 GET_CURRENT_CONTEXT(ctx
);
8540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8541 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8542 4 + POINTER_DWORDS
);
8548 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8550 if (ctx
->ExecuteFlag
) {
8551 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8552 (program
, location
, count
, transpose
, v
));
8556 static void GLAPIENTRY
8557 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8558 GLboolean transpose
, const GLfloat
*v
)
8560 GET_CURRENT_CONTEXT(ctx
);
8562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8563 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8564 4 + POINTER_DWORDS
);
8570 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8572 if (ctx
->ExecuteFlag
) {
8573 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8574 (program
, location
, count
, transpose
, v
));
8578 static void GLAPIENTRY
8579 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8580 GLboolean transpose
, const GLfloat
*v
)
8582 GET_CURRENT_CONTEXT(ctx
);
8584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8585 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8586 4 + POINTER_DWORDS
);
8592 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8594 if (ctx
->ExecuteFlag
) {
8595 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8596 (program
, location
, count
, transpose
, v
));
8600 static void GLAPIENTRY
8601 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8602 GLboolean transpose
, const GLfloat
*v
)
8604 GET_CURRENT_CONTEXT(ctx
);
8606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8607 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8608 4 + POINTER_DWORDS
);
8614 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8616 if (ctx
->ExecuteFlag
) {
8617 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8618 (program
, location
, count
, transpose
, v
));
8622 static void GLAPIENTRY
8623 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8624 GLboolean transpose
, const GLfloat
*v
)
8626 GET_CURRENT_CONTEXT(ctx
);
8628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8629 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8630 4 + POINTER_DWORDS
);
8636 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8638 if (ctx
->ExecuteFlag
) {
8639 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8640 (program
, location
, count
, transpose
, v
));
8644 static void GLAPIENTRY
8645 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8646 GLboolean transpose
, const GLdouble
*v
)
8648 GET_CURRENT_CONTEXT(ctx
);
8650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8651 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8652 4 + POINTER_DWORDS
);
8658 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8660 if (ctx
->ExecuteFlag
) {
8661 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8662 (program
, location
, count
, transpose
, v
));
8666 static void GLAPIENTRY
8667 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8668 GLboolean transpose
, const GLdouble
*v
)
8670 GET_CURRENT_CONTEXT(ctx
);
8672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8673 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8674 4 + POINTER_DWORDS
);
8680 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8682 if (ctx
->ExecuteFlag
) {
8683 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8684 (program
, location
, count
, transpose
, v
));
8688 static void GLAPIENTRY
8689 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8690 GLboolean transpose
, const GLdouble
*v
)
8692 GET_CURRENT_CONTEXT(ctx
);
8694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8695 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8696 4 + POINTER_DWORDS
);
8702 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8704 if (ctx
->ExecuteFlag
) {
8705 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8706 (program
, location
, count
, transpose
, v
));
8710 static void GLAPIENTRY
8711 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8712 GLboolean transpose
, const GLdouble
*v
)
8714 GET_CURRENT_CONTEXT(ctx
);
8716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8717 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8718 4 + POINTER_DWORDS
);
8724 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8726 if (ctx
->ExecuteFlag
) {
8727 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8728 (program
, location
, count
, transpose
, v
));
8732 static void GLAPIENTRY
8733 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8734 GLboolean transpose
, const GLdouble
*v
)
8736 GET_CURRENT_CONTEXT(ctx
);
8738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8739 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8740 4 + POINTER_DWORDS
);
8746 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8748 if (ctx
->ExecuteFlag
) {
8749 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8750 (program
, location
, count
, transpose
, v
));
8754 static void GLAPIENTRY
8755 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8756 GLboolean transpose
, const GLdouble
*v
)
8758 GET_CURRENT_CONTEXT(ctx
);
8760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8761 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8762 4 + POINTER_DWORDS
);
8768 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8770 if (ctx
->ExecuteFlag
) {
8771 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8772 (program
, location
, count
, transpose
, v
));
8776 static void GLAPIENTRY
8777 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8778 GLboolean transpose
, const GLdouble
*v
)
8780 GET_CURRENT_CONTEXT(ctx
);
8782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8783 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8784 4 + POINTER_DWORDS
);
8790 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8792 if (ctx
->ExecuteFlag
) {
8793 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8794 (program
, location
, count
, transpose
, v
));
8798 static void GLAPIENTRY
8799 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8800 GLboolean transpose
, const GLdouble
*v
)
8802 GET_CURRENT_CONTEXT(ctx
);
8804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8805 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8806 4 + POINTER_DWORDS
);
8812 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8814 if (ctx
->ExecuteFlag
) {
8815 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8816 (program
, location
, count
, transpose
, v
));
8820 static void GLAPIENTRY
8821 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8822 GLboolean transpose
, const GLdouble
*v
)
8824 GET_CURRENT_CONTEXT(ctx
);
8826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8827 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8828 4 + POINTER_DWORDS
);
8834 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8836 if (ctx
->ExecuteFlag
) {
8837 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8838 (program
, location
, count
, transpose
, v
));
8842 static void GLAPIENTRY
8843 save_ClipControl(GLenum origin
, GLenum depth
)
8845 GET_CURRENT_CONTEXT(ctx
);
8847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8848 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8853 if (ctx
->ExecuteFlag
) {
8854 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8858 static void GLAPIENTRY
8859 save_ClampColorARB(GLenum target
, GLenum clamp
)
8861 GET_CURRENT_CONTEXT(ctx
);
8863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8864 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8869 if (ctx
->ExecuteFlag
) {
8870 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8874 /** GL_EXT_texture_integer */
8875 static void GLAPIENTRY
8876 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8878 GET_CURRENT_CONTEXT(ctx
);
8880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8881 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8888 if (ctx
->ExecuteFlag
) {
8889 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8893 /** GL_EXT_texture_integer */
8894 static void GLAPIENTRY
8895 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8897 GET_CURRENT_CONTEXT(ctx
);
8899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8900 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8907 if (ctx
->ExecuteFlag
) {
8908 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8912 /** GL_EXT_texture_integer */
8913 static void GLAPIENTRY
8914 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8916 GET_CURRENT_CONTEXT(ctx
);
8918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8919 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8928 if (ctx
->ExecuteFlag
) {
8929 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8933 /** GL_EXT_texture_integer */
8934 static void GLAPIENTRY
8935 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8937 GET_CURRENT_CONTEXT(ctx
);
8939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8940 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8944 n
[3].ui
= params
[0];
8945 n
[4].ui
= params
[1];
8946 n
[5].ui
= params
[2];
8947 n
[6].ui
= params
[3];
8949 if (ctx
->ExecuteFlag
) {
8950 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8954 /* GL_ARB_instanced_arrays */
8955 static void GLAPIENTRY
8956 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8958 GET_CURRENT_CONTEXT(ctx
);
8960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8961 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8966 if (ctx
->ExecuteFlag
) {
8967 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8972 /* GL_NV_texture_barrier */
8973 static void GLAPIENTRY
8974 save_TextureBarrierNV(void)
8976 GET_CURRENT_CONTEXT(ctx
);
8977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8978 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8979 if (ctx
->ExecuteFlag
) {
8980 CALL_TextureBarrierNV(ctx
->Exec
, ());
8985 /* GL_ARB_sampler_objects */
8986 static void GLAPIENTRY
8987 save_BindSampler(GLuint unit
, GLuint sampler
)
8990 GET_CURRENT_CONTEXT(ctx
);
8991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8992 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8997 if (ctx
->ExecuteFlag
) {
8998 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9002 static void GLAPIENTRY
9003 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9006 GET_CURRENT_CONTEXT(ctx
);
9007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9008 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9013 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9019 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9022 if (ctx
->ExecuteFlag
) {
9023 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9027 static void GLAPIENTRY
9028 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9032 parray
[1] = parray
[2] = parray
[3] = 0;
9033 save_SamplerParameteriv(sampler
, pname
, parray
);
9036 static void GLAPIENTRY
9037 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9040 GET_CURRENT_CONTEXT(ctx
);
9041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9042 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9047 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9053 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9056 if (ctx
->ExecuteFlag
) {
9057 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9061 static void GLAPIENTRY
9062 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9066 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9067 save_SamplerParameterfv(sampler
, pname
, parray
);
9070 static void GLAPIENTRY
9071 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9074 GET_CURRENT_CONTEXT(ctx
);
9075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9076 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9081 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9087 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9090 if (ctx
->ExecuteFlag
) {
9091 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9095 static void GLAPIENTRY
9096 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9099 GET_CURRENT_CONTEXT(ctx
);
9100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9101 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9105 n
[3].ui
= params
[0];
9106 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9107 n
[4].ui
= params
[1];
9108 n
[5].ui
= params
[2];
9109 n
[6].ui
= params
[3];
9112 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9115 if (ctx
->ExecuteFlag
) {
9116 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9120 static void GLAPIENTRY
9121 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9124 GET_CURRENT_CONTEXT(ctx
);
9125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9126 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9128 union uint64_pair p
;
9131 n
[2].ui
= p
.uint32
[0];
9132 n
[3].ui
= p
.uint32
[1];
9133 save_pointer(&n
[4], sync
);
9135 if (ctx
->ExecuteFlag
) {
9136 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9141 /** GL_NV_conditional_render */
9142 static void GLAPIENTRY
9143 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9145 GET_CURRENT_CONTEXT(ctx
);
9147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9148 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9153 if (ctx
->ExecuteFlag
) {
9154 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9158 static void GLAPIENTRY
9159 save_EndConditionalRender(void)
9161 GET_CURRENT_CONTEXT(ctx
);
9162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9163 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9164 if (ctx
->ExecuteFlag
) {
9165 CALL_EndConditionalRender(ctx
->Exec
, ());
9169 static void GLAPIENTRY
9170 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9172 GET_CURRENT_CONTEXT(ctx
);
9174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9175 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9181 if (ctx
->ExecuteFlag
) {
9182 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9186 static void GLAPIENTRY
9187 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9188 const GLuint
*indices
)
9190 GET_CURRENT_CONTEXT(ctx
);
9192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9193 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9195 GLint
*indices_copy
= NULL
;
9198 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9199 n
[1].e
= shadertype
;
9201 save_pointer(&n
[3], indices_copy
);
9203 if (ctx
->ExecuteFlag
) {
9204 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9208 /** GL_EXT_window_rectangles */
9209 static void GLAPIENTRY
9210 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9212 GET_CURRENT_CONTEXT(ctx
);
9214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9215 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9217 GLint
*box_copy
= NULL
;
9220 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9223 save_pointer(&n
[3], box_copy
);
9225 if (ctx
->ExecuteFlag
) {
9226 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9231 /** GL_NV_conservative_raster */
9232 static void GLAPIENTRY
9233 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9235 GET_CURRENT_CONTEXT(ctx
);
9237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9238 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9243 if (ctx
->ExecuteFlag
) {
9244 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9248 /** GL_NV_conservative_raster_dilate */
9249 static void GLAPIENTRY
9250 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9252 GET_CURRENT_CONTEXT(ctx
);
9254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9255 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9260 if (ctx
->ExecuteFlag
) {
9261 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9265 /** GL_NV_conservative_raster_pre_snap_triangles */
9266 static void GLAPIENTRY
9267 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9269 GET_CURRENT_CONTEXT(ctx
);
9271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9272 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9277 if (ctx
->ExecuteFlag
) {
9278 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9282 /** GL_EXT_direct_state_access */
9284 static void GLAPIENTRY
9285 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9287 GET_CURRENT_CONTEXT(ctx
);
9289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9290 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9292 n
[1].e
= matrixMode
;
9293 for (unsigned i
= 0; i
< 16; i
++) {
9297 if (ctx
->ExecuteFlag
) {
9298 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9302 static void GLAPIENTRY
9303 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9306 for (unsigned i
= 0; i
< 16; i
++) {
9307 f
[i
] = (GLfloat
) m
[i
];
9309 save_MatrixLoadfEXT(matrixMode
, f
);
9312 static void GLAPIENTRY
9313 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9315 GET_CURRENT_CONTEXT(ctx
);
9317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9318 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9320 n
[1].e
= matrixMode
;
9321 for (unsigned i
= 0; i
< 16; i
++) {
9325 if (ctx
->ExecuteFlag
) {
9326 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9330 static void GLAPIENTRY
9331 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9334 for (unsigned i
= 0; i
< 16; i
++) {
9335 f
[i
] = (GLfloat
) m
[i
];
9337 save_MatrixMultfEXT(matrixMode
, f
);
9340 static void GLAPIENTRY
9341 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9343 GET_CURRENT_CONTEXT(ctx
);
9345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9346 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9348 n
[1].e
= matrixMode
;
9354 if (ctx
->ExecuteFlag
) {
9355 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9359 static void GLAPIENTRY
9360 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9362 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9365 static void GLAPIENTRY
9366 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9368 GET_CURRENT_CONTEXT(ctx
);
9370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9371 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9373 n
[1].e
= matrixMode
;
9378 if (ctx
->ExecuteFlag
) {
9379 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9383 static void GLAPIENTRY
9384 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9386 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9389 static void GLAPIENTRY
9390 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9392 GET_CURRENT_CONTEXT(ctx
);
9394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9395 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9397 n
[1].e
= matrixMode
;
9402 if (ctx
->ExecuteFlag
) {
9403 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9407 static void GLAPIENTRY
9408 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9410 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9413 static void GLAPIENTRY
9414 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9416 GET_CURRENT_CONTEXT(ctx
);
9418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9419 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9421 n
[1].e
= matrixMode
;
9423 if (ctx
->ExecuteFlag
) {
9424 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9428 static void GLAPIENTRY
9429 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9430 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9432 GET_CURRENT_CONTEXT(ctx
);
9434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9435 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9437 n
[1].e
= matrixMode
;
9438 n
[2].f
= (GLfloat
) left
;
9439 n
[3].f
= (GLfloat
) right
;
9440 n
[4].f
= (GLfloat
) bottom
;
9441 n
[5].f
= (GLfloat
) top
;
9442 n
[6].f
= (GLfloat
) nearval
;
9443 n
[7].f
= (GLfloat
) farval
;
9445 if (ctx
->ExecuteFlag
) {
9446 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9451 static void GLAPIENTRY
9452 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9453 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9455 GET_CURRENT_CONTEXT(ctx
);
9457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9458 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9460 n
[1].e
= matrixMode
;
9461 n
[2].f
= (GLfloat
) left
;
9462 n
[3].f
= (GLfloat
) right
;
9463 n
[4].f
= (GLfloat
) bottom
;
9464 n
[5].f
= (GLfloat
) top
;
9465 n
[6].f
= (GLfloat
) nearval
;
9466 n
[7].f
= (GLfloat
) farval
;
9468 if (ctx
->ExecuteFlag
) {
9469 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9473 static void GLAPIENTRY
9474 save_MatrixPushEXT(GLenum matrixMode
)
9476 GET_CURRENT_CONTEXT(ctx
);
9478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9479 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9481 n
[1].e
= matrixMode
;
9483 if (ctx
->ExecuteFlag
) {
9484 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9488 static void GLAPIENTRY
9489 save_MatrixPopEXT(GLenum matrixMode
)
9491 GET_CURRENT_CONTEXT(ctx
);
9493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9494 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9496 n
[1].e
= matrixMode
;
9498 if (ctx
->ExecuteFlag
) {
9499 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9503 static void GLAPIENTRY
9504 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9507 _math_transposef(tm
, m
);
9508 save_MatrixLoadfEXT(matrixMode
, tm
);
9511 static void GLAPIENTRY
9512 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9515 _math_transposefd(tm
, m
);
9516 save_MatrixLoadfEXT(matrixMode
, tm
);
9519 static void GLAPIENTRY
9520 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9523 _math_transposef(tm
, m
);
9524 save_MatrixMultfEXT(matrixMode
, tm
);
9527 static void GLAPIENTRY
9528 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9531 _math_transposefd(tm
, m
);
9532 save_MatrixMultfEXT(matrixMode
, tm
);
9535 static void GLAPIENTRY
9536 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9537 const GLfloat
*params
)
9539 GET_CURRENT_CONTEXT(ctx
);
9541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9542 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9552 if (ctx
->ExecuteFlag
) {
9553 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9558 static void GLAPIENTRY
9559 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9563 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9564 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9567 static void GLAPIENTRY
9568 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9570 GET_CURRENT_CONTEXT(ctx
);
9572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9573 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9583 if (ctx
->ExecuteFlag
) {
9584 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9588 static void GLAPIENTRY
9589 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9593 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9594 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9597 static void GLAPIENTRY
9598 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9599 GLint level
, GLint components
,
9600 GLsizei width
, GLint border
,
9601 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9603 GET_CURRENT_CONTEXT(ctx
);
9604 if (target
== GL_PROXY_TEXTURE_1D
) {
9605 /* don't compile, execute immediately */
9606 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9607 border
, format
, type
, pixels
));
9611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9612 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9617 n
[4].i
= components
;
9618 n
[5].i
= (GLint
) width
;
9623 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9624 pixels
, &ctx
->Unpack
));
9626 if (ctx
->ExecuteFlag
) {
9627 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9628 border
, format
, type
, pixels
));
9634 static void GLAPIENTRY
9635 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9636 GLint level
, GLint components
,
9637 GLsizei width
, GLsizei height
, GLint border
,
9638 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9640 GET_CURRENT_CONTEXT(ctx
);
9641 if (target
== GL_PROXY_TEXTURE_2D
) {
9642 /* don't compile, execute immediately */
9643 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9644 height
, border
, format
, type
, pixels
));
9648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9649 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9654 n
[4].i
= components
;
9655 n
[5].i
= (GLint
) width
;
9656 n
[6].i
= (GLint
) height
;
9660 save_pointer(&n
[10],
9661 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9662 pixels
, &ctx
->Unpack
));
9664 if (ctx
->ExecuteFlag
) {
9665 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9666 height
, border
, format
, type
, pixels
));
9672 static void GLAPIENTRY
9673 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9674 GLint level
, GLint internalFormat
,
9675 GLsizei width
, GLsizei height
, GLsizei depth
,
9677 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9679 GET_CURRENT_CONTEXT(ctx
);
9680 if (target
== GL_PROXY_TEXTURE_3D
) {
9681 /* don't compile, execute immediately */
9682 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9683 height
, depth
, border
, format
, type
,
9688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9689 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9694 n
[4].i
= (GLint
) internalFormat
;
9695 n
[5].i
= (GLint
) width
;
9696 n
[6].i
= (GLint
) height
;
9697 n
[7].i
= (GLint
) depth
;
9701 save_pointer(&n
[11],
9702 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9703 pixels
, &ctx
->Unpack
));
9705 if (ctx
->ExecuteFlag
) {
9706 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9707 width
, height
, depth
, border
, format
,
9714 static void GLAPIENTRY
9715 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9716 GLsizei width
, GLenum format
, GLenum type
,
9717 const GLvoid
* pixels
)
9719 GET_CURRENT_CONTEXT(ctx
);
9722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9724 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9730 n
[5].i
= (GLint
) width
;
9734 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9735 pixels
, &ctx
->Unpack
));
9737 if (ctx
->ExecuteFlag
) {
9738 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9739 format
, type
, pixels
));
9744 static void GLAPIENTRY
9745 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9746 GLint xoffset
, GLint yoffset
,
9747 GLsizei width
, GLsizei height
,
9748 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9750 GET_CURRENT_CONTEXT(ctx
);
9753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9755 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9762 n
[6].i
= (GLint
) width
;
9763 n
[7].i
= (GLint
) height
;
9766 save_pointer(&n
[10],
9767 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9768 pixels
, &ctx
->Unpack
));
9770 if (ctx
->ExecuteFlag
) {
9771 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9772 width
, height
, format
, type
, pixels
));
9777 static void GLAPIENTRY
9778 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9779 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9780 GLsizei width
, GLsizei height
, GLsizei depth
,
9781 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9783 GET_CURRENT_CONTEXT(ctx
);
9786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9788 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9796 n
[7].i
= (GLint
) width
;
9797 n
[8].i
= (GLint
) height
;
9798 n
[9].i
= (GLint
) depth
;
9801 save_pointer(&n
[12],
9802 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9803 pixels
, &ctx
->Unpack
));
9805 if (ctx
->ExecuteFlag
) {
9806 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9807 xoffset
, yoffset
, zoffset
,
9808 width
, height
, depth
, format
, type
,
9813 static void GLAPIENTRY
9814 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9815 GLenum internalformat
, GLint x
, GLint y
,
9816 GLsizei width
, GLint border
)
9818 GET_CURRENT_CONTEXT(ctx
);
9820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9821 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9826 n
[4].e
= internalformat
;
9832 if (ctx
->ExecuteFlag
) {
9833 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9834 internalformat
, x
, y
,
9839 static void GLAPIENTRY
9840 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9841 GLenum internalformat
,
9842 GLint x
, GLint y
, GLsizei width
,
9843 GLsizei height
, GLint border
)
9845 GET_CURRENT_CONTEXT(ctx
);
9847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9848 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9853 n
[4].e
= internalformat
;
9860 if (ctx
->ExecuteFlag
) {
9861 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9862 internalformat
, x
, y
,
9863 width
, height
, border
));
9867 static void GLAPIENTRY
9868 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9869 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9871 GET_CURRENT_CONTEXT(ctx
);
9873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9874 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9884 if (ctx
->ExecuteFlag
) {
9885 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9886 (texture
, target
, level
, xoffset
, x
, y
, width
));
9890 static void GLAPIENTRY
9891 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9892 GLint xoffset
, GLint yoffset
,
9893 GLint x
, GLint y
, GLsizei width
, GLint height
)
9895 GET_CURRENT_CONTEXT(ctx
);
9897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9898 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9910 if (ctx
->ExecuteFlag
) {
9911 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9913 x
, y
, width
, height
));
9918 static void GLAPIENTRY
9919 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9920 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9921 GLint x
, GLint y
, GLsizei width
, GLint height
)
9923 GET_CURRENT_CONTEXT(ctx
);
9925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9926 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9939 if (ctx
->ExecuteFlag
) {
9940 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9941 xoffset
, yoffset
, zoffset
,
9942 x
, y
, width
, height
));
9947 static void GLAPIENTRY
9948 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9950 GET_CURRENT_CONTEXT(ctx
);
9952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9953 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9959 if (ctx
->ExecuteFlag
) {
9960 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9965 static void GLAPIENTRY
9966 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9967 const GLfloat
*params
)
9969 GET_CURRENT_CONTEXT(ctx
);
9971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9972 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
9982 if (ctx
->ExecuteFlag
) {
9983 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9988 static void GLAPIENTRY
9989 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
9993 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9994 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
9997 static void GLAPIENTRY
9998 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10000 GET_CURRENT_CONTEXT(ctx
);
10002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10003 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10008 n
[4].i
= params
[0];
10009 n
[5].i
= params
[1];
10010 n
[6].i
= params
[2];
10011 n
[7].i
= params
[3];
10013 if (ctx
->ExecuteFlag
) {
10014 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10018 static void GLAPIENTRY
10019 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10023 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10024 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10028 static void GLAPIENTRY
10029 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10030 GLint level
, GLint components
,
10031 GLsizei width
, GLint border
,
10032 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10034 GET_CURRENT_CONTEXT(ctx
);
10035 if (target
== GL_PROXY_TEXTURE_1D
) {
10036 /* don't compile, execute immediately */
10037 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10038 border
, format
, type
, pixels
));
10042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10043 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10048 n
[4].i
= components
;
10049 n
[5].i
= (GLint
) width
;
10053 save_pointer(&n
[9],
10054 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10055 pixels
, &ctx
->Unpack
));
10057 if (ctx
->ExecuteFlag
) {
10058 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10059 border
, format
, type
, pixels
));
10065 static void GLAPIENTRY
10066 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10067 GLint level
, GLint components
,
10068 GLsizei width
, GLsizei height
, GLint border
,
10069 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10071 GET_CURRENT_CONTEXT(ctx
);
10072 if (target
== GL_PROXY_TEXTURE_2D
) {
10073 /* don't compile, execute immediately */
10074 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10075 height
, border
, format
, type
, pixels
));
10079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10080 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10085 n
[4].i
= components
;
10086 n
[5].i
= (GLint
) width
;
10087 n
[6].i
= (GLint
) height
;
10091 save_pointer(&n
[10],
10092 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10093 pixels
, &ctx
->Unpack
));
10095 if (ctx
->ExecuteFlag
) {
10096 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10097 height
, border
, format
, type
, pixels
));
10103 static void GLAPIENTRY
10104 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10105 GLint level
, GLint internalFormat
,
10106 GLsizei width
, GLsizei height
, GLsizei depth
,
10108 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10110 GET_CURRENT_CONTEXT(ctx
);
10111 if (target
== GL_PROXY_TEXTURE_3D
) {
10112 /* don't compile, execute immediately */
10113 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10114 height
, depth
, border
, format
, type
,
10119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10120 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10125 n
[4].i
= (GLint
) internalFormat
;
10126 n
[5].i
= (GLint
) width
;
10127 n
[6].i
= (GLint
) height
;
10128 n
[7].i
= (GLint
) depth
;
10132 save_pointer(&n
[11],
10133 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10134 pixels
, &ctx
->Unpack
));
10136 if (ctx
->ExecuteFlag
) {
10137 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10138 width
, height
, depth
, border
, format
,
10145 static void GLAPIENTRY
10146 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10147 GLsizei width
, GLenum format
, GLenum type
,
10148 const GLvoid
* pixels
)
10150 GET_CURRENT_CONTEXT(ctx
);
10153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10155 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10161 n
[5].i
= (GLint
) width
;
10164 save_pointer(&n
[8],
10165 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10166 pixels
, &ctx
->Unpack
));
10168 if (ctx
->ExecuteFlag
) {
10169 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10170 format
, type
, pixels
));
10175 static void GLAPIENTRY
10176 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10177 GLint xoffset
, GLint yoffset
,
10178 GLsizei width
, GLsizei height
,
10179 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10181 GET_CURRENT_CONTEXT(ctx
);
10184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10186 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10193 n
[6].i
= (GLint
) width
;
10194 n
[7].i
= (GLint
) height
;
10197 save_pointer(&n
[10],
10198 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10199 pixels
, &ctx
->Unpack
));
10201 if (ctx
->ExecuteFlag
) {
10202 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10203 width
, height
, format
, type
, pixels
));
10208 static void GLAPIENTRY
10209 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10210 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10211 GLsizei width
, GLsizei height
, GLsizei depth
,
10212 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10214 GET_CURRENT_CONTEXT(ctx
);
10217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10219 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10227 n
[7].i
= (GLint
) width
;
10228 n
[8].i
= (GLint
) height
;
10229 n
[9].i
= (GLint
) depth
;
10232 save_pointer(&n
[12],
10233 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10234 pixels
, &ctx
->Unpack
));
10236 if (ctx
->ExecuteFlag
) {
10237 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10238 xoffset
, yoffset
, zoffset
,
10239 width
, height
, depth
, format
, type
,
10245 static void GLAPIENTRY
10246 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10247 GLenum internalformat
, GLint x
, GLint y
,
10248 GLsizei width
, GLint border
)
10250 GET_CURRENT_CONTEXT(ctx
);
10252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10253 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10258 n
[4].e
= internalformat
;
10264 if (ctx
->ExecuteFlag
) {
10265 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10266 internalformat
, x
, y
,
10272 static void GLAPIENTRY
10273 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10274 GLenum internalformat
,
10275 GLint x
, GLint y
, GLsizei width
,
10276 GLsizei height
, GLint border
)
10278 GET_CURRENT_CONTEXT(ctx
);
10280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10281 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10286 n
[4].e
= internalformat
;
10293 if (ctx
->ExecuteFlag
) {
10294 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10295 internalformat
, x
, y
,
10296 width
, height
, border
));
10301 static void GLAPIENTRY
10302 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10303 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10305 GET_CURRENT_CONTEXT(ctx
);
10307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10308 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10318 if (ctx
->ExecuteFlag
) {
10319 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10320 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10325 static void GLAPIENTRY
10326 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10327 GLint xoffset
, GLint yoffset
,
10328 GLint x
, GLint y
, GLsizei width
, GLint height
)
10330 GET_CURRENT_CONTEXT(ctx
);
10332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10333 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10345 if (ctx
->ExecuteFlag
) {
10346 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10348 x
, y
, width
, height
));
10353 static void GLAPIENTRY
10354 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10355 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10356 GLint x
, GLint y
, GLsizei width
, GLint height
)
10358 GET_CURRENT_CONTEXT(ctx
);
10360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10361 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10374 if (ctx
->ExecuteFlag
) {
10375 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10376 xoffset
, yoffset
, zoffset
,
10377 x
, y
, width
, height
));
10382 static void GLAPIENTRY
10383 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10385 GET_CURRENT_CONTEXT(ctx
);
10387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10388 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10393 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10394 n
[4].f
= params
[0];
10395 n
[5].f
= params
[1];
10396 n
[6].f
= params
[2];
10397 n
[7].f
= params
[3];
10400 n
[4].f
= params
[0];
10401 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10404 if (ctx
->ExecuteFlag
) {
10405 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10410 static void GLAPIENTRY
10411 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10414 parray
[0] = (GLfloat
) param
;
10415 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10416 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10420 static void GLAPIENTRY
10421 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10424 p
[0] = (GLfloat
) param
;
10425 p
[1] = p
[2] = p
[3] = 0.0F
;
10426 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10430 static void GLAPIENTRY
10431 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10434 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10435 p
[0] = INT_TO_FLOAT(param
[0]);
10436 p
[1] = INT_TO_FLOAT(param
[1]);
10437 p
[2] = INT_TO_FLOAT(param
[2]);
10438 p
[3] = INT_TO_FLOAT(param
[3]);
10441 p
[0] = (GLfloat
) param
[0];
10442 p
[1] = p
[2] = p
[3] = 0.0F
;
10444 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10448 static void GLAPIENTRY
10449 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10450 GLenum internalFormat
, GLsizei width
,
10451 GLint border
, GLsizei imageSize
,
10452 const GLvoid
* data
)
10454 GET_CURRENT_CONTEXT(ctx
);
10455 if (target
== GL_PROXY_TEXTURE_1D
) {
10456 /* don't compile, execute immediately */
10457 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10458 internalFormat
, width
,
10464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10466 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
10467 7 + POINTER_DWORDS
);
10472 n
[4].e
= internalFormat
;
10473 n
[5].i
= (GLint
) width
;
10475 n
[7].i
= imageSize
;
10476 save_pointer(&n
[8],
10477 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
10479 if (ctx
->ExecuteFlag
) {
10480 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
10481 (texture
, target
, level
, internalFormat
,
10482 width
, border
, imageSize
, data
));
10488 static void GLAPIENTRY
10489 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10490 GLenum internalFormat
, GLsizei width
,
10491 GLsizei height
, GLint border
, GLsizei imageSize
,
10492 const GLvoid
* data
)
10494 GET_CURRENT_CONTEXT(ctx
);
10495 if (target
== GL_PROXY_TEXTURE_2D
) {
10496 /* don't compile, execute immediately */
10497 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10498 internalFormat
, width
, height
,
10499 border
, imageSize
, data
));
10503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10505 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
10506 8 + POINTER_DWORDS
);
10511 n
[4].e
= internalFormat
;
10512 n
[5].i
= (GLint
) width
;
10513 n
[6].i
= (GLint
) height
;
10515 n
[8].i
= imageSize
;
10516 save_pointer(&n
[9],
10517 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
10519 if (ctx
->ExecuteFlag
) {
10520 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
10521 (texture
, target
, level
, internalFormat
,
10522 width
, height
, border
, imageSize
, data
));
10528 static void GLAPIENTRY
10529 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10530 GLenum internalFormat
, GLsizei width
,
10531 GLsizei height
, GLsizei depth
, GLint border
,
10532 GLsizei imageSize
, const GLvoid
* data
)
10534 GET_CURRENT_CONTEXT(ctx
);
10535 if (target
== GL_PROXY_TEXTURE_3D
) {
10536 /* don't compile, execute immediately */
10537 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10538 internalFormat
, width
,
10539 height
, depth
, border
,
10544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10546 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
10547 9 + POINTER_DWORDS
);
10552 n
[4].e
= internalFormat
;
10553 n
[5].i
= (GLint
) width
;
10554 n
[6].i
= (GLint
) height
;
10555 n
[7].i
= (GLint
) depth
;
10557 n
[9].i
= imageSize
;
10558 save_pointer(&n
[10],
10559 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
10561 if (ctx
->ExecuteFlag
) {
10562 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
10563 (texture
, target
, level
, internalFormat
,
10564 width
, height
, depth
, border
, imageSize
,
10571 static void GLAPIENTRY
10572 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10573 GLsizei width
, GLenum format
,
10574 GLsizei imageSize
, const GLvoid
* data
)
10577 GET_CURRENT_CONTEXT(ctx
);
10578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10580 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
10581 7 + POINTER_DWORDS
);
10587 n
[5].i
= (GLint
) width
;
10589 n
[7].i
= imageSize
;
10590 save_pointer(&n
[8],
10591 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
10593 if (ctx
->ExecuteFlag
) {
10594 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
10595 width
, format
, imageSize
, data
));
10600 static void GLAPIENTRY
10601 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10602 GLint yoffset
, GLsizei width
, GLsizei height
,
10603 GLenum format
, GLsizei imageSize
,
10604 const GLvoid
* data
)
10607 GET_CURRENT_CONTEXT(ctx
);
10608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10610 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10611 9 + POINTER_DWORDS
);
10618 n
[6].i
= (GLint
) width
;
10619 n
[7].i
= (GLint
) height
;
10621 n
[9].i
= imageSize
;
10622 save_pointer(&n
[10],
10623 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10625 if (ctx
->ExecuteFlag
) {
10626 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10627 (texture
, target
, level
, xoffset
, yoffset
,
10628 width
, height
, format
, imageSize
, data
));
10633 static void GLAPIENTRY
10634 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10635 GLint yoffset
, GLint zoffset
, GLsizei width
,
10636 GLsizei height
, GLsizei depth
, GLenum format
,
10637 GLsizei imageSize
, const GLvoid
* data
)
10640 GET_CURRENT_CONTEXT(ctx
);
10641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10643 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
10644 11 + POINTER_DWORDS
);
10652 n
[7].i
= (GLint
) width
;
10653 n
[8].i
= (GLint
) height
;
10654 n
[9].i
= (GLint
) depth
;
10656 n
[11].i
= imageSize
;
10657 save_pointer(&n
[12],
10658 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
10660 if (ctx
->ExecuteFlag
) {
10661 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
10662 (texture
, target
, level
, xoffset
, yoffset
,
10663 zoffset
, width
, height
, depth
, format
,
10670 * Save an error-generating command into display list.
10672 * KW: Will appear in the list before the vertex buffer containing the
10673 * command that provoked the error. I don't see this as a problem.
10676 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10679 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
10682 save_pointer(&n
[2], (void *) s
);
10683 /* note: the data/string here doesn't have to be freed in
10684 * _mesa_delete_list() since the string is never dynamically
10692 * Compile an error into current display list.
10695 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10697 if (ctx
->CompileFlag
)
10698 save_error(ctx
, error
, s
);
10699 if (ctx
->ExecuteFlag
)
10700 _mesa_error(ctx
, error
, "%s", s
);
10705 * Test if ID names a display list.
10708 islist(struct gl_context
*ctx
, GLuint list
)
10710 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
10720 /**********************************************************************/
10721 /* Display list execution */
10722 /**********************************************************************/
10726 * Execute a display list. Note that the ListBase offset must have already
10727 * been added before calling this function. I.e. the list argument is
10728 * the absolute list number, not relative to ListBase.
10729 * \param list - display list number
10732 execute_list(struct gl_context
*ctx
, GLuint list
)
10734 struct gl_display_list
*dlist
;
10738 if (list
== 0 || !islist(ctx
, list
))
10741 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10742 /* raise an error? */
10746 dlist
= _mesa_lookup_list(ctx
, list
);
10750 ctx
->ListState
.CallDepth
++;
10752 vbo_save_BeginCallList(ctx
, dlist
);
10758 const OpCode opcode
= n
[0].opcode
;
10760 if (is_ext_opcode(opcode
)) {
10761 n
+= ext_opcode_execute(ctx
, n
);
10766 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10769 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10771 case OPCODE_ALPHA_FUNC
:
10772 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10774 case OPCODE_BIND_TEXTURE
:
10775 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10777 case OPCODE_BITMAP
:
10779 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10780 ctx
->Unpack
= ctx
->DefaultPacking
;
10781 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10782 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10783 get_pointer(&n
[7])));
10784 ctx
->Unpack
= save
; /* restore */
10787 case OPCODE_BLEND_COLOR
:
10788 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10790 case OPCODE_BLEND_EQUATION
:
10791 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10793 case OPCODE_BLEND_EQUATION_SEPARATE
:
10794 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10796 case OPCODE_BLEND_FUNC_SEPARATE
:
10797 CALL_BlendFuncSeparate(ctx
->Exec
,
10798 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10801 case OPCODE_BLEND_FUNC_I
:
10802 /* GL_ARB_draw_buffers_blend */
10803 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10805 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10806 /* GL_ARB_draw_buffers_blend */
10807 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10810 case OPCODE_BLEND_EQUATION_I
:
10811 /* GL_ARB_draw_buffers_blend */
10812 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10814 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10815 /* GL_ARB_draw_buffers_blend */
10816 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10817 (n
[1].ui
, n
[2].e
, n
[3].e
));
10820 case OPCODE_CALL_LIST
:
10821 /* Generated by glCallList(), don't add ListBase */
10822 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10823 execute_list(ctx
, n
[1].ui
);
10826 case OPCODE_CALL_LISTS
:
10827 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10828 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10832 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10834 case OPCODE_CLEAR_BUFFER_IV
:
10841 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10844 case OPCODE_CLEAR_BUFFER_UIV
:
10847 value
[0] = n
[3].ui
;
10848 value
[1] = n
[4].ui
;
10849 value
[2] = n
[5].ui
;
10850 value
[3] = n
[6].ui
;
10851 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10854 case OPCODE_CLEAR_BUFFER_FV
:
10861 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10864 case OPCODE_CLEAR_BUFFER_FI
:
10865 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10867 case OPCODE_CLEAR_COLOR
:
10868 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10870 case OPCODE_CLEAR_ACCUM
:
10871 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10873 case OPCODE_CLEAR_DEPTH
:
10874 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10876 case OPCODE_CLEAR_INDEX
:
10877 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10879 case OPCODE_CLEAR_STENCIL
:
10880 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10882 case OPCODE_CLIP_PLANE
:
10889 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10892 case OPCODE_COLOR_MASK
:
10893 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10895 case OPCODE_COLOR_MASK_INDEXED
:
10896 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10899 case OPCODE_COLOR_MATERIAL
:
10900 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10902 case OPCODE_COPY_PIXELS
:
10903 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10904 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10907 case OPCODE_COPY_TEX_IMAGE1D
:
10908 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10909 n
[5].i
, n
[6].i
, n
[7].i
));
10911 case OPCODE_COPY_TEX_IMAGE2D
:
10912 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10913 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10915 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10916 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10917 n
[4].i
, n
[5].i
, n
[6].i
));
10919 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10920 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10921 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10924 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10925 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10926 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10929 case OPCODE_CULL_FACE
:
10930 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10932 case OPCODE_DEPTH_FUNC
:
10933 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10935 case OPCODE_DEPTH_MASK
:
10936 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10938 case OPCODE_DEPTH_RANGE
:
10939 CALL_DepthRange(ctx
->Exec
,
10940 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10942 case OPCODE_DISABLE
:
10943 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10945 case OPCODE_DISABLE_INDEXED
:
10946 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10948 case OPCODE_DRAW_BUFFER
:
10949 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10951 case OPCODE_DRAW_PIXELS
:
10953 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10954 ctx
->Unpack
= ctx
->DefaultPacking
;
10955 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10956 get_pointer(&n
[5])));
10957 ctx
->Unpack
= save
; /* restore */
10960 case OPCODE_ENABLE
:
10961 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10963 case OPCODE_ENABLE_INDEXED
:
10964 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10966 case OPCODE_EVALMESH1
:
10967 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10969 case OPCODE_EVALMESH2
:
10970 CALL_EvalMesh2(ctx
->Exec
,
10971 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10980 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10983 case OPCODE_FRONT_FACE
:
10984 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10986 case OPCODE_FRUSTUM
:
10987 CALL_Frustum(ctx
->Exec
,
10988 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10991 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10993 case OPCODE_INDEX_MASK
:
10994 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10996 case OPCODE_INIT_NAMES
:
10997 CALL_InitNames(ctx
->Exec
, ());
11006 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
11009 case OPCODE_LIGHT_MODEL
:
11016 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
11019 case OPCODE_LINE_STIPPLE
:
11020 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
11022 case OPCODE_LINE_WIDTH
:
11023 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
11025 case OPCODE_LIST_BASE
:
11026 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
11028 case OPCODE_LOAD_IDENTITY
:
11029 CALL_LoadIdentity(ctx
->Exec
, ());
11031 case OPCODE_LOAD_MATRIX
:
11032 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
11033 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
11035 case OPCODE_LOAD_NAME
:
11036 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
11038 case OPCODE_LOGIC_OP
:
11039 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
11043 GLenum target
= n
[1].e
;
11044 GLint ustride
= _mesa_evaluator_components(target
);
11045 GLint uorder
= n
[5].i
;
11046 GLfloat u1
= n
[2].f
;
11047 GLfloat u2
= n
[3].f
;
11048 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11049 (GLfloat
*) get_pointer(&n
[6])));
11054 GLenum target
= n
[1].e
;
11055 GLfloat u1
= n
[2].f
;
11056 GLfloat u2
= n
[3].f
;
11057 GLfloat v1
= n
[4].f
;
11058 GLfloat v2
= n
[5].f
;
11059 GLint ustride
= n
[6].i
;
11060 GLint vstride
= n
[7].i
;
11061 GLint uorder
= n
[8].i
;
11062 GLint vorder
= n
[9].i
;
11063 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11064 v1
, v2
, vstride
, vorder
,
11065 (GLfloat
*) get_pointer(&n
[10])));
11068 case OPCODE_MAPGRID1
:
11069 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11071 case OPCODE_MAPGRID2
:
11072 CALL_MapGrid2f(ctx
->Exec
,
11073 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
11075 case OPCODE_MATRIX_MODE
:
11076 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
11078 case OPCODE_MULT_MATRIX
:
11079 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
11082 CALL_Ortho(ctx
->Exec
,
11083 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11085 case OPCODE_PASSTHROUGH
:
11086 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
11088 case OPCODE_PATCH_PARAMETER_I
:
11089 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11091 case OPCODE_PATCH_PARAMETER_FV_INNER
:
11094 params
[0] = n
[2].f
;
11095 params
[1] = n
[3].f
;
11096 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11099 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
11102 params
[0] = n
[2].f
;
11103 params
[1] = n
[3].f
;
11104 params
[2] = n
[4].f
;
11105 params
[3] = n
[5].f
;
11106 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11109 case OPCODE_PIXEL_MAP
:
11110 CALL_PixelMapfv(ctx
->Exec
,
11111 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
11113 case OPCODE_PIXEL_TRANSFER
:
11114 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11116 case OPCODE_PIXEL_ZOOM
:
11117 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11119 case OPCODE_POINT_SIZE
:
11120 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
11122 case OPCODE_POINT_PARAMETERS
:
11125 params
[0] = n
[2].f
;
11126 params
[1] = n
[3].f
;
11127 params
[2] = n
[4].f
;
11128 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11131 case OPCODE_POLYGON_MODE
:
11132 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11134 case OPCODE_POLYGON_STIPPLE
:
11136 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11137 ctx
->Unpack
= ctx
->DefaultPacking
;
11138 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
11139 ctx
->Unpack
= save
; /* restore */
11142 case OPCODE_POLYGON_OFFSET
:
11143 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11145 case OPCODE_POLYGON_OFFSET_CLAMP
:
11146 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11148 case OPCODE_POP_ATTRIB
:
11149 CALL_PopAttrib(ctx
->Exec
, ());
11151 case OPCODE_POP_MATRIX
:
11152 CALL_PopMatrix(ctx
->Exec
, ());
11154 case OPCODE_POP_NAME
:
11155 CALL_PopName(ctx
->Exec
, ());
11157 case OPCODE_PRIORITIZE_TEXTURE
:
11158 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
11160 case OPCODE_PUSH_ATTRIB
:
11161 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
11163 case OPCODE_PUSH_MATRIX
:
11164 CALL_PushMatrix(ctx
->Exec
, ());
11166 case OPCODE_PUSH_NAME
:
11167 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
11169 case OPCODE_RASTER_POS
:
11170 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11172 case OPCODE_READ_BUFFER
:
11173 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
11175 case OPCODE_ROTATE
:
11176 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11179 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11181 case OPCODE_SCISSOR
:
11182 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11184 case OPCODE_SHADE_MODEL
:
11185 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
11187 case OPCODE_PROVOKING_VERTEX
:
11188 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
11190 case OPCODE_STENCIL_FUNC
:
11191 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
11193 case OPCODE_STENCIL_MASK
:
11194 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
11196 case OPCODE_STENCIL_OP
:
11197 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
11199 case OPCODE_STENCIL_FUNC_SEPARATE
:
11200 CALL_StencilFuncSeparate(ctx
->Exec
,
11201 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
11203 case OPCODE_STENCIL_MASK_SEPARATE
:
11204 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11206 case OPCODE_STENCIL_OP_SEPARATE
:
11207 CALL_StencilOpSeparate(ctx
->Exec
,
11208 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11210 case OPCODE_TEXENV
:
11213 params
[0] = n
[3].f
;
11214 params
[1] = n
[4].f
;
11215 params
[2] = n
[5].f
;
11216 params
[3] = n
[6].f
;
11217 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11220 case OPCODE_TEXGEN
:
11223 params
[0] = n
[3].f
;
11224 params
[1] = n
[4].f
;
11225 params
[2] = n
[5].f
;
11226 params
[3] = n
[6].f
;
11227 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11230 case OPCODE_TEXPARAMETER
:
11233 params
[0] = n
[3].f
;
11234 params
[1] = n
[4].f
;
11235 params
[2] = n
[5].f
;
11236 params
[3] = n
[6].f
;
11237 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11240 case OPCODE_TEX_IMAGE1D
:
11242 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11243 ctx
->Unpack
= ctx
->DefaultPacking
;
11244 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11245 n
[2].i
, /* level */
11246 n
[3].i
, /* components */
11247 n
[4].i
, /* width */
11248 n
[5].e
, /* border */
11249 n
[6].e
, /* format */
11251 get_pointer(&n
[8])));
11252 ctx
->Unpack
= save
; /* restore */
11255 case OPCODE_TEX_IMAGE2D
:
11257 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11258 ctx
->Unpack
= ctx
->DefaultPacking
;
11259 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11260 n
[2].i
, /* level */
11261 n
[3].i
, /* components */
11262 n
[4].i
, /* width */
11263 n
[5].i
, /* height */
11264 n
[6].e
, /* border */
11265 n
[7].e
, /* format */
11267 get_pointer(&n
[9])));
11268 ctx
->Unpack
= save
; /* restore */
11271 case OPCODE_TEX_IMAGE3D
:
11273 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11274 ctx
->Unpack
= ctx
->DefaultPacking
;
11275 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11276 n
[2].i
, /* level */
11277 n
[3].i
, /* components */
11278 n
[4].i
, /* width */
11279 n
[5].i
, /* height */
11280 n
[6].i
, /* depth */
11281 n
[7].e
, /* border */
11282 n
[8].e
, /* format */
11284 get_pointer(&n
[10])));
11285 ctx
->Unpack
= save
; /* restore */
11288 case OPCODE_TEX_SUB_IMAGE1D
:
11290 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11291 ctx
->Unpack
= ctx
->DefaultPacking
;
11292 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11294 n
[6].e
, get_pointer(&n
[7])));
11295 ctx
->Unpack
= save
; /* restore */
11298 case OPCODE_TEX_SUB_IMAGE2D
:
11300 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11301 ctx
->Unpack
= ctx
->DefaultPacking
;
11302 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11304 n
[6].i
, n
[7].e
, n
[8].e
,
11305 get_pointer(&n
[9])));
11306 ctx
->Unpack
= save
; /* restore */
11309 case OPCODE_TEX_SUB_IMAGE3D
:
11311 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11312 ctx
->Unpack
= ctx
->DefaultPacking
;
11313 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11314 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11315 n
[8].i
, n
[9].e
, n
[10].e
,
11316 get_pointer(&n
[11])));
11317 ctx
->Unpack
= save
; /* restore */
11320 case OPCODE_TRANSLATE
:
11321 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11323 case OPCODE_VIEWPORT
:
11324 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11325 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11327 case OPCODE_WINDOW_POS
:
11328 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11330 case OPCODE_VIEWPORT_ARRAY_V
:
11331 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11332 get_pointer(&n
[3])));
11334 case OPCODE_VIEWPORT_INDEXED_F
:
11335 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11338 case OPCODE_VIEWPORT_INDEXED_FV
: {
11344 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11347 case OPCODE_SCISSOR_ARRAY_V
:
11348 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11349 get_pointer(&n
[3])));
11351 case OPCODE_SCISSOR_INDEXED
:
11352 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11355 case OPCODE_SCISSOR_INDEXED_V
: {
11361 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11364 case OPCODE_DEPTH_ARRAY_V
:
11365 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11366 get_pointer(&n
[3])));
11368 case OPCODE_DEPTH_INDEXED
:
11369 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11371 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11372 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11374 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11375 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11376 n
[4].i
, n
[5].i
, n
[6].i
,
11377 get_pointer(&n
[7])));
11379 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11380 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11381 n
[4].i
, n
[5].i
, n
[6].i
,
11382 n
[7].i
, get_pointer(&n
[8])));
11384 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11385 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11386 n
[4].i
, n
[5].i
, n
[6].i
,
11388 get_pointer(&n
[9])));
11390 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11391 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11392 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11394 get_pointer(&n
[7])));
11396 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
11397 CALL_CompressedTexSubImage2D(ctx
->Exec
,
11398 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11399 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
11400 get_pointer(&n
[9])));
11402 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
11403 CALL_CompressedTexSubImage3D(ctx
->Exec
,
11404 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11405 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11407 get_pointer(&n
[11])));
11409 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
11410 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
11412 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
11413 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11415 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
11416 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11418 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
11419 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
11420 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
11423 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
11424 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
11426 case OPCODE_DEPTH_BOUNDS_EXT
:
11427 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11429 case OPCODE_PROGRAM_STRING_ARB
:
11430 CALL_ProgramStringARB(ctx
->Exec
,
11431 (n
[1].e
, n
[2].e
, n
[3].i
,
11432 get_pointer(&n
[4])));
11434 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
11435 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
11439 case OPCODE_BEGIN_QUERY_ARB
:
11440 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11442 case OPCODE_END_QUERY_ARB
:
11443 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
11445 case OPCODE_QUERY_COUNTER
:
11446 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11448 case OPCODE_BEGIN_QUERY_INDEXED
:
11449 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11451 case OPCODE_END_QUERY_INDEXED
:
11452 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11454 case OPCODE_DRAW_BUFFERS_ARB
:
11456 GLenum buffers
[MAX_DRAW_BUFFERS
];
11457 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11458 for (i
= 0; i
< count
; i
++)
11459 buffers
[i
] = n
[2 + i
].e
;
11460 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11463 case OPCODE_BLIT_FRAMEBUFFER
:
11464 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11465 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11468 case OPCODE_PRIMITIVE_RESTART_NV
:
11469 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11472 case OPCODE_USE_PROGRAM
:
11473 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11475 case OPCODE_UNIFORM_1F
:
11476 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11478 case OPCODE_UNIFORM_2F
:
11479 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11481 case OPCODE_UNIFORM_3F
:
11482 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11484 case OPCODE_UNIFORM_4F
:
11485 CALL_Uniform4f(ctx
->Exec
,
11486 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11488 case OPCODE_UNIFORM_1FV
:
11489 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11491 case OPCODE_UNIFORM_2FV
:
11492 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11494 case OPCODE_UNIFORM_3FV
:
11495 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11497 case OPCODE_UNIFORM_4FV
:
11498 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11500 case OPCODE_UNIFORM_1D
: {
11501 union float64_pair x
;
11503 x
.uint32
[0] = n
[2].ui
;
11504 x
.uint32
[1] = n
[3].ui
;
11506 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11509 case OPCODE_UNIFORM_2D
: {
11510 union float64_pair x
;
11511 union float64_pair y
;
11513 x
.uint32
[0] = n
[2].ui
;
11514 x
.uint32
[1] = n
[3].ui
;
11515 y
.uint32
[0] = n
[4].ui
;
11516 y
.uint32
[1] = n
[5].ui
;
11518 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11521 case OPCODE_UNIFORM_3D
: {
11522 union float64_pair x
;
11523 union float64_pair y
;
11524 union float64_pair z
;
11526 x
.uint32
[0] = n
[2].ui
;
11527 x
.uint32
[1] = n
[3].ui
;
11528 y
.uint32
[0] = n
[4].ui
;
11529 y
.uint32
[1] = n
[5].ui
;
11530 z
.uint32
[0] = n
[6].ui
;
11531 z
.uint32
[1] = n
[7].ui
;
11533 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11536 case OPCODE_UNIFORM_4D
: {
11537 union float64_pair x
;
11538 union float64_pair y
;
11539 union float64_pair z
;
11540 union float64_pair w
;
11542 x
.uint32
[0] = n
[2].ui
;
11543 x
.uint32
[1] = n
[3].ui
;
11544 y
.uint32
[0] = n
[4].ui
;
11545 y
.uint32
[1] = n
[5].ui
;
11546 z
.uint32
[0] = n
[6].ui
;
11547 z
.uint32
[1] = n
[7].ui
;
11548 w
.uint32
[0] = n
[8].ui
;
11549 w
.uint32
[1] = n
[9].ui
;
11551 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11554 case OPCODE_UNIFORM_1DV
:
11555 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11557 case OPCODE_UNIFORM_2DV
:
11558 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11560 case OPCODE_UNIFORM_3DV
:
11561 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11563 case OPCODE_UNIFORM_4DV
:
11564 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11566 case OPCODE_UNIFORM_1I
:
11567 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11569 case OPCODE_UNIFORM_2I
:
11570 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11572 case OPCODE_UNIFORM_3I
:
11573 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11575 case OPCODE_UNIFORM_4I
:
11576 CALL_Uniform4i(ctx
->Exec
,
11577 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11579 case OPCODE_UNIFORM_1IV
:
11580 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11582 case OPCODE_UNIFORM_2IV
:
11583 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11585 case OPCODE_UNIFORM_3IV
:
11586 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11588 case OPCODE_UNIFORM_4IV
:
11589 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11591 case OPCODE_UNIFORM_1UI
:
11592 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11594 case OPCODE_UNIFORM_2UI
:
11595 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11597 case OPCODE_UNIFORM_3UI
:
11598 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11600 case OPCODE_UNIFORM_4UI
:
11601 CALL_Uniform4ui(ctx
->Exec
,
11602 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11604 case OPCODE_UNIFORM_1UIV
:
11605 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11607 case OPCODE_UNIFORM_2UIV
:
11608 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11610 case OPCODE_UNIFORM_3UIV
:
11611 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11613 case OPCODE_UNIFORM_4UIV
:
11614 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11616 case OPCODE_UNIFORM_MATRIX22
:
11617 CALL_UniformMatrix2fv(ctx
->Exec
,
11618 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11620 case OPCODE_UNIFORM_MATRIX33
:
11621 CALL_UniformMatrix3fv(ctx
->Exec
,
11622 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11624 case OPCODE_UNIFORM_MATRIX44
:
11625 CALL_UniformMatrix4fv(ctx
->Exec
,
11626 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11628 case OPCODE_UNIFORM_MATRIX23
:
11629 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11630 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11632 case OPCODE_UNIFORM_MATRIX32
:
11633 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11634 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11636 case OPCODE_UNIFORM_MATRIX24
:
11637 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11638 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11640 case OPCODE_UNIFORM_MATRIX42
:
11641 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11642 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11644 case OPCODE_UNIFORM_MATRIX34
:
11645 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11646 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11648 case OPCODE_UNIFORM_MATRIX43
:
11649 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11650 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11652 case OPCODE_UNIFORM_MATRIX22D
:
11653 CALL_UniformMatrix2dv(ctx
->Exec
,
11654 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11656 case OPCODE_UNIFORM_MATRIX33D
:
11657 CALL_UniformMatrix3dv(ctx
->Exec
,
11658 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11660 case OPCODE_UNIFORM_MATRIX44D
:
11661 CALL_UniformMatrix4dv(ctx
->Exec
,
11662 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11664 case OPCODE_UNIFORM_MATRIX23D
:
11665 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11666 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11668 case OPCODE_UNIFORM_MATRIX32D
:
11669 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11670 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11672 case OPCODE_UNIFORM_MATRIX24D
:
11673 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11674 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11676 case OPCODE_UNIFORM_MATRIX42D
:
11677 CALL_UniformMatrix4x2dv(ctx
->Exec
,
11678 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11680 case OPCODE_UNIFORM_MATRIX34D
:
11681 CALL_UniformMatrix3x4dv(ctx
->Exec
,
11682 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11684 case OPCODE_UNIFORM_MATRIX43D
:
11685 CALL_UniformMatrix4x3dv(ctx
->Exec
,
11686 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11689 case OPCODE_USE_PROGRAM_STAGES
:
11690 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11692 case OPCODE_PROGRAM_UNIFORM_1F
:
11693 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
11695 case OPCODE_PROGRAM_UNIFORM_2F
:
11696 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
11698 case OPCODE_PROGRAM_UNIFORM_3F
:
11699 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11700 n
[3].f
, n
[4].f
, n
[5].f
));
11702 case OPCODE_PROGRAM_UNIFORM_4F
:
11703 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11704 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11706 case OPCODE_PROGRAM_UNIFORM_1FV
:
11707 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11708 get_pointer(&n
[4])));
11710 case OPCODE_PROGRAM_UNIFORM_2FV
:
11711 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11712 get_pointer(&n
[4])));
11714 case OPCODE_PROGRAM_UNIFORM_3FV
:
11715 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11716 get_pointer(&n
[4])));
11718 case OPCODE_PROGRAM_UNIFORM_4FV
:
11719 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11720 get_pointer(&n
[4])));
11722 case OPCODE_PROGRAM_UNIFORM_1D
: {
11723 union float64_pair x
;
11725 x
.uint32
[0] = n
[3].ui
;
11726 x
.uint32
[1] = n
[4].ui
;
11728 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11731 case OPCODE_PROGRAM_UNIFORM_2D
: {
11732 union float64_pair x
;
11733 union float64_pair y
;
11735 x
.uint32
[0] = n
[3].ui
;
11736 x
.uint32
[1] = n
[4].ui
;
11737 y
.uint32
[0] = n
[5].ui
;
11738 y
.uint32
[1] = n
[6].ui
;
11740 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11743 case OPCODE_PROGRAM_UNIFORM_3D
: {
11744 union float64_pair x
;
11745 union float64_pair y
;
11746 union float64_pair z
;
11748 x
.uint32
[0] = n
[3].ui
;
11749 x
.uint32
[1] = n
[4].ui
;
11750 y
.uint32
[0] = n
[5].ui
;
11751 y
.uint32
[1] = n
[6].ui
;
11752 z
.uint32
[0] = n
[7].ui
;
11753 z
.uint32
[1] = n
[8].ui
;
11755 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11759 case OPCODE_PROGRAM_UNIFORM_4D
: {
11760 union float64_pair x
;
11761 union float64_pair y
;
11762 union float64_pair z
;
11763 union float64_pair w
;
11765 x
.uint32
[0] = n
[3].ui
;
11766 x
.uint32
[1] = n
[4].ui
;
11767 y
.uint32
[0] = n
[5].ui
;
11768 y
.uint32
[1] = n
[6].ui
;
11769 z
.uint32
[0] = n
[7].ui
;
11770 z
.uint32
[1] = n
[8].ui
;
11771 w
.uint32
[0] = n
[9].ui
;
11772 w
.uint32
[1] = n
[10].ui
;
11774 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11775 x
.d
, y
.d
, z
.d
, w
.d
));
11778 case OPCODE_PROGRAM_UNIFORM_1DV
:
11779 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11780 get_pointer(&n
[4])));
11782 case OPCODE_PROGRAM_UNIFORM_2DV
:
11783 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11784 get_pointer(&n
[4])));
11786 case OPCODE_PROGRAM_UNIFORM_3DV
:
11787 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11788 get_pointer(&n
[4])));
11790 case OPCODE_PROGRAM_UNIFORM_4DV
:
11791 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11792 get_pointer(&n
[4])));
11794 case OPCODE_PROGRAM_UNIFORM_1I
:
11795 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11797 case OPCODE_PROGRAM_UNIFORM_2I
:
11798 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11800 case OPCODE_PROGRAM_UNIFORM_3I
:
11801 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11802 n
[3].i
, n
[4].i
, n
[5].i
));
11804 case OPCODE_PROGRAM_UNIFORM_4I
:
11805 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11806 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11808 case OPCODE_PROGRAM_UNIFORM_1IV
:
11809 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11810 get_pointer(&n
[4])));
11812 case OPCODE_PROGRAM_UNIFORM_2IV
:
11813 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11814 get_pointer(&n
[4])));
11816 case OPCODE_PROGRAM_UNIFORM_3IV
:
11817 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11818 get_pointer(&n
[4])));
11820 case OPCODE_PROGRAM_UNIFORM_4IV
:
11821 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11822 get_pointer(&n
[4])));
11824 case OPCODE_PROGRAM_UNIFORM_1UI
:
11825 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11827 case OPCODE_PROGRAM_UNIFORM_2UI
:
11828 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11829 n
[3].ui
, n
[4].ui
));
11831 case OPCODE_PROGRAM_UNIFORM_3UI
:
11832 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11833 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11835 case OPCODE_PROGRAM_UNIFORM_4UI
:
11836 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11838 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11840 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11841 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11842 get_pointer(&n
[4])));
11844 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11845 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11846 get_pointer(&n
[4])));
11848 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11849 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11850 get_pointer(&n
[4])));
11852 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11853 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11854 get_pointer(&n
[4])));
11856 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11857 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11858 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11859 get_pointer(&n
[5])));
11861 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11862 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11863 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11864 get_pointer(&n
[5])));
11866 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11867 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11868 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11869 get_pointer(&n
[5])));
11871 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11872 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11873 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11874 get_pointer(&n
[5])));
11876 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11877 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11878 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11879 get_pointer(&n
[5])));
11881 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11882 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11883 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11884 get_pointer(&n
[5])));
11886 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11887 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11888 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11889 get_pointer(&n
[5])));
11891 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11892 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11893 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11894 get_pointer(&n
[5])));
11896 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11897 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11898 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11899 get_pointer(&n
[5])));
11901 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11902 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11903 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11904 get_pointer(&n
[5])));
11906 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11907 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11908 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11909 get_pointer(&n
[5])));
11911 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11912 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11913 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11914 get_pointer(&n
[5])));
11916 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11917 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11918 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11919 get_pointer(&n
[5])));
11921 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11922 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11923 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11924 get_pointer(&n
[5])));
11926 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11927 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11928 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11929 get_pointer(&n
[5])));
11931 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11932 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11933 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11934 get_pointer(&n
[5])));
11936 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11937 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11938 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11939 get_pointer(&n
[5])));
11941 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11942 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11943 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11944 get_pointer(&n
[5])));
11947 case OPCODE_CLIP_CONTROL
:
11948 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11951 case OPCODE_CLAMP_COLOR
:
11952 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11955 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11956 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11958 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11959 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11961 case OPCODE_ATTR_1F_NV
:
11962 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11964 case OPCODE_ATTR_2F_NV
:
11965 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11967 case OPCODE_ATTR_3F_NV
:
11968 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11970 case OPCODE_ATTR_4F_NV
:
11971 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11973 case OPCODE_ATTR_1F_ARB
:
11974 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11976 case OPCODE_ATTR_2F_ARB
:
11977 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11979 case OPCODE_ATTR_3F_ARB
:
11980 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11982 case OPCODE_ATTR_4F_ARB
:
11983 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11985 case OPCODE_ATTR_1D
: {
11986 GLdouble
*d
= (GLdouble
*) &n
[2];
11987 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11990 case OPCODE_ATTR_2D
: {
11991 GLdouble
*d
= (GLdouble
*) &n
[2];
11992 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11995 case OPCODE_ATTR_3D
: {
11996 GLdouble
*d
= (GLdouble
*) &n
[2];
11997 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
12000 case OPCODE_ATTR_4D
: {
12001 GLdouble
*d
= (GLdouble
*) &n
[2];
12002 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
12005 case OPCODE_MATERIAL
:
12006 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
12009 CALL_Begin(ctx
->Exec
, (n
[1].e
));
12012 CALL_End(ctx
->Exec
, ());
12015 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12017 case OPCODE_EVAL_C1
:
12018 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
12020 case OPCODE_EVAL_C2
:
12021 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12023 case OPCODE_EVAL_P1
:
12024 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
12026 case OPCODE_EVAL_P2
:
12027 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12030 /* GL_EXT_texture_integer */
12031 case OPCODE_CLEARCOLOR_I
:
12032 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12034 case OPCODE_CLEARCOLOR_UI
:
12035 CALL_ClearColorIuiEXT(ctx
->Exec
,
12036 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
12038 case OPCODE_TEXPARAMETER_I
:
12041 params
[0] = n
[3].i
;
12042 params
[1] = n
[4].i
;
12043 params
[2] = n
[5].i
;
12044 params
[3] = n
[6].i
;
12045 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12048 case OPCODE_TEXPARAMETER_UI
:
12051 params
[0] = n
[3].ui
;
12052 params
[1] = n
[4].ui
;
12053 params
[2] = n
[5].ui
;
12054 params
[3] = n
[6].ui
;
12055 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12059 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
12060 /* GL_ARB_instanced_arrays */
12061 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12064 case OPCODE_TEXTURE_BARRIER_NV
:
12065 CALL_TextureBarrierNV(ctx
->Exec
, ());
12068 /* GL_EXT/ARB_transform_feedback */
12069 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
12070 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
12072 case OPCODE_END_TRANSFORM_FEEDBACK
:
12073 CALL_EndTransformFeedback(ctx
->Exec
, ());
12075 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
12076 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12078 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
12079 CALL_PauseTransformFeedback(ctx
->Exec
, ());
12081 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
12082 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
12084 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
12085 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12087 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
12088 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
12089 (n
[1].e
, n
[2].ui
, n
[3].ui
));
12091 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
12092 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
12093 (n
[1].e
, n
[2].ui
, n
[3].si
));
12095 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
12096 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
12097 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
12101 case OPCODE_BIND_SAMPLER
:
12102 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12104 case OPCODE_SAMPLER_PARAMETERIV
:
12107 params
[0] = n
[3].i
;
12108 params
[1] = n
[4].i
;
12109 params
[2] = n
[5].i
;
12110 params
[3] = n
[6].i
;
12111 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12114 case OPCODE_SAMPLER_PARAMETERFV
:
12117 params
[0] = n
[3].f
;
12118 params
[1] = n
[4].f
;
12119 params
[2] = n
[5].f
;
12120 params
[3] = n
[6].f
;
12121 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12124 case OPCODE_SAMPLER_PARAMETERIIV
:
12127 params
[0] = n
[3].i
;
12128 params
[1] = n
[4].i
;
12129 params
[2] = n
[5].i
;
12130 params
[3] = n
[6].i
;
12131 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12134 case OPCODE_SAMPLER_PARAMETERUIV
:
12137 params
[0] = n
[3].ui
;
12138 params
[1] = n
[4].ui
;
12139 params
[2] = n
[5].ui
;
12140 params
[3] = n
[6].ui
;
12141 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12145 /* ARB_compute_shader */
12146 case OPCODE_DISPATCH_COMPUTE
:
12147 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12151 case OPCODE_WAIT_SYNC
:
12153 union uint64_pair p
;
12154 p
.uint32
[0] = n
[2].ui
;
12155 p
.uint32
[1] = n
[3].ui
;
12156 CALL_WaitSync(ctx
->Exec
,
12157 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
12161 /* GL_NV_conditional_render */
12162 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
12163 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
12165 case OPCODE_END_CONDITIONAL_RENDER
:
12166 CALL_EndConditionalRender(ctx
->Exec
, ());
12169 case OPCODE_UNIFORM_BLOCK_BINDING
:
12170 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12173 case OPCODE_UNIFORM_SUBROUTINES
:
12174 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
12175 get_pointer(&n
[3])));
12178 /* GL_EXT_window_rectangles */
12179 case OPCODE_WINDOW_RECTANGLES
:
12180 CALL_WindowRectanglesEXT(
12181 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
12184 /* GL_NV_conservative_raster */
12185 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
12186 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12189 /* GL_NV_conservative_raster_dilate */
12190 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
12191 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12194 /* GL_NV_conservative_raster_pre_snap_triangles */
12195 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
12196 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12199 /* GL_EXT_direct_state_access */
12200 case OPCODE_MATRIX_LOAD
:
12201 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12203 case OPCODE_MATRIX_MULT
:
12204 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12206 case OPCODE_MATRIX_ROTATE
:
12207 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12209 case OPCODE_MATRIX_SCALE
:
12210 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12212 case OPCODE_MATRIX_TRANSLATE
:
12213 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12215 case OPCODE_MATRIX_LOAD_IDENTITY
:
12216 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
12218 case OPCODE_MATRIX_ORTHO
:
12219 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
12220 n
[2].f
, n
[3].f
, n
[4].f
,
12221 n
[5].f
, n
[6].f
, n
[7].f
));
12223 case OPCODE_MATRIX_FRUSTUM
:
12224 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
12225 n
[2].f
, n
[3].f
, n
[4].f
,
12226 n
[5].f
, n
[6].f
, n
[7].f
));
12228 case OPCODE_MATRIX_PUSH
:
12229 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
12231 case OPCODE_MATRIX_POP
:
12232 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
12234 case OPCODE_TEXTUREPARAMETER_F
:
12237 params
[0] = n
[4].f
;
12238 params
[1] = n
[5].f
;
12239 params
[2] = n
[6].f
;
12240 params
[3] = n
[7].f
;
12241 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12244 case OPCODE_TEXTUREPARAMETER_I
:
12247 params
[0] = n
[4].i
;
12248 params
[1] = n
[5].i
;
12249 params
[2] = n
[6].i
;
12250 params
[3] = n
[7].i
;
12251 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12254 case OPCODE_TEXTURE_IMAGE1D
:
12256 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12257 ctx
->Unpack
= ctx
->DefaultPacking
;
12258 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12259 n
[2].e
, /* target */
12260 n
[3].i
, /* level */
12261 n
[4].i
, /* components */
12262 n
[5].i
, /* width */
12263 n
[6].e
, /* border */
12264 n
[7].e
, /* format */
12266 get_pointer(&n
[9])));
12267 ctx
->Unpack
= save
; /* restore */
12270 case OPCODE_TEXTURE_IMAGE2D
:
12272 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12273 ctx
->Unpack
= ctx
->DefaultPacking
;
12274 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12275 n
[2].e
, /* target */
12276 n
[3].i
, /* level */
12277 n
[4].i
, /* components */
12278 n
[5].i
, /* width */
12279 n
[6].i
, /* height */
12280 n
[7].e
, /* border */
12281 n
[8].e
, /* format */
12283 get_pointer(&n
[10])));
12284 ctx
->Unpack
= save
; /* restore */
12287 case OPCODE_TEXTURE_IMAGE3D
:
12289 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12290 ctx
->Unpack
= ctx
->DefaultPacking
;
12291 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12292 n
[2].e
, /* target */
12293 n
[3].i
, /* level */
12294 n
[4].i
, /* components */
12295 n
[5].i
, /* width */
12296 n
[6].i
, /* height */
12297 n
[7].i
, /* depth */
12298 n
[8].e
, /* border */
12299 n
[9].e
, /* format */
12300 n
[10].e
, /* type */
12301 get_pointer(&n
[11])));
12302 ctx
->Unpack
= save
; /* restore */
12305 case OPCODE_TEXTURE_SUB_IMAGE1D
:
12307 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12308 ctx
->Unpack
= ctx
->DefaultPacking
;
12309 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12310 n
[4].i
, n
[5].i
, n
[6].e
,
12311 n
[7].e
, get_pointer(&n
[8])));
12312 ctx
->Unpack
= save
; /* restore */
12315 case OPCODE_TEXTURE_SUB_IMAGE2D
:
12317 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12318 ctx
->Unpack
= ctx
->DefaultPacking
;
12319 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12320 n
[4].i
, n
[5].i
, n
[6].e
,
12321 n
[7].i
, n
[8].e
, n
[9].e
,
12322 get_pointer(&n
[10])));
12323 ctx
->Unpack
= save
;
12326 case OPCODE_TEXTURE_SUB_IMAGE3D
:
12328 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12329 ctx
->Unpack
= ctx
->DefaultPacking
;
12330 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12331 n
[4].i
, n
[5].i
, n
[6].i
,
12332 n
[7].i
, n
[8].i
, n
[9].i
,
12334 get_pointer(&n
[12])));
12335 ctx
->Unpack
= save
; /* restore */
12338 case OPCODE_COPY_TEXTURE_IMAGE1D
:
12339 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12340 n
[4].e
, n
[5].i
, n
[6].i
,
12343 case OPCODE_COPY_TEXTURE_IMAGE2D
:
12344 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12345 n
[4].e
, n
[5].i
, n
[6].i
,
12346 n
[7].i
, n
[8].i
, n
[9].i
));
12348 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
12349 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12350 n
[4].i
, n
[5].i
, n
[6].i
,
12353 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
12354 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12355 n
[4].i
, n
[5].i
, n
[6].i
,
12356 n
[7].i
, n
[8].i
, n
[9].i
));
12358 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
12359 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12360 n
[4].i
, n
[5].i
, n
[6].i
,
12361 n
[7].i
, n
[8].i
, n
[9].i
,
12364 case OPCODE_BIND_MULTITEXTURE
:
12365 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
12367 case OPCODE_MULTITEXPARAMETER_F
:
12370 params
[0] = n
[4].f
;
12371 params
[1] = n
[5].f
;
12372 params
[2] = n
[6].f
;
12373 params
[3] = n
[7].f
;
12374 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12377 case OPCODE_MULTITEXPARAMETER_I
:
12380 params
[0] = n
[4].i
;
12381 params
[1] = n
[5].i
;
12382 params
[2] = n
[6].i
;
12383 params
[3] = n
[7].i
;
12384 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12387 case OPCODE_MULTITEX_IMAGE1D
:
12389 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12390 ctx
->Unpack
= ctx
->DefaultPacking
;
12391 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12392 n
[2].e
, /* target */
12393 n
[3].i
, /* level */
12394 n
[4].i
, /* components */
12395 n
[5].i
, /* width */
12396 n
[6].e
, /* border */
12397 n
[7].e
, /* format */
12399 get_pointer(&n
[9])));
12400 ctx
->Unpack
= save
; /* restore */
12403 case OPCODE_MULTITEX_IMAGE2D
:
12405 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12406 ctx
->Unpack
= ctx
->DefaultPacking
;
12407 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12408 n
[2].e
, /* target */
12409 n
[3].i
, /* level */
12410 n
[4].i
, /* components */
12411 n
[5].i
, /* width */
12412 n
[6].i
, /* height */
12413 n
[7].e
, /* border */
12414 n
[8].e
, /* format */
12416 get_pointer(&n
[10])));
12417 ctx
->Unpack
= save
; /* restore */
12420 case OPCODE_MULTITEX_IMAGE3D
:
12422 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12423 ctx
->Unpack
= ctx
->DefaultPacking
;
12424 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12425 n
[2].e
, /* target */
12426 n
[3].i
, /* level */
12427 n
[4].i
, /* components */
12428 n
[5].i
, /* width */
12429 n
[6].i
, /* height */
12430 n
[7].i
, /* depth */
12431 n
[8].e
, /* border */
12432 n
[9].e
, /* format */
12433 n
[10].e
, /* type */
12434 get_pointer(&n
[11])));
12435 ctx
->Unpack
= save
; /* restore */
12438 case OPCODE_MULTITEX_SUB_IMAGE1D
:
12440 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12441 ctx
->Unpack
= ctx
->DefaultPacking
;
12442 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12443 n
[4].i
, n
[5].i
, n
[6].e
,
12444 n
[7].e
, get_pointer(&n
[8])));
12445 ctx
->Unpack
= save
; /* restore */
12448 case OPCODE_MULTITEX_SUB_IMAGE2D
:
12450 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12451 ctx
->Unpack
= ctx
->DefaultPacking
;
12452 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12453 n
[4].i
, n
[5].i
, n
[6].e
,
12454 n
[7].i
, n
[8].e
, n
[9].e
,
12455 get_pointer(&n
[10])));
12456 ctx
->Unpack
= save
; /* restore */
12459 case OPCODE_MULTITEX_SUB_IMAGE3D
:
12461 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12462 ctx
->Unpack
= ctx
->DefaultPacking
;
12463 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12464 n
[4].i
, n
[5].i
, n
[6].i
,
12465 n
[7].i
, n
[8].i
, n
[9].i
,
12467 get_pointer(&n
[12])));
12468 ctx
->Unpack
= save
; /* restore */
12471 case OPCODE_COPY_MULTITEX_IMAGE1D
:
12472 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12473 n
[4].e
, n
[5].i
, n
[6].i
,
12476 case OPCODE_COPY_MULTITEX_IMAGE2D
:
12477 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12478 n
[4].e
, n
[5].i
, n
[6].i
,
12479 n
[7].i
, n
[8].i
, n
[9].i
));
12481 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
12482 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12483 n
[4].i
, n
[5].i
, n
[6].i
,
12486 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
12487 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12488 n
[4].i
, n
[5].i
, n
[6].i
,
12489 n
[7].i
, n
[8].i
, n
[9].i
));
12491 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
12492 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12493 n
[4].i
, n
[5].i
, n
[6].i
,
12494 n
[7].i
, n
[8].i
, n
[9].i
,
12497 case OPCODE_MULTITEXENV
:
12500 params
[0] = n
[4].f
;
12501 params
[1] = n
[5].f
;
12502 params
[2] = n
[6].f
;
12503 params
[3] = n
[7].f
;
12504 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12507 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
12508 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12509 n
[4].e
, n
[5].i
, n
[6].i
,
12510 n
[7].i
, get_pointer(&n
[8])));
12512 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
12513 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12514 n
[4].e
, n
[5].i
, n
[6].i
,
12516 get_pointer(&n
[9])));
12518 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
12519 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12520 n
[4].e
, n
[5].i
, n
[6].i
,
12521 n
[7].i
, n
[8].i
, n
[9].i
,
12522 get_pointer(&n
[10])));
12524 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
12525 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
12526 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12527 n
[5].i
, n
[6].e
, n
[7].i
,
12528 get_pointer(&n
[8])));
12530 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
12531 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
12532 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12533 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12534 n
[9].i
, get_pointer(&n
[10])));
12536 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
12537 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
12538 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12539 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12540 n
[9].i
, n
[10].e
, n
[11].i
,
12541 get_pointer(&n
[12])));
12544 case OPCODE_CONTINUE
:
12545 n
= (Node
*) get_pointer(&n
[1]);
12550 case OPCODE_END_OF_LIST
:
12556 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
12558 _mesa_problem(ctx
, "%s", msg
);
12563 /* increment n to point to next compiled command */
12564 if (opcode
!= OPCODE_CONTINUE
) {
12565 assert(InstSize
[opcode
] > 0);
12566 n
+= InstSize
[opcode
];
12571 vbo_save_EndCallList(ctx
);
12573 ctx
->ListState
.CallDepth
--;
12578 /**********************************************************************/
12580 /**********************************************************************/
12583 * Test if a display list number is valid.
12585 GLboolean GLAPIENTRY
12586 _mesa_IsList(GLuint list
)
12588 GET_CURRENT_CONTEXT(ctx
);
12589 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12590 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
12591 return islist(ctx
, list
);
12596 * Delete a sequence of consecutive display lists.
12599 _mesa_DeleteLists(GLuint list
, GLsizei range
)
12601 GET_CURRENT_CONTEXT(ctx
);
12603 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12604 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12607 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
12612 /* We may be deleting a set of bitmap lists. See if there's a
12613 * bitmap atlas to free.
12615 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
12617 _mesa_delete_bitmap_atlas(ctx
, atlas
);
12618 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
12622 for (i
= list
; i
< list
+ range
; i
++) {
12623 destroy_list(ctx
, i
);
12629 * Return a display list number, n, such that lists n through n+range-1
12633 _mesa_GenLists(GLsizei range
)
12635 GET_CURRENT_CONTEXT(ctx
);
12637 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12638 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
12641 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
12649 * Make this an atomic operation
12651 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
12653 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
12655 /* reserve the list IDs by with empty/dummy lists */
12657 for (i
= 0; i
< range
; i
++) {
12658 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
12659 make_list(base
+ i
, 1));
12663 if (USE_BITMAP_ATLAS
&&
12665 ctx
->Driver
.DrawAtlasBitmaps
) {
12666 /* "range > 16" is a rough heuristic to guess when glGenLists might be
12667 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
12668 * Create the empty atlas now.
12670 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
12672 atlas
= alloc_bitmap_atlas(ctx
, base
);
12675 /* Atlas _should_ be new/empty now, but clobbering is OK */
12676 assert(atlas
->numBitmaps
== 0);
12677 atlas
->numBitmaps
= range
;
12681 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
12688 * Begin a new display list.
12691 _mesa_NewList(GLuint name
, GLenum mode
)
12693 GET_CURRENT_CONTEXT(ctx
);
12695 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
12696 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12698 if (MESA_VERBOSE
& VERBOSE_API
)
12699 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
12700 _mesa_enum_to_string(mode
));
12703 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
12707 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
12708 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
12712 if (ctx
->ListState
.CurrentList
) {
12713 /* already compiling a display list */
12714 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
12718 ctx
->CompileFlag
= GL_TRUE
;
12719 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
12721 /* Reset accumulated list state */
12722 invalidate_saved_current_state( ctx
);
12724 /* Allocate new display list */
12725 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
12726 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
12727 ctx
->ListState
.CurrentPos
= 0;
12729 vbo_save_NewList(ctx
, name
, mode
);
12731 ctx
->CurrentServerDispatch
= ctx
->Save
;
12732 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12733 if (ctx
->MarshalExec
== NULL
) {
12734 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12740 * End definition of current display list.
12743 _mesa_EndList(void)
12745 GET_CURRENT_CONTEXT(ctx
);
12746 SAVE_FLUSH_VERTICES(ctx
);
12747 FLUSH_VERTICES(ctx
, 0);
12749 if (MESA_VERBOSE
& VERBOSE_API
)
12750 _mesa_debug(ctx
, "glEndList\n");
12752 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
12753 _mesa_error(ctx
, GL_INVALID_OPERATION
,
12754 "glEndList() called inside glBegin/End");
12757 /* Check that a list is under construction */
12758 if (!ctx
->ListState
.CurrentList
) {
12759 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
12763 /* Call before emitting END_OF_LIST, in case the driver wants to
12764 * emit opcodes itself.
12766 vbo_save_EndList(ctx
);
12768 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
12772 /* Destroy old list, if any */
12773 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
12775 /* Install the new list */
12776 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
12777 ctx
->ListState
.CurrentList
->Name
,
12778 ctx
->ListState
.CurrentList
);
12781 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
12782 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
12784 ctx
->ListState
.CurrentList
= NULL
;
12785 ctx
->ListState
.CurrentBlock
= NULL
;
12786 ctx
->ListState
.CurrentPos
= 0;
12787 ctx
->ExecuteFlag
= GL_TRUE
;
12788 ctx
->CompileFlag
= GL_FALSE
;
12790 ctx
->CurrentServerDispatch
= ctx
->Exec
;
12791 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12792 if (ctx
->MarshalExec
== NULL
) {
12793 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12799 _mesa_CallList(GLuint list
)
12801 GLboolean save_compile_flag
;
12802 GET_CURRENT_CONTEXT(ctx
);
12803 FLUSH_CURRENT(ctx
, 0);
12805 if (MESA_VERBOSE
& VERBOSE_API
)
12806 _mesa_debug(ctx
, "glCallList %d\n", list
);
12809 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
12814 mesa_print_display_list( list
);
12816 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
12817 * execute the display list, and restore the CompileFlag.
12819 save_compile_flag
= ctx
->CompileFlag
;
12820 if (save_compile_flag
) {
12821 ctx
->CompileFlag
= GL_FALSE
;
12824 execute_list(ctx
, list
);
12825 ctx
->CompileFlag
= save_compile_flag
;
12827 /* also restore API function pointers to point to "save" versions */
12828 if (save_compile_flag
) {
12829 ctx
->CurrentServerDispatch
= ctx
->Save
;
12830 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12831 if (ctx
->MarshalExec
== NULL
) {
12832 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12839 * Try to execute a glCallLists() command where the display lists contain
12840 * glBitmap commands with a texture atlas.
12841 * \return true for success, false otherwise
12844 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
12847 struct gl_bitmap_atlas
*atlas
;
12850 if (!USE_BITMAP_ATLAS
||
12851 !ctx
->Current
.RasterPosValid
||
12852 ctx
->List
.ListBase
== 0 ||
12853 type
!= GL_UNSIGNED_BYTE
||
12854 !ctx
->Driver
.DrawAtlasBitmaps
) {
12859 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12862 /* Even if glGenLists wasn't called, we can still try to create
12865 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12868 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
12869 /* Try to build the bitmap atlas now.
12870 * If the atlas was created in glGenLists, we'll have recorded the
12871 * number of lists (bitmaps). Otherwise, take a guess at 256.
12873 if (atlas
->numBitmaps
== 0)
12874 atlas
->numBitmaps
= 256;
12875 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
12878 if (!atlas
|| !atlas
->complete
) {
12882 /* check that all display list IDs are in the atlas */
12883 for (i
= 0; i
< n
; i
++) {
12884 const GLubyte
*ids
= (const GLubyte
*) lists
;
12886 if (ids
[i
] >= atlas
->numBitmaps
) {
12891 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
12898 * Execute glCallLists: call multiple display lists.
12901 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12903 GET_CURRENT_CONTEXT(ctx
);
12905 GLboolean save_compile_flag
;
12907 if (MESA_VERBOSE
& VERBOSE_API
)
12908 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12912 case GL_UNSIGNED_BYTE
:
12914 case GL_UNSIGNED_SHORT
:
12916 case GL_UNSIGNED_INT
:
12924 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12929 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12931 } else if (n
== 0 || lists
== NULL
) {
12932 /* nothing to do */
12936 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12940 /* Save the CompileFlag status, turn it off, execute display list,
12941 * and restore the CompileFlag.
12943 save_compile_flag
= ctx
->CompileFlag
;
12944 ctx
->CompileFlag
= GL_FALSE
;
12946 for (i
= 0; i
< n
; i
++) {
12947 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12948 execute_list(ctx
, list
);
12951 ctx
->CompileFlag
= save_compile_flag
;
12953 /* also restore API function pointers to point to "save" versions */
12954 if (save_compile_flag
) {
12955 ctx
->CurrentServerDispatch
= ctx
->Save
;
12956 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12957 if (ctx
->MarshalExec
== NULL
) {
12958 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12965 * Set the offset added to list numbers in glCallLists.
12968 _mesa_ListBase(GLuint base
)
12970 GET_CURRENT_CONTEXT(ctx
);
12971 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12972 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12973 ctx
->List
.ListBase
= base
;
12977 * Setup the given dispatch table to point to Mesa's display list
12978 * building functions.
12980 * This does not include any of the tnl functions - they are
12981 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12985 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12987 struct _glapi_table
*table
= ctx
->Save
;
12988 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12990 /* Initially populate the dispatch table with the contents of the
12991 * normal-execution dispatch table. This lets us skip populating functions
12992 * that should be called directly instead of compiled into display lists.
12994 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12996 _mesa_loopback_init_api_table(ctx
, table
);
12998 /* VBO functions */
12999 vbo_initialize_save_dispatch(ctx
, table
);
13002 SET_Accum(table
, save_Accum
);
13003 SET_AlphaFunc(table
, save_AlphaFunc
);
13004 SET_Bitmap(table
, save_Bitmap
);
13005 SET_BlendFunc(table
, save_BlendFunc
);
13006 SET_CallList(table
, save_CallList
);
13007 SET_CallLists(table
, save_CallLists
);
13008 SET_Clear(table
, save_Clear
);
13009 SET_ClearAccum(table
, save_ClearAccum
);
13010 SET_ClearColor(table
, save_ClearColor
);
13011 SET_ClearDepth(table
, save_ClearDepth
);
13012 SET_ClearIndex(table
, save_ClearIndex
);
13013 SET_ClearStencil(table
, save_ClearStencil
);
13014 SET_ClipPlane(table
, save_ClipPlane
);
13015 SET_ColorMask(table
, save_ColorMask
);
13016 SET_ColorMaski(table
, save_ColorMaskIndexed
);
13017 SET_ColorMaterial(table
, save_ColorMaterial
);
13018 SET_CopyPixels(table
, save_CopyPixels
);
13019 SET_CullFace(table
, save_CullFace
);
13020 SET_DepthFunc(table
, save_DepthFunc
);
13021 SET_DepthMask(table
, save_DepthMask
);
13022 SET_DepthRange(table
, save_DepthRange
);
13023 SET_Disable(table
, save_Disable
);
13024 SET_Disablei(table
, save_DisableIndexed
);
13025 SET_DrawBuffer(table
, save_DrawBuffer
);
13026 SET_DrawPixels(table
, save_DrawPixels
);
13027 SET_Enable(table
, save_Enable
);
13028 SET_Enablei(table
, save_EnableIndexed
);
13029 SET_EvalMesh1(table
, save_EvalMesh1
);
13030 SET_EvalMesh2(table
, save_EvalMesh2
);
13031 SET_Fogf(table
, save_Fogf
);
13032 SET_Fogfv(table
, save_Fogfv
);
13033 SET_Fogi(table
, save_Fogi
);
13034 SET_Fogiv(table
, save_Fogiv
);
13035 SET_FrontFace(table
, save_FrontFace
);
13036 SET_Frustum(table
, save_Frustum
);
13037 SET_Hint(table
, save_Hint
);
13038 SET_IndexMask(table
, save_IndexMask
);
13039 SET_InitNames(table
, save_InitNames
);
13040 SET_LightModelf(table
, save_LightModelf
);
13041 SET_LightModelfv(table
, save_LightModelfv
);
13042 SET_LightModeli(table
, save_LightModeli
);
13043 SET_LightModeliv(table
, save_LightModeliv
);
13044 SET_Lightf(table
, save_Lightf
);
13045 SET_Lightfv(table
, save_Lightfv
);
13046 SET_Lighti(table
, save_Lighti
);
13047 SET_Lightiv(table
, save_Lightiv
);
13048 SET_LineStipple(table
, save_LineStipple
);
13049 SET_LineWidth(table
, save_LineWidth
);
13050 SET_ListBase(table
, save_ListBase
);
13051 SET_LoadIdentity(table
, save_LoadIdentity
);
13052 SET_LoadMatrixd(table
, save_LoadMatrixd
);
13053 SET_LoadMatrixf(table
, save_LoadMatrixf
);
13054 SET_LoadName(table
, save_LoadName
);
13055 SET_LogicOp(table
, save_LogicOp
);
13056 SET_Map1d(table
, save_Map1d
);
13057 SET_Map1f(table
, save_Map1f
);
13058 SET_Map2d(table
, save_Map2d
);
13059 SET_Map2f(table
, save_Map2f
);
13060 SET_MapGrid1d(table
, save_MapGrid1d
);
13061 SET_MapGrid1f(table
, save_MapGrid1f
);
13062 SET_MapGrid2d(table
, save_MapGrid2d
);
13063 SET_MapGrid2f(table
, save_MapGrid2f
);
13064 SET_MatrixMode(table
, save_MatrixMode
);
13065 SET_MultMatrixd(table
, save_MultMatrixd
);
13066 SET_MultMatrixf(table
, save_MultMatrixf
);
13067 SET_NewList(table
, save_NewList
);
13068 SET_Ortho(table
, save_Ortho
);
13069 SET_PassThrough(table
, save_PassThrough
);
13070 SET_PixelMapfv(table
, save_PixelMapfv
);
13071 SET_PixelMapuiv(table
, save_PixelMapuiv
);
13072 SET_PixelMapusv(table
, save_PixelMapusv
);
13073 SET_PixelTransferf(table
, save_PixelTransferf
);
13074 SET_PixelTransferi(table
, save_PixelTransferi
);
13075 SET_PixelZoom(table
, save_PixelZoom
);
13076 SET_PointSize(table
, save_PointSize
);
13077 SET_PolygonMode(table
, save_PolygonMode
);
13078 SET_PolygonOffset(table
, save_PolygonOffset
);
13079 SET_PolygonStipple(table
, save_PolygonStipple
);
13080 SET_PopAttrib(table
, save_PopAttrib
);
13081 SET_PopMatrix(table
, save_PopMatrix
);
13082 SET_PopName(table
, save_PopName
);
13083 SET_PushAttrib(table
, save_PushAttrib
);
13084 SET_PushMatrix(table
, save_PushMatrix
);
13085 SET_PushName(table
, save_PushName
);
13086 SET_RasterPos2d(table
, save_RasterPos2d
);
13087 SET_RasterPos2dv(table
, save_RasterPos2dv
);
13088 SET_RasterPos2f(table
, save_RasterPos2f
);
13089 SET_RasterPos2fv(table
, save_RasterPos2fv
);
13090 SET_RasterPos2i(table
, save_RasterPos2i
);
13091 SET_RasterPos2iv(table
, save_RasterPos2iv
);
13092 SET_RasterPos2s(table
, save_RasterPos2s
);
13093 SET_RasterPos2sv(table
, save_RasterPos2sv
);
13094 SET_RasterPos3d(table
, save_RasterPos3d
);
13095 SET_RasterPos3dv(table
, save_RasterPos3dv
);
13096 SET_RasterPos3f(table
, save_RasterPos3f
);
13097 SET_RasterPos3fv(table
, save_RasterPos3fv
);
13098 SET_RasterPos3i(table
, save_RasterPos3i
);
13099 SET_RasterPos3iv(table
, save_RasterPos3iv
);
13100 SET_RasterPos3s(table
, save_RasterPos3s
);
13101 SET_RasterPos3sv(table
, save_RasterPos3sv
);
13102 SET_RasterPos4d(table
, save_RasterPos4d
);
13103 SET_RasterPos4dv(table
, save_RasterPos4dv
);
13104 SET_RasterPos4f(table
, save_RasterPos4f
);
13105 SET_RasterPos4fv(table
, save_RasterPos4fv
);
13106 SET_RasterPos4i(table
, save_RasterPos4i
);
13107 SET_RasterPos4iv(table
, save_RasterPos4iv
);
13108 SET_RasterPos4s(table
, save_RasterPos4s
);
13109 SET_RasterPos4sv(table
, save_RasterPos4sv
);
13110 SET_ReadBuffer(table
, save_ReadBuffer
);
13111 SET_Rectf(table
, save_Rectf
);
13112 SET_Rotated(table
, save_Rotated
);
13113 SET_Rotatef(table
, save_Rotatef
);
13114 SET_Scaled(table
, save_Scaled
);
13115 SET_Scalef(table
, save_Scalef
);
13116 SET_Scissor(table
, save_Scissor
);
13117 SET_ShadeModel(table
, save_ShadeModel
);
13118 SET_StencilFunc(table
, save_StencilFunc
);
13119 SET_StencilMask(table
, save_StencilMask
);
13120 SET_StencilOp(table
, save_StencilOp
);
13121 SET_TexEnvf(table
, save_TexEnvf
);
13122 SET_TexEnvfv(table
, save_TexEnvfv
);
13123 SET_TexEnvi(table
, save_TexEnvi
);
13124 SET_TexEnviv(table
, save_TexEnviv
);
13125 SET_TexGend(table
, save_TexGend
);
13126 SET_TexGendv(table
, save_TexGendv
);
13127 SET_TexGenf(table
, save_TexGenf
);
13128 SET_TexGenfv(table
, save_TexGenfv
);
13129 SET_TexGeni(table
, save_TexGeni
);
13130 SET_TexGeniv(table
, save_TexGeniv
);
13131 SET_TexImage1D(table
, save_TexImage1D
);
13132 SET_TexImage2D(table
, save_TexImage2D
);
13133 SET_TexParameterf(table
, save_TexParameterf
);
13134 SET_TexParameterfv(table
, save_TexParameterfv
);
13135 SET_TexParameteri(table
, save_TexParameteri
);
13136 SET_TexParameteriv(table
, save_TexParameteriv
);
13137 SET_Translated(table
, save_Translated
);
13138 SET_Translatef(table
, save_Translatef
);
13139 SET_Viewport(table
, save_Viewport
);
13142 SET_BindTexture(table
, save_BindTexture
);
13143 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
13144 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
13145 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
13146 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
13147 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
13148 SET_TexSubImage1D(table
, save_TexSubImage1D
);
13149 SET_TexSubImage2D(table
, save_TexSubImage2D
);
13152 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
13153 SET_TexImage3D(table
, save_TexImage3D
);
13154 SET_TexSubImage3D(table
, save_TexSubImage3D
);
13157 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
13158 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
13159 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
13161 /* ATI_separate_stencil */
13162 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
13164 /* GL_ARB_imaging */
13165 /* Not all are supported */
13166 SET_BlendColor(table
, save_BlendColor
);
13167 SET_BlendEquation(table
, save_BlendEquation
);
13169 /* 2. GL_EXT_blend_color */
13171 SET_BlendColorEXT(table
, save_BlendColorEXT
);
13174 /* 6. GL_EXT_texture3d */
13176 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
13177 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
13178 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
13181 /* 37. GL_EXT_blend_minmax */
13183 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
13186 /* 54. GL_EXT_point_parameters */
13187 SET_PointParameterf(table
, save_PointParameterfEXT
);
13188 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
13190 /* 91. GL_ARB_tessellation_shader */
13191 SET_PatchParameteri(table
, save_PatchParameteri
);
13192 SET_PatchParameterfv(table
, save_PatchParameterfv
);
13194 /* 100. ARB_viewport_array */
13195 SET_ViewportArrayv(table
, save_ViewportArrayv
);
13196 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
13197 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
13198 SET_ScissorArrayv(table
, save_ScissorArrayv
);
13199 SET_ScissorIndexed(table
, save_ScissorIndexed
);
13200 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
13201 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
13202 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
13204 /* 122. ARB_compute_shader */
13205 SET_DispatchCompute(table
, save_DispatchCompute
);
13206 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
13208 /* 173. GL_EXT_blend_func_separate */
13209 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
13211 /* 197. GL_MESA_window_pos */
13212 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
13213 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
13214 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
13215 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
13216 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
13217 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
13218 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
13219 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
13220 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
13221 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
13222 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
13223 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
13224 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
13225 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
13226 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
13227 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
13228 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
13229 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
13230 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
13231 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
13232 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
13233 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
13234 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
13235 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
13237 /* 245. GL_ATI_fragment_shader */
13238 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
13239 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
13241 /* 262. GL_NV_point_sprite */
13242 SET_PointParameteri(table
, save_PointParameteriNV
);
13243 SET_PointParameteriv(table
, save_PointParameterivNV
);
13245 /* 268. GL_EXT_stencil_two_side */
13246 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
13248 /* ???. GL_EXT_depth_bounds_test */
13249 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
13251 /* ARB 1. GL_ARB_multitexture */
13252 SET_ActiveTexture(table
, save_ActiveTextureARB
);
13254 /* ARB 3. GL_ARB_transpose_matrix */
13255 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
13256 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
13257 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
13258 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
13260 /* ARB 5. GL_ARB_multisample */
13261 SET_SampleCoverage(table
, save_SampleCoverageARB
);
13263 /* ARB 12. GL_ARB_texture_compression */
13264 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
13265 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
13266 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
13267 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
13268 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
13269 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
13271 /* ARB 14. GL_ARB_point_parameters */
13272 /* aliased with EXT_point_parameters functions */
13274 /* ARB 25. GL_ARB_window_pos */
13275 /* aliased with MESA_window_pos functions */
13277 /* ARB 26. GL_ARB_vertex_program */
13278 /* ARB 27. GL_ARB_fragment_program */
13279 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
13280 SET_ProgramStringARB(table
, save_ProgramStringARB
);
13281 SET_BindProgramARB(table
, save_BindProgramARB
);
13282 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
13283 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
13284 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
13285 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
13286 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
13287 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
13288 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
13289 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
13291 SET_BeginQuery(table
, save_BeginQueryARB
);
13292 SET_EndQuery(table
, save_EndQueryARB
);
13293 SET_QueryCounter(table
, save_QueryCounter
);
13295 SET_DrawBuffers(table
, save_DrawBuffersARB
);
13297 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
13299 SET_UseProgram(table
, save_UseProgram
);
13300 SET_Uniform1f(table
, save_Uniform1fARB
);
13301 SET_Uniform2f(table
, save_Uniform2fARB
);
13302 SET_Uniform3f(table
, save_Uniform3fARB
);
13303 SET_Uniform4f(table
, save_Uniform4fARB
);
13304 SET_Uniform1fv(table
, save_Uniform1fvARB
);
13305 SET_Uniform2fv(table
, save_Uniform2fvARB
);
13306 SET_Uniform3fv(table
, save_Uniform3fvARB
);
13307 SET_Uniform4fv(table
, save_Uniform4fvARB
);
13308 SET_Uniform1i(table
, save_Uniform1iARB
);
13309 SET_Uniform2i(table
, save_Uniform2iARB
);
13310 SET_Uniform3i(table
, save_Uniform3iARB
);
13311 SET_Uniform4i(table
, save_Uniform4iARB
);
13312 SET_Uniform1iv(table
, save_Uniform1ivARB
);
13313 SET_Uniform2iv(table
, save_Uniform2ivARB
);
13314 SET_Uniform3iv(table
, save_Uniform3ivARB
);
13315 SET_Uniform4iv(table
, save_Uniform4ivARB
);
13316 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
13317 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
13318 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
13319 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
13320 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
13321 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
13322 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
13323 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
13324 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
13326 /* 299. GL_EXT_blend_equation_separate */
13327 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
13329 /* GL_EXT_gpu_program_parameters */
13330 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
13331 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
13333 /* 364. GL_EXT_provoking_vertex */
13334 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
13336 /* GL_EXT_texture_integer */
13337 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
13338 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
13339 SET_TexParameterIiv(table
, save_TexParameterIiv
);
13340 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
13342 /* GL_ARB_clip_control */
13343 SET_ClipControl(table
, save_ClipControl
);
13345 /* GL_ARB_color_buffer_float */
13346 SET_ClampColor(table
, save_ClampColorARB
);
13349 SET_ClearBufferiv(table
, save_ClearBufferiv
);
13350 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
13351 SET_ClearBufferfv(table
, save_ClearBufferfv
);
13352 SET_ClearBufferfi(table
, save_ClearBufferfi
);
13353 SET_Uniform1ui(table
, save_Uniform1ui
);
13354 SET_Uniform2ui(table
, save_Uniform2ui
);
13355 SET_Uniform3ui(table
, save_Uniform3ui
);
13356 SET_Uniform4ui(table
, save_Uniform4ui
);
13357 SET_Uniform1uiv(table
, save_Uniform1uiv
);
13358 SET_Uniform2uiv(table
, save_Uniform2uiv
);
13359 SET_Uniform3uiv(table
, save_Uniform3uiv
);
13360 SET_Uniform4uiv(table
, save_Uniform4uiv
);
13362 /* GL_ARB_gpu_shader_fp64 */
13363 SET_Uniform1d(table
, save_Uniform1d
);
13364 SET_Uniform2d(table
, save_Uniform2d
);
13365 SET_Uniform3d(table
, save_Uniform3d
);
13366 SET_Uniform4d(table
, save_Uniform4d
);
13367 SET_Uniform1dv(table
, save_Uniform1dv
);
13368 SET_Uniform2dv(table
, save_Uniform2dv
);
13369 SET_Uniform3dv(table
, save_Uniform3dv
);
13370 SET_Uniform4dv(table
, save_Uniform4dv
);
13371 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
13372 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
13373 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
13374 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
13375 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
13376 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
13377 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
13378 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
13379 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
13382 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
13383 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
13384 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
13385 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
13386 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
13387 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
13388 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
13389 SET_DrawTransformFeedbackInstanced(table
,
13390 save_DrawTransformFeedbackInstanced
);
13391 SET_DrawTransformFeedbackStreamInstanced(table
,
13392 save_DrawTransformFeedbackStreamInstanced
);
13393 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
13394 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
13396 /* GL_ARB_instanced_arrays */
13397 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
13399 /* GL_NV_texture_barrier */
13400 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
13402 SET_BindSampler(table
, save_BindSampler
);
13403 SET_SamplerParameteri(table
, save_SamplerParameteri
);
13404 SET_SamplerParameterf(table
, save_SamplerParameterf
);
13405 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
13406 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
13407 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
13408 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
13410 /* GL_ARB_draw_buffer_blend */
13411 SET_BlendFunciARB(table
, save_BlendFunci
);
13412 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
13413 SET_BlendEquationiARB(table
, save_BlendEquationi
);
13414 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
13416 /* GL_NV_conditional_render */
13417 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
13418 SET_EndConditionalRender(table
, save_EndConditionalRender
);
13421 SET_WaitSync(table
, save_WaitSync
);
13423 /* GL_ARB_uniform_buffer_object */
13424 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
13426 /* GL_ARB_shader_subroutines */
13427 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
13429 /* GL_ARB_draw_instanced */
13430 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
13431 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
13433 /* GL_ARB_draw_elements_base_vertex */
13434 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
13436 /* GL_ARB_base_instance */
13437 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
13438 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
13439 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
13441 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
13442 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
13443 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
13444 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
13445 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
13447 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
13448 SET_UseProgramStages(table
, save_UseProgramStages
);
13449 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
13450 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
13451 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
13452 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
13453 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
13454 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
13455 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
13456 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
13457 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
13458 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
13459 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
13460 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
13461 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
13462 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
13463 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
13464 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
13465 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
13466 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
13467 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
13468 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
13469 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
13470 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
13471 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
13472 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
13473 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
13474 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
13475 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
13476 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
13477 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
13478 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
13479 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
13480 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
13481 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
13482 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
13483 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
13484 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
13485 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
13486 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
13487 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
13488 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
13489 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
13490 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
13491 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
13492 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
13493 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
13494 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
13495 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
13496 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
13497 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
13498 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
13500 /* GL_{ARB,EXT}_polygon_offset_clamp */
13501 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
13503 /* GL_EXT_window_rectangles */
13504 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
13506 /* GL_NV_conservative_raster */
13507 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
13509 /* GL_NV_conservative_raster_dilate */
13510 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
13512 /* GL_NV_conservative_raster_pre_snap_triangles */
13513 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
13515 /* GL_EXT_direct_state_access */
13516 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
13517 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
13518 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
13519 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
13520 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
13521 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
13522 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
13523 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
13524 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
13525 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
13526 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
13527 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
13528 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
13529 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
13530 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
13531 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
13532 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
13533 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
13534 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
13535 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
13536 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
13537 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
13538 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
13539 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
13540 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
13541 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
13542 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
13543 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
13544 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
13545 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
13546 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
13547 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
13548 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
13549 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
13550 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
13551 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
13552 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
13553 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
13554 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
13555 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
13556 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
13557 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
13558 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
13559 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
13560 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
13561 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
13562 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
13563 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
13564 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
13565 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
13566 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
13567 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
13568 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
13569 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
13570 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
13571 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
13572 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
13573 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
13574 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
13575 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
13580 static const char *
13581 enum_string(GLenum k
)
13583 return _mesa_enum_to_string(k
);
13588 * Print the commands in a display list. For debugging only.
13589 * TODO: many commands aren't handled yet.
13590 * \param fname filename to write display list to. If null, use stdout.
13592 static void GLAPIENTRY
13593 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
13595 struct gl_display_list
*dlist
;
13601 f
= fopen(fname
, "w");
13606 if (!islist(ctx
, list
)) {
13607 fprintf(f
, "%u is not a display list ID\n", list
);
13611 dlist
= _mesa_lookup_list(ctx
, list
);
13618 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
13620 done
= n
? GL_FALSE
: GL_TRUE
;
13622 const OpCode opcode
= n
[0].opcode
;
13624 if (is_ext_opcode(opcode
)) {
13625 n
+= ext_opcode_print(ctx
, n
, f
);
13630 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
13632 case OPCODE_ACTIVE_TEXTURE
:
13633 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
13635 case OPCODE_BITMAP
:
13636 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
13637 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
13638 get_pointer(&n
[7]));
13640 case OPCODE_BLEND_COLOR
:
13641 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
13642 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13644 case OPCODE_BLEND_EQUATION
:
13645 fprintf(f
, "BlendEquation %s\n",
13646 enum_string(n
[1].e
));
13648 case OPCODE_BLEND_EQUATION_SEPARATE
:
13649 fprintf(f
, "BlendEquationSeparate %s, %s\n",
13650 enum_string(n
[1].e
),
13651 enum_string(n
[2].e
));
13653 case OPCODE_BLEND_FUNC_SEPARATE
:
13654 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
13655 enum_string(n
[1].e
),
13656 enum_string(n
[2].e
),
13657 enum_string(n
[3].e
),
13658 enum_string(n
[4].e
));
13660 case OPCODE_BLEND_EQUATION_I
:
13661 fprintf(f
, "BlendEquationi %u, %s\n",
13662 n
[1].ui
, enum_string(n
[2].e
));
13664 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
13665 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
13666 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13668 case OPCODE_BLEND_FUNC_I
:
13669 fprintf(f
, "BlendFunci %u, %s, %s\n",
13670 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13672 case OPCODE_BLEND_FUNC_SEPARATE_I
:
13673 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
13675 enum_string(n
[2].e
),
13676 enum_string(n
[3].e
),
13677 enum_string(n
[4].e
),
13678 enum_string(n
[5].e
));
13680 case OPCODE_CALL_LIST
:
13681 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
13683 case OPCODE_CALL_LISTS
:
13684 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
13686 case OPCODE_DISABLE
:
13687 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
13689 case OPCODE_ENABLE
:
13690 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
13692 case OPCODE_FRUSTUM
:
13693 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
13694 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13696 case OPCODE_LINE_STIPPLE
:
13697 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
13699 case OPCODE_LINE_WIDTH
:
13700 fprintf(f
, "LineWidth %f\n", n
[1].f
);
13702 case OPCODE_LOAD_IDENTITY
:
13703 fprintf(f
, "LoadIdentity\n");
13705 case OPCODE_LOAD_MATRIX
:
13706 fprintf(f
, "LoadMatrix\n");
13707 fprintf(f
, " %8f %8f %8f %8f\n",
13708 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13709 fprintf(f
, " %8f %8f %8f %8f\n",
13710 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13711 fprintf(f
, " %8f %8f %8f %8f\n",
13712 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13713 fprintf(f
, " %8f %8f %8f %8f\n",
13714 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13716 case OPCODE_MULT_MATRIX
:
13717 fprintf(f
, "MultMatrix (or Rotate)\n");
13718 fprintf(f
, " %8f %8f %8f %8f\n",
13719 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13720 fprintf(f
, " %8f %8f %8f %8f\n",
13721 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13722 fprintf(f
, " %8f %8f %8f %8f\n",
13723 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13724 fprintf(f
, " %8f %8f %8f %8f\n",
13725 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13728 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
13729 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13731 case OPCODE_POINT_SIZE
:
13732 fprintf(f
, "PointSize %f\n", n
[1].f
);
13734 case OPCODE_POP_ATTRIB
:
13735 fprintf(f
, "PopAttrib\n");
13737 case OPCODE_POP_MATRIX
:
13738 fprintf(f
, "PopMatrix\n");
13740 case OPCODE_POP_NAME
:
13741 fprintf(f
, "PopName\n");
13743 case OPCODE_PUSH_ATTRIB
:
13744 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
13746 case OPCODE_PUSH_MATRIX
:
13747 fprintf(f
, "PushMatrix\n");
13749 case OPCODE_PUSH_NAME
:
13750 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
13752 case OPCODE_RASTER_POS
:
13753 fprintf(f
, "RasterPos %g %g %g %g\n",
13754 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13756 case OPCODE_ROTATE
:
13757 fprintf(f
, "Rotate %g %g %g %g\n",
13758 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13761 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13763 case OPCODE_TRANSLATE
:
13764 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13766 case OPCODE_BIND_TEXTURE
:
13767 fprintf(f
, "BindTexture %s %d\n",
13768 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
13770 case OPCODE_SHADE_MODEL
:
13771 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
13774 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
13775 _mesa_enum_to_string(n
[1].ui
),
13776 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
13779 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13780 _mesa_enum_to_string(n
[1].ui
),
13781 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
13782 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
13784 case OPCODE_MAPGRID1
:
13785 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
13787 case OPCODE_MAPGRID2
:
13788 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13789 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
13791 case OPCODE_EVALMESH1
:
13792 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
13794 case OPCODE_EVALMESH2
:
13795 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
13796 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
13799 case OPCODE_ATTR_1F_NV
:
13800 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
13802 case OPCODE_ATTR_2F_NV
:
13803 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
13804 n
[1].i
, n
[2].f
, n
[3].f
);
13806 case OPCODE_ATTR_3F_NV
:
13807 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
13808 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13810 case OPCODE_ATTR_4F_NV
:
13811 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13812 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13814 case OPCODE_ATTR_1F_ARB
:
13815 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
13817 case OPCODE_ATTR_2F_ARB
:
13818 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
13819 n
[1].i
, n
[2].f
, n
[3].f
);
13821 case OPCODE_ATTR_3F_ARB
:
13822 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
13823 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13825 case OPCODE_ATTR_4F_ARB
:
13826 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13827 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13830 case OPCODE_MATERIAL
:
13831 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
13832 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13835 fprintf(f
, "BEGIN %x\n", n
[1].i
);
13838 fprintf(f
, "END\n");
13841 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
13844 case OPCODE_EVAL_C1
:
13845 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
13847 case OPCODE_EVAL_C2
:
13848 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
13850 case OPCODE_EVAL_P1
:
13851 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
13853 case OPCODE_EVAL_P2
:
13854 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
13857 case OPCODE_PROVOKING_VERTEX
:
13858 fprintf(f
, "ProvokingVertex %s\n",
13859 _mesa_enum_to_string(n
[1].ui
));
13863 * meta opcodes/commands
13866 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
13867 (const char *) get_pointer(&n
[2]));
13869 case OPCODE_CONTINUE
:
13870 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
13871 n
= (Node
*) get_pointer(&n
[1]);
13874 fprintf(f
, "NOP\n");
13876 case OPCODE_END_OF_LIST
:
13877 fprintf(f
, "END-LIST %u\n", list
);
13881 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
13883 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13884 opcode
, (void *) n
);
13888 fprintf(f
, "command %d, %u operands\n", opcode
,
13892 /* increment n to point to next compiled command */
13893 if (opcode
!= OPCODE_CONTINUE
) {
13894 assert(InstSize
[opcode
] > 0);
13895 n
+= InstSize
[opcode
];
13909 * Clients may call this function to help debug display list problems.
13910 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
13911 * changed, or break in the future without notice.
13914 mesa_print_display_list(GLuint list
)
13916 GET_CURRENT_CONTEXT(ctx
);
13917 print_list(ctx
, list
, NULL
);
13921 /**********************************************************************/
13922 /***** Initialization *****/
13923 /**********************************************************************/
13926 save_vtxfmt_init(GLvertexformat
* vfmt
)
13928 vfmt
->ArrayElement
= _ae_ArrayElement
;
13930 vfmt
->Begin
= save_Begin
;
13932 vfmt
->CallList
= save_CallList
;
13933 vfmt
->CallLists
= save_CallLists
;
13935 vfmt
->Color3f
= save_Color3f
;
13936 vfmt
->Color3fv
= save_Color3fv
;
13937 vfmt
->Color4f
= save_Color4f
;
13938 vfmt
->Color4fv
= save_Color4fv
;
13939 vfmt
->EdgeFlag
= save_EdgeFlag
;
13940 vfmt
->End
= save_End
;
13942 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13943 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13944 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13945 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13946 vfmt
->EvalPoint1
= save_EvalPoint1
;
13947 vfmt
->EvalPoint2
= save_EvalPoint2
;
13949 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13950 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13951 vfmt
->Indexf
= save_Indexf
;
13952 vfmt
->Indexfv
= save_Indexfv
;
13953 vfmt
->Materialfv
= save_Materialfv
;
13954 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13955 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13956 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13957 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13958 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13959 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13960 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13961 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13962 vfmt
->Normal3f
= save_Normal3f
;
13963 vfmt
->Normal3fv
= save_Normal3fv
;
13964 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13965 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13966 vfmt
->TexCoord1f
= save_TexCoord1f
;
13967 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13968 vfmt
->TexCoord2f
= save_TexCoord2f
;
13969 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13970 vfmt
->TexCoord3f
= save_TexCoord3f
;
13971 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13972 vfmt
->TexCoord4f
= save_TexCoord4f
;
13973 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13974 vfmt
->Vertex2f
= save_Vertex2f
;
13975 vfmt
->Vertex2fv
= save_Vertex2fv
;
13976 vfmt
->Vertex3f
= save_Vertex3f
;
13977 vfmt
->Vertex3fv
= save_Vertex3fv
;
13978 vfmt
->Vertex4f
= save_Vertex4f
;
13979 vfmt
->Vertex4fv
= save_Vertex4fv
;
13980 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13981 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13982 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13983 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13984 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13985 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13986 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13987 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13988 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13989 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13990 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13991 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13992 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13993 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13994 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13995 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13997 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
14002 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
14003 const GLvertexformat
*vfmt
)
14005 SET_CallList(disp
, vfmt
->CallList
);
14006 SET_CallLists(disp
, vfmt
->CallLists
);
14011 * Initialize display list state for given context.
14014 _mesa_init_display_list(struct gl_context
*ctx
)
14016 static GLboolean tableInitialized
= GL_FALSE
;
14018 /* zero-out the instruction size table, just once */
14019 if (!tableInitialized
) {
14020 memset(InstSize
, 0, sizeof(InstSize
));
14021 tableInitialized
= GL_TRUE
;
14024 /* extension info */
14025 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
14028 ctx
->ListState
.CallDepth
= 0;
14029 ctx
->ExecuteFlag
= GL_TRUE
;
14030 ctx
->CompileFlag
= GL_FALSE
;
14031 ctx
->ListState
.CurrentBlock
= NULL
;
14032 ctx
->ListState
.CurrentPos
= 0;
14034 /* Display List group */
14035 ctx
->List
.ListBase
= 0;
14037 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
14039 InstSize
[OPCODE_NOP
] = 1;
14044 _mesa_free_display_list_data(struct gl_context
*ctx
)
14046 free(ctx
->ListExt
);
14047 ctx
->ListExt
= NULL
;