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.
34 #include "util/imports.h"
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"
73 #include "vbo/vbo_util.h"
74 #include "util/format_r11g11b10f.h"
77 #define USE_BITMAP_ATLAS 1
82 * Other parts of Mesa (such as the VBO module) can plug into the display
83 * list system. This structure describes new display list instructions.
85 struct gl_list_instruction
88 void (*Execute
)( struct gl_context
*ctx
, void *data
);
89 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
90 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
94 #define MAX_DLIST_EXT_OPCODES 16
97 * Used by device drivers to hook new commands into display lists.
99 struct gl_list_extensions
101 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
110 * \param ctx GL context.
112 * Checks if dd_function_table::SaveNeedFlush is marked to flush
113 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
115 #define SAVE_FLUSH_VERTICES(ctx) \
117 if (ctx->Driver.SaveNeedFlush) \
118 vbo_save_SaveFlushVertices(ctx); \
123 * Macro to assert that the API call was made outside the
124 * glBegin()/glEnd() pair, with return value.
126 * \param ctx GL context.
127 * \param retval value to return value in case the assertion fails.
129 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
131 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
132 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
138 * Macro to assert that the API call was made outside the
139 * glBegin()/glEnd() pair.
141 * \param ctx GL context.
143 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
145 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
146 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
152 * Macro to assert that the API call was made outside the
153 * glBegin()/glEnd() pair and flush the vertices.
155 * \param ctx GL context.
157 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
159 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
160 SAVE_FLUSH_VERTICES(ctx); \
164 * Macro to assert that the API call was made outside the
165 * glBegin()/glEnd() pair and flush the vertices, with return value.
167 * \param ctx GL context.
168 * \param retval value to return value in case the assertion fails.
170 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
172 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
173 SAVE_FLUSH_VERTICES(ctx); \
178 * Display list opcodes.
180 * The fact that these identifiers are assigned consecutive
181 * integer values starting at 0 is very important, see InstSize array usage)
185 OPCODE_INVALID
= -1, /* Force signed enum */
191 OPCODE_BLEND_EQUATION
,
192 OPCODE_BLEND_EQUATION_SEPARATE
,
193 OPCODE_BLEND_FUNC_SEPARATE
,
195 OPCODE_BLEND_EQUATION_I
,
196 OPCODE_BLEND_EQUATION_SEPARATE_I
,
198 OPCODE_BLEND_FUNC_SEPARATE_I
,
207 OPCODE_CLEAR_STENCIL
,
208 OPCODE_CLEAR_BUFFER_IV
,
209 OPCODE_CLEAR_BUFFER_UIV
,
210 OPCODE_CLEAR_BUFFER_FV
,
211 OPCODE_CLEAR_BUFFER_FI
,
214 OPCODE_COLOR_MASK_INDEXED
,
215 OPCODE_COLOR_MATERIAL
,
217 OPCODE_COPY_TEX_IMAGE1D
,
218 OPCODE_COPY_TEX_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE1D
,
220 OPCODE_COPY_TEX_SUB_IMAGE2D
,
221 OPCODE_COPY_TEX_SUB_IMAGE3D
,
227 OPCODE_DISABLE_INDEXED
,
231 OPCODE_ENABLE_INDEXED
,
245 OPCODE_LOAD_IDENTITY
,
258 OPCODE_PIXEL_TRANSFER
,
261 OPCODE_POINT_PARAMETERS
,
263 OPCODE_POLYGON_STIPPLE
,
264 OPCODE_POLYGON_OFFSET
,
268 OPCODE_PRIORITIZE_TEXTURE
,
277 OPCODE_SELECT_TEXTURE_SGIS
,
278 OPCODE_SELECT_TEXTURE_COORD_SET
,
289 OPCODE_TEX_SUB_IMAGE1D
,
290 OPCODE_TEX_SUB_IMAGE2D
,
291 OPCODE_TEX_SUB_IMAGE3D
,
295 /* ARB_viewport_array */
296 OPCODE_VIEWPORT_ARRAY_V
,
297 OPCODE_VIEWPORT_INDEXED_F
,
298 OPCODE_VIEWPORT_INDEXED_FV
,
299 OPCODE_SCISSOR_ARRAY_V
,
300 OPCODE_SCISSOR_INDEXED
,
301 OPCODE_SCISSOR_INDEXED_V
,
302 OPCODE_DEPTH_ARRAY_V
,
303 OPCODE_DEPTH_INDEXED
,
304 /* GL_ARB_multitexture */
305 OPCODE_ACTIVE_TEXTURE
,
306 /* GL_ARB_texture_compression */
307 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
308 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
309 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
311 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
312 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
313 /* GL_ARB_multisample */
314 OPCODE_SAMPLE_COVERAGE
,
315 /* GL_ARB_window_pos */
316 OPCODE_WINDOW_POS_ARB
,
317 /* GL_ARB_vertex_program */
318 OPCODE_BIND_PROGRAM_ARB
,
319 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
320 /* GL_EXT_stencil_two_side */
321 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
322 /* GL_EXT_depth_bounds_test */
323 OPCODE_DEPTH_BOUNDS_EXT
,
324 /* GL_ARB_vertex/fragment_program */
325 OPCODE_PROGRAM_STRING_ARB
,
326 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
327 /* GL_ARB_occlusion_query */
328 OPCODE_BEGIN_QUERY_ARB
,
329 OPCODE_END_QUERY_ARB
,
330 /* GL_ARB_draw_buffers */
331 OPCODE_DRAW_BUFFERS_ARB
,
332 /* GL_ATI_fragment_shader */
333 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
334 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
336 OPCODE_STENCIL_FUNC_SEPARATE
,
337 OPCODE_STENCIL_OP_SEPARATE
,
338 OPCODE_STENCIL_MASK_SEPARATE
,
339 /* GL_NV_primitive_restart */
340 OPCODE_PRIMITIVE_RESTART_NV
,
341 /* GL_ARB_shader_objects */
359 OPCODE_UNIFORM_MATRIX22
,
360 OPCODE_UNIFORM_MATRIX33
,
361 OPCODE_UNIFORM_MATRIX44
,
362 OPCODE_UNIFORM_MATRIX23
,
363 OPCODE_UNIFORM_MATRIX32
,
364 OPCODE_UNIFORM_MATRIX24
,
365 OPCODE_UNIFORM_MATRIX42
,
366 OPCODE_UNIFORM_MATRIX34
,
367 OPCODE_UNIFORM_MATRIX43
,
379 /* GL_ARB_gpu_shader_fp64 */
388 OPCODE_UNIFORM_MATRIX22D
,
389 OPCODE_UNIFORM_MATRIX33D
,
390 OPCODE_UNIFORM_MATRIX44D
,
391 OPCODE_UNIFORM_MATRIX23D
,
392 OPCODE_UNIFORM_MATRIX32D
,
393 OPCODE_UNIFORM_MATRIX24D
,
394 OPCODE_UNIFORM_MATRIX42D
,
395 OPCODE_UNIFORM_MATRIX34D
,
396 OPCODE_UNIFORM_MATRIX43D
,
398 /* GL_ARB_gpu_shader_int64 */
403 OPCODE_UNIFORM_1I64V
,
404 OPCODE_UNIFORM_2I64V
,
405 OPCODE_UNIFORM_3I64V
,
406 OPCODE_UNIFORM_4I64V
,
407 OPCODE_UNIFORM_1UI64
,
408 OPCODE_UNIFORM_2UI64
,
409 OPCODE_UNIFORM_3UI64
,
410 OPCODE_UNIFORM_4UI64
,
411 OPCODE_UNIFORM_1UI64V
,
412 OPCODE_UNIFORM_2UI64V
,
413 OPCODE_UNIFORM_3UI64V
,
414 OPCODE_UNIFORM_4UI64V
,
415 OPCODE_PROGRAM_UNIFORM_1I64
,
416 OPCODE_PROGRAM_UNIFORM_2I64
,
417 OPCODE_PROGRAM_UNIFORM_3I64
,
418 OPCODE_PROGRAM_UNIFORM_4I64
,
419 OPCODE_PROGRAM_UNIFORM_1I64V
,
420 OPCODE_PROGRAM_UNIFORM_2I64V
,
421 OPCODE_PROGRAM_UNIFORM_3I64V
,
422 OPCODE_PROGRAM_UNIFORM_4I64V
,
423 OPCODE_PROGRAM_UNIFORM_1UI64
,
424 OPCODE_PROGRAM_UNIFORM_2UI64
,
425 OPCODE_PROGRAM_UNIFORM_3UI64
,
426 OPCODE_PROGRAM_UNIFORM_4UI64
,
427 OPCODE_PROGRAM_UNIFORM_1UI64V
,
428 OPCODE_PROGRAM_UNIFORM_2UI64V
,
429 OPCODE_PROGRAM_UNIFORM_3UI64V
,
430 OPCODE_PROGRAM_UNIFORM_4UI64V
,
432 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
433 OPCODE_PATCH_PARAMETER_I
,
434 OPCODE_PATCH_PARAMETER_FV_INNER
,
435 OPCODE_PATCH_PARAMETER_FV_OUTER
,
437 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
438 OPCODE_USE_PROGRAM_STAGES
,
439 OPCODE_PROGRAM_UNIFORM_1F
,
440 OPCODE_PROGRAM_UNIFORM_2F
,
441 OPCODE_PROGRAM_UNIFORM_3F
,
442 OPCODE_PROGRAM_UNIFORM_4F
,
443 OPCODE_PROGRAM_UNIFORM_1FV
,
444 OPCODE_PROGRAM_UNIFORM_2FV
,
445 OPCODE_PROGRAM_UNIFORM_3FV
,
446 OPCODE_PROGRAM_UNIFORM_4FV
,
447 OPCODE_PROGRAM_UNIFORM_1D
,
448 OPCODE_PROGRAM_UNIFORM_2D
,
449 OPCODE_PROGRAM_UNIFORM_3D
,
450 OPCODE_PROGRAM_UNIFORM_4D
,
451 OPCODE_PROGRAM_UNIFORM_1DV
,
452 OPCODE_PROGRAM_UNIFORM_2DV
,
453 OPCODE_PROGRAM_UNIFORM_3DV
,
454 OPCODE_PROGRAM_UNIFORM_4DV
,
455 OPCODE_PROGRAM_UNIFORM_1I
,
456 OPCODE_PROGRAM_UNIFORM_2I
,
457 OPCODE_PROGRAM_UNIFORM_3I
,
458 OPCODE_PROGRAM_UNIFORM_4I
,
459 OPCODE_PROGRAM_UNIFORM_1IV
,
460 OPCODE_PROGRAM_UNIFORM_2IV
,
461 OPCODE_PROGRAM_UNIFORM_3IV
,
462 OPCODE_PROGRAM_UNIFORM_4IV
,
463 OPCODE_PROGRAM_UNIFORM_1UI
,
464 OPCODE_PROGRAM_UNIFORM_2UI
,
465 OPCODE_PROGRAM_UNIFORM_3UI
,
466 OPCODE_PROGRAM_UNIFORM_4UI
,
467 OPCODE_PROGRAM_UNIFORM_1UIV
,
468 OPCODE_PROGRAM_UNIFORM_2UIV
,
469 OPCODE_PROGRAM_UNIFORM_3UIV
,
470 OPCODE_PROGRAM_UNIFORM_4UIV
,
471 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
472 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
473 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
474 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
475 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
476 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
477 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
478 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
479 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
480 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
481 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
482 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
483 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
484 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
485 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
486 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
487 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
488 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
490 /* GL_ARB_clip_control */
493 /* GL_ARB_color_buffer_float */
496 /* GL_EXT_framebuffer_blit */
497 OPCODE_BLIT_FRAMEBUFFER
,
499 /* Vertex attributes -- fallback for when optimized display
500 * list build isn't active.
528 /* GL_EXT_provoking_vertex */
529 OPCODE_PROVOKING_VERTEX
,
531 /* GL_EXT_transform_feedback */
532 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
533 OPCODE_END_TRANSFORM_FEEDBACK
,
534 OPCODE_BIND_TRANSFORM_FEEDBACK
,
535 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
536 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
539 /* GL_EXT_texture_integer */
541 OPCODE_CLEARCOLOR_UI
,
542 OPCODE_TEXPARAMETER_I
,
543 OPCODE_TEXPARAMETER_UI
,
545 /* GL_ARB_instanced_arrays */
546 OPCODE_VERTEX_ATTRIB_DIVISOR
,
548 /* GL_NV_texture_barrier */
549 OPCODE_TEXTURE_BARRIER_NV
,
551 /* GL_ARB_sampler_object */
553 OPCODE_SAMPLER_PARAMETERIV
,
554 OPCODE_SAMPLER_PARAMETERFV
,
555 OPCODE_SAMPLER_PARAMETERIIV
,
556 OPCODE_SAMPLER_PARAMETERUIV
,
558 /* ARB_compute_shader */
559 OPCODE_DISPATCH_COMPUTE
,
564 /* GL_NV_conditional_render */
565 OPCODE_BEGIN_CONDITIONAL_RENDER
,
566 OPCODE_END_CONDITIONAL_RENDER
,
568 /* ARB_timer_query */
569 OPCODE_QUERY_COUNTER
,
571 /* ARB_transform_feedback3 */
572 OPCODE_BEGIN_QUERY_INDEXED
,
573 OPCODE_END_QUERY_INDEXED
,
574 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
576 /* ARB_transform_feedback_instanced */
577 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
578 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
580 /* ARB_uniform_buffer_object */
581 OPCODE_UNIFORM_BLOCK_BINDING
,
583 /* ARB_shader_subroutines */
584 OPCODE_UNIFORM_SUBROUTINES
,
586 /* EXT_polygon_offset_clamp */
587 OPCODE_POLYGON_OFFSET_CLAMP
,
589 /* EXT_window_rectangles */
590 OPCODE_WINDOW_RECTANGLES
,
592 /* NV_conservative_raster */
593 OPCODE_SUBPIXEL_PRECISION_BIAS
,
595 /* NV_conservative_raster_dilate */
596 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
598 /* NV_conservative_raster_pre_snap_triangles */
599 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
601 /* EXT_direct_state_access */
604 OPCODE_MATRIX_ROTATE
,
606 OPCODE_MATRIX_TRANSLATE
,
607 OPCODE_MATRIX_LOAD_IDENTITY
,
609 OPCODE_MATRIX_FRUSTUM
,
612 OPCODE_TEXTUREPARAMETER_F
,
613 OPCODE_TEXTUREPARAMETER_I
,
614 OPCODE_TEXTUREPARAMETER_II
,
615 OPCODE_TEXTUREPARAMETER_IUI
,
616 OPCODE_TEXTURE_IMAGE1D
,
617 OPCODE_TEXTURE_IMAGE2D
,
618 OPCODE_TEXTURE_IMAGE3D
,
619 OPCODE_TEXTURE_SUB_IMAGE1D
,
620 OPCODE_TEXTURE_SUB_IMAGE2D
,
621 OPCODE_TEXTURE_SUB_IMAGE3D
,
622 OPCODE_COPY_TEXTURE_IMAGE1D
,
623 OPCODE_COPY_TEXTURE_IMAGE2D
,
624 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
625 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
626 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
627 OPCODE_BIND_MULTITEXTURE
,
628 OPCODE_MULTITEXPARAMETER_F
,
629 OPCODE_MULTITEXPARAMETER_I
,
630 OPCODE_MULTITEXPARAMETER_II
,
631 OPCODE_MULTITEXPARAMETER_IUI
,
632 OPCODE_MULTITEX_IMAGE1D
,
633 OPCODE_MULTITEX_IMAGE2D
,
634 OPCODE_MULTITEX_IMAGE3D
,
635 OPCODE_MULTITEX_SUB_IMAGE1D
,
636 OPCODE_MULTITEX_SUB_IMAGE2D
,
637 OPCODE_MULTITEX_SUB_IMAGE3D
,
638 OPCODE_COPY_MULTITEX_IMAGE1D
,
639 OPCODE_COPY_MULTITEX_IMAGE2D
,
640 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
641 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
642 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
644 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
645 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
646 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
647 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
648 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
649 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
650 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
651 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
652 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
653 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
654 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
655 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
656 OPCODE_NAMED_PROGRAM_STRING
,
657 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
,
659 /* The following three are meta instructions */
660 OPCODE_ERROR
, /* raise compiled-in error */
662 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
672 * Display list instructions are stored as sequences of "nodes". Nodes
673 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
674 * are linked together with a pointer.
676 * Each instruction in the display list is stored as a sequence of
677 * contiguous nodes in memory.
678 * Each node is the union of a variety of data types.
680 * Note, all of these members should be 4 bytes in size or less for the
681 * sake of compact display lists. We store 8-byte pointers in a pair of
682 * these nodes using the save/get_pointer() functions below.
700 typedef union gl_dlist_node Node
;
703 /** How many 4-byte dwords to store a pointer */
704 #define POINTER_DWORDS (sizeof(void *) / 4)
706 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
707 * space for display lists. The following types and functions are
708 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
713 GLuint dwords
[POINTER_DWORDS
];
718 * Save a 4 or 8-byte pointer at dest (and dest+1).
721 save_pointer(Node
*dest
, void *src
)
726 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
727 STATIC_ASSERT(sizeof(Node
) == 4);
731 for (i
= 0; i
< POINTER_DWORDS
; i
++)
732 dest
[i
].ui
= p
.dwords
[i
];
737 * Retrieve a 4 or 8-byte pointer from node (node+1).
740 get_pointer(const Node
*node
)
745 for (i
= 0; i
< POINTER_DWORDS
; i
++)
746 p
.dwords
[i
] = node
[i
].ui
;
753 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
775 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
777 union float64_pair tmp; \
779 n[idx].ui = tmp.uint32[0]; \
780 n[idx+1].ui = tmp.uint32[1]; \
783 #define ASSIGN_UINT64_TO_NODES(n, idx, value) \
785 union uint64_pair tmp; \
786 tmp.uint64 = value; \
787 n[idx].ui = tmp.uint32[0]; \
788 n[idx+1].ui = tmp.uint32[1]; \
791 #define ASSIGN_INT64_TO_NODES(n, idx, value) \
793 union int64_pair tmp; \
795 n[idx].i = tmp.int32[0]; \
796 n[idx+1].i = tmp.int32[1]; \
800 * How many nodes to allocate at a time. Note that bulk vertex data
801 * from glBegin/glVertex/glEnd primitives will typically wind up in
802 * a VBO, and not directly in the display list itself.
804 #define BLOCK_SIZE 256
809 * Number of nodes of storage needed for each instruction.
810 * Sizes for dynamically allocated opcodes are stored in the context struct.
812 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
815 void mesa_print_display_list(GLuint list
);
819 * Does the given display list only contain a single glBitmap call?
822 is_bitmap_list(const struct gl_display_list
*dlist
)
824 const Node
*n
= dlist
->Head
;
825 if (n
[0].opcode
== OPCODE_BITMAP
) {
826 n
+= InstSize
[OPCODE_BITMAP
];
827 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
835 * Is the given display list an empty list?
838 is_empty_list(const struct gl_display_list
*dlist
)
840 const Node
*n
= dlist
->Head
;
841 return n
[0].opcode
== OPCODE_END_OF_LIST
;
846 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
849 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
852 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
860 * Lookup a gl_bitmap_atlas by listBase ID.
862 static struct gl_bitmap_atlas
*
863 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
865 struct gl_bitmap_atlas
*atlas
;
867 assert(listBase
> 0);
868 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
874 * Create new bitmap atlas and insert into hash table.
876 static struct gl_bitmap_atlas
*
877 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
879 struct gl_bitmap_atlas
*atlas
;
881 assert(listBase
> 0);
882 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
884 atlas
= calloc(1, sizeof(*atlas
));
886 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
894 * Try to build a bitmap atlas. This involves examining a sequence of
895 * display lists which contain glBitmap commands and putting the bitmap
896 * images into a texture map (the atlas).
897 * If we succeed, gl_bitmap_atlas::complete will be set to true.
898 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
901 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
904 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
909 assert(!atlas
->complete
);
910 assert(atlas
->numBitmaps
> 0);
912 /* We use a rectangle texture (non-normalized coords) for the atlas */
913 assert(ctx
->Extensions
.NV_texture_rectangle
);
914 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
916 atlas
->texWidth
= 1024;
917 atlas
->texHeight
= 0; /* determined below */
919 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
920 if (!atlas
->glyphs
) {
922 atlas
->incomplete
= true;
926 /* Loop over the display lists. They should all contain a single glBitmap
927 * call. If not, bail out. Also, compute the position and sizes of each
928 * bitmap in the atlas to determine the texture atlas size.
930 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
931 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
933 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
934 unsigned bitmap_width
, bitmap_height
;
935 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
937 if (!list
|| is_empty_list(list
)) {
939 atlas
->numBitmaps
= i
;
943 if (!is_bitmap_list(list
)) {
944 /* This list does not contain exactly one glBitmap command. Give up. */
945 atlas
->incomplete
= true;
949 /* get bitmap info from the display list command */
951 assert(n
[0].opcode
== OPCODE_BITMAP
);
952 bitmap_width
= n
[1].i
;
953 bitmap_height
= n
[2].i
;
954 bitmap_xorig
= n
[3].f
;
955 bitmap_yorig
= n
[4].f
;
956 bitmap_xmove
= n
[5].f
;
957 bitmap_ymove
= n
[6].f
;
959 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
960 /* advance to the next row of the texture */
966 /* save the bitmap's position in the atlas */
970 g
->h
= bitmap_height
;
971 g
->xorig
= bitmap_xorig
;
972 g
->yorig
= bitmap_yorig
;
973 g
->xmove
= bitmap_xmove
;
974 g
->ymove
= bitmap_ymove
;
976 xpos
+= bitmap_width
;
978 /* keep track of tallest bitmap in the row */
979 row_height
= MAX2(row_height
, bitmap_height
);
982 /* Now we know the texture height */
983 atlas
->texHeight
= ypos
+ row_height
;
985 if (atlas
->texHeight
== 0) {
986 /* no glyphs found, give up */
989 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
990 /* too large, give up */
994 /* Create atlas texture (texture ID is irrelevant) */
995 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
996 if (!atlas
->texObj
) {
1000 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
1001 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
1002 atlas
->texObj
->MaxLevel
= 0;
1003 atlas
->texObj
->Immutable
= GL_TRUE
;
1005 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
1006 GL_TEXTURE_RECTANGLE
, 0);
1007 if (!atlas
->texImage
) {
1011 if (ctx
->Const
.BitmapUsesRed
)
1012 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1013 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1014 GL_RED
, MESA_FORMAT_R_UNORM8
);
1016 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1017 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1018 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
1020 /* alloc image storage */
1021 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
1025 /* map teximage, load with bitmap glyphs */
1026 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
1027 0, 0, atlas
->texWidth
, atlas
->texHeight
,
1028 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
1033 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
1034 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
1036 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
1037 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
1038 const Node
*n
= list
->Head
;
1040 assert(n
[0].opcode
== OPCODE_BITMAP
||
1041 n
[0].opcode
== OPCODE_END_OF_LIST
);
1043 if (n
[0].opcode
== OPCODE_BITMAP
) {
1044 unsigned bitmap_width
= n
[1].i
;
1045 unsigned bitmap_height
= n
[2].i
;
1046 unsigned xpos
= atlas
->glyphs
[i
].x
;
1047 unsigned ypos
= atlas
->glyphs
[i
].y
;
1048 const void *bitmap_image
= get_pointer(&n
[7]);
1050 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
1051 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
1053 /* put the bitmap image into the texture image */
1054 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
1055 &ctx
->DefaultPacking
, bitmap_image
,
1056 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
1061 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
1063 atlas
->complete
= true;
1068 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
1070 if (atlas
->texObj
) {
1071 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
1073 free(atlas
->glyphs
);
1074 atlas
->glyphs
= NULL
;
1075 atlas
->incomplete
= true;
1080 * Allocate a gl_display_list object with an initial block of storage.
1081 * \param count how many display list nodes/tokens to allocate
1083 static struct gl_display_list
*
1084 make_list(GLuint name
, GLuint count
)
1086 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1088 dlist
->Head
= malloc(sizeof(Node
) * count
);
1089 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1090 /* All InstSize[] entries must be non-zero */
1091 InstSize
[OPCODE_END_OF_LIST
] = 1;
1097 * Lookup function to just encapsulate casting.
1099 struct gl_display_list
*
1100 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1102 return (struct gl_display_list
*)
1103 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1107 /** Is the given opcode an extension code? */
1108 static inline GLboolean
1109 is_ext_opcode(OpCode opcode
)
1111 return (opcode
>= OPCODE_EXT_0
);
1115 /** Destroy an extended opcode instruction */
1117 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1119 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1121 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1122 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1127 /** Execute an extended opcode instruction */
1129 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1131 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1133 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1134 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1139 /** Print an extended opcode instruction */
1141 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1143 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1145 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1146 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1152 * Delete the named display list, but don't remove from hash table.
1153 * \param dlist - display list pointer
1156 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1161 n
= block
= dlist
->Head
;
1163 done
= block
? GL_FALSE
: GL_TRUE
;
1165 const OpCode opcode
= n
[0].opcode
;
1167 /* check for extension opcodes first */
1168 if (is_ext_opcode(opcode
)) {
1169 n
+= ext_opcode_destroy(ctx
, n
);
1173 /* for some commands, we need to free malloc'd memory */
1175 free(get_pointer(&n
[6]));
1178 free(get_pointer(&n
[10]));
1180 case OPCODE_CALL_LISTS
:
1181 free(get_pointer(&n
[3]));
1183 case OPCODE_DRAW_PIXELS
:
1184 free(get_pointer(&n
[5]));
1187 free(get_pointer(&n
[7]));
1189 case OPCODE_POLYGON_STIPPLE
:
1190 free(get_pointer(&n
[1]));
1192 case OPCODE_TEX_IMAGE1D
:
1193 free(get_pointer(&n
[8]));
1195 case OPCODE_TEX_IMAGE2D
:
1196 free(get_pointer(&n
[9]));
1198 case OPCODE_TEX_IMAGE3D
:
1199 free(get_pointer(&n
[10]));
1201 case OPCODE_TEX_SUB_IMAGE1D
:
1202 free(get_pointer(&n
[7]));
1204 case OPCODE_TEX_SUB_IMAGE2D
:
1205 free(get_pointer(&n
[9]));
1207 case OPCODE_TEX_SUB_IMAGE3D
:
1208 free(get_pointer(&n
[11]));
1210 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1211 free(get_pointer(&n
[7]));
1213 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1214 free(get_pointer(&n
[8]));
1216 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1217 free(get_pointer(&n
[9]));
1219 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1220 free(get_pointer(&n
[7]));
1222 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1223 free(get_pointer(&n
[9]));
1225 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1226 free(get_pointer(&n
[11]));
1228 case OPCODE_PROGRAM_STRING_ARB
:
1229 free(get_pointer(&n
[4])); /* program string */
1231 case OPCODE_UNIFORM_1FV
:
1232 case OPCODE_UNIFORM_2FV
:
1233 case OPCODE_UNIFORM_3FV
:
1234 case OPCODE_UNIFORM_4FV
:
1235 case OPCODE_UNIFORM_1DV
:
1236 case OPCODE_UNIFORM_2DV
:
1237 case OPCODE_UNIFORM_3DV
:
1238 case OPCODE_UNIFORM_4DV
:
1239 case OPCODE_UNIFORM_1IV
:
1240 case OPCODE_UNIFORM_2IV
:
1241 case OPCODE_UNIFORM_3IV
:
1242 case OPCODE_UNIFORM_4IV
:
1243 case OPCODE_UNIFORM_1UIV
:
1244 case OPCODE_UNIFORM_2UIV
:
1245 case OPCODE_UNIFORM_3UIV
:
1246 case OPCODE_UNIFORM_4UIV
:
1247 case OPCODE_UNIFORM_1I64V
:
1248 case OPCODE_UNIFORM_2I64V
:
1249 case OPCODE_UNIFORM_3I64V
:
1250 case OPCODE_UNIFORM_4I64V
:
1251 case OPCODE_UNIFORM_1UI64V
:
1252 case OPCODE_UNIFORM_2UI64V
:
1253 case OPCODE_UNIFORM_3UI64V
:
1254 case OPCODE_UNIFORM_4UI64V
:
1255 free(get_pointer(&n
[3]));
1257 case OPCODE_UNIFORM_MATRIX22
:
1258 case OPCODE_UNIFORM_MATRIX33
:
1259 case OPCODE_UNIFORM_MATRIX44
:
1260 case OPCODE_UNIFORM_MATRIX24
:
1261 case OPCODE_UNIFORM_MATRIX42
:
1262 case OPCODE_UNIFORM_MATRIX23
:
1263 case OPCODE_UNIFORM_MATRIX32
:
1264 case OPCODE_UNIFORM_MATRIX34
:
1265 case OPCODE_UNIFORM_MATRIX43
:
1266 case OPCODE_UNIFORM_MATRIX22D
:
1267 case OPCODE_UNIFORM_MATRIX33D
:
1268 case OPCODE_UNIFORM_MATRIX44D
:
1269 case OPCODE_UNIFORM_MATRIX24D
:
1270 case OPCODE_UNIFORM_MATRIX42D
:
1271 case OPCODE_UNIFORM_MATRIX23D
:
1272 case OPCODE_UNIFORM_MATRIX32D
:
1273 case OPCODE_UNIFORM_MATRIX34D
:
1274 case OPCODE_UNIFORM_MATRIX43D
:
1275 free(get_pointer(&n
[4]));
1277 case OPCODE_PROGRAM_UNIFORM_1FV
:
1278 case OPCODE_PROGRAM_UNIFORM_2FV
:
1279 case OPCODE_PROGRAM_UNIFORM_3FV
:
1280 case OPCODE_PROGRAM_UNIFORM_4FV
:
1281 case OPCODE_PROGRAM_UNIFORM_1DV
:
1282 case OPCODE_PROGRAM_UNIFORM_2DV
:
1283 case OPCODE_PROGRAM_UNIFORM_3DV
:
1284 case OPCODE_PROGRAM_UNIFORM_4DV
:
1285 case OPCODE_PROGRAM_UNIFORM_1IV
:
1286 case OPCODE_PROGRAM_UNIFORM_2IV
:
1287 case OPCODE_PROGRAM_UNIFORM_3IV
:
1288 case OPCODE_PROGRAM_UNIFORM_4IV
:
1289 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1290 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1291 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1292 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1293 case OPCODE_PROGRAM_UNIFORM_1I64V
:
1294 case OPCODE_PROGRAM_UNIFORM_2I64V
:
1295 case OPCODE_PROGRAM_UNIFORM_3I64V
:
1296 case OPCODE_PROGRAM_UNIFORM_4I64V
:
1297 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
1298 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
1299 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
1300 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
1301 free(get_pointer(&n
[4]));
1303 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1304 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1305 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1306 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1307 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1308 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1309 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1310 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1311 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1312 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1313 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1314 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1315 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1316 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1317 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1318 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1319 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1320 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1321 free(get_pointer(&n
[5]));
1323 case OPCODE_PIXEL_MAP
:
1324 free(get_pointer(&n
[3]));
1326 case OPCODE_VIEWPORT_ARRAY_V
:
1327 case OPCODE_SCISSOR_ARRAY_V
:
1328 case OPCODE_DEPTH_ARRAY_V
:
1329 case OPCODE_UNIFORM_SUBROUTINES
:
1330 case OPCODE_WINDOW_RECTANGLES
:
1331 free(get_pointer(&n
[3]));
1333 case OPCODE_TEXTURE_IMAGE1D
:
1334 case OPCODE_MULTITEX_IMAGE1D
:
1335 free(get_pointer(&n
[9]));
1337 case OPCODE_TEXTURE_IMAGE2D
:
1338 case OPCODE_MULTITEX_IMAGE2D
:
1339 free(get_pointer(&n
[10]));
1341 case OPCODE_TEXTURE_IMAGE3D
:
1342 case OPCODE_MULTITEX_IMAGE3D
:
1343 free(get_pointer(&n
[11]));
1345 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1346 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1347 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1348 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
1349 free(get_pointer(&n
[8]));
1351 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1352 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1353 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1354 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
1355 free(get_pointer(&n
[10]));
1357 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1358 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1359 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1360 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
1361 free(get_pointer(&n
[12]));
1363 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1364 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
1365 free(get_pointer(&n
[8]));
1367 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1368 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
1369 free(get_pointer(&n
[9]));
1371 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1372 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
1373 free(get_pointer(&n
[10]));
1375 case OPCODE_NAMED_PROGRAM_STRING
:
1376 free(get_pointer(&n
[5]));
1378 case OPCODE_CONTINUE
:
1379 n
= (Node
*) get_pointer(&n
[1]);
1383 case OPCODE_END_OF_LIST
:
1388 /* just increment 'n' pointer, below */
1392 if (opcode
!= OPCODE_CONTINUE
) {
1393 assert(InstSize
[opcode
] > 0);
1394 n
+= InstSize
[opcode
];
1405 * Called by _mesa_HashWalk() to check if a display list which is being
1406 * deleted belongs to a bitmap texture atlas.
1409 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1411 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1412 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1414 /* See if the list_id falls in the range contained in this texture atlas */
1415 if (atlas
->complete
&&
1416 list_id
>= atlas_id
&&
1417 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1418 /* Mark the atlas as incomplete so it doesn't get used. But don't
1419 * delete it yet since we don't want to try to recreate it in the next
1422 atlas
->complete
= false;
1423 atlas
->incomplete
= true;
1429 * Destroy a display list and remove from hash table.
1430 * \param list - display list number
1433 destroy_list(struct gl_context
*ctx
, GLuint list
)
1435 struct gl_display_list
*dlist
;
1440 dlist
= _mesa_lookup_list(ctx
, list
);
1444 if (is_bitmap_list(dlist
)) {
1445 /* If we're destroying a simple glBitmap display list, there's a
1446 * chance that we're destroying a bitmap image that's in a texture
1447 * atlas. Examine all atlases to see if that's the case. There's
1448 * usually few (if any) atlases so this isn't expensive.
1450 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1451 check_atlas_for_deleted_list
, &list
);
1454 _mesa_delete_list(ctx
, dlist
);
1455 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1460 * Translate the nth element of list from <type> to GLint.
1463 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1475 bptr
= (GLbyte
*) list
;
1476 return (GLint
) bptr
[n
];
1477 case GL_UNSIGNED_BYTE
:
1478 ubptr
= (GLubyte
*) list
;
1479 return (GLint
) ubptr
[n
];
1481 sptr
= (GLshort
*) list
;
1482 return (GLint
) sptr
[n
];
1483 case GL_UNSIGNED_SHORT
:
1484 usptr
= (GLushort
*) list
;
1485 return (GLint
) usptr
[n
];
1487 iptr
= (GLint
*) list
;
1489 case GL_UNSIGNED_INT
:
1490 uiptr
= (GLuint
*) list
;
1491 return (GLint
) uiptr
[n
];
1493 fptr
= (GLfloat
*) list
;
1494 return (GLint
) floorf(fptr
[n
]);
1496 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1497 return (GLint
) ubptr
[0] * 256
1500 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1501 return (GLint
) ubptr
[0] * 65536
1502 + (GLint
) ubptr
[1] * 256
1505 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1506 return (GLint
) ubptr
[0] * 16777216
1507 + (GLint
) ubptr
[1] * 65536
1508 + (GLint
) ubptr
[2] * 256
1517 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1518 * If width < 0 or height < 0 or format or type are invalid we'll just
1519 * return NULL. We will not generate an error since OpenGL command
1520 * arguments aren't error-checked until the command is actually executed
1521 * (not when they're compiled).
1522 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1525 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1526 GLsizei width
, GLsizei height
, GLsizei depth
,
1527 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1528 const struct gl_pixelstore_attrib
*unpack
)
1530 if (width
<= 0 || height
<= 0) {
1534 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1535 /* bad format and/or type */
1539 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1543 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1544 format
, type
, pixels
, unpack
);
1545 if (pixels
&& !image
) {
1546 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1550 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1551 depth
, format
, type
, INT_MAX
, pixels
)) {
1552 const GLubyte
*map
, *src
;
1556 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1557 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1560 /* unable to map src buffer! */
1561 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1565 src
= ADD_POINTERS(map
, pixels
);
1566 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1567 format
, type
, src
, unpack
);
1569 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1572 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1578 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1583 /** Return copy of memory */
1585 memdup(const void *src
, GLsizei bytes
)
1587 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1589 memcpy(b
, src
, bytes
);
1595 * Allocate space for a display list instruction (opcode + payload space).
1596 * \param opcode the instruction opcode (OPCODE_* value)
1597 * \param bytes instruction payload size (not counting opcode)
1598 * \param align8 does the payload need to be 8-byte aligned?
1599 * This is only relevant in 64-bit environments.
1600 * \return pointer to allocated memory (the payload will be at pointer+1)
1603 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1605 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1606 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1610 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1612 if (opcode
< OPCODE_EXT_0
) {
1613 if (InstSize
[opcode
] == 0) {
1614 /* save instruction size now */
1615 InstSize
[opcode
] = numNodes
;
1618 /* make sure instruction size agrees */
1619 assert(numNodes
== InstSize
[opcode
]);
1623 if (sizeof(void *) > sizeof(Node
) && align8
1624 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1625 /* The opcode would get placed at node[0] and the payload would start
1626 * at node[1]. But the payload needs to be at an even offset (8-byte
1635 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1637 /* This block is full. Allocate a new block and chain to it */
1639 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1640 n
[0].opcode
= OPCODE_CONTINUE
;
1641 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1643 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1647 /* a fresh block should be 8-byte aligned on 64-bit systems */
1648 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1650 save_pointer(&n
[1], newblock
);
1651 ctx
->ListState
.CurrentBlock
= newblock
;
1652 ctx
->ListState
.CurrentPos
= 0;
1654 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1655 * we have to insert a NOP so that the payload of the real opcode lands
1656 * on an even location:
1657 * node[0] = OPCODE_NOP
1658 * node[1] = OPCODE_x;
1659 * node[2] = start of payload
1661 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1664 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1666 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1667 n
[0].opcode
= OPCODE_NOP
;
1669 /* The "real" opcode will now be at an odd location and the payload
1670 * will be at an even location.
1673 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1675 n
[0].opcode
= opcode
;
1683 * Allocate space for a display list instruction. Used by callers outside
1684 * this file for things like VBO vertex data.
1686 * \param opcode the instruction opcode (OPCODE_* value)
1687 * \param bytes instruction size in bytes, not counting opcode.
1688 * \return pointer to the usable data area (not including the internal
1692 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1694 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1696 return n
+ 1; /* return pointer to payload area, after opcode */
1703 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1704 * aligned in 64-bit environments, 4-byte aligned otherwise.
1707 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1709 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1711 return n
+ 1; /* return pointer to payload area, after opcode */
1718 * This function allows modules and drivers to get their own opcodes
1719 * for extending display list functionality.
1720 * \param ctx the rendering context
1721 * \param size number of bytes for storing the new display list command
1722 * \param execute function to execute the new display list command
1723 * \param destroy function to destroy the new display list command
1724 * \param print function to print the new display list command
1725 * \return the new opcode number or -1 if error
1728 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1730 void (*execute
) (struct gl_context
*, void *),
1731 void (*destroy
) (struct gl_context
*, void *),
1732 void (*print
) (struct gl_context
*, void *, FILE *))
1734 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1735 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1736 ctx
->ListExt
->Opcode
[i
].Size
=
1737 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1738 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1739 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1740 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1741 return i
+ OPCODE_EXT_0
;
1748 * Allocate space for a display list instruction. The space is basically
1749 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1750 * function parameter, node[2] is the second parameter, etc.
1752 * \param opcode one of OPCODE_x
1753 * \param nparams number of function parameters
1754 * \return pointer to start of instruction space
1756 static inline Node
*
1757 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1759 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1764 * Called by EndList to try to reduce memory used for the list.
1767 trim_list(struct gl_context
*ctx
)
1769 /* If the list we're ending only has one allocated block of nodes/tokens
1770 * and its size isn't a full block size, realloc the block to use less
1771 * memory. This is important for apps that create many small display
1772 * lists and apps that use glXUseXFont (many lists each containing one
1774 * Note: we currently only trim display lists that allocated one block
1775 * of tokens. That hits the short list case which is what we're mainly
1776 * concerned with. Trimming longer lists would involve traversing the
1777 * linked list of blocks.
1779 struct gl_dlist_state
*list
= &ctx
->ListState
;
1781 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1782 (list
->CurrentPos
< BLOCK_SIZE
)) {
1783 /* There's only one block and it's not full, so realloc */
1784 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1785 list
->CurrentList
->Head
=
1786 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1787 if (!list
->CurrentBlock
) {
1788 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1796 * Display List compilation functions
1798 static void GLAPIENTRY
1799 save_Accum(GLenum op
, GLfloat value
)
1801 GET_CURRENT_CONTEXT(ctx
);
1803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1804 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1809 if (ctx
->ExecuteFlag
) {
1810 CALL_Accum(ctx
->Exec
, (op
, value
));
1815 static void GLAPIENTRY
1816 save_AlphaFunc(GLenum func
, GLclampf ref
)
1818 GET_CURRENT_CONTEXT(ctx
);
1820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1821 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1824 n
[2].f
= (GLfloat
) ref
;
1826 if (ctx
->ExecuteFlag
) {
1827 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1832 static void GLAPIENTRY
1833 save_BindTexture(GLenum target
, GLuint texture
)
1835 GET_CURRENT_CONTEXT(ctx
);
1837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1838 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1843 if (ctx
->ExecuteFlag
) {
1844 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1849 static void GLAPIENTRY
1850 save_Bitmap(GLsizei width
, GLsizei height
,
1851 GLfloat xorig
, GLfloat yorig
,
1852 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1854 GET_CURRENT_CONTEXT(ctx
);
1856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1857 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1859 n
[1].i
= (GLint
) width
;
1860 n
[2].i
= (GLint
) height
;
1866 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1867 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1869 if (ctx
->ExecuteFlag
) {
1870 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1871 xorig
, yorig
, xmove
, ymove
, pixels
));
1876 static void GLAPIENTRY
1877 save_BlendEquation(GLenum mode
)
1879 GET_CURRENT_CONTEXT(ctx
);
1881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1882 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1886 if (ctx
->ExecuteFlag
) {
1887 CALL_BlendEquation(ctx
->Exec
, (mode
));
1892 static void GLAPIENTRY
1893 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1895 GET_CURRENT_CONTEXT(ctx
);
1897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1898 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1903 if (ctx
->ExecuteFlag
) {
1904 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1909 static void GLAPIENTRY
1910 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1911 GLenum sfactorA
, GLenum dfactorA
)
1913 GET_CURRENT_CONTEXT(ctx
);
1915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1916 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1918 n
[1].e
= sfactorRGB
;
1919 n
[2].e
= dfactorRGB
;
1923 if (ctx
->ExecuteFlag
) {
1924 CALL_BlendFuncSeparate(ctx
->Exec
,
1925 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1930 static void GLAPIENTRY
1931 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1933 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1937 static void GLAPIENTRY
1938 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1940 GET_CURRENT_CONTEXT(ctx
);
1942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1943 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1950 if (ctx
->ExecuteFlag
) {
1951 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1955 /* GL_ARB_draw_buffers_blend */
1956 static void GLAPIENTRY
1957 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1958 GLenum sfactorA
, GLenum dfactorA
)
1960 GET_CURRENT_CONTEXT(ctx
);
1962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1963 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1966 n
[2].e
= sfactorRGB
;
1967 n
[3].e
= dfactorRGB
;
1971 if (ctx
->ExecuteFlag
) {
1972 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1973 sfactorA
, dfactorA
));
1977 /* GL_ARB_draw_buffers_blend */
1978 static void GLAPIENTRY
1979 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1981 GET_CURRENT_CONTEXT(ctx
);
1983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1984 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1990 if (ctx
->ExecuteFlag
) {
1991 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1995 /* GL_ARB_draw_buffers_blend */
1996 static void GLAPIENTRY
1997 save_BlendEquationi(GLuint buf
, GLenum mode
)
1999 GET_CURRENT_CONTEXT(ctx
);
2001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2002 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
2007 if (ctx
->ExecuteFlag
) {
2008 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
2012 /* GL_ARB_draw_buffers_blend */
2013 static void GLAPIENTRY
2014 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
2016 GET_CURRENT_CONTEXT(ctx
);
2018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2019 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
2025 if (ctx
->ExecuteFlag
) {
2026 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
2031 /* GL_ARB_draw_instanced. */
2032 static void GLAPIENTRY
2033 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
2035 UNUSED GLsizei count
,
2036 UNUSED GLsizei primcount
)
2038 GET_CURRENT_CONTEXT(ctx
);
2039 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2040 "glDrawArraysInstanced() during display list compile");
2043 static void GLAPIENTRY
2044 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
2045 UNUSED GLsizei count
,
2047 UNUSED
const GLvoid
*indices
,
2048 UNUSED GLsizei primcount
)
2050 GET_CURRENT_CONTEXT(ctx
);
2051 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2052 "glDrawElementsInstanced() during display list compile");
2055 static void GLAPIENTRY
2056 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
2057 UNUSED GLsizei count
,
2059 UNUSED
const GLvoid
*indices
,
2060 UNUSED GLsizei primcount
,
2061 UNUSED GLint basevertex
)
2063 GET_CURRENT_CONTEXT(ctx
);
2064 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2065 "glDrawElementsInstancedBaseVertex() during display list compile");
2068 /* GL_ARB_base_instance. */
2069 static void GLAPIENTRY
2070 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
2072 UNUSED GLsizei count
,
2073 UNUSED GLsizei primcount
,
2074 UNUSED GLuint baseinstance
)
2076 GET_CURRENT_CONTEXT(ctx
);
2077 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2078 "glDrawArraysInstancedBaseInstance() during display list compile");
2081 static void APIENTRY
2082 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
2083 UNUSED GLsizei count
,
2085 UNUSED
const void *indices
,
2086 UNUSED GLsizei primcount
,
2087 UNUSED GLuint baseinstance
)
2089 GET_CURRENT_CONTEXT(ctx
);
2090 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2091 "glDrawElementsInstancedBaseInstance() during display list compile");
2094 static void APIENTRY
2095 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
2096 UNUSED GLsizei count
,
2098 UNUSED
const void *indices
,
2099 UNUSED GLsizei primcount
,
2100 UNUSED GLint basevertex
,
2101 UNUSED GLuint baseinstance
)
2103 GET_CURRENT_CONTEXT(ctx
);
2104 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2105 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2108 static void APIENTRY
2109 save_DrawArraysIndirect(UNUSED GLenum mode
,
2110 UNUSED
const void *indirect
)
2112 GET_CURRENT_CONTEXT(ctx
);
2113 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2114 "glDrawArraysIndirect() during display list compile");
2117 static void APIENTRY
2118 save_DrawElementsIndirect(UNUSED GLenum mode
,
2120 UNUSED
const void *indirect
)
2122 GET_CURRENT_CONTEXT(ctx
);
2123 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2124 "glDrawElementsIndirect() during display list compile");
2127 static void APIENTRY
2128 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2129 UNUSED
const void *indirect
,
2130 UNUSED GLsizei primcount
,
2131 UNUSED GLsizei stride
)
2133 GET_CURRENT_CONTEXT(ctx
);
2134 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2135 "glMultiDrawArraysIndirect() during display list compile");
2138 static void APIENTRY
2139 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2141 UNUSED
const void *indirect
,
2142 UNUSED GLsizei primcount
,
2143 UNUSED GLsizei stride
)
2145 GET_CURRENT_CONTEXT(ctx
);
2146 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2147 "glMultiDrawElementsIndirect() during display list compile");
2151 * While building a display list we cache some OpenGL state.
2152 * Under some circumstances we need to invalidate that state (immediately
2153 * when we start compiling a list, or after glCallList(s)).
2156 invalidate_saved_current_state(struct gl_context
*ctx
)
2160 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2161 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2163 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2164 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2166 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2168 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2172 static void GLAPIENTRY
2173 save_CallList(GLuint list
)
2175 GET_CURRENT_CONTEXT(ctx
);
2177 SAVE_FLUSH_VERTICES(ctx
);
2179 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2184 /* After this, we don't know what state we're in. Invalidate all
2185 * cached information previously gathered:
2187 invalidate_saved_current_state( ctx
);
2189 if (ctx
->ExecuteFlag
) {
2190 _mesa_CallList(list
);
2195 static void GLAPIENTRY
2196 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2198 GET_CURRENT_CONTEXT(ctx
);
2203 SAVE_FLUSH_VERTICES(ctx
);
2207 case GL_UNSIGNED_BYTE
:
2211 case GL_UNSIGNED_SHORT
:
2219 case GL_UNSIGNED_INT
:
2228 if (num
> 0 && type_size
> 0) {
2229 /* create a copy of the array of list IDs to save in the display list */
2230 lists_copy
= memdup(lists
, num
* type_size
);
2235 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2239 save_pointer(&n
[3], lists_copy
);
2242 /* After this, we don't know what state we're in. Invalidate all
2243 * cached information previously gathered:
2245 invalidate_saved_current_state( ctx
);
2247 if (ctx
->ExecuteFlag
) {
2248 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2253 static void GLAPIENTRY
2254 save_Clear(GLbitfield mask
)
2256 GET_CURRENT_CONTEXT(ctx
);
2258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2259 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2263 if (ctx
->ExecuteFlag
) {
2264 CALL_Clear(ctx
->Exec
, (mask
));
2269 static void GLAPIENTRY
2270 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2278 n
[2].i
= drawbuffer
;
2280 if (buffer
== GL_COLOR
) {
2291 if (ctx
->ExecuteFlag
) {
2292 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2297 static void GLAPIENTRY
2298 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2300 GET_CURRENT_CONTEXT(ctx
);
2302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2303 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2306 n
[2].i
= drawbuffer
;
2308 if (buffer
== GL_COLOR
) {
2319 if (ctx
->ExecuteFlag
) {
2320 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2325 static void GLAPIENTRY
2326 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2328 GET_CURRENT_CONTEXT(ctx
);
2330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2331 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2334 n
[2].i
= drawbuffer
;
2336 if (buffer
== GL_COLOR
) {
2347 if (ctx
->ExecuteFlag
) {
2348 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2353 static void GLAPIENTRY
2354 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2355 GLfloat depth
, GLint stencil
)
2357 GET_CURRENT_CONTEXT(ctx
);
2359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2360 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2363 n
[2].i
= drawbuffer
;
2367 if (ctx
->ExecuteFlag
) {
2368 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2373 static void GLAPIENTRY
2374 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2376 GET_CURRENT_CONTEXT(ctx
);
2378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2379 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2386 if (ctx
->ExecuteFlag
) {
2387 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2392 static void GLAPIENTRY
2393 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2395 GET_CURRENT_CONTEXT(ctx
);
2397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2398 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2405 if (ctx
->ExecuteFlag
) {
2406 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2411 static void GLAPIENTRY
2412 save_ClearDepth(GLclampd depth
)
2414 GET_CURRENT_CONTEXT(ctx
);
2416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2417 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2419 n
[1].f
= (GLfloat
) depth
;
2421 if (ctx
->ExecuteFlag
) {
2422 CALL_ClearDepth(ctx
->Exec
, (depth
));
2427 static void GLAPIENTRY
2428 save_ClearIndex(GLfloat c
)
2430 GET_CURRENT_CONTEXT(ctx
);
2432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2433 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2437 if (ctx
->ExecuteFlag
) {
2438 CALL_ClearIndex(ctx
->Exec
, (c
));
2443 static void GLAPIENTRY
2444 save_ClearStencil(GLint s
)
2446 GET_CURRENT_CONTEXT(ctx
);
2448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2449 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2453 if (ctx
->ExecuteFlag
) {
2454 CALL_ClearStencil(ctx
->Exec
, (s
));
2459 static void GLAPIENTRY
2460 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2462 GET_CURRENT_CONTEXT(ctx
);
2464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2465 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2468 n
[2].f
= (GLfloat
) equ
[0];
2469 n
[3].f
= (GLfloat
) equ
[1];
2470 n
[4].f
= (GLfloat
) equ
[2];
2471 n
[5].f
= (GLfloat
) equ
[3];
2473 if (ctx
->ExecuteFlag
) {
2474 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2480 static void GLAPIENTRY
2481 save_ColorMask(GLboolean red
, GLboolean green
,
2482 GLboolean blue
, GLboolean alpha
)
2484 GET_CURRENT_CONTEXT(ctx
);
2486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2487 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2494 if (ctx
->ExecuteFlag
) {
2495 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2500 static void GLAPIENTRY
2501 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2502 GLboolean blue
, GLboolean alpha
)
2504 GET_CURRENT_CONTEXT(ctx
);
2506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2507 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2515 if (ctx
->ExecuteFlag
) {
2516 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2521 static void GLAPIENTRY
2522 save_ColorMaterial(GLenum face
, GLenum mode
)
2524 GET_CURRENT_CONTEXT(ctx
);
2526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2528 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2533 if (ctx
->ExecuteFlag
) {
2534 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2539 static void GLAPIENTRY
2540 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2542 GET_CURRENT_CONTEXT(ctx
);
2544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2545 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2549 n
[3].i
= (GLint
) width
;
2550 n
[4].i
= (GLint
) height
;
2553 if (ctx
->ExecuteFlag
) {
2554 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2560 static void GLAPIENTRY
2561 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2562 GLint x
, GLint y
, GLsizei width
, GLint border
)
2564 GET_CURRENT_CONTEXT(ctx
);
2566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2567 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2571 n
[3].e
= internalformat
;
2577 if (ctx
->ExecuteFlag
) {
2578 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2579 x
, y
, width
, border
));
2584 static void GLAPIENTRY
2585 save_CopyTexImage2D(GLenum target
, GLint level
,
2586 GLenum internalformat
,
2587 GLint x
, GLint y
, GLsizei width
,
2588 GLsizei height
, GLint border
)
2590 GET_CURRENT_CONTEXT(ctx
);
2592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2593 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2597 n
[3].e
= internalformat
;
2604 if (ctx
->ExecuteFlag
) {
2605 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2606 x
, y
, width
, height
, border
));
2612 static void GLAPIENTRY
2613 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2614 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2616 GET_CURRENT_CONTEXT(ctx
);
2618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2619 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2628 if (ctx
->ExecuteFlag
) {
2629 CALL_CopyTexSubImage1D(ctx
->Exec
,
2630 (target
, level
, xoffset
, x
, y
, width
));
2635 static void GLAPIENTRY
2636 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2637 GLint xoffset
, GLint yoffset
,
2638 GLint x
, GLint y
, GLsizei width
, GLint height
)
2640 GET_CURRENT_CONTEXT(ctx
);
2642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2643 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2654 if (ctx
->ExecuteFlag
) {
2655 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2656 x
, y
, width
, height
));
2661 static void GLAPIENTRY
2662 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2663 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2664 GLint x
, GLint y
, GLsizei width
, GLint height
)
2666 GET_CURRENT_CONTEXT(ctx
);
2668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2669 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2681 if (ctx
->ExecuteFlag
) {
2682 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2683 xoffset
, yoffset
, zoffset
,
2684 x
, y
, width
, height
));
2689 static void GLAPIENTRY
2690 save_CullFace(GLenum mode
)
2692 GET_CURRENT_CONTEXT(ctx
);
2694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2695 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2699 if (ctx
->ExecuteFlag
) {
2700 CALL_CullFace(ctx
->Exec
, (mode
));
2705 static void GLAPIENTRY
2706 save_DepthFunc(GLenum func
)
2708 GET_CURRENT_CONTEXT(ctx
);
2710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2711 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2715 if (ctx
->ExecuteFlag
) {
2716 CALL_DepthFunc(ctx
->Exec
, (func
));
2721 static void GLAPIENTRY
2722 save_DepthMask(GLboolean mask
)
2724 GET_CURRENT_CONTEXT(ctx
);
2726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2727 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2731 if (ctx
->ExecuteFlag
) {
2732 CALL_DepthMask(ctx
->Exec
, (mask
));
2737 static void GLAPIENTRY
2738 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2740 GET_CURRENT_CONTEXT(ctx
);
2742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2743 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2745 n
[1].f
= (GLfloat
) nearval
;
2746 n
[2].f
= (GLfloat
) farval
;
2748 if (ctx
->ExecuteFlag
) {
2749 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2754 static void GLAPIENTRY
2755 save_Disable(GLenum cap
)
2757 GET_CURRENT_CONTEXT(ctx
);
2759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2760 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2764 if (ctx
->ExecuteFlag
) {
2765 CALL_Disable(ctx
->Exec
, (cap
));
2770 static void GLAPIENTRY
2771 save_DisableIndexed(GLuint index
, GLenum cap
)
2773 GET_CURRENT_CONTEXT(ctx
);
2775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2776 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2781 if (ctx
->ExecuteFlag
) {
2782 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2787 static void GLAPIENTRY
2788 save_DrawBuffer(GLenum mode
)
2790 GET_CURRENT_CONTEXT(ctx
);
2792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2793 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2797 if (ctx
->ExecuteFlag
) {
2798 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2803 static void GLAPIENTRY
2804 save_DrawPixels(GLsizei width
, GLsizei height
,
2805 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2807 GET_CURRENT_CONTEXT(ctx
);
2810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2812 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2819 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2820 pixels
, &ctx
->Unpack
));
2822 if (ctx
->ExecuteFlag
) {
2823 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2829 static void GLAPIENTRY
2830 save_Enable(GLenum cap
)
2832 GET_CURRENT_CONTEXT(ctx
);
2834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2835 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2839 if (ctx
->ExecuteFlag
) {
2840 CALL_Enable(ctx
->Exec
, (cap
));
2846 static void GLAPIENTRY
2847 save_EnableIndexed(GLuint index
, GLenum cap
)
2849 GET_CURRENT_CONTEXT(ctx
);
2851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2852 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2857 if (ctx
->ExecuteFlag
) {
2858 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2864 static void GLAPIENTRY
2865 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2867 GET_CURRENT_CONTEXT(ctx
);
2869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2870 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2876 if (ctx
->ExecuteFlag
) {
2877 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2882 static void GLAPIENTRY
2883 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2885 GET_CURRENT_CONTEXT(ctx
);
2887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2888 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2896 if (ctx
->ExecuteFlag
) {
2897 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2904 static void GLAPIENTRY
2905 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2907 GET_CURRENT_CONTEXT(ctx
);
2909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2910 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2918 if (ctx
->ExecuteFlag
) {
2919 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2924 static void GLAPIENTRY
2925 save_Fogf(GLenum pname
, GLfloat param
)
2929 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2930 save_Fogfv(pname
, parray
);
2934 static void GLAPIENTRY
2935 save_Fogiv(GLenum pname
, const GLint
*params
)
2940 case GL_FOG_DENSITY
:
2944 case GL_FOG_COORDINATE_SOURCE
:
2945 p
[0] = (GLfloat
) *params
;
2951 p
[0] = INT_TO_FLOAT(params
[0]);
2952 p
[1] = INT_TO_FLOAT(params
[1]);
2953 p
[2] = INT_TO_FLOAT(params
[2]);
2954 p
[3] = INT_TO_FLOAT(params
[3]);
2957 /* Error will be caught later in gl_Fogfv */
2958 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2960 save_Fogfv(pname
, p
);
2964 static void GLAPIENTRY
2965 save_Fogi(GLenum pname
, GLint param
)
2969 parray
[1] = parray
[2] = parray
[3] = 0;
2970 save_Fogiv(pname
, parray
);
2974 static void GLAPIENTRY
2975 save_FrontFace(GLenum mode
)
2977 GET_CURRENT_CONTEXT(ctx
);
2979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2980 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2984 if (ctx
->ExecuteFlag
) {
2985 CALL_FrontFace(ctx
->Exec
, (mode
));
2990 static void GLAPIENTRY
2991 save_Frustum(GLdouble left
, GLdouble right
,
2992 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2994 GET_CURRENT_CONTEXT(ctx
);
2996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2997 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2999 n
[1].f
= (GLfloat
) left
;
3000 n
[2].f
= (GLfloat
) right
;
3001 n
[3].f
= (GLfloat
) bottom
;
3002 n
[4].f
= (GLfloat
) top
;
3003 n
[5].f
= (GLfloat
) nearval
;
3004 n
[6].f
= (GLfloat
) farval
;
3006 if (ctx
->ExecuteFlag
) {
3007 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3012 static void GLAPIENTRY
3013 save_Hint(GLenum target
, GLenum mode
)
3015 GET_CURRENT_CONTEXT(ctx
);
3017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3018 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
3023 if (ctx
->ExecuteFlag
) {
3024 CALL_Hint(ctx
->Exec
, (target
, mode
));
3029 static void GLAPIENTRY
3030 save_IndexMask(GLuint mask
)
3032 GET_CURRENT_CONTEXT(ctx
);
3034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3035 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
3039 if (ctx
->ExecuteFlag
) {
3040 CALL_IndexMask(ctx
->Exec
, (mask
));
3045 static void GLAPIENTRY
3046 save_InitNames(void)
3048 GET_CURRENT_CONTEXT(ctx
);
3049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3050 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
3051 if (ctx
->ExecuteFlag
) {
3052 CALL_InitNames(ctx
->Exec
, ());
3057 static void GLAPIENTRY
3058 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
3060 GET_CURRENT_CONTEXT(ctx
);
3062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3063 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
3081 case GL_SPOT_DIRECTION
:
3084 case GL_SPOT_EXPONENT
:
3087 case GL_SPOT_CUTOFF
:
3090 case GL_CONSTANT_ATTENUATION
:
3093 case GL_LINEAR_ATTENUATION
:
3096 case GL_QUADRATIC_ATTENUATION
:
3102 for (i
= 0; i
< nParams
; i
++) {
3103 n
[3 + i
].f
= params
[i
];
3106 if (ctx
->ExecuteFlag
) {
3107 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3112 static void GLAPIENTRY
3113 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3117 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3118 save_Lightfv(light
, pname
, parray
);
3122 static void GLAPIENTRY
3123 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3130 fparam
[0] = INT_TO_FLOAT(params
[0]);
3131 fparam
[1] = INT_TO_FLOAT(params
[1]);
3132 fparam
[2] = INT_TO_FLOAT(params
[2]);
3133 fparam
[3] = INT_TO_FLOAT(params
[3]);
3136 fparam
[0] = (GLfloat
) params
[0];
3137 fparam
[1] = (GLfloat
) params
[1];
3138 fparam
[2] = (GLfloat
) params
[2];
3139 fparam
[3] = (GLfloat
) params
[3];
3141 case GL_SPOT_DIRECTION
:
3142 fparam
[0] = (GLfloat
) params
[0];
3143 fparam
[1] = (GLfloat
) params
[1];
3144 fparam
[2] = (GLfloat
) params
[2];
3146 case GL_SPOT_EXPONENT
:
3147 case GL_SPOT_CUTOFF
:
3148 case GL_CONSTANT_ATTENUATION
:
3149 case GL_LINEAR_ATTENUATION
:
3150 case GL_QUADRATIC_ATTENUATION
:
3151 fparam
[0] = (GLfloat
) params
[0];
3154 /* error will be caught later in gl_Lightfv */
3157 save_Lightfv(light
, pname
, fparam
);
3161 static void GLAPIENTRY
3162 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3166 parray
[1] = parray
[2] = parray
[3] = 0;
3167 save_Lightiv(light
, pname
, parray
);
3171 static void GLAPIENTRY
3172 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3174 GET_CURRENT_CONTEXT(ctx
);
3176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3177 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3185 if (ctx
->ExecuteFlag
) {
3186 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3191 static void GLAPIENTRY
3192 save_LightModelf(GLenum pname
, GLfloat param
)
3196 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3197 save_LightModelfv(pname
, parray
);
3201 static void GLAPIENTRY
3202 save_LightModeliv(GLenum pname
, const GLint
*params
)
3206 case GL_LIGHT_MODEL_AMBIENT
:
3207 fparam
[0] = INT_TO_FLOAT(params
[0]);
3208 fparam
[1] = INT_TO_FLOAT(params
[1]);
3209 fparam
[2] = INT_TO_FLOAT(params
[2]);
3210 fparam
[3] = INT_TO_FLOAT(params
[3]);
3212 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3213 case GL_LIGHT_MODEL_TWO_SIDE
:
3214 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3215 fparam
[0] = (GLfloat
) params
[0];
3221 /* Error will be caught later in gl_LightModelfv */
3222 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3224 save_LightModelfv(pname
, fparam
);
3228 static void GLAPIENTRY
3229 save_LightModeli(GLenum pname
, GLint param
)
3233 parray
[1] = parray
[2] = parray
[3] = 0;
3234 save_LightModeliv(pname
, parray
);
3238 static void GLAPIENTRY
3239 save_LineStipple(GLint factor
, GLushort pattern
)
3241 GET_CURRENT_CONTEXT(ctx
);
3243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3244 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3249 if (ctx
->ExecuteFlag
) {
3250 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3255 static void GLAPIENTRY
3256 save_LineWidth(GLfloat width
)
3258 GET_CURRENT_CONTEXT(ctx
);
3260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3261 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3265 if (ctx
->ExecuteFlag
) {
3266 CALL_LineWidth(ctx
->Exec
, (width
));
3271 static void GLAPIENTRY
3272 save_ListBase(GLuint base
)
3274 GET_CURRENT_CONTEXT(ctx
);
3276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3277 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3281 if (ctx
->ExecuteFlag
) {
3282 CALL_ListBase(ctx
->Exec
, (base
));
3287 static void GLAPIENTRY
3288 save_LoadIdentity(void)
3290 GET_CURRENT_CONTEXT(ctx
);
3291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3292 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3293 if (ctx
->ExecuteFlag
) {
3294 CALL_LoadIdentity(ctx
->Exec
, ());
3299 static void GLAPIENTRY
3300 save_LoadMatrixf(const GLfloat
* m
)
3302 GET_CURRENT_CONTEXT(ctx
);
3304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3305 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3308 for (i
= 0; i
< 16; i
++) {
3312 if (ctx
->ExecuteFlag
) {
3313 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3318 static void GLAPIENTRY
3319 save_LoadMatrixd(const GLdouble
* m
)
3323 for (i
= 0; i
< 16; i
++) {
3324 f
[i
] = (GLfloat
) m
[i
];
3326 save_LoadMatrixf(f
);
3330 static void GLAPIENTRY
3331 save_LoadName(GLuint name
)
3333 GET_CURRENT_CONTEXT(ctx
);
3335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3336 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3340 if (ctx
->ExecuteFlag
) {
3341 CALL_LoadName(ctx
->Exec
, (name
));
3346 static void GLAPIENTRY
3347 save_LogicOp(GLenum opcode
)
3349 GET_CURRENT_CONTEXT(ctx
);
3351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3352 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3356 if (ctx
->ExecuteFlag
) {
3357 CALL_LogicOp(ctx
->Exec
, (opcode
));
3362 static void GLAPIENTRY
3363 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3364 GLint order
, const GLdouble
* points
)
3366 GET_CURRENT_CONTEXT(ctx
);
3368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3369 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3371 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3373 n
[2].f
= (GLfloat
) u1
;
3374 n
[3].f
= (GLfloat
) u2
;
3375 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3377 save_pointer(&n
[6], pnts
);
3379 if (ctx
->ExecuteFlag
) {
3380 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3384 static void GLAPIENTRY
3385 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3386 GLint order
, const GLfloat
* points
)
3388 GET_CURRENT_CONTEXT(ctx
);
3390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3391 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3393 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3397 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3399 save_pointer(&n
[6], pnts
);
3401 if (ctx
->ExecuteFlag
) {
3402 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3407 static void GLAPIENTRY
3408 save_Map2d(GLenum target
,
3409 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3410 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3411 const GLdouble
* points
)
3413 GET_CURRENT_CONTEXT(ctx
);
3415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3416 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3418 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3419 vstride
, vorder
, points
);
3421 n
[2].f
= (GLfloat
) u1
;
3422 n
[3].f
= (GLfloat
) u2
;
3423 n
[4].f
= (GLfloat
) v1
;
3424 n
[5].f
= (GLfloat
) v2
;
3425 /* XXX verify these strides are correct */
3426 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3427 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3430 save_pointer(&n
[10], pnts
);
3432 if (ctx
->ExecuteFlag
) {
3433 CALL_Map2d(ctx
->Exec
, (target
,
3434 u1
, u2
, ustride
, uorder
,
3435 v1
, v2
, vstride
, vorder
, points
));
3440 static void GLAPIENTRY
3441 save_Map2f(GLenum target
,
3442 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3443 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3444 const GLfloat
* points
)
3446 GET_CURRENT_CONTEXT(ctx
);
3448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3449 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3451 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3452 vstride
, vorder
, points
);
3458 /* XXX verify these strides are correct */
3459 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3460 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3463 save_pointer(&n
[10], pnts
);
3465 if (ctx
->ExecuteFlag
) {
3466 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3467 v1
, v2
, vstride
, vorder
, points
));
3472 static void GLAPIENTRY
3473 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3475 GET_CURRENT_CONTEXT(ctx
);
3477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3478 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3484 if (ctx
->ExecuteFlag
) {
3485 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3490 static void GLAPIENTRY
3491 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3493 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3497 static void GLAPIENTRY
3498 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3499 GLint vn
, GLfloat v1
, GLfloat v2
)
3501 GET_CURRENT_CONTEXT(ctx
);
3503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3504 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3513 if (ctx
->ExecuteFlag
) {
3514 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3520 static void GLAPIENTRY
3521 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3522 GLint vn
, GLdouble v1
, GLdouble v2
)
3524 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3525 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3529 static void GLAPIENTRY
3530 save_MatrixMode(GLenum mode
)
3532 GET_CURRENT_CONTEXT(ctx
);
3534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3535 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3539 if (ctx
->ExecuteFlag
) {
3540 CALL_MatrixMode(ctx
->Exec
, (mode
));
3545 static void GLAPIENTRY
3546 save_MultMatrixf(const GLfloat
* m
)
3548 GET_CURRENT_CONTEXT(ctx
);
3550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3551 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3554 for (i
= 0; i
< 16; i
++) {
3558 if (ctx
->ExecuteFlag
) {
3559 CALL_MultMatrixf(ctx
->Exec
, (m
));
3564 static void GLAPIENTRY
3565 save_MultMatrixd(const GLdouble
* m
)
3569 for (i
= 0; i
< 16; i
++) {
3570 f
[i
] = (GLfloat
) m
[i
];
3572 save_MultMatrixf(f
);
3576 static void GLAPIENTRY
3577 save_NewList(GLuint name
, GLenum mode
)
3579 GET_CURRENT_CONTEXT(ctx
);
3580 /* It's an error to call this function while building a display list */
3581 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3588 static void GLAPIENTRY
3589 save_Ortho(GLdouble left
, GLdouble right
,
3590 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3592 GET_CURRENT_CONTEXT(ctx
);
3594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3595 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3597 n
[1].f
= (GLfloat
) left
;
3598 n
[2].f
= (GLfloat
) right
;
3599 n
[3].f
= (GLfloat
) bottom
;
3600 n
[4].f
= (GLfloat
) top
;
3601 n
[5].f
= (GLfloat
) nearval
;
3602 n
[6].f
= (GLfloat
) farval
;
3604 if (ctx
->ExecuteFlag
) {
3605 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3610 static void GLAPIENTRY
3611 save_PatchParameteri(GLenum pname
, const GLint value
)
3613 GET_CURRENT_CONTEXT(ctx
);
3615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3616 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3621 if (ctx
->ExecuteFlag
) {
3622 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3627 static void GLAPIENTRY
3628 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3630 GET_CURRENT_CONTEXT(ctx
);
3632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3634 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3635 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3637 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3638 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3642 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3652 if (ctx
->ExecuteFlag
) {
3653 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3658 static void GLAPIENTRY
3659 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3661 GET_CURRENT_CONTEXT(ctx
);
3663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3664 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3668 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3670 if (ctx
->ExecuteFlag
) {
3671 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3676 static void GLAPIENTRY
3677 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3679 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3681 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3682 for (i
= 0; i
< mapsize
; i
++) {
3683 fvalues
[i
] = (GLfloat
) values
[i
];
3687 for (i
= 0; i
< mapsize
; i
++) {
3688 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3691 save_PixelMapfv(map
, mapsize
, fvalues
);
3695 static void GLAPIENTRY
3696 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3698 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3700 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3701 for (i
= 0; i
< mapsize
; i
++) {
3702 fvalues
[i
] = (GLfloat
) values
[i
];
3706 for (i
= 0; i
< mapsize
; i
++) {
3707 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3710 save_PixelMapfv(map
, mapsize
, fvalues
);
3714 static void GLAPIENTRY
3715 save_PixelTransferf(GLenum pname
, GLfloat param
)
3717 GET_CURRENT_CONTEXT(ctx
);
3719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3720 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3725 if (ctx
->ExecuteFlag
) {
3726 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3731 static void GLAPIENTRY
3732 save_PixelTransferi(GLenum pname
, GLint param
)
3734 save_PixelTransferf(pname
, (GLfloat
) param
);
3738 static void GLAPIENTRY
3739 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3741 GET_CURRENT_CONTEXT(ctx
);
3743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3744 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3749 if (ctx
->ExecuteFlag
) {
3750 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3755 static void GLAPIENTRY
3756 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3758 GET_CURRENT_CONTEXT(ctx
);
3760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3761 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3768 if (ctx
->ExecuteFlag
) {
3769 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3774 static void GLAPIENTRY
3775 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3779 parray
[1] = parray
[2] = 0.0F
;
3780 save_PointParameterfvEXT(pname
, parray
);
3783 static void GLAPIENTRY
3784 save_PointParameteriNV(GLenum pname
, GLint param
)
3787 parray
[0] = (GLfloat
) param
;
3788 parray
[1] = parray
[2] = 0.0F
;
3789 save_PointParameterfvEXT(pname
, parray
);
3792 static void GLAPIENTRY
3793 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3796 parray
[0] = (GLfloat
) param
[0];
3797 parray
[1] = parray
[2] = 0.0F
;
3798 save_PointParameterfvEXT(pname
, parray
);
3802 static void GLAPIENTRY
3803 save_PointSize(GLfloat size
)
3805 GET_CURRENT_CONTEXT(ctx
);
3807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3808 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3812 if (ctx
->ExecuteFlag
) {
3813 CALL_PointSize(ctx
->Exec
, (size
));
3818 static void GLAPIENTRY
3819 save_PolygonMode(GLenum face
, GLenum mode
)
3821 GET_CURRENT_CONTEXT(ctx
);
3823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3824 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3829 if (ctx
->ExecuteFlag
) {
3830 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3835 static void GLAPIENTRY
3836 save_PolygonStipple(const GLubyte
* pattern
)
3838 GET_CURRENT_CONTEXT(ctx
);
3841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3843 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3846 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3847 pattern
, &ctx
->Unpack
));
3849 if (ctx
->ExecuteFlag
) {
3850 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3855 static void GLAPIENTRY
3856 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3858 GET_CURRENT_CONTEXT(ctx
);
3860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3861 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3866 if (ctx
->ExecuteFlag
) {
3867 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3872 static void GLAPIENTRY
3873 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3875 GET_CURRENT_CONTEXT(ctx
);
3877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3878 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3884 if (ctx
->ExecuteFlag
) {
3885 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3889 static void GLAPIENTRY
3890 save_PopAttrib(void)
3892 GET_CURRENT_CONTEXT(ctx
);
3893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3894 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3895 if (ctx
->ExecuteFlag
) {
3896 CALL_PopAttrib(ctx
->Exec
, ());
3901 static void GLAPIENTRY
3902 save_PopMatrix(void)
3904 GET_CURRENT_CONTEXT(ctx
);
3905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3906 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3907 if (ctx
->ExecuteFlag
) {
3908 CALL_PopMatrix(ctx
->Exec
, ());
3913 static void GLAPIENTRY
3916 GET_CURRENT_CONTEXT(ctx
);
3917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3918 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3919 if (ctx
->ExecuteFlag
) {
3920 CALL_PopName(ctx
->Exec
, ());
3925 static void GLAPIENTRY
3926 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3927 const GLclampf
* priorities
)
3929 GET_CURRENT_CONTEXT(ctx
);
3931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3933 for (i
= 0; i
< num
; i
++) {
3935 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3937 n
[1].ui
= textures
[i
];
3938 n
[2].f
= priorities
[i
];
3941 if (ctx
->ExecuteFlag
) {
3942 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3947 static void GLAPIENTRY
3948 save_PushAttrib(GLbitfield mask
)
3950 GET_CURRENT_CONTEXT(ctx
);
3952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3953 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3957 if (ctx
->ExecuteFlag
) {
3958 CALL_PushAttrib(ctx
->Exec
, (mask
));
3963 static void GLAPIENTRY
3964 save_PushMatrix(void)
3966 GET_CURRENT_CONTEXT(ctx
);
3967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3968 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3969 if (ctx
->ExecuteFlag
) {
3970 CALL_PushMatrix(ctx
->Exec
, ());
3975 static void GLAPIENTRY
3976 save_PushName(GLuint name
)
3978 GET_CURRENT_CONTEXT(ctx
);
3980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3981 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3985 if (ctx
->ExecuteFlag
) {
3986 CALL_PushName(ctx
->Exec
, (name
));
3991 static void GLAPIENTRY
3992 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3994 GET_CURRENT_CONTEXT(ctx
);
3996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3997 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
4004 if (ctx
->ExecuteFlag
) {
4005 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
4009 static void GLAPIENTRY
4010 save_RasterPos2d(GLdouble x
, GLdouble y
)
4012 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4015 static void GLAPIENTRY
4016 save_RasterPos2f(GLfloat x
, GLfloat y
)
4018 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4021 static void GLAPIENTRY
4022 save_RasterPos2i(GLint x
, GLint y
)
4024 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4027 static void GLAPIENTRY
4028 save_RasterPos2s(GLshort x
, GLshort y
)
4030 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4033 static void GLAPIENTRY
4034 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
4036 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4039 static void GLAPIENTRY
4040 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
4042 save_RasterPos4f(x
, y
, z
, 1.0F
);
4045 static void GLAPIENTRY
4046 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
4048 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4051 static void GLAPIENTRY
4052 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
4054 save_RasterPos4f(x
, y
, z
, 1.0F
);
4057 static void GLAPIENTRY
4058 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4060 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4063 static void GLAPIENTRY
4064 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
4066 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4069 static void GLAPIENTRY
4070 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4072 save_RasterPos4f(x
, y
, z
, w
);
4075 static void GLAPIENTRY
4076 save_RasterPos2dv(const GLdouble
* v
)
4078 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4081 static void GLAPIENTRY
4082 save_RasterPos2fv(const GLfloat
* v
)
4084 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4087 static void GLAPIENTRY
4088 save_RasterPos2iv(const GLint
* v
)
4090 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4093 static void GLAPIENTRY
4094 save_RasterPos2sv(const GLshort
* v
)
4096 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4099 static void GLAPIENTRY
4100 save_RasterPos3dv(const GLdouble
* v
)
4102 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4105 static void GLAPIENTRY
4106 save_RasterPos3fv(const GLfloat
* v
)
4108 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4111 static void GLAPIENTRY
4112 save_RasterPos3iv(const GLint
* v
)
4114 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4117 static void GLAPIENTRY
4118 save_RasterPos3sv(const GLshort
* v
)
4120 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4123 static void GLAPIENTRY
4124 save_RasterPos4dv(const GLdouble
* v
)
4126 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4127 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4130 static void GLAPIENTRY
4131 save_RasterPos4fv(const GLfloat
* v
)
4133 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4136 static void GLAPIENTRY
4137 save_RasterPos4iv(const GLint
* v
)
4139 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4140 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4143 static void GLAPIENTRY
4144 save_RasterPos4sv(const GLshort
* v
)
4146 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4150 static void GLAPIENTRY
4151 save_PassThrough(GLfloat token
)
4153 GET_CURRENT_CONTEXT(ctx
);
4155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4156 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4160 if (ctx
->ExecuteFlag
) {
4161 CALL_PassThrough(ctx
->Exec
, (token
));
4166 static void GLAPIENTRY
4167 save_ReadBuffer(GLenum mode
)
4169 GET_CURRENT_CONTEXT(ctx
);
4171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4172 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4176 if (ctx
->ExecuteFlag
) {
4177 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4182 static void GLAPIENTRY
4183 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4185 GET_CURRENT_CONTEXT(ctx
);
4187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4188 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4195 if (ctx
->ExecuteFlag
) {
4196 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4201 static void GLAPIENTRY
4202 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4204 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4208 static void GLAPIENTRY
4209 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4211 GET_CURRENT_CONTEXT(ctx
);
4213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4214 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4220 if (ctx
->ExecuteFlag
) {
4221 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4226 static void GLAPIENTRY
4227 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4229 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4233 static void GLAPIENTRY
4234 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4236 GET_CURRENT_CONTEXT(ctx
);
4238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4239 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4246 if (ctx
->ExecuteFlag
) {
4247 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4252 static void GLAPIENTRY
4253 save_ShadeModel(GLenum mode
)
4255 GET_CURRENT_CONTEXT(ctx
);
4257 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4259 if (ctx
->ExecuteFlag
) {
4260 CALL_ShadeModel(ctx
->Exec
, (mode
));
4263 /* Don't compile this call if it's a no-op.
4264 * By avoiding this state change we have a better chance of
4265 * coalescing subsequent drawing commands into one batch.
4267 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4270 SAVE_FLUSH_VERTICES(ctx
);
4272 ctx
->ListState
.Current
.ShadeModel
= mode
;
4274 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4281 static void GLAPIENTRY
4282 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4284 GET_CURRENT_CONTEXT(ctx
);
4286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4287 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4293 if (ctx
->ExecuteFlag
) {
4294 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4299 static void GLAPIENTRY
4300 save_StencilMask(GLuint mask
)
4302 GET_CURRENT_CONTEXT(ctx
);
4304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4305 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4309 if (ctx
->ExecuteFlag
) {
4310 CALL_StencilMask(ctx
->Exec
, (mask
));
4315 static void GLAPIENTRY
4316 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4318 GET_CURRENT_CONTEXT(ctx
);
4320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4321 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4327 if (ctx
->ExecuteFlag
) {
4328 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4333 static void GLAPIENTRY
4334 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4336 GET_CURRENT_CONTEXT(ctx
);
4338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4339 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4346 if (ctx
->ExecuteFlag
) {
4347 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4352 static void GLAPIENTRY
4353 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4356 GET_CURRENT_CONTEXT(ctx
);
4358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4360 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4368 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4375 if (ctx
->ExecuteFlag
) {
4376 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4377 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4382 static void GLAPIENTRY
4383 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4385 GET_CURRENT_CONTEXT(ctx
);
4387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4388 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4393 if (ctx
->ExecuteFlag
) {
4394 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4399 static void GLAPIENTRY
4400 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4402 GET_CURRENT_CONTEXT(ctx
);
4404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4405 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4412 if (ctx
->ExecuteFlag
) {
4413 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4418 static void GLAPIENTRY
4419 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4421 GET_CURRENT_CONTEXT(ctx
);
4423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4424 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4428 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4436 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4439 if (ctx
->ExecuteFlag
) {
4440 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4445 static void GLAPIENTRY
4446 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4449 parray
[0] = (GLfloat
) param
;
4450 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4451 save_TexEnvfv(target
, pname
, parray
);
4455 static void GLAPIENTRY
4456 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4459 p
[0] = (GLfloat
) param
;
4460 p
[1] = p
[2] = p
[3] = 0.0F
;
4461 save_TexEnvfv(target
, pname
, p
);
4465 static void GLAPIENTRY
4466 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4469 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4470 p
[0] = INT_TO_FLOAT(param
[0]);
4471 p
[1] = INT_TO_FLOAT(param
[1]);
4472 p
[2] = INT_TO_FLOAT(param
[2]);
4473 p
[3] = INT_TO_FLOAT(param
[3]);
4476 p
[0] = (GLfloat
) param
[0];
4477 p
[1] = p
[2] = p
[3] = 0.0F
;
4479 save_TexEnvfv(target
, pname
, p
);
4483 static void GLAPIENTRY
4484 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4486 GET_CURRENT_CONTEXT(ctx
);
4488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4489 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4498 if (ctx
->ExecuteFlag
) {
4499 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4504 static void GLAPIENTRY
4505 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4508 p
[0] = (GLfloat
) params
[0];
4509 p
[1] = (GLfloat
) params
[1];
4510 p
[2] = (GLfloat
) params
[2];
4511 p
[3] = (GLfloat
) params
[3];
4512 save_TexGenfv(coord
, pname
, p
);
4516 static void GLAPIENTRY
4517 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4520 parray
[0] = (GLfloat
) param
;
4521 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4522 save_TexGenfv(coord
, pname
, parray
);
4526 static void GLAPIENTRY
4527 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4530 p
[0] = (GLfloat
) params
[0];
4531 p
[1] = (GLfloat
) params
[1];
4532 p
[2] = (GLfloat
) params
[2];
4533 p
[3] = (GLfloat
) params
[3];
4534 save_TexGenfv(coord
, pname
, p
);
4538 static void GLAPIENTRY
4539 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4543 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4544 save_TexGenfv(coord
, pname
, parray
);
4548 static void GLAPIENTRY
4549 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4553 parray
[1] = parray
[2] = parray
[3] = 0;
4554 save_TexGeniv(coord
, pname
, parray
);
4558 static void GLAPIENTRY
4559 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4561 GET_CURRENT_CONTEXT(ctx
);
4563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4564 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4573 if (ctx
->ExecuteFlag
) {
4574 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4579 static void GLAPIENTRY
4580 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4584 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4585 save_TexParameterfv(target
, pname
, parray
);
4589 static void GLAPIENTRY
4590 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4593 fparam
[0] = (GLfloat
) param
;
4594 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4595 save_TexParameterfv(target
, pname
, fparam
);
4599 static void GLAPIENTRY
4600 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4603 fparam
[0] = (GLfloat
) params
[0];
4604 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4605 save_TexParameterfv(target
, pname
, fparam
);
4609 static void GLAPIENTRY
4610 save_TexImage1D(GLenum target
,
4611 GLint level
, GLint components
,
4612 GLsizei width
, GLint border
,
4613 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4615 GET_CURRENT_CONTEXT(ctx
);
4616 if (target
== GL_PROXY_TEXTURE_1D
) {
4617 /* don't compile, execute immediately */
4618 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4619 border
, format
, type
, pixels
));
4623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4624 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4628 n
[3].i
= components
;
4629 n
[4].i
= (GLint
) width
;
4634 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4635 pixels
, &ctx
->Unpack
));
4637 if (ctx
->ExecuteFlag
) {
4638 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4639 border
, format
, type
, pixels
));
4645 static void GLAPIENTRY
4646 save_TexImage2D(GLenum target
,
4647 GLint level
, GLint components
,
4648 GLsizei width
, GLsizei height
, GLint border
,
4649 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4651 GET_CURRENT_CONTEXT(ctx
);
4652 if (target
== GL_PROXY_TEXTURE_2D
) {
4653 /* don't compile, execute immediately */
4654 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4655 height
, border
, format
, type
, pixels
));
4659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4664 n
[3].i
= components
;
4665 n
[4].i
= (GLint
) width
;
4666 n
[5].i
= (GLint
) height
;
4671 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4672 pixels
, &ctx
->Unpack
));
4674 if (ctx
->ExecuteFlag
) {
4675 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4676 height
, border
, format
, type
, pixels
));
4682 static void GLAPIENTRY
4683 save_TexImage3D(GLenum target
,
4684 GLint level
, GLint internalFormat
,
4685 GLsizei width
, GLsizei height
, GLsizei depth
,
4687 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4689 GET_CURRENT_CONTEXT(ctx
);
4690 if (target
== GL_PROXY_TEXTURE_3D
) {
4691 /* don't compile, execute immediately */
4692 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4693 height
, depth
, border
, format
, type
,
4698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4699 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4703 n
[3].i
= (GLint
) internalFormat
;
4704 n
[4].i
= (GLint
) width
;
4705 n
[5].i
= (GLint
) height
;
4706 n
[6].i
= (GLint
) depth
;
4710 save_pointer(&n
[10],
4711 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4712 pixels
, &ctx
->Unpack
));
4714 if (ctx
->ExecuteFlag
) {
4715 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4716 height
, depth
, border
, format
, type
,
4723 static void GLAPIENTRY
4724 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4725 GLsizei width
, GLenum format
, GLenum type
,
4726 const GLvoid
* pixels
)
4728 GET_CURRENT_CONTEXT(ctx
);
4731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4733 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4738 n
[4].i
= (GLint
) width
;
4742 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4743 pixels
, &ctx
->Unpack
));
4745 if (ctx
->ExecuteFlag
) {
4746 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4747 format
, type
, pixels
));
4752 static void GLAPIENTRY
4753 save_TexSubImage2D(GLenum target
, GLint level
,
4754 GLint xoffset
, GLint yoffset
,
4755 GLsizei width
, GLsizei height
,
4756 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4758 GET_CURRENT_CONTEXT(ctx
);
4761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4763 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4769 n
[5].i
= (GLint
) width
;
4770 n
[6].i
= (GLint
) height
;
4774 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4775 pixels
, &ctx
->Unpack
));
4777 if (ctx
->ExecuteFlag
) {
4778 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4779 width
, height
, format
, type
, pixels
));
4784 static void GLAPIENTRY
4785 save_TexSubImage3D(GLenum target
, GLint level
,
4786 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4787 GLsizei width
, GLsizei height
, GLsizei depth
,
4788 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4790 GET_CURRENT_CONTEXT(ctx
);
4793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4795 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4802 n
[6].i
= (GLint
) width
;
4803 n
[7].i
= (GLint
) height
;
4804 n
[8].i
= (GLint
) depth
;
4807 save_pointer(&n
[11],
4808 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4809 pixels
, &ctx
->Unpack
));
4811 if (ctx
->ExecuteFlag
) {
4812 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4813 xoffset
, yoffset
, zoffset
,
4814 width
, height
, depth
, format
, type
,
4820 static void GLAPIENTRY
4821 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4823 GET_CURRENT_CONTEXT(ctx
);
4825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4826 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4832 if (ctx
->ExecuteFlag
) {
4833 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4838 static void GLAPIENTRY
4839 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4841 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4846 static void GLAPIENTRY
4847 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4849 GET_CURRENT_CONTEXT(ctx
);
4851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4852 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4856 n
[3].i
= (GLint
) width
;
4857 n
[4].i
= (GLint
) height
;
4859 if (ctx
->ExecuteFlag
) {
4860 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4864 static void GLAPIENTRY
4865 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4868 GET_CURRENT_CONTEXT(ctx
);
4870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4871 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4879 if (ctx
->ExecuteFlag
) {
4880 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4884 static void GLAPIENTRY
4885 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4887 GET_CURRENT_CONTEXT(ctx
);
4889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4890 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4898 if (ctx
->ExecuteFlag
) {
4899 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4903 static void GLAPIENTRY
4904 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4906 GET_CURRENT_CONTEXT(ctx
);
4908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4909 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4913 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4915 if (ctx
->ExecuteFlag
) {
4916 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4920 static void GLAPIENTRY
4921 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4924 GET_CURRENT_CONTEXT(ctx
);
4926 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4927 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4935 if (ctx
->ExecuteFlag
) {
4936 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4940 static void GLAPIENTRY
4941 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4943 GET_CURRENT_CONTEXT(ctx
);
4945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4946 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4954 if (ctx
->ExecuteFlag
) {
4955 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4959 static void GLAPIENTRY
4960 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4962 GET_CURRENT_CONTEXT(ctx
);
4964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4965 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4969 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4971 if (ctx
->ExecuteFlag
) {
4972 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4976 static void GLAPIENTRY
4977 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4979 GET_CURRENT_CONTEXT(ctx
);
4981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4982 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4985 /* Mesa stores these as floats internally so we deliberately convert
4986 * them to a float here.
4991 if (ctx
->ExecuteFlag
) {
4992 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4996 static void GLAPIENTRY
4997 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4999 GET_CURRENT_CONTEXT(ctx
);
5001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5002 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
5006 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
5008 if (ctx
->ExecuteFlag
) {
5009 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
5013 static void GLAPIENTRY
5014 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5016 GET_CURRENT_CONTEXT(ctx
);
5018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5019 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
5026 if (ctx
->ExecuteFlag
) {
5027 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
5031 static void GLAPIENTRY
5032 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
5034 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5037 static void GLAPIENTRY
5038 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
5040 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5043 static void GLAPIENTRY
5044 save_WindowPos2iMESA(GLint x
, GLint y
)
5046 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5049 static void GLAPIENTRY
5050 save_WindowPos2sMESA(GLshort x
, GLshort y
)
5052 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5055 static void GLAPIENTRY
5056 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
5058 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5061 static void GLAPIENTRY
5062 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
5064 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5067 static void GLAPIENTRY
5068 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
5070 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5073 static void GLAPIENTRY
5074 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
5076 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5079 static void GLAPIENTRY
5080 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5082 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5085 static void GLAPIENTRY
5086 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
5088 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5091 static void GLAPIENTRY
5092 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
5094 save_WindowPos4fMESA(x
, y
, z
, w
);
5097 static void GLAPIENTRY
5098 save_WindowPos2dvMESA(const GLdouble
* v
)
5100 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5103 static void GLAPIENTRY
5104 save_WindowPos2fvMESA(const GLfloat
* v
)
5106 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5109 static void GLAPIENTRY
5110 save_WindowPos2ivMESA(const GLint
* v
)
5112 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5115 static void GLAPIENTRY
5116 save_WindowPos2svMESA(const GLshort
* v
)
5118 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5121 static void GLAPIENTRY
5122 save_WindowPos3dvMESA(const GLdouble
* v
)
5124 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5127 static void GLAPIENTRY
5128 save_WindowPos3fvMESA(const GLfloat
* v
)
5130 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5133 static void GLAPIENTRY
5134 save_WindowPos3ivMESA(const GLint
* v
)
5136 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5139 static void GLAPIENTRY
5140 save_WindowPos3svMESA(const GLshort
* v
)
5142 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5145 static void GLAPIENTRY
5146 save_WindowPos4dvMESA(const GLdouble
* v
)
5148 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5149 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5152 static void GLAPIENTRY
5153 save_WindowPos4fvMESA(const GLfloat
* v
)
5155 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5158 static void GLAPIENTRY
5159 save_WindowPos4ivMESA(const GLint
* v
)
5161 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5162 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5165 static void GLAPIENTRY
5166 save_WindowPos4svMESA(const GLshort
* v
)
5168 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5173 /* GL_ARB_multitexture */
5174 static void GLAPIENTRY
5175 save_ActiveTextureARB(GLenum target
)
5177 GET_CURRENT_CONTEXT(ctx
);
5179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5180 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5184 if (ctx
->ExecuteFlag
) {
5185 CALL_ActiveTexture(ctx
->Exec
, (target
));
5190 /* GL_ARB_transpose_matrix */
5192 static void GLAPIENTRY
5193 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5196 _math_transposefd(tm
, m
);
5197 save_LoadMatrixf(tm
);
5201 static void GLAPIENTRY
5202 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5205 _math_transposef(tm
, m
);
5206 save_LoadMatrixf(tm
);
5210 static void GLAPIENTRY
5211 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5214 _math_transposefd(tm
, m
);
5215 save_MultMatrixf(tm
);
5219 static void GLAPIENTRY
5220 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5223 _math_transposef(tm
, m
);
5224 save_MultMatrixf(tm
);
5227 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5229 GET_CURRENT_CONTEXT(ctx
);
5235 image
= malloc(size
);
5237 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5240 memcpy(image
, data
, size
);
5246 /* GL_ARB_texture_compression */
5247 static void GLAPIENTRY
5248 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5249 GLenum internalFormat
, GLsizei width
,
5250 GLint border
, GLsizei imageSize
,
5251 const GLvoid
* data
)
5253 GET_CURRENT_CONTEXT(ctx
);
5254 if (target
== GL_PROXY_TEXTURE_1D
) {
5255 /* don't compile, execute immediately */
5256 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5257 width
, border
, imageSize
,
5262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5264 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5265 6 + POINTER_DWORDS
);
5269 n
[3].e
= internalFormat
;
5270 n
[4].i
= (GLint
) width
;
5274 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5276 if (ctx
->ExecuteFlag
) {
5277 CALL_CompressedTexImage1D(ctx
->Exec
,
5278 (target
, level
, internalFormat
, width
,
5279 border
, imageSize
, data
));
5285 static void GLAPIENTRY
5286 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5287 GLenum internalFormat
, GLsizei width
,
5288 GLsizei height
, GLint border
, GLsizei imageSize
,
5289 const GLvoid
* data
)
5291 GET_CURRENT_CONTEXT(ctx
);
5292 if (target
== GL_PROXY_TEXTURE_2D
) {
5293 /* don't compile, execute immediately */
5294 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5295 width
, height
, border
,
5300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5302 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5303 7 + POINTER_DWORDS
);
5307 n
[3].e
= internalFormat
;
5308 n
[4].i
= (GLint
) width
;
5309 n
[5].i
= (GLint
) height
;
5313 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5315 if (ctx
->ExecuteFlag
) {
5316 CALL_CompressedTexImage2D(ctx
->Exec
,
5317 (target
, level
, internalFormat
, width
,
5318 height
, border
, imageSize
, data
));
5324 static void GLAPIENTRY
5325 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5326 GLenum internalFormat
, GLsizei width
,
5327 GLsizei height
, GLsizei depth
, GLint border
,
5328 GLsizei imageSize
, const GLvoid
* data
)
5330 GET_CURRENT_CONTEXT(ctx
);
5331 if (target
== GL_PROXY_TEXTURE_3D
) {
5332 /* don't compile, execute immediately */
5333 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5334 width
, height
, depth
, border
,
5339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5341 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5342 8 + POINTER_DWORDS
);
5346 n
[3].e
= internalFormat
;
5347 n
[4].i
= (GLint
) width
;
5348 n
[5].i
= (GLint
) height
;
5349 n
[6].i
= (GLint
) depth
;
5353 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5355 if (ctx
->ExecuteFlag
) {
5356 CALL_CompressedTexImage3D(ctx
->Exec
,
5357 (target
, level
, internalFormat
, width
,
5358 height
, depth
, border
, imageSize
,
5365 static void GLAPIENTRY
5366 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5367 GLsizei width
, GLenum format
,
5368 GLsizei imageSize
, const GLvoid
* data
)
5371 GET_CURRENT_CONTEXT(ctx
);
5372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5374 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5375 6 + POINTER_DWORDS
);
5380 n
[4].i
= (GLint
) width
;
5384 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5386 if (ctx
->ExecuteFlag
) {
5387 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5388 width
, format
, imageSize
,
5394 static void GLAPIENTRY
5395 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5396 GLint yoffset
, GLsizei width
, GLsizei height
,
5397 GLenum format
, GLsizei imageSize
,
5398 const GLvoid
* data
)
5401 GET_CURRENT_CONTEXT(ctx
);
5402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5404 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5405 8 + POINTER_DWORDS
);
5411 n
[5].i
= (GLint
) width
;
5412 n
[6].i
= (GLint
) height
;
5416 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5418 if (ctx
->ExecuteFlag
) {
5419 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5420 (target
, level
, xoffset
, yoffset
, width
,
5421 height
, format
, imageSize
, data
));
5426 static void GLAPIENTRY
5427 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5428 GLint yoffset
, GLint zoffset
, GLsizei width
,
5429 GLsizei height
, GLsizei depth
, GLenum format
,
5430 GLsizei imageSize
, const GLvoid
* data
)
5433 GET_CURRENT_CONTEXT(ctx
);
5434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5436 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5437 10 + POINTER_DWORDS
);
5444 n
[6].i
= (GLint
) width
;
5445 n
[7].i
= (GLint
) height
;
5446 n
[8].i
= (GLint
) depth
;
5448 n
[10].i
= imageSize
;
5449 save_pointer(&n
[11],
5450 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5452 if (ctx
->ExecuteFlag
) {
5453 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5454 (target
, level
, xoffset
, yoffset
,
5455 zoffset
, width
, height
, depth
, format
,
5461 /* GL_ARB_multisample */
5462 static void GLAPIENTRY
5463 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5465 GET_CURRENT_CONTEXT(ctx
);
5467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5468 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5473 if (ctx
->ExecuteFlag
) {
5474 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5480 * GL_ARB_vertex_program
5482 static void GLAPIENTRY
5483 save_BindProgramARB(GLenum target
, GLuint id
)
5485 GET_CURRENT_CONTEXT(ctx
);
5487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5488 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5493 if (ctx
->ExecuteFlag
) {
5494 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5498 static void GLAPIENTRY
5499 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5500 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5502 GET_CURRENT_CONTEXT(ctx
);
5504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5505 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5514 if (ctx
->ExecuteFlag
) {
5515 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5520 static void GLAPIENTRY
5521 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5522 const GLfloat
*params
)
5524 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5525 params
[2], params
[3]);
5529 static void GLAPIENTRY
5530 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5531 const GLfloat
* params
)
5533 GET_CURRENT_CONTEXT(ctx
);
5535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5539 const GLfloat
* p
= params
;
5541 for (i
= 0 ; i
< count
; i
++) {
5542 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5555 if (ctx
->ExecuteFlag
) {
5556 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5561 static void GLAPIENTRY
5562 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5563 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5565 save_ProgramEnvParameter4fARB(target
, index
,
5567 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5571 static void GLAPIENTRY
5572 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5573 const GLdouble
*params
)
5575 save_ProgramEnvParameter4fARB(target
, index
,
5576 (GLfloat
) params
[0],
5577 (GLfloat
) params
[1],
5578 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5582 static void GLAPIENTRY
5583 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5584 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5586 GET_CURRENT_CONTEXT(ctx
);
5588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5589 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5598 if (ctx
->ExecuteFlag
) {
5599 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5604 static void GLAPIENTRY
5605 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5606 const GLfloat
*params
)
5608 GET_CURRENT_CONTEXT(ctx
);
5610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5611 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5620 if (ctx
->ExecuteFlag
) {
5621 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5626 static void GLAPIENTRY
5627 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5628 const GLfloat
*params
)
5630 GET_CURRENT_CONTEXT(ctx
);
5632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5636 const GLfloat
* p
= params
;
5638 for (i
= 0 ; i
< count
; i
++) {
5639 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5652 if (ctx
->ExecuteFlag
) {
5653 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5658 static void GLAPIENTRY
5659 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5660 GLdouble x
, GLdouble y
,
5661 GLdouble z
, GLdouble w
)
5663 GET_CURRENT_CONTEXT(ctx
);
5665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5666 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5670 n
[3].f
= (GLfloat
) x
;
5671 n
[4].f
= (GLfloat
) y
;
5672 n
[5].f
= (GLfloat
) z
;
5673 n
[6].f
= (GLfloat
) w
;
5675 if (ctx
->ExecuteFlag
) {
5676 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5681 static void GLAPIENTRY
5682 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5683 const GLdouble
*params
)
5685 GET_CURRENT_CONTEXT(ctx
);
5687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5688 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5692 n
[3].f
= (GLfloat
) params
[0];
5693 n
[4].f
= (GLfloat
) params
[1];
5694 n
[5].f
= (GLfloat
) params
[2];
5695 n
[6].f
= (GLfloat
) params
[3];
5697 if (ctx
->ExecuteFlag
) {
5698 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5703 /* GL_EXT_stencil_two_side */
5704 static void GLAPIENTRY
5705 save_ActiveStencilFaceEXT(GLenum face
)
5707 GET_CURRENT_CONTEXT(ctx
);
5709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5710 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5714 if (ctx
->ExecuteFlag
) {
5715 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5720 /* GL_EXT_depth_bounds_test */
5721 static void GLAPIENTRY
5722 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5724 GET_CURRENT_CONTEXT(ctx
);
5726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5727 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5729 n
[1].f
= (GLfloat
) zmin
;
5730 n
[2].f
= (GLfloat
) zmax
;
5732 if (ctx
->ExecuteFlag
) {
5733 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5739 static void GLAPIENTRY
5740 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5741 const GLvoid
* string
)
5743 GET_CURRENT_CONTEXT(ctx
);
5746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5748 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5750 GLubyte
*programCopy
= malloc(len
);
5752 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5755 memcpy(programCopy
, string
, len
);
5759 save_pointer(&n
[4], programCopy
);
5761 if (ctx
->ExecuteFlag
) {
5762 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5767 static void GLAPIENTRY
5768 save_BeginQueryARB(GLenum target
, GLuint id
)
5770 GET_CURRENT_CONTEXT(ctx
);
5772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5773 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5778 if (ctx
->ExecuteFlag
) {
5779 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5783 static void GLAPIENTRY
5784 save_EndQueryARB(GLenum target
)
5786 GET_CURRENT_CONTEXT(ctx
);
5788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5789 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5793 if (ctx
->ExecuteFlag
) {
5794 CALL_EndQuery(ctx
->Exec
, (target
));
5798 static void GLAPIENTRY
5799 save_QueryCounter(GLuint id
, GLenum target
)
5801 GET_CURRENT_CONTEXT(ctx
);
5803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5804 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5809 if (ctx
->ExecuteFlag
) {
5810 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5814 static void GLAPIENTRY
5815 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5817 GET_CURRENT_CONTEXT(ctx
);
5819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5820 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5826 if (ctx
->ExecuteFlag
) {
5827 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5831 static void GLAPIENTRY
5832 save_EndQueryIndexed(GLenum target
, GLuint index
)
5834 GET_CURRENT_CONTEXT(ctx
);
5836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5837 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5842 if (ctx
->ExecuteFlag
) {
5843 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5848 static void GLAPIENTRY
5849 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5851 GET_CURRENT_CONTEXT(ctx
);
5853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5854 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5858 if (count
> MAX_DRAW_BUFFERS
)
5859 count
= MAX_DRAW_BUFFERS
;
5860 for (i
= 0; i
< count
; i
++) {
5861 n
[2 + i
].e
= buffers
[i
];
5864 if (ctx
->ExecuteFlag
) {
5865 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5869 static void GLAPIENTRY
5870 save_BindFragmentShaderATI(GLuint id
)
5872 GET_CURRENT_CONTEXT(ctx
);
5875 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5879 if (ctx
->ExecuteFlag
) {
5880 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5884 static void GLAPIENTRY
5885 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5887 GET_CURRENT_CONTEXT(ctx
);
5890 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5898 if (ctx
->ExecuteFlag
) {
5899 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5903 static void GLAPIENTRY
5904 save_EvalCoord1f(GLfloat x
)
5906 GET_CURRENT_CONTEXT(ctx
);
5908 SAVE_FLUSH_VERTICES(ctx
);
5909 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5913 if (ctx
->ExecuteFlag
) {
5914 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5918 static void GLAPIENTRY
5919 save_EvalCoord1fv(const GLfloat
* v
)
5921 save_EvalCoord1f(v
[0]);
5924 static void GLAPIENTRY
5925 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5927 GET_CURRENT_CONTEXT(ctx
);
5929 SAVE_FLUSH_VERTICES(ctx
);
5930 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5935 if (ctx
->ExecuteFlag
) {
5936 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5940 static void GLAPIENTRY
5941 save_EvalCoord2fv(const GLfloat
* v
)
5943 save_EvalCoord2f(v
[0], v
[1]);
5947 static void GLAPIENTRY
5948 save_EvalPoint1(GLint x
)
5950 GET_CURRENT_CONTEXT(ctx
);
5952 SAVE_FLUSH_VERTICES(ctx
);
5953 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5957 if (ctx
->ExecuteFlag
) {
5958 CALL_EvalPoint1(ctx
->Exec
, (x
));
5962 static void GLAPIENTRY
5963 save_EvalPoint2(GLint x
, GLint y
)
5965 GET_CURRENT_CONTEXT(ctx
);
5967 SAVE_FLUSH_VERTICES(ctx
);
5968 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5973 if (ctx
->ExecuteFlag
) {
5974 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5980 * Compare 'count' elements of vectors 'a' and 'b'.
5981 * \return GL_TRUE if equal, GL_FALSE if different.
5983 static inline GLboolean
5984 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5986 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5991 * This glMaterial function is used for glMaterial calls that are outside
5992 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5994 static void GLAPIENTRY
5995 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5997 GET_CURRENT_CONTEXT(ctx
);
6005 case GL_FRONT_AND_BACK
:
6008 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6017 case GL_AMBIENT_AND_DIFFUSE
:
6023 case GL_COLOR_INDEXES
:
6027 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6031 if (ctx
->ExecuteFlag
) {
6032 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6035 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6037 /* Try to eliminate redundant statechanges. Because it is legal to
6038 * call glMaterial even inside begin/end calls, don't need to worry
6039 * about ctx->Driver.CurrentSavePrimitive here.
6041 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6042 if (bitmask
& (1 << i
)) {
6043 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6044 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6045 /* no change in material value */
6046 bitmask
&= ~(1 << i
);
6049 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6050 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6055 /* If this call has no effect, return early */
6059 SAVE_FLUSH_VERTICES(ctx
);
6061 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6065 for (i
= 0; i
< args
; i
++)
6066 n
[3 + i
].f
= param
[i
];
6070 static void GLAPIENTRY
6071 save_Begin(GLenum mode
)
6073 GET_CURRENT_CONTEXT(ctx
);
6075 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6076 /* compile this error into the display list */
6077 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6079 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6080 /* compile this error into the display list */
6081 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6084 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6086 vbo_save_NotifyBegin(ctx
, mode
, false);
6090 static void GLAPIENTRY
6093 GET_CURRENT_CONTEXT(ctx
);
6094 SAVE_FLUSH_VERTICES(ctx
);
6095 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6096 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6097 if (ctx
->ExecuteFlag
) {
6098 CALL_End(ctx
->Exec
, ());
6102 static void GLAPIENTRY
6103 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6105 GET_CURRENT_CONTEXT(ctx
);
6107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6108 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6115 if (ctx
->ExecuteFlag
) {
6116 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6120 static void GLAPIENTRY
6121 save_PrimitiveRestartNV(void)
6123 /* Note: this is used when outside a glBegin/End pair in a display list */
6124 GET_CURRENT_CONTEXT(ctx
);
6125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6126 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6127 if (ctx
->ExecuteFlag
) {
6128 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6133 static void GLAPIENTRY
6134 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6135 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6136 GLbitfield mask
, GLenum filter
)
6138 GET_CURRENT_CONTEXT(ctx
);
6140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6141 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6154 if (ctx
->ExecuteFlag
) {
6155 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6156 dstX0
, dstY0
, dstX1
, dstY1
,
6162 /** GL_EXT_provoking_vertex */
6163 static void GLAPIENTRY
6164 save_ProvokingVertexEXT(GLenum mode
)
6166 GET_CURRENT_CONTEXT(ctx
);
6168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6169 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6173 if (ctx
->ExecuteFlag
) {
6174 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6175 _mesa_ProvokingVertex(mode
);
6180 /** GL_EXT_transform_feedback */
6181 static void GLAPIENTRY
6182 save_BeginTransformFeedback(GLenum mode
)
6184 GET_CURRENT_CONTEXT(ctx
);
6186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6187 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6191 if (ctx
->ExecuteFlag
) {
6192 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6197 /** GL_EXT_transform_feedback */
6198 static void GLAPIENTRY
6199 save_EndTransformFeedback(void)
6201 GET_CURRENT_CONTEXT(ctx
);
6202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6203 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6204 if (ctx
->ExecuteFlag
) {
6205 CALL_EndTransformFeedback(ctx
->Exec
, ());
6209 static void GLAPIENTRY
6210 save_BindTransformFeedback(GLenum target
, GLuint name
)
6212 GET_CURRENT_CONTEXT(ctx
);
6214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6215 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6220 if (ctx
->ExecuteFlag
) {
6221 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6225 static void GLAPIENTRY
6226 save_PauseTransformFeedback(void)
6228 GET_CURRENT_CONTEXT(ctx
);
6229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6230 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6231 if (ctx
->ExecuteFlag
) {
6232 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6236 static void GLAPIENTRY
6237 save_ResumeTransformFeedback(void)
6239 GET_CURRENT_CONTEXT(ctx
);
6240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6241 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6242 if (ctx
->ExecuteFlag
) {
6243 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6247 static void GLAPIENTRY
6248 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6250 GET_CURRENT_CONTEXT(ctx
);
6252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6253 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6258 if (ctx
->ExecuteFlag
) {
6259 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6263 static void GLAPIENTRY
6264 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6266 GET_CURRENT_CONTEXT(ctx
);
6268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6269 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6275 if (ctx
->ExecuteFlag
) {
6276 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6280 static void GLAPIENTRY
6281 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6284 GET_CURRENT_CONTEXT(ctx
);
6286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6287 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6291 n
[3].si
= primcount
;
6293 if (ctx
->ExecuteFlag
) {
6294 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6298 static void GLAPIENTRY
6299 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6300 GLuint stream
, GLsizei primcount
)
6302 GET_CURRENT_CONTEXT(ctx
);
6304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6305 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6310 n
[4].si
= primcount
;
6312 if (ctx
->ExecuteFlag
) {
6313 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6318 static void GLAPIENTRY
6319 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6320 GLuint num_groups_z
)
6322 GET_CURRENT_CONTEXT(ctx
);
6324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6325 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6327 n
[1].ui
= num_groups_x
;
6328 n
[2].ui
= num_groups_y
;
6329 n
[3].ui
= num_groups_z
;
6331 if (ctx
->ExecuteFlag
) {
6332 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6337 static void GLAPIENTRY
6338 save_DispatchComputeIndirect(GLintptr indirect
)
6340 GET_CURRENT_CONTEXT(ctx
);
6341 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6342 "glDispatchComputeIndirect() during display list compile");
6345 static void ALWAYS_INLINE
6346 save_Attr32bit(struct gl_context
*ctx
, unsigned attr
, unsigned size
,
6347 GLenum type
, uint32_t x
, uint32_t y
, uint32_t z
, uint32_t w
)
6350 SAVE_FLUSH_VERTICES(ctx
);
6352 unsigned index
= attr
;
6354 /* We don't care about GL_INT vs GL_UNSIGNED_INT. The idea is to get W=1
6355 * right for 3 or lower number of components, so only distinguish between
6358 if (type
== GL_FLOAT
) {
6359 if (attr
>= VERT_ATTRIB_GENERIC0
) {
6360 base_op
= OPCODE_ATTR_1F_ARB
;
6361 attr
-= VERT_ATTRIB_GENERIC0
;
6363 base_op
= OPCODE_ATTR_1F_NV
;
6366 base_op
= OPCODE_ATTR_1I
;
6367 attr
-= VERT_ATTRIB_GENERIC0
;
6370 n
= alloc_instruction(ctx
, base_op
+ size
- 1, 1 + size
);
6374 if (size
>= 2) n
[3].ui
= y
;
6375 if (size
>= 3) n
[4].ui
= z
;
6376 if (size
>= 4) n
[5].ui
= w
;
6379 ctx
->ListState
.ActiveAttribSize
[index
] = size
;
6380 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[index
], x
, y
, z
, w
);
6382 if (ctx
->ExecuteFlag
) {
6383 if (type
== GL_FLOAT
) {
6384 if (base_op
== OPCODE_ATTR_1F_NV
) {
6386 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
), uif(w
)));
6388 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
)));
6390 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
)));
6392 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, uif(x
)));
6395 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
), uif(w
)));
6397 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
)));
6399 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
)));
6401 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, uif(x
)));
6405 CALL_VertexAttribI4iEXT(ctx
->Exec
, (attr
, x
, y
, z
, w
));
6407 CALL_VertexAttribI3iEXT(ctx
->Exec
, (attr
, x
, y
, z
));
6409 CALL_VertexAttribI2iEXT(ctx
->Exec
, (attr
, x
, y
));
6411 CALL_VertexAttribI1iEXT(ctx
->Exec
, (attr
, x
));
6416 static void ALWAYS_INLINE
6417 save_Attr64bit(struct gl_context
*ctx
, unsigned attr
, unsigned size
,
6418 GLenum type
, uint64_t x
, uint64_t y
, uint64_t z
, uint64_t w
)
6421 SAVE_FLUSH_VERTICES(ctx
);
6423 unsigned index
= attr
;
6425 if (type
== GL_DOUBLE
) {
6426 base_op
= OPCODE_ATTR_1D
;
6428 base_op
= OPCODE_ATTR_1UI64
;
6432 attr
-= VERT_ATTRIB_GENERIC0
;
6433 n
= alloc_instruction(ctx
, base_op
+ size
- 1, 1 + size
* 2);
6436 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
6437 if (size
>= 2) ASSIGN_UINT64_TO_NODES(n
, 4, y
);
6438 if (size
>= 3) ASSIGN_UINT64_TO_NODES(n
, 6, z
);
6439 if (size
>= 4) ASSIGN_UINT64_TO_NODES(n
, 8, w
);
6442 ctx
->ListState
.ActiveAttribSize
[index
] = size
;
6443 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], size
* sizeof(uint64_t));
6445 if (ctx
->ExecuteFlag
) {
6446 uint64_t v
[] = {x
, y
, z
, w
};
6447 if (type
== GL_DOUBLE
) {
6449 CALL_VertexAttribL4dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6451 CALL_VertexAttribL3dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6453 CALL_VertexAttribL2dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6455 CALL_VertexAttribL1d(ctx
->Exec
, (attr
, UINT64_AS_DOUBLE(x
)));
6457 CALL_VertexAttribL1ui64ARB(ctx
->Exec
, (attr
, x
));
6463 * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
6464 * It depends on a few things, including whether we're inside or outside
6468 is_vertex_position(const struct gl_context
*ctx
, GLuint index
)
6470 return (index
== 0 &&
6471 _mesa_attr_zero_aliases_vertex(ctx
) &&
6472 _mesa_inside_dlist_begin_end(ctx
));
6476 * This macro is used to implement all the glVertex, glColor, glTexCoord,
6477 * glVertexAttrib, etc functions.
6478 * \param A VBO_ATTRIB_x attribute index
6479 * \param N attribute size (1..4)
6480 * \param T type (GL_FLOAT, GL_DOUBLE, GL_INT, GL_UNSIGNED_INT)
6481 * \param C cast type (uint32_t or uint64_t)
6482 * \param V0, V1, v2, V3 attribute value
6484 #define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) \
6486 if (sizeof(C) == 4) { \
6487 save_Attr32bit(ctx, A, N, T, V0, V1, V2, V3); \
6489 save_Attr64bit(ctx, A, N, T, V0, V1, V2, V3); \
6494 #define ERROR(err) _mesa_error(ctx, err, __func__)
6495 #define TAG(x) save_##x
6497 #define VBO_ATTRIB_POS VERT_ATTRIB_POS
6498 #define VBO_ATTRIB_NORMAL VERT_ATTRIB_NORMAL
6499 #define VBO_ATTRIB_COLOR0 VERT_ATTRIB_COLOR0
6500 #define VBO_ATTRIB_COLOR1 VERT_ATTRIB_COLOR1
6501 #define VBO_ATTRIB_FOG VERT_ATTRIB_FOG
6502 #define VBO_ATTRIB_COLOR_INDEX VERT_ATTRIB_COLOR_INDEX
6503 #define VBO_ATTRIB_EDGEFLAG VERT_ATTRIB_EDGEFLAG
6504 #define VBO_ATTRIB_TEX0 VERT_ATTRIB_TEX0
6505 #define VBO_ATTRIB_GENERIC0 VERT_ATTRIB_GENERIC0
6506 #define VBO_ATTRIB_MAX VERT_ATTRIB_MAX
6508 #include "vbo/vbo_attrib_tmp.h"
6510 static void GLAPIENTRY
6511 save_UseProgram(GLuint program
)
6513 GET_CURRENT_CONTEXT(ctx
);
6515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6516 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6520 if (ctx
->ExecuteFlag
) {
6521 CALL_UseProgram(ctx
->Exec
, (program
));
6526 static void GLAPIENTRY
6527 save_Uniform1fARB(GLint location
, GLfloat x
)
6529 GET_CURRENT_CONTEXT(ctx
);
6531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6532 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6537 if (ctx
->ExecuteFlag
) {
6538 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6543 static void GLAPIENTRY
6544 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6546 GET_CURRENT_CONTEXT(ctx
);
6548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6549 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6555 if (ctx
->ExecuteFlag
) {
6556 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6561 static void GLAPIENTRY
6562 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6564 GET_CURRENT_CONTEXT(ctx
);
6566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6567 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6574 if (ctx
->ExecuteFlag
) {
6575 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6580 static void GLAPIENTRY
6581 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6583 GET_CURRENT_CONTEXT(ctx
);
6585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6586 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6594 if (ctx
->ExecuteFlag
) {
6595 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6600 static void GLAPIENTRY
6601 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6603 GET_CURRENT_CONTEXT(ctx
);
6605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6606 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6610 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6612 if (ctx
->ExecuteFlag
) {
6613 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6617 static void GLAPIENTRY
6618 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6620 GET_CURRENT_CONTEXT(ctx
);
6622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6623 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6627 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6629 if (ctx
->ExecuteFlag
) {
6630 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6634 static void GLAPIENTRY
6635 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6637 GET_CURRENT_CONTEXT(ctx
);
6639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6640 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6644 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6646 if (ctx
->ExecuteFlag
) {
6647 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6651 static void GLAPIENTRY
6652 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6654 GET_CURRENT_CONTEXT(ctx
);
6656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6657 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6661 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6663 if (ctx
->ExecuteFlag
) {
6664 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6669 static void GLAPIENTRY
6670 save_Uniform1d(GLint location
, GLdouble x
)
6672 GET_CURRENT_CONTEXT(ctx
);
6674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6675 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
6678 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6680 if (ctx
->ExecuteFlag
) {
6681 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
6686 static void GLAPIENTRY
6687 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
6689 GET_CURRENT_CONTEXT(ctx
);
6691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6692 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
6695 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6696 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6698 if (ctx
->ExecuteFlag
) {
6699 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
6704 static void GLAPIENTRY
6705 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
6707 GET_CURRENT_CONTEXT(ctx
);
6709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6710 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
6713 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6714 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6715 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6717 if (ctx
->ExecuteFlag
) {
6718 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
6723 static void GLAPIENTRY
6724 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
6726 GET_CURRENT_CONTEXT(ctx
);
6728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6729 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
6732 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6733 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6734 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6735 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6737 if (ctx
->ExecuteFlag
) {
6738 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
6743 static void GLAPIENTRY
6744 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6746 GET_CURRENT_CONTEXT(ctx
);
6748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6749 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
6753 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
6755 if (ctx
->ExecuteFlag
) {
6756 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
6761 static void GLAPIENTRY
6762 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6764 GET_CURRENT_CONTEXT(ctx
);
6766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6767 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
6771 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
6773 if (ctx
->ExecuteFlag
) {
6774 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
6779 static void GLAPIENTRY
6780 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6782 GET_CURRENT_CONTEXT(ctx
);
6784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6785 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
6789 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
6791 if (ctx
->ExecuteFlag
) {
6792 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
6797 static void GLAPIENTRY
6798 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6800 GET_CURRENT_CONTEXT(ctx
);
6802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6803 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
6807 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
6809 if (ctx
->ExecuteFlag
) {
6810 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
6815 static void GLAPIENTRY
6816 save_Uniform1iARB(GLint location
, GLint x
)
6818 GET_CURRENT_CONTEXT(ctx
);
6820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6821 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6826 if (ctx
->ExecuteFlag
) {
6827 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
6831 static void GLAPIENTRY
6832 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6834 GET_CURRENT_CONTEXT(ctx
);
6836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6837 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6843 if (ctx
->ExecuteFlag
) {
6844 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
6848 static void GLAPIENTRY
6849 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6851 GET_CURRENT_CONTEXT(ctx
);
6853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6854 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6861 if (ctx
->ExecuteFlag
) {
6862 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
6866 static void GLAPIENTRY
6867 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6869 GET_CURRENT_CONTEXT(ctx
);
6871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6872 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6880 if (ctx
->ExecuteFlag
) {
6881 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
6887 static void GLAPIENTRY
6888 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6890 GET_CURRENT_CONTEXT(ctx
);
6892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6893 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
6897 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
6899 if (ctx
->ExecuteFlag
) {
6900 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
6904 static void GLAPIENTRY
6905 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6907 GET_CURRENT_CONTEXT(ctx
);
6909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6910 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
6914 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
6916 if (ctx
->ExecuteFlag
) {
6917 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
6921 static void GLAPIENTRY
6922 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6924 GET_CURRENT_CONTEXT(ctx
);
6926 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6927 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
6931 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
6933 if (ctx
->ExecuteFlag
) {
6934 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
6938 static void GLAPIENTRY
6939 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6941 GET_CURRENT_CONTEXT(ctx
);
6943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6944 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
6948 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6950 if (ctx
->ExecuteFlag
) {
6951 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
6957 static void GLAPIENTRY
6958 save_Uniform1ui(GLint location
, GLuint x
)
6960 GET_CURRENT_CONTEXT(ctx
);
6962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6963 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6968 if (ctx
->ExecuteFlag
) {
6969 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
6973 static void GLAPIENTRY
6974 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6976 GET_CURRENT_CONTEXT(ctx
);
6978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6979 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6985 if (ctx
->ExecuteFlag
) {
6986 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
6990 static void GLAPIENTRY
6991 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6993 GET_CURRENT_CONTEXT(ctx
);
6995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6996 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7003 if (ctx
->ExecuteFlag
) {
7004 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7008 static void GLAPIENTRY
7009 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7011 GET_CURRENT_CONTEXT(ctx
);
7013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7014 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7022 if (ctx
->ExecuteFlag
) {
7023 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7029 static void GLAPIENTRY
7030 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7032 GET_CURRENT_CONTEXT(ctx
);
7034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7035 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7039 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7041 if (ctx
->ExecuteFlag
) {
7042 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7046 static void GLAPIENTRY
7047 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7049 GET_CURRENT_CONTEXT(ctx
);
7051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7052 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7056 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7058 if (ctx
->ExecuteFlag
) {
7059 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7063 static void GLAPIENTRY
7064 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7066 GET_CURRENT_CONTEXT(ctx
);
7068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7069 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7073 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7075 if (ctx
->ExecuteFlag
) {
7076 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7080 static void GLAPIENTRY
7081 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7083 GET_CURRENT_CONTEXT(ctx
);
7085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7086 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7090 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7092 if (ctx
->ExecuteFlag
) {
7093 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7099 static void GLAPIENTRY
7100 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7103 GET_CURRENT_CONTEXT(ctx
);
7105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7106 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7111 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7113 if (ctx
->ExecuteFlag
) {
7114 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7118 static void GLAPIENTRY
7119 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7122 GET_CURRENT_CONTEXT(ctx
);
7124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7125 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7130 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7132 if (ctx
->ExecuteFlag
) {
7133 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7137 static void GLAPIENTRY
7138 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7141 GET_CURRENT_CONTEXT(ctx
);
7143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7144 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7149 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7151 if (ctx
->ExecuteFlag
) {
7152 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7157 static void GLAPIENTRY
7158 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7161 GET_CURRENT_CONTEXT(ctx
);
7163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7164 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7169 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7171 if (ctx
->ExecuteFlag
) {
7172 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7176 static void GLAPIENTRY
7177 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7180 GET_CURRENT_CONTEXT(ctx
);
7182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7183 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7188 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7190 if (ctx
->ExecuteFlag
) {
7191 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7196 static void GLAPIENTRY
7197 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7200 GET_CURRENT_CONTEXT(ctx
);
7202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7203 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7208 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7210 if (ctx
->ExecuteFlag
) {
7211 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7215 static void GLAPIENTRY
7216 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7219 GET_CURRENT_CONTEXT(ctx
);
7221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7222 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7227 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7229 if (ctx
->ExecuteFlag
) {
7230 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7235 static void GLAPIENTRY
7236 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7239 GET_CURRENT_CONTEXT(ctx
);
7241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7242 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7247 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7249 if (ctx
->ExecuteFlag
) {
7250 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7254 static void GLAPIENTRY
7255 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7258 GET_CURRENT_CONTEXT(ctx
);
7260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7261 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7266 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7268 if (ctx
->ExecuteFlag
) {
7269 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7274 static void GLAPIENTRY
7275 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7278 GET_CURRENT_CONTEXT(ctx
);
7280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7281 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7286 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7288 if (ctx
->ExecuteFlag
) {
7289 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7293 static void GLAPIENTRY
7294 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7297 GET_CURRENT_CONTEXT(ctx
);
7299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7300 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7305 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7307 if (ctx
->ExecuteFlag
) {
7308 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7312 static void GLAPIENTRY
7313 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7316 GET_CURRENT_CONTEXT(ctx
);
7318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7319 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7324 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7326 if (ctx
->ExecuteFlag
) {
7327 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7332 static void GLAPIENTRY
7333 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7336 GET_CURRENT_CONTEXT(ctx
);
7338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7339 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7344 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7346 if (ctx
->ExecuteFlag
) {
7347 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7352 static void GLAPIENTRY
7353 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7356 GET_CURRENT_CONTEXT(ctx
);
7358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7359 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7364 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7366 if (ctx
->ExecuteFlag
) {
7367 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7372 static void GLAPIENTRY
7373 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7376 GET_CURRENT_CONTEXT(ctx
);
7378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7379 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7384 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7386 if (ctx
->ExecuteFlag
) {
7387 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7391 static void GLAPIENTRY
7392 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7395 GET_CURRENT_CONTEXT(ctx
);
7397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7398 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7403 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7405 if (ctx
->ExecuteFlag
) {
7406 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7411 static void GLAPIENTRY
7412 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7415 GET_CURRENT_CONTEXT(ctx
);
7417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7418 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7423 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7425 if (ctx
->ExecuteFlag
) {
7426 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7431 static void GLAPIENTRY
7432 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7435 GET_CURRENT_CONTEXT(ctx
);
7437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7438 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7443 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7445 if (ctx
->ExecuteFlag
) {
7446 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7450 static void GLAPIENTRY
7451 save_Uniform1i64ARB(GLint location
, GLint64 x
)
7453 GET_CURRENT_CONTEXT(ctx
);
7455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7456 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64
, 3);
7459 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7461 if (ctx
->ExecuteFlag
) {
7462 CALL_Uniform1i64ARB(ctx
->Exec
, (location
, x
));
7466 static void GLAPIENTRY
7467 save_Uniform2i64ARB(GLint location
, GLint64 x
, GLint64 y
)
7469 GET_CURRENT_CONTEXT(ctx
);
7471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7472 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64
, 5);
7475 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7476 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7478 if (ctx
->ExecuteFlag
) {
7479 CALL_Uniform2i64ARB(ctx
->Exec
, (location
, x
, y
));
7483 static void GLAPIENTRY
7484 save_Uniform3i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
)
7486 GET_CURRENT_CONTEXT(ctx
);
7488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7489 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64
, 7);
7492 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7493 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7494 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7496 if (ctx
->ExecuteFlag
) {
7497 CALL_Uniform3i64ARB(ctx
->Exec
, (location
, x
, y
, z
));
7501 static void GLAPIENTRY
7502 save_Uniform4i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
, GLint64 w
)
7504 GET_CURRENT_CONTEXT(ctx
);
7506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7507 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64
, 9);
7510 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7511 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7512 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7513 ASSIGN_INT64_TO_NODES(n
, 8, w
);
7515 if (ctx
->ExecuteFlag
) {
7516 CALL_Uniform4i64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
7520 static void GLAPIENTRY
7521 save_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7523 GET_CURRENT_CONTEXT(ctx
);
7525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64V
, 2 + POINTER_DWORDS
);
7530 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint64
)));
7532 if (ctx
->ExecuteFlag
) {
7533 CALL_Uniform1i64vARB(ctx
->Exec
, (location
, count
, v
));
7537 static void GLAPIENTRY
7538 save_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7540 GET_CURRENT_CONTEXT(ctx
);
7542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7543 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64V
, 2 + POINTER_DWORDS
);
7547 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint64
)));
7549 if (ctx
->ExecuteFlag
) {
7550 CALL_Uniform2i64vARB(ctx
->Exec
, (location
, count
, v
));
7554 static void GLAPIENTRY
7555 save_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7557 GET_CURRENT_CONTEXT(ctx
);
7559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7560 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64V
, 2 + POINTER_DWORDS
);
7564 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint64
)));
7566 if (ctx
->ExecuteFlag
) {
7567 CALL_Uniform3i64vARB(ctx
->Exec
, (location
, count
, v
));
7571 static void GLAPIENTRY
7572 save_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7574 GET_CURRENT_CONTEXT(ctx
);
7576 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7577 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64V
, 2 + POINTER_DWORDS
);
7581 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint64
)));
7583 if (ctx
->ExecuteFlag
) {
7584 CALL_Uniform4i64vARB(ctx
->Exec
, (location
, count
, v
));
7588 static void GLAPIENTRY
7589 save_Uniform1ui64ARB(GLint location
, GLuint64 x
)
7591 GET_CURRENT_CONTEXT(ctx
);
7593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7594 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64
, 3);
7597 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7599 if (ctx
->ExecuteFlag
) {
7600 CALL_Uniform1ui64ARB(ctx
->Exec
, (location
, x
));
7604 static void GLAPIENTRY
7605 save_Uniform2ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
)
7607 GET_CURRENT_CONTEXT(ctx
);
7609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7610 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64
, 5);
7613 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7614 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7616 if (ctx
->ExecuteFlag
) {
7617 CALL_Uniform2ui64ARB(ctx
->Exec
, (location
, x
, y
));
7621 static void GLAPIENTRY
7622 save_Uniform3ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
)
7624 GET_CURRENT_CONTEXT(ctx
);
7626 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7627 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64
, 7);
7630 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7631 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7632 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
7634 if (ctx
->ExecuteFlag
) {
7635 CALL_Uniform3ui64ARB(ctx
->Exec
, (location
, x
, y
, z
));
7639 static void GLAPIENTRY
7640 save_Uniform4ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
, GLuint64 w
)
7642 GET_CURRENT_CONTEXT(ctx
);
7644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7645 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64
, 9);
7648 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7649 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7650 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
7651 ASSIGN_UINT64_TO_NODES(n
, 8, w
);
7653 if (ctx
->ExecuteFlag
) {
7654 CALL_Uniform4ui64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
7658 static void GLAPIENTRY
7659 save_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7661 GET_CURRENT_CONTEXT(ctx
);
7663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7664 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64V
, 2 + POINTER_DWORDS
);
7668 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7670 if (ctx
->ExecuteFlag
) {
7671 CALL_Uniform1ui64vARB(ctx
->Exec
, (location
, count
, v
));
7675 static void GLAPIENTRY
7676 save_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7678 GET_CURRENT_CONTEXT(ctx
);
7680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7681 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64V
, 2 + POINTER_DWORDS
);
7685 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLuint64
)));
7687 if (ctx
->ExecuteFlag
) {
7688 CALL_Uniform2ui64vARB(ctx
->Exec
, (location
, count
, v
));
7692 static void GLAPIENTRY
7693 save_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7695 GET_CURRENT_CONTEXT(ctx
);
7697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7698 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64V
, 2 + POINTER_DWORDS
);
7702 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLuint64
)));
7704 if (ctx
->ExecuteFlag
) {
7705 CALL_Uniform3ui64vARB(ctx
->Exec
, (location
, count
, v
));
7709 static void GLAPIENTRY
7710 save_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7712 GET_CURRENT_CONTEXT(ctx
);
7714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7715 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64V
, 2 + POINTER_DWORDS
);
7719 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLuint64
)));
7721 if (ctx
->ExecuteFlag
) {
7722 CALL_Uniform4ui64vARB(ctx
->Exec
, (location
, count
, v
));
7726 static void GLAPIENTRY
7727 save_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 x
)
7729 GET_CURRENT_CONTEXT(ctx
);
7731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7732 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64
, 4);
7736 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7738 if (ctx
->ExecuteFlag
) {
7739 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (program
, location
, x
));
7743 static void GLAPIENTRY
7744 save_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 x
,
7747 GET_CURRENT_CONTEXT(ctx
);
7749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7750 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64
, 6);
7754 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7755 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7757 if (ctx
->ExecuteFlag
) {
7758 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (program
, location
, x
, y
));
7762 static void GLAPIENTRY
7763 save_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 x
,
7764 GLint64 y
, GLint64 z
)
7766 GET_CURRENT_CONTEXT(ctx
);
7768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7769 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64
, 8);
7773 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7774 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7775 ASSIGN_INT64_TO_NODES(n
, 7, z
);
7777 if (ctx
->ExecuteFlag
) {
7778 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
7782 static void GLAPIENTRY
7783 save_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 x
,
7784 GLint64 y
, GLint64 z
, GLint64 w
)
7786 GET_CURRENT_CONTEXT(ctx
);
7788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7789 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64
, 10);
7793 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7794 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7795 ASSIGN_INT64_TO_NODES(n
, 7, z
);
7796 ASSIGN_INT64_TO_NODES(n
, 9, w
);
7798 if (ctx
->ExecuteFlag
) {
7799 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7803 static void GLAPIENTRY
7804 save_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
,
7807 GET_CURRENT_CONTEXT(ctx
);
7809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7810 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64V
, 3 + POINTER_DWORDS
);
7815 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7817 if (ctx
->ExecuteFlag
) {
7818 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7822 static void GLAPIENTRY
7823 save_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
,
7826 GET_CURRENT_CONTEXT(ctx
);
7828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7829 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64V
, 3 + POINTER_DWORDS
);
7834 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7836 if (ctx
->ExecuteFlag
) {
7837 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7841 static void GLAPIENTRY
7842 save_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
,
7845 GET_CURRENT_CONTEXT(ctx
);
7847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7848 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64V
, 3 + POINTER_DWORDS
);
7853 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7855 if (ctx
->ExecuteFlag
) {
7856 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7860 static void GLAPIENTRY
7861 save_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
,
7864 GET_CURRENT_CONTEXT(ctx
);
7866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7867 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64V
, 3 + POINTER_DWORDS
);
7872 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7874 if (ctx
->ExecuteFlag
) {
7875 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7879 static void GLAPIENTRY
7880 save_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 x
)
7882 GET_CURRENT_CONTEXT(ctx
);
7884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7885 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64
, 4);
7889 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7891 if (ctx
->ExecuteFlag
) {
7892 CALL_ProgramUniform1ui64ARB(ctx
->Exec
, (program
, location
, x
));
7896 static void GLAPIENTRY
7897 save_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7900 GET_CURRENT_CONTEXT(ctx
);
7902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7903 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64
, 6);
7907 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7908 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7910 if (ctx
->ExecuteFlag
) {
7911 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (program
, location
, x
, y
));
7915 static void GLAPIENTRY
7916 save_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7917 GLuint64 y
, GLuint64 z
)
7919 GET_CURRENT_CONTEXT(ctx
);
7921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7922 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64
, 8);
7926 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7927 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7928 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
7930 if (ctx
->ExecuteFlag
) {
7931 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
7935 static void GLAPIENTRY
7936 save_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7937 GLuint64 y
, GLuint64 z
, GLuint64 w
)
7939 GET_CURRENT_CONTEXT(ctx
);
7941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7942 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64
, 10);
7946 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7947 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7948 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
7949 ASSIGN_UINT64_TO_NODES(n
, 9, w
);
7951 if (ctx
->ExecuteFlag
) {
7952 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7956 static void GLAPIENTRY
7957 save_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
,
7960 GET_CURRENT_CONTEXT(ctx
);
7962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7963 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64V
,
7964 3 + POINTER_DWORDS
);
7969 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7971 if (ctx
->ExecuteFlag
) {
7972 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7976 static void GLAPIENTRY
7977 save_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
,
7980 GET_CURRENT_CONTEXT(ctx
);
7982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7983 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64V
,
7984 3 + POINTER_DWORDS
);
7989 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7991 if (ctx
->ExecuteFlag
) {
7992 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7996 static void GLAPIENTRY
7997 save_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8000 GET_CURRENT_CONTEXT(ctx
);
8002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8003 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64V
,
8004 3 + POINTER_DWORDS
);
8009 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8011 if (ctx
->ExecuteFlag
) {
8012 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8016 static void GLAPIENTRY
8017 save_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8020 GET_CURRENT_CONTEXT(ctx
);
8022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8023 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64V
,
8024 3 + POINTER_DWORDS
);
8029 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8031 if (ctx
->ExecuteFlag
) {
8032 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8037 static void GLAPIENTRY
8038 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
8040 GET_CURRENT_CONTEXT(ctx
);
8042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8043 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
8049 if (ctx
->ExecuteFlag
) {
8050 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
8054 static void GLAPIENTRY
8055 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
8057 GET_CURRENT_CONTEXT(ctx
);
8059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8060 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
8066 if (ctx
->ExecuteFlag
) {
8067 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
8071 static void GLAPIENTRY
8072 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
8074 GET_CURRENT_CONTEXT(ctx
);
8076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8077 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
8084 if (ctx
->ExecuteFlag
) {
8085 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
8089 static void GLAPIENTRY
8090 save_ProgramUniform3f(GLuint program
, GLint location
,
8091 GLfloat x
, GLfloat y
, GLfloat z
)
8093 GET_CURRENT_CONTEXT(ctx
);
8095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8096 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
8104 if (ctx
->ExecuteFlag
) {
8105 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
8109 static void GLAPIENTRY
8110 save_ProgramUniform4f(GLuint program
, GLint location
,
8111 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
8113 GET_CURRENT_CONTEXT(ctx
);
8115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8116 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
8125 if (ctx
->ExecuteFlag
) {
8126 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8130 static void GLAPIENTRY
8131 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
8134 GET_CURRENT_CONTEXT(ctx
);
8136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8137 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
8142 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
8144 if (ctx
->ExecuteFlag
) {
8145 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
8149 static void GLAPIENTRY
8150 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
8153 GET_CURRENT_CONTEXT(ctx
);
8155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8156 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
8161 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
8163 if (ctx
->ExecuteFlag
) {
8164 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
8168 static void GLAPIENTRY
8169 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
8172 GET_CURRENT_CONTEXT(ctx
);
8174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8175 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
8180 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
8182 if (ctx
->ExecuteFlag
) {
8183 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
8187 static void GLAPIENTRY
8188 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
8191 GET_CURRENT_CONTEXT(ctx
);
8193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8194 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
8199 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
8201 if (ctx
->ExecuteFlag
) {
8202 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
8206 static void GLAPIENTRY
8207 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
8209 GET_CURRENT_CONTEXT(ctx
);
8211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8212 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8216 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8218 if (ctx
->ExecuteFlag
) {
8219 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8223 static void GLAPIENTRY
8224 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8226 GET_CURRENT_CONTEXT(ctx
);
8228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8229 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8233 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8234 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8236 if (ctx
->ExecuteFlag
) {
8237 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8241 static void GLAPIENTRY
8242 save_ProgramUniform3d(GLuint program
, GLint location
,
8243 GLdouble x
, GLdouble y
, GLdouble z
)
8245 GET_CURRENT_CONTEXT(ctx
);
8247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8248 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8252 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8253 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8254 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8256 if (ctx
->ExecuteFlag
) {
8257 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8261 static void GLAPIENTRY
8262 save_ProgramUniform4d(GLuint program
, GLint location
,
8263 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8265 GET_CURRENT_CONTEXT(ctx
);
8267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8268 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8272 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8273 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8274 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8275 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8277 if (ctx
->ExecuteFlag
) {
8278 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8282 static void GLAPIENTRY
8283 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8286 GET_CURRENT_CONTEXT(ctx
);
8288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8289 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8294 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8296 if (ctx
->ExecuteFlag
) {
8297 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8301 static void GLAPIENTRY
8302 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8305 GET_CURRENT_CONTEXT(ctx
);
8307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8308 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8313 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8315 if (ctx
->ExecuteFlag
) {
8316 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8320 static void GLAPIENTRY
8321 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8324 GET_CURRENT_CONTEXT(ctx
);
8326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8327 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8332 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8334 if (ctx
->ExecuteFlag
) {
8335 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8339 static void GLAPIENTRY
8340 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8343 GET_CURRENT_CONTEXT(ctx
);
8345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8346 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8351 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8353 if (ctx
->ExecuteFlag
) {
8354 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8358 static void GLAPIENTRY
8359 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8361 GET_CURRENT_CONTEXT(ctx
);
8363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8364 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8370 if (ctx
->ExecuteFlag
) {
8371 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8375 static void GLAPIENTRY
8376 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8378 GET_CURRENT_CONTEXT(ctx
);
8380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8381 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8388 if (ctx
->ExecuteFlag
) {
8389 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8393 static void GLAPIENTRY
8394 save_ProgramUniform3i(GLuint program
, GLint location
,
8395 GLint x
, GLint y
, GLint z
)
8397 GET_CURRENT_CONTEXT(ctx
);
8399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8400 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8408 if (ctx
->ExecuteFlag
) {
8409 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8413 static void GLAPIENTRY
8414 save_ProgramUniform4i(GLuint program
, GLint location
,
8415 GLint x
, GLint y
, GLint z
, GLint w
)
8417 GET_CURRENT_CONTEXT(ctx
);
8419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8420 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8429 if (ctx
->ExecuteFlag
) {
8430 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8434 static void GLAPIENTRY
8435 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8438 GET_CURRENT_CONTEXT(ctx
);
8440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8441 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8446 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8448 if (ctx
->ExecuteFlag
) {
8449 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8453 static void GLAPIENTRY
8454 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8457 GET_CURRENT_CONTEXT(ctx
);
8459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8460 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8465 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8467 if (ctx
->ExecuteFlag
) {
8468 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8472 static void GLAPIENTRY
8473 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8476 GET_CURRENT_CONTEXT(ctx
);
8478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8479 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8484 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8486 if (ctx
->ExecuteFlag
) {
8487 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8491 static void GLAPIENTRY
8492 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8495 GET_CURRENT_CONTEXT(ctx
);
8497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8498 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8503 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8505 if (ctx
->ExecuteFlag
) {
8506 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8510 static void GLAPIENTRY
8511 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8513 GET_CURRENT_CONTEXT(ctx
);
8515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8516 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8522 if (ctx
->ExecuteFlag
) {
8523 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8527 static void GLAPIENTRY
8528 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8530 GET_CURRENT_CONTEXT(ctx
);
8532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8533 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8540 if (ctx
->ExecuteFlag
) {
8541 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8545 static void GLAPIENTRY
8546 save_ProgramUniform3ui(GLuint program
, GLint location
,
8547 GLuint x
, GLuint y
, GLuint z
)
8549 GET_CURRENT_CONTEXT(ctx
);
8551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8552 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8560 if (ctx
->ExecuteFlag
) {
8561 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8565 static void GLAPIENTRY
8566 save_ProgramUniform4ui(GLuint program
, GLint location
,
8567 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8569 GET_CURRENT_CONTEXT(ctx
);
8571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8572 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8581 if (ctx
->ExecuteFlag
) {
8582 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8586 static void GLAPIENTRY
8587 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8590 GET_CURRENT_CONTEXT(ctx
);
8592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8593 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8598 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8600 if (ctx
->ExecuteFlag
) {
8601 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8605 static void GLAPIENTRY
8606 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8609 GET_CURRENT_CONTEXT(ctx
);
8611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8612 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8617 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8619 if (ctx
->ExecuteFlag
) {
8620 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8624 static void GLAPIENTRY
8625 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8628 GET_CURRENT_CONTEXT(ctx
);
8630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8631 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8636 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8638 if (ctx
->ExecuteFlag
) {
8639 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8643 static void GLAPIENTRY
8644 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8647 GET_CURRENT_CONTEXT(ctx
);
8649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8650 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8655 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8657 if (ctx
->ExecuteFlag
) {
8658 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8662 static void GLAPIENTRY
8663 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8664 GLboolean transpose
, const GLfloat
*v
)
8666 GET_CURRENT_CONTEXT(ctx
);
8668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8669 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8670 4 + POINTER_DWORDS
);
8676 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8678 if (ctx
->ExecuteFlag
) {
8679 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8680 (program
, location
, count
, transpose
, v
));
8684 static void GLAPIENTRY
8685 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8686 GLboolean transpose
, const GLfloat
*v
)
8688 GET_CURRENT_CONTEXT(ctx
);
8690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8691 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8692 4 + POINTER_DWORDS
);
8698 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8700 if (ctx
->ExecuteFlag
) {
8701 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8702 (program
, location
, count
, transpose
, v
));
8706 static void GLAPIENTRY
8707 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8708 GLboolean transpose
, const GLfloat
*v
)
8710 GET_CURRENT_CONTEXT(ctx
);
8712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8713 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8714 4 + POINTER_DWORDS
);
8720 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8722 if (ctx
->ExecuteFlag
) {
8723 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8724 (program
, location
, count
, transpose
, v
));
8728 static void GLAPIENTRY
8729 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8730 GLboolean transpose
, const GLfloat
*v
)
8732 GET_CURRENT_CONTEXT(ctx
);
8734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8735 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8736 4 + POINTER_DWORDS
);
8742 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8744 if (ctx
->ExecuteFlag
) {
8745 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8746 (program
, location
, count
, transpose
, v
));
8750 static void GLAPIENTRY
8751 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8752 GLboolean transpose
, const GLfloat
*v
)
8754 GET_CURRENT_CONTEXT(ctx
);
8756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8757 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8758 4 + POINTER_DWORDS
);
8764 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8766 if (ctx
->ExecuteFlag
) {
8767 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8768 (program
, location
, count
, transpose
, v
));
8772 static void GLAPIENTRY
8773 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8774 GLboolean transpose
, const GLfloat
*v
)
8776 GET_CURRENT_CONTEXT(ctx
);
8778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8779 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8780 4 + POINTER_DWORDS
);
8786 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8788 if (ctx
->ExecuteFlag
) {
8789 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8790 (program
, location
, count
, transpose
, v
));
8794 static void GLAPIENTRY
8795 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8796 GLboolean transpose
, const GLfloat
*v
)
8798 GET_CURRENT_CONTEXT(ctx
);
8800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8801 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8802 4 + POINTER_DWORDS
);
8808 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8810 if (ctx
->ExecuteFlag
) {
8811 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8812 (program
, location
, count
, transpose
, v
));
8816 static void GLAPIENTRY
8817 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8818 GLboolean transpose
, const GLfloat
*v
)
8820 GET_CURRENT_CONTEXT(ctx
);
8822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8823 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8824 4 + POINTER_DWORDS
);
8830 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8832 if (ctx
->ExecuteFlag
) {
8833 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8834 (program
, location
, count
, transpose
, v
));
8838 static void GLAPIENTRY
8839 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8840 GLboolean transpose
, const GLfloat
*v
)
8842 GET_CURRENT_CONTEXT(ctx
);
8844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8845 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8846 4 + POINTER_DWORDS
);
8852 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8854 if (ctx
->ExecuteFlag
) {
8855 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8856 (program
, location
, count
, transpose
, v
));
8860 static void GLAPIENTRY
8861 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8862 GLboolean transpose
, const GLdouble
*v
)
8864 GET_CURRENT_CONTEXT(ctx
);
8866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8867 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8868 4 + POINTER_DWORDS
);
8874 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8876 if (ctx
->ExecuteFlag
) {
8877 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8878 (program
, location
, count
, transpose
, v
));
8882 static void GLAPIENTRY
8883 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8884 GLboolean transpose
, const GLdouble
*v
)
8886 GET_CURRENT_CONTEXT(ctx
);
8888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8889 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8890 4 + POINTER_DWORDS
);
8896 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8898 if (ctx
->ExecuteFlag
) {
8899 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8900 (program
, location
, count
, transpose
, v
));
8904 static void GLAPIENTRY
8905 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8906 GLboolean transpose
, const GLdouble
*v
)
8908 GET_CURRENT_CONTEXT(ctx
);
8910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8911 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8912 4 + POINTER_DWORDS
);
8918 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8920 if (ctx
->ExecuteFlag
) {
8921 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8922 (program
, location
, count
, transpose
, v
));
8926 static void GLAPIENTRY
8927 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8928 GLboolean transpose
, const GLdouble
*v
)
8930 GET_CURRENT_CONTEXT(ctx
);
8932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8933 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8934 4 + POINTER_DWORDS
);
8940 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8942 if (ctx
->ExecuteFlag
) {
8943 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8944 (program
, location
, count
, transpose
, v
));
8948 static void GLAPIENTRY
8949 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8950 GLboolean transpose
, const GLdouble
*v
)
8952 GET_CURRENT_CONTEXT(ctx
);
8954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8955 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8956 4 + POINTER_DWORDS
);
8962 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8964 if (ctx
->ExecuteFlag
) {
8965 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8966 (program
, location
, count
, transpose
, v
));
8970 static void GLAPIENTRY
8971 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8972 GLboolean transpose
, const GLdouble
*v
)
8974 GET_CURRENT_CONTEXT(ctx
);
8976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8977 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8978 4 + POINTER_DWORDS
);
8984 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8986 if (ctx
->ExecuteFlag
) {
8987 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8988 (program
, location
, count
, transpose
, v
));
8992 static void GLAPIENTRY
8993 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8994 GLboolean transpose
, const GLdouble
*v
)
8996 GET_CURRENT_CONTEXT(ctx
);
8998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8999 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
9000 4 + POINTER_DWORDS
);
9006 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
9008 if (ctx
->ExecuteFlag
) {
9009 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
9010 (program
, location
, count
, transpose
, v
));
9014 static void GLAPIENTRY
9015 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
9016 GLboolean transpose
, const GLdouble
*v
)
9018 GET_CURRENT_CONTEXT(ctx
);
9020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9021 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
9022 4 + POINTER_DWORDS
);
9028 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
9030 if (ctx
->ExecuteFlag
) {
9031 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
9032 (program
, location
, count
, transpose
, v
));
9036 static void GLAPIENTRY
9037 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
9038 GLboolean transpose
, const GLdouble
*v
)
9040 GET_CURRENT_CONTEXT(ctx
);
9042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9043 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
9044 4 + POINTER_DWORDS
);
9050 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
9052 if (ctx
->ExecuteFlag
) {
9053 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
9054 (program
, location
, count
, transpose
, v
));
9058 static void GLAPIENTRY
9059 save_ClipControl(GLenum origin
, GLenum depth
)
9061 GET_CURRENT_CONTEXT(ctx
);
9063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9064 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
9069 if (ctx
->ExecuteFlag
) {
9070 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
9074 static void GLAPIENTRY
9075 save_ClampColorARB(GLenum target
, GLenum clamp
)
9077 GET_CURRENT_CONTEXT(ctx
);
9079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9080 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
9085 if (ctx
->ExecuteFlag
) {
9086 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
9090 /** GL_EXT_texture_integer */
9091 static void GLAPIENTRY
9092 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
9094 GET_CURRENT_CONTEXT(ctx
);
9096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9097 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
9104 if (ctx
->ExecuteFlag
) {
9105 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9109 /** GL_EXT_texture_integer */
9110 static void GLAPIENTRY
9111 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
9113 GET_CURRENT_CONTEXT(ctx
);
9115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9116 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
9123 if (ctx
->ExecuteFlag
) {
9124 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9128 /** GL_EXT_texture_integer */
9129 static void GLAPIENTRY
9130 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
9132 GET_CURRENT_CONTEXT(ctx
);
9134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9135 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
9144 if (ctx
->ExecuteFlag
) {
9145 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
9149 /** GL_EXT_texture_integer */
9150 static void GLAPIENTRY
9151 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
9153 GET_CURRENT_CONTEXT(ctx
);
9155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9156 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
9160 n
[3].ui
= params
[0];
9161 n
[4].ui
= params
[1];
9162 n
[5].ui
= params
[2];
9163 n
[6].ui
= params
[3];
9165 if (ctx
->ExecuteFlag
) {
9166 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
9170 /* GL_ARB_instanced_arrays */
9171 static void GLAPIENTRY
9172 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
9174 GET_CURRENT_CONTEXT(ctx
);
9176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9177 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
9182 if (ctx
->ExecuteFlag
) {
9183 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
9188 /* GL_NV_texture_barrier */
9189 static void GLAPIENTRY
9190 save_TextureBarrierNV(void)
9192 GET_CURRENT_CONTEXT(ctx
);
9193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9194 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
9195 if (ctx
->ExecuteFlag
) {
9196 CALL_TextureBarrierNV(ctx
->Exec
, ());
9201 /* GL_ARB_sampler_objects */
9202 static void GLAPIENTRY
9203 save_BindSampler(GLuint unit
, GLuint sampler
)
9206 GET_CURRENT_CONTEXT(ctx
);
9207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9208 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
9213 if (ctx
->ExecuteFlag
) {
9214 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9218 static void GLAPIENTRY
9219 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9222 GET_CURRENT_CONTEXT(ctx
);
9223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9224 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9229 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9235 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9238 if (ctx
->ExecuteFlag
) {
9239 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9243 static void GLAPIENTRY
9244 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9248 parray
[1] = parray
[2] = parray
[3] = 0;
9249 save_SamplerParameteriv(sampler
, pname
, parray
);
9252 static void GLAPIENTRY
9253 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9256 GET_CURRENT_CONTEXT(ctx
);
9257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9258 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9263 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9269 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9272 if (ctx
->ExecuteFlag
) {
9273 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9277 static void GLAPIENTRY
9278 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9282 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9283 save_SamplerParameterfv(sampler
, pname
, parray
);
9286 static void GLAPIENTRY
9287 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9290 GET_CURRENT_CONTEXT(ctx
);
9291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9292 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9297 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9303 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9306 if (ctx
->ExecuteFlag
) {
9307 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9311 static void GLAPIENTRY
9312 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9315 GET_CURRENT_CONTEXT(ctx
);
9316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9317 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9321 n
[3].ui
= params
[0];
9322 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9323 n
[4].ui
= params
[1];
9324 n
[5].ui
= params
[2];
9325 n
[6].ui
= params
[3];
9328 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9331 if (ctx
->ExecuteFlag
) {
9332 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9336 static void GLAPIENTRY
9337 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9340 GET_CURRENT_CONTEXT(ctx
);
9341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9342 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9344 union uint64_pair p
;
9347 n
[2].ui
= p
.uint32
[0];
9348 n
[3].ui
= p
.uint32
[1];
9349 save_pointer(&n
[4], sync
);
9351 if (ctx
->ExecuteFlag
) {
9352 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9357 /** GL_NV_conditional_render */
9358 static void GLAPIENTRY
9359 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9361 GET_CURRENT_CONTEXT(ctx
);
9363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9364 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9369 if (ctx
->ExecuteFlag
) {
9370 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9374 static void GLAPIENTRY
9375 save_EndConditionalRender(void)
9377 GET_CURRENT_CONTEXT(ctx
);
9378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9379 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9380 if (ctx
->ExecuteFlag
) {
9381 CALL_EndConditionalRender(ctx
->Exec
, ());
9385 static void GLAPIENTRY
9386 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9388 GET_CURRENT_CONTEXT(ctx
);
9390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9391 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9397 if (ctx
->ExecuteFlag
) {
9398 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9402 static void GLAPIENTRY
9403 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9404 const GLuint
*indices
)
9406 GET_CURRENT_CONTEXT(ctx
);
9408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9409 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9411 GLint
*indices_copy
= NULL
;
9414 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9415 n
[1].e
= shadertype
;
9417 save_pointer(&n
[3], indices_copy
);
9419 if (ctx
->ExecuteFlag
) {
9420 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9424 /** GL_EXT_window_rectangles */
9425 static void GLAPIENTRY
9426 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9428 GET_CURRENT_CONTEXT(ctx
);
9430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9431 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9433 GLint
*box_copy
= NULL
;
9436 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9439 save_pointer(&n
[3], box_copy
);
9441 if (ctx
->ExecuteFlag
) {
9442 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9447 /** GL_NV_conservative_raster */
9448 static void GLAPIENTRY
9449 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9451 GET_CURRENT_CONTEXT(ctx
);
9453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9454 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9459 if (ctx
->ExecuteFlag
) {
9460 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9464 /** GL_NV_conservative_raster_dilate */
9465 static void GLAPIENTRY
9466 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9468 GET_CURRENT_CONTEXT(ctx
);
9470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9471 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9476 if (ctx
->ExecuteFlag
) {
9477 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9481 /** GL_NV_conservative_raster_pre_snap_triangles */
9482 static void GLAPIENTRY
9483 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9485 GET_CURRENT_CONTEXT(ctx
);
9487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9488 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9493 if (ctx
->ExecuteFlag
) {
9494 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9498 /** GL_EXT_direct_state_access */
9500 static void GLAPIENTRY
9501 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9503 GET_CURRENT_CONTEXT(ctx
);
9505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9506 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9508 n
[1].e
= matrixMode
;
9509 for (unsigned i
= 0; i
< 16; i
++) {
9513 if (ctx
->ExecuteFlag
) {
9514 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9518 static void GLAPIENTRY
9519 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9522 for (unsigned i
= 0; i
< 16; i
++) {
9523 f
[i
] = (GLfloat
) m
[i
];
9525 save_MatrixLoadfEXT(matrixMode
, f
);
9528 static void GLAPIENTRY
9529 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9531 GET_CURRENT_CONTEXT(ctx
);
9533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9534 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9536 n
[1].e
= matrixMode
;
9537 for (unsigned i
= 0; i
< 16; i
++) {
9541 if (ctx
->ExecuteFlag
) {
9542 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9546 static void GLAPIENTRY
9547 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9550 for (unsigned i
= 0; i
< 16; i
++) {
9551 f
[i
] = (GLfloat
) m
[i
];
9553 save_MatrixMultfEXT(matrixMode
, f
);
9556 static void GLAPIENTRY
9557 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9559 GET_CURRENT_CONTEXT(ctx
);
9561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9562 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9564 n
[1].e
= matrixMode
;
9570 if (ctx
->ExecuteFlag
) {
9571 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9575 static void GLAPIENTRY
9576 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9578 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9581 static void GLAPIENTRY
9582 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9584 GET_CURRENT_CONTEXT(ctx
);
9586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9587 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9589 n
[1].e
= matrixMode
;
9594 if (ctx
->ExecuteFlag
) {
9595 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9599 static void GLAPIENTRY
9600 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9602 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9605 static void GLAPIENTRY
9606 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9608 GET_CURRENT_CONTEXT(ctx
);
9610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9611 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9613 n
[1].e
= matrixMode
;
9618 if (ctx
->ExecuteFlag
) {
9619 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9623 static void GLAPIENTRY
9624 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9626 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9629 static void GLAPIENTRY
9630 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9632 GET_CURRENT_CONTEXT(ctx
);
9634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9635 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9637 n
[1].e
= matrixMode
;
9639 if (ctx
->ExecuteFlag
) {
9640 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9644 static void GLAPIENTRY
9645 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9646 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9648 GET_CURRENT_CONTEXT(ctx
);
9650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9651 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9653 n
[1].e
= matrixMode
;
9654 n
[2].f
= (GLfloat
) left
;
9655 n
[3].f
= (GLfloat
) right
;
9656 n
[4].f
= (GLfloat
) bottom
;
9657 n
[5].f
= (GLfloat
) top
;
9658 n
[6].f
= (GLfloat
) nearval
;
9659 n
[7].f
= (GLfloat
) farval
;
9661 if (ctx
->ExecuteFlag
) {
9662 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9667 static void GLAPIENTRY
9668 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9669 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9671 GET_CURRENT_CONTEXT(ctx
);
9673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9674 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9676 n
[1].e
= matrixMode
;
9677 n
[2].f
= (GLfloat
) left
;
9678 n
[3].f
= (GLfloat
) right
;
9679 n
[4].f
= (GLfloat
) bottom
;
9680 n
[5].f
= (GLfloat
) top
;
9681 n
[6].f
= (GLfloat
) nearval
;
9682 n
[7].f
= (GLfloat
) farval
;
9684 if (ctx
->ExecuteFlag
) {
9685 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9689 static void GLAPIENTRY
9690 save_MatrixPushEXT(GLenum matrixMode
)
9692 GET_CURRENT_CONTEXT(ctx
);
9694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9695 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9697 n
[1].e
= matrixMode
;
9699 if (ctx
->ExecuteFlag
) {
9700 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9704 static void GLAPIENTRY
9705 save_MatrixPopEXT(GLenum matrixMode
)
9707 GET_CURRENT_CONTEXT(ctx
);
9709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9710 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9712 n
[1].e
= matrixMode
;
9714 if (ctx
->ExecuteFlag
) {
9715 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9719 static void GLAPIENTRY
9720 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9723 _math_transposef(tm
, m
);
9724 save_MatrixLoadfEXT(matrixMode
, tm
);
9727 static void GLAPIENTRY
9728 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9731 _math_transposefd(tm
, m
);
9732 save_MatrixLoadfEXT(matrixMode
, tm
);
9735 static void GLAPIENTRY
9736 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9739 _math_transposef(tm
, m
);
9740 save_MatrixMultfEXT(matrixMode
, tm
);
9743 static void GLAPIENTRY
9744 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9747 _math_transposefd(tm
, m
);
9748 save_MatrixMultfEXT(matrixMode
, tm
);
9751 static void GLAPIENTRY
9752 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9753 const GLfloat
*params
)
9755 GET_CURRENT_CONTEXT(ctx
);
9757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9758 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9768 if (ctx
->ExecuteFlag
) {
9769 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9774 static void GLAPIENTRY
9775 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9779 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9780 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9783 static void GLAPIENTRY
9784 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9786 GET_CURRENT_CONTEXT(ctx
);
9788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9789 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9799 if (ctx
->ExecuteFlag
) {
9800 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9804 static void GLAPIENTRY
9805 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9809 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9810 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9813 static void GLAPIENTRY
9814 save_TextureParameterIivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
* params
)
9816 GET_CURRENT_CONTEXT(ctx
);
9818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9819 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_II
, 7);
9829 if (ctx
->ExecuteFlag
) {
9830 CALL_TextureParameterIivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9834 static void GLAPIENTRY
9835 save_TextureParameterIuivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLuint
* params
)
9837 GET_CURRENT_CONTEXT(ctx
);
9839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9840 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_IUI
, 7);
9845 n
[4].ui
= params
[0];
9846 n
[5].ui
= params
[1];
9847 n
[6].ui
= params
[2];
9848 n
[7].ui
= params
[3];
9850 if (ctx
->ExecuteFlag
) {
9851 CALL_TextureParameterIuivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9856 static void GLAPIENTRY
9857 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9858 GLint level
, GLint components
,
9859 GLsizei width
, GLint border
,
9860 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9862 GET_CURRENT_CONTEXT(ctx
);
9863 if (target
== GL_PROXY_TEXTURE_1D
) {
9864 /* don't compile, execute immediately */
9865 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9866 border
, format
, type
, pixels
));
9870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9871 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9876 n
[4].i
= components
;
9877 n
[5].i
= (GLint
) width
;
9882 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9883 pixels
, &ctx
->Unpack
));
9885 if (ctx
->ExecuteFlag
) {
9886 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9887 border
, format
, type
, pixels
));
9893 static void GLAPIENTRY
9894 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9895 GLint level
, GLint components
,
9896 GLsizei width
, GLsizei height
, GLint border
,
9897 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9899 GET_CURRENT_CONTEXT(ctx
);
9900 if (target
== GL_PROXY_TEXTURE_2D
) {
9901 /* don't compile, execute immediately */
9902 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9903 height
, border
, format
, type
, pixels
));
9907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9908 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9913 n
[4].i
= components
;
9914 n
[5].i
= (GLint
) width
;
9915 n
[6].i
= (GLint
) height
;
9919 save_pointer(&n
[10],
9920 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9921 pixels
, &ctx
->Unpack
));
9923 if (ctx
->ExecuteFlag
) {
9924 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9925 height
, border
, format
, type
, pixels
));
9931 static void GLAPIENTRY
9932 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9933 GLint level
, GLint internalFormat
,
9934 GLsizei width
, GLsizei height
, GLsizei depth
,
9936 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9938 GET_CURRENT_CONTEXT(ctx
);
9939 if (target
== GL_PROXY_TEXTURE_3D
) {
9940 /* don't compile, execute immediately */
9941 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9942 height
, depth
, border
, format
, type
,
9947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9948 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9953 n
[4].i
= (GLint
) internalFormat
;
9954 n
[5].i
= (GLint
) width
;
9955 n
[6].i
= (GLint
) height
;
9956 n
[7].i
= (GLint
) depth
;
9960 save_pointer(&n
[11],
9961 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9962 pixels
, &ctx
->Unpack
));
9964 if (ctx
->ExecuteFlag
) {
9965 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9966 width
, height
, depth
, border
, format
,
9973 static void GLAPIENTRY
9974 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9975 GLsizei width
, GLenum format
, GLenum type
,
9976 const GLvoid
* pixels
)
9978 GET_CURRENT_CONTEXT(ctx
);
9981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9983 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9989 n
[5].i
= (GLint
) width
;
9993 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9994 pixels
, &ctx
->Unpack
));
9996 if (ctx
->ExecuteFlag
) {
9997 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9998 format
, type
, pixels
));
10003 static void GLAPIENTRY
10004 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10005 GLint xoffset
, GLint yoffset
,
10006 GLsizei width
, GLsizei height
,
10007 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10009 GET_CURRENT_CONTEXT(ctx
);
10012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10014 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10021 n
[6].i
= (GLint
) width
;
10022 n
[7].i
= (GLint
) height
;
10025 save_pointer(&n
[10],
10026 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10027 pixels
, &ctx
->Unpack
));
10029 if (ctx
->ExecuteFlag
) {
10030 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
10031 width
, height
, format
, type
, pixels
));
10036 static void GLAPIENTRY
10037 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10038 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10039 GLsizei width
, GLsizei height
, GLsizei depth
,
10040 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10042 GET_CURRENT_CONTEXT(ctx
);
10045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10047 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10055 n
[7].i
= (GLint
) width
;
10056 n
[8].i
= (GLint
) height
;
10057 n
[9].i
= (GLint
) depth
;
10060 save_pointer(&n
[12],
10061 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10062 pixels
, &ctx
->Unpack
));
10064 if (ctx
->ExecuteFlag
) {
10065 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10066 xoffset
, yoffset
, zoffset
,
10067 width
, height
, depth
, format
, type
,
10072 static void GLAPIENTRY
10073 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10074 GLenum internalformat
, GLint x
, GLint y
,
10075 GLsizei width
, GLint border
)
10077 GET_CURRENT_CONTEXT(ctx
);
10079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10080 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
10085 n
[4].e
= internalformat
;
10091 if (ctx
->ExecuteFlag
) {
10092 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10093 internalformat
, x
, y
,
10098 static void GLAPIENTRY
10099 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10100 GLenum internalformat
,
10101 GLint x
, GLint y
, GLsizei width
,
10102 GLsizei height
, GLint border
)
10104 GET_CURRENT_CONTEXT(ctx
);
10106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10107 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
10112 n
[4].e
= internalformat
;
10119 if (ctx
->ExecuteFlag
) {
10120 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10121 internalformat
, x
, y
,
10122 width
, height
, border
));
10126 static void GLAPIENTRY
10127 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10128 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10130 GET_CURRENT_CONTEXT(ctx
);
10132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10133 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
10143 if (ctx
->ExecuteFlag
) {
10144 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
10145 (texture
, target
, level
, xoffset
, x
, y
, width
));
10149 static void GLAPIENTRY
10150 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10151 GLint xoffset
, GLint yoffset
,
10152 GLint x
, GLint y
, GLsizei width
, GLint height
)
10154 GET_CURRENT_CONTEXT(ctx
);
10156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10157 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
10169 if (ctx
->ExecuteFlag
) {
10170 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10172 x
, y
, width
, height
));
10177 static void GLAPIENTRY
10178 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10179 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10180 GLint x
, GLint y
, GLsizei width
, GLint height
)
10182 GET_CURRENT_CONTEXT(ctx
);
10184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10185 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
10198 if (ctx
->ExecuteFlag
) {
10199 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10200 xoffset
, yoffset
, zoffset
,
10201 x
, y
, width
, height
));
10206 static void GLAPIENTRY
10207 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
10209 GET_CURRENT_CONTEXT(ctx
);
10211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10212 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
10218 if (ctx
->ExecuteFlag
) {
10219 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
10224 static void GLAPIENTRY
10225 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
10226 const GLfloat
*params
)
10228 GET_CURRENT_CONTEXT(ctx
);
10230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10231 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
10236 n
[4].f
= params
[0];
10237 n
[5].f
= params
[1];
10238 n
[6].f
= params
[2];
10239 n
[7].f
= params
[3];
10241 if (ctx
->ExecuteFlag
) {
10242 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10247 static void GLAPIENTRY
10248 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10252 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10253 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
10256 static void GLAPIENTRY
10257 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10259 GET_CURRENT_CONTEXT(ctx
);
10261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10262 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10267 n
[4].i
= params
[0];
10268 n
[5].i
= params
[1];
10269 n
[6].i
= params
[2];
10270 n
[7].i
= params
[3];
10272 if (ctx
->ExecuteFlag
) {
10273 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10277 static void GLAPIENTRY
10278 save_MultiTexParameterIivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10280 GET_CURRENT_CONTEXT(ctx
);
10282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10283 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_II
, 7);
10288 n
[4].i
= params
[0];
10289 n
[5].i
= params
[1];
10290 n
[6].i
= params
[2];
10291 n
[7].i
= params
[3];
10293 if (ctx
->ExecuteFlag
) {
10294 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10298 static void GLAPIENTRY
10299 save_MultiTexParameterIuivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLuint
*params
)
10301 GET_CURRENT_CONTEXT(ctx
);
10303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10304 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_IUI
, 7);
10309 n
[4].ui
= params
[0];
10310 n
[5].ui
= params
[1];
10311 n
[6].ui
= params
[2];
10312 n
[7].ui
= params
[3];
10314 if (ctx
->ExecuteFlag
) {
10315 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10319 static void GLAPIENTRY
10320 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10324 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10325 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10329 static void GLAPIENTRY
10330 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10331 GLint level
, GLint components
,
10332 GLsizei width
, GLint border
,
10333 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10335 GET_CURRENT_CONTEXT(ctx
);
10336 if (target
== GL_PROXY_TEXTURE_1D
) {
10337 /* don't compile, execute immediately */
10338 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10339 border
, format
, type
, pixels
));
10343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10344 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10349 n
[4].i
= components
;
10350 n
[5].i
= (GLint
) width
;
10354 save_pointer(&n
[9],
10355 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10356 pixels
, &ctx
->Unpack
));
10358 if (ctx
->ExecuteFlag
) {
10359 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10360 border
, format
, type
, pixels
));
10366 static void GLAPIENTRY
10367 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10368 GLint level
, GLint components
,
10369 GLsizei width
, GLsizei height
, GLint border
,
10370 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10372 GET_CURRENT_CONTEXT(ctx
);
10373 if (target
== GL_PROXY_TEXTURE_2D
) {
10374 /* don't compile, execute immediately */
10375 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10376 height
, border
, format
, type
, pixels
));
10380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10381 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10386 n
[4].i
= components
;
10387 n
[5].i
= (GLint
) width
;
10388 n
[6].i
= (GLint
) height
;
10392 save_pointer(&n
[10],
10393 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10394 pixels
, &ctx
->Unpack
));
10396 if (ctx
->ExecuteFlag
) {
10397 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10398 height
, border
, format
, type
, pixels
));
10404 static void GLAPIENTRY
10405 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10406 GLint level
, GLint internalFormat
,
10407 GLsizei width
, GLsizei height
, GLsizei depth
,
10409 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10411 GET_CURRENT_CONTEXT(ctx
);
10412 if (target
== GL_PROXY_TEXTURE_3D
) {
10413 /* don't compile, execute immediately */
10414 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10415 height
, depth
, border
, format
, type
,
10420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10421 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10426 n
[4].i
= (GLint
) internalFormat
;
10427 n
[5].i
= (GLint
) width
;
10428 n
[6].i
= (GLint
) height
;
10429 n
[7].i
= (GLint
) depth
;
10433 save_pointer(&n
[11],
10434 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10435 pixels
, &ctx
->Unpack
));
10437 if (ctx
->ExecuteFlag
) {
10438 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10439 width
, height
, depth
, border
, format
,
10446 static void GLAPIENTRY
10447 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10448 GLsizei width
, GLenum format
, GLenum type
,
10449 const GLvoid
* pixels
)
10451 GET_CURRENT_CONTEXT(ctx
);
10454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10456 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10462 n
[5].i
= (GLint
) width
;
10465 save_pointer(&n
[8],
10466 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10467 pixels
, &ctx
->Unpack
));
10469 if (ctx
->ExecuteFlag
) {
10470 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10471 format
, type
, pixels
));
10476 static void GLAPIENTRY
10477 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10478 GLint xoffset
, GLint yoffset
,
10479 GLsizei width
, GLsizei height
,
10480 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10482 GET_CURRENT_CONTEXT(ctx
);
10485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10487 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10494 n
[6].i
= (GLint
) width
;
10495 n
[7].i
= (GLint
) height
;
10498 save_pointer(&n
[10],
10499 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10500 pixels
, &ctx
->Unpack
));
10502 if (ctx
->ExecuteFlag
) {
10503 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10504 width
, height
, format
, type
, pixels
));
10509 static void GLAPIENTRY
10510 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10511 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10512 GLsizei width
, GLsizei height
, GLsizei depth
,
10513 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10515 GET_CURRENT_CONTEXT(ctx
);
10518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10520 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10528 n
[7].i
= (GLint
) width
;
10529 n
[8].i
= (GLint
) height
;
10530 n
[9].i
= (GLint
) depth
;
10533 save_pointer(&n
[12],
10534 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10535 pixels
, &ctx
->Unpack
));
10537 if (ctx
->ExecuteFlag
) {
10538 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10539 xoffset
, yoffset
, zoffset
,
10540 width
, height
, depth
, format
, type
,
10546 static void GLAPIENTRY
10547 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10548 GLenum internalformat
, GLint x
, GLint y
,
10549 GLsizei width
, GLint border
)
10551 GET_CURRENT_CONTEXT(ctx
);
10553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10554 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10559 n
[4].e
= internalformat
;
10565 if (ctx
->ExecuteFlag
) {
10566 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10567 internalformat
, x
, y
,
10573 static void GLAPIENTRY
10574 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10575 GLenum internalformat
,
10576 GLint x
, GLint y
, GLsizei width
,
10577 GLsizei height
, GLint border
)
10579 GET_CURRENT_CONTEXT(ctx
);
10581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10582 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10587 n
[4].e
= internalformat
;
10594 if (ctx
->ExecuteFlag
) {
10595 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10596 internalformat
, x
, y
,
10597 width
, height
, border
));
10602 static void GLAPIENTRY
10603 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10604 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10606 GET_CURRENT_CONTEXT(ctx
);
10608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10609 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10619 if (ctx
->ExecuteFlag
) {
10620 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10621 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10626 static void GLAPIENTRY
10627 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10628 GLint xoffset
, GLint yoffset
,
10629 GLint x
, GLint y
, GLsizei width
, GLint height
)
10631 GET_CURRENT_CONTEXT(ctx
);
10633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10634 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10646 if (ctx
->ExecuteFlag
) {
10647 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10649 x
, y
, width
, height
));
10654 static void GLAPIENTRY
10655 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10656 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10657 GLint x
, GLint y
, GLsizei width
, GLint height
)
10659 GET_CURRENT_CONTEXT(ctx
);
10661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10662 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10675 if (ctx
->ExecuteFlag
) {
10676 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10677 xoffset
, yoffset
, zoffset
,
10678 x
, y
, width
, height
));
10683 static void GLAPIENTRY
10684 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10686 GET_CURRENT_CONTEXT(ctx
);
10688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10689 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10694 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10695 n
[4].f
= params
[0];
10696 n
[5].f
= params
[1];
10697 n
[6].f
= params
[2];
10698 n
[7].f
= params
[3];
10701 n
[4].f
= params
[0];
10702 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10705 if (ctx
->ExecuteFlag
) {
10706 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10711 static void GLAPIENTRY
10712 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10715 parray
[0] = (GLfloat
) param
;
10716 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10717 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10721 static void GLAPIENTRY
10722 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10725 p
[0] = (GLfloat
) param
;
10726 p
[1] = p
[2] = p
[3] = 0.0F
;
10727 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10731 static void GLAPIENTRY
10732 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10735 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10736 p
[0] = INT_TO_FLOAT(param
[0]);
10737 p
[1] = INT_TO_FLOAT(param
[1]);
10738 p
[2] = INT_TO_FLOAT(param
[2]);
10739 p
[3] = INT_TO_FLOAT(param
[3]);
10742 p
[0] = (GLfloat
) param
[0];
10743 p
[1] = p
[2] = p
[3] = 0.0F
;
10745 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10749 static void GLAPIENTRY
10750 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10751 GLenum internalFormat
, GLsizei width
,
10752 GLint border
, GLsizei imageSize
,
10753 const GLvoid
* data
)
10755 GET_CURRENT_CONTEXT(ctx
);
10756 if (target
== GL_PROXY_TEXTURE_1D
) {
10757 /* don't compile, execute immediately */
10758 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10759 internalFormat
, width
,
10765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10767 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
10768 7 + POINTER_DWORDS
);
10773 n
[4].e
= internalFormat
;
10774 n
[5].i
= (GLint
) width
;
10776 n
[7].i
= imageSize
;
10777 save_pointer(&n
[8],
10778 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
10780 if (ctx
->ExecuteFlag
) {
10781 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
10782 (texture
, target
, level
, internalFormat
,
10783 width
, border
, imageSize
, data
));
10789 static void GLAPIENTRY
10790 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10791 GLenum internalFormat
, GLsizei width
,
10792 GLsizei height
, GLint border
, GLsizei imageSize
,
10793 const GLvoid
* data
)
10795 GET_CURRENT_CONTEXT(ctx
);
10796 if (target
== GL_PROXY_TEXTURE_2D
) {
10797 /* don't compile, execute immediately */
10798 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10799 internalFormat
, width
, height
,
10800 border
, imageSize
, data
));
10804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10806 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
10807 8 + POINTER_DWORDS
);
10812 n
[4].e
= internalFormat
;
10813 n
[5].i
= (GLint
) width
;
10814 n
[6].i
= (GLint
) height
;
10816 n
[8].i
= imageSize
;
10817 save_pointer(&n
[9],
10818 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
10820 if (ctx
->ExecuteFlag
) {
10821 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
10822 (texture
, target
, level
, internalFormat
,
10823 width
, height
, border
, imageSize
, data
));
10829 static void GLAPIENTRY
10830 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10831 GLenum internalFormat
, GLsizei width
,
10832 GLsizei height
, GLsizei depth
, GLint border
,
10833 GLsizei imageSize
, const GLvoid
* data
)
10835 GET_CURRENT_CONTEXT(ctx
);
10836 if (target
== GL_PROXY_TEXTURE_3D
) {
10837 /* don't compile, execute immediately */
10838 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10839 internalFormat
, width
,
10840 height
, depth
, border
,
10845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10847 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
10848 9 + POINTER_DWORDS
);
10853 n
[4].e
= internalFormat
;
10854 n
[5].i
= (GLint
) width
;
10855 n
[6].i
= (GLint
) height
;
10856 n
[7].i
= (GLint
) depth
;
10858 n
[9].i
= imageSize
;
10859 save_pointer(&n
[10],
10860 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
10862 if (ctx
->ExecuteFlag
) {
10863 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
10864 (texture
, target
, level
, internalFormat
,
10865 width
, height
, depth
, border
, imageSize
,
10872 static void GLAPIENTRY
10873 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10874 GLsizei width
, GLenum format
,
10875 GLsizei imageSize
, const GLvoid
* data
)
10878 GET_CURRENT_CONTEXT(ctx
);
10879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10881 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
10882 7 + POINTER_DWORDS
);
10888 n
[5].i
= (GLint
) width
;
10890 n
[7].i
= imageSize
;
10891 save_pointer(&n
[8],
10892 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
10894 if (ctx
->ExecuteFlag
) {
10895 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
10896 width
, format
, imageSize
, data
));
10901 static void GLAPIENTRY
10902 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10903 GLint yoffset
, GLsizei width
, GLsizei height
,
10904 GLenum format
, GLsizei imageSize
,
10905 const GLvoid
* data
)
10908 GET_CURRENT_CONTEXT(ctx
);
10909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10911 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10912 9 + POINTER_DWORDS
);
10919 n
[6].i
= (GLint
) width
;
10920 n
[7].i
= (GLint
) height
;
10922 n
[9].i
= imageSize
;
10923 save_pointer(&n
[10],
10924 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10926 if (ctx
->ExecuteFlag
) {
10927 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10928 (texture
, target
, level
, xoffset
, yoffset
,
10929 width
, height
, format
, imageSize
, data
));
10934 static void GLAPIENTRY
10935 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10936 GLint yoffset
, GLint zoffset
, GLsizei width
,
10937 GLsizei height
, GLsizei depth
, GLenum format
,
10938 GLsizei imageSize
, const GLvoid
* data
)
10941 GET_CURRENT_CONTEXT(ctx
);
10942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10944 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
10945 11 + POINTER_DWORDS
);
10953 n
[7].i
= (GLint
) width
;
10954 n
[8].i
= (GLint
) height
;
10955 n
[9].i
= (GLint
) depth
;
10957 n
[11].i
= imageSize
;
10958 save_pointer(&n
[12],
10959 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
10961 if (ctx
->ExecuteFlag
) {
10962 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
10963 (texture
, target
, level
, xoffset
, yoffset
,
10964 zoffset
, width
, height
, depth
, format
,
10970 static void GLAPIENTRY
10971 save_CompressedMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10972 GLenum internalFormat
, GLsizei width
,
10973 GLint border
, GLsizei imageSize
,
10974 const GLvoid
* data
)
10976 GET_CURRENT_CONTEXT(ctx
);
10977 if (target
== GL_PROXY_TEXTURE_1D
) {
10978 /* don't compile, execute immediately */
10979 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10980 internalFormat
, width
,
10986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10988 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
10989 7 + POINTER_DWORDS
);
10994 n
[4].e
= internalFormat
;
10995 n
[5].i
= (GLint
) width
;
10997 n
[7].i
= imageSize
;
10998 save_pointer(&n
[8],
10999 copy_data(data
, imageSize
, "glCompressedMultiTexImage1DEXT"));
11001 if (ctx
->ExecuteFlag
) {
11002 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
,
11003 (texunit
, target
, level
, internalFormat
,
11004 width
, border
, imageSize
, data
));
11010 static void GLAPIENTRY
11011 save_CompressedMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
11012 GLenum internalFormat
, GLsizei width
,
11013 GLsizei height
, GLint border
, GLsizei imageSize
,
11014 const GLvoid
* data
)
11016 GET_CURRENT_CONTEXT(ctx
);
11017 if (target
== GL_PROXY_TEXTURE_2D
) {
11018 /* don't compile, execute immediately */
11019 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
11020 internalFormat
, width
, height
,
11021 border
, imageSize
, data
));
11025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11027 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
11028 8 + POINTER_DWORDS
);
11033 n
[4].e
= internalFormat
;
11034 n
[5].i
= (GLint
) width
;
11035 n
[6].i
= (GLint
) height
;
11037 n
[8].i
= imageSize
;
11038 save_pointer(&n
[9],
11039 copy_data(data
, imageSize
, "glCompressedMultiTexImage2DEXT"));
11041 if (ctx
->ExecuteFlag
) {
11042 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
,
11043 (texunit
, target
, level
, internalFormat
,
11044 width
, height
, border
, imageSize
, data
));
11050 static void GLAPIENTRY
11051 save_CompressedMultiTexImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
11052 GLenum internalFormat
, GLsizei width
,
11053 GLsizei height
, GLsizei depth
, GLint border
,
11054 GLsizei imageSize
, const GLvoid
* data
)
11056 GET_CURRENT_CONTEXT(ctx
);
11057 if (target
== GL_PROXY_TEXTURE_3D
) {
11058 /* don't compile, execute immediately */
11059 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
11060 internalFormat
, width
,
11061 height
, depth
, border
,
11066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11068 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
11069 9 + POINTER_DWORDS
);
11074 n
[4].e
= internalFormat
;
11075 n
[5].i
= (GLint
) width
;
11076 n
[6].i
= (GLint
) height
;
11077 n
[7].i
= (GLint
) depth
;
11079 n
[9].i
= imageSize
;
11080 save_pointer(&n
[10],
11081 copy_data(data
, imageSize
, "glCompressedMultiTexImage3DEXT"));
11083 if (ctx
->ExecuteFlag
) {
11084 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
,
11085 (texunit
, target
, level
, internalFormat
,
11086 width
, height
, depth
, border
, imageSize
,
11093 static void GLAPIENTRY
11094 save_CompressedMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11095 GLsizei width
, GLenum format
,
11096 GLsizei imageSize
, const GLvoid
* data
)
11099 GET_CURRENT_CONTEXT(ctx
);
11100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11102 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
11103 7 + POINTER_DWORDS
);
11109 n
[5].i
= (GLint
) width
;
11111 n
[7].i
= imageSize
;
11112 save_pointer(&n
[8],
11113 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage1DEXT"));
11115 if (ctx
->ExecuteFlag
) {
11116 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
,
11117 width
, format
, imageSize
, data
));
11122 static void GLAPIENTRY
11123 save_CompressedMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11124 GLint yoffset
, GLsizei width
, GLsizei height
,
11125 GLenum format
, GLsizei imageSize
,
11126 const GLvoid
* data
)
11129 GET_CURRENT_CONTEXT(ctx
);
11130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11132 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
11133 9 + POINTER_DWORDS
);
11140 n
[6].i
= (GLint
) width
;
11141 n
[7].i
= (GLint
) height
;
11143 n
[9].i
= imageSize
;
11144 save_pointer(&n
[10],
11145 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage2DEXT"));
11147 if (ctx
->ExecuteFlag
) {
11148 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
11149 (texunit
, target
, level
, xoffset
, yoffset
,
11150 width
, height
, format
, imageSize
, data
));
11155 static void GLAPIENTRY
11156 save_CompressedMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11157 GLint yoffset
, GLint zoffset
, GLsizei width
,
11158 GLsizei height
, GLsizei depth
, GLenum format
,
11159 GLsizei imageSize
, const GLvoid
* data
)
11162 GET_CURRENT_CONTEXT(ctx
);
11163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11165 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
11166 11 + POINTER_DWORDS
);
11174 n
[7].i
= (GLint
) width
;
11175 n
[8].i
= (GLint
) height
;
11176 n
[9].i
= (GLint
) depth
;
11178 n
[11].i
= imageSize
;
11179 save_pointer(&n
[12],
11180 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage3DEXT"));
11182 if (ctx
->ExecuteFlag
) {
11183 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
11184 (texunit
, target
, level
, xoffset
, yoffset
,
11185 zoffset
, width
, height
, depth
, format
,
11191 static void GLAPIENTRY
11192 save_NamedProgramStringEXT(GLuint program
, GLenum target
, GLenum format
, GLsizei len
,
11193 const GLvoid
* string
)
11195 GET_CURRENT_CONTEXT(ctx
);
11198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11200 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_STRING
, 4 + POINTER_DWORDS
);
11202 GLubyte
*programCopy
= malloc(len
);
11203 if (!programCopy
) {
11204 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glNamedProgramStringEXT");
11207 memcpy(programCopy
, string
, len
);
11212 save_pointer(&n
[5], programCopy
);
11214 if (ctx
->ExecuteFlag
) {
11215 CALL_NamedProgramStringEXT(ctx
->Exec
, (program
, target
, format
, len
, string
));
11220 static void GLAPIENTRY
11221 save_NamedProgramLocalParameter4fEXT(GLuint program
, GLenum target
, GLuint index
,
11222 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
11224 GET_CURRENT_CONTEXT(ctx
);
11226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11227 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
, 7);
11237 if (ctx
->ExecuteFlag
) {
11238 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
, (program
, target
, index
, x
, y
, z
, w
));
11243 static void GLAPIENTRY
11244 save_NamedProgramLocalParameter4fvEXT(GLuint program
, GLenum target
, GLuint index
,
11245 const GLfloat
*params
)
11247 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, params
[0],
11248 params
[1], params
[2], params
[3]);
11252 static void GLAPIENTRY
11253 save_NamedProgramLocalParameter4dEXT(GLuint program
, GLenum target
, GLuint index
,
11254 GLdouble x
, GLdouble y
,
11255 GLdouble z
, GLdouble w
)
11257 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) x
,
11258 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
11262 static void GLAPIENTRY
11263 save_NamedProgramLocalParameter4dvEXT(GLuint program
, GLenum target
, GLuint index
,
11264 const GLdouble
*params
)
11266 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) params
[0],
11267 (GLfloat
) params
[1], (GLfloat
) params
[2],
11268 (GLfloat
) params
[3]);
11273 * Save an error-generating command into display list.
11275 * KW: Will appear in the list before the vertex buffer containing the
11276 * command that provoked the error. I don't see this as a problem.
11279 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11282 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
11285 save_pointer(&n
[2], (void *) s
);
11286 /* note: the data/string here doesn't have to be freed in
11287 * _mesa_delete_list() since the string is never dynamically
11295 * Compile an error into current display list.
11298 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11300 if (ctx
->CompileFlag
)
11301 save_error(ctx
, error
, s
);
11302 if (ctx
->ExecuteFlag
)
11303 _mesa_error(ctx
, error
, "%s", s
);
11308 * Test if ID names a display list.
11311 islist(struct gl_context
*ctx
, GLuint list
)
11313 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
11323 /**********************************************************************/
11324 /* Display list execution */
11325 /**********************************************************************/
11329 * Execute a display list. Note that the ListBase offset must have already
11330 * been added before calling this function. I.e. the list argument is
11331 * the absolute list number, not relative to ListBase.
11332 * \param list - display list number
11335 execute_list(struct gl_context
*ctx
, GLuint list
)
11337 struct gl_display_list
*dlist
;
11341 if (list
== 0 || !islist(ctx
, list
))
11344 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
11345 /* raise an error? */
11349 dlist
= _mesa_lookup_list(ctx
, list
);
11353 ctx
->ListState
.CallDepth
++;
11355 vbo_save_BeginCallList(ctx
, dlist
);
11361 const OpCode opcode
= n
[0].opcode
;
11363 if (is_ext_opcode(opcode
)) {
11364 n
+= ext_opcode_execute(ctx
, n
);
11369 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
11372 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11374 case OPCODE_ALPHA_FUNC
:
11375 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11377 case OPCODE_BIND_TEXTURE
:
11378 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11380 case OPCODE_BITMAP
:
11382 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11383 ctx
->Unpack
= ctx
->DefaultPacking
;
11384 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
11385 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11386 get_pointer(&n
[7])));
11387 ctx
->Unpack
= save
; /* restore */
11390 case OPCODE_BLEND_COLOR
:
11391 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11393 case OPCODE_BLEND_EQUATION
:
11394 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
11396 case OPCODE_BLEND_EQUATION_SEPARATE
:
11397 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11399 case OPCODE_BLEND_FUNC_SEPARATE
:
11400 CALL_BlendFuncSeparate(ctx
->Exec
,
11401 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11404 case OPCODE_BLEND_FUNC_I
:
11405 /* GL_ARB_draw_buffers_blend */
11406 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
11408 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11409 /* GL_ARB_draw_buffers_blend */
11410 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
11413 case OPCODE_BLEND_EQUATION_I
:
11414 /* GL_ARB_draw_buffers_blend */
11415 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11417 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11418 /* GL_ARB_draw_buffers_blend */
11419 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
11420 (n
[1].ui
, n
[2].e
, n
[3].e
));
11423 case OPCODE_CALL_LIST
:
11424 /* Generated by glCallList(), don't add ListBase */
11425 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11426 execute_list(ctx
, n
[1].ui
);
11429 case OPCODE_CALL_LISTS
:
11430 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11431 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
11435 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
11437 case OPCODE_CLEAR_BUFFER_IV
:
11444 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11447 case OPCODE_CLEAR_BUFFER_UIV
:
11450 value
[0] = n
[3].ui
;
11451 value
[1] = n
[4].ui
;
11452 value
[2] = n
[5].ui
;
11453 value
[3] = n
[6].ui
;
11454 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11457 case OPCODE_CLEAR_BUFFER_FV
:
11464 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11467 case OPCODE_CLEAR_BUFFER_FI
:
11468 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
11470 case OPCODE_CLEAR_COLOR
:
11471 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11473 case OPCODE_CLEAR_ACCUM
:
11474 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11476 case OPCODE_CLEAR_DEPTH
:
11477 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
11479 case OPCODE_CLEAR_INDEX
:
11480 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
11482 case OPCODE_CLEAR_STENCIL
:
11483 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
11485 case OPCODE_CLIP_PLANE
:
11492 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
11495 case OPCODE_COLOR_MASK
:
11496 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
11498 case OPCODE_COLOR_MASK_INDEXED
:
11499 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
11502 case OPCODE_COLOR_MATERIAL
:
11503 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11505 case OPCODE_COPY_PIXELS
:
11506 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11507 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
11510 case OPCODE_COPY_TEX_IMAGE1D
:
11511 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11512 n
[5].i
, n
[6].i
, n
[7].i
));
11514 case OPCODE_COPY_TEX_IMAGE2D
:
11515 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11516 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
11518 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
11519 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11520 n
[4].i
, n
[5].i
, n
[6].i
));
11522 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
11523 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11524 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11527 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
11528 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11529 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11532 case OPCODE_CULL_FACE
:
11533 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
11535 case OPCODE_DEPTH_FUNC
:
11536 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
11538 case OPCODE_DEPTH_MASK
:
11539 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
11541 case OPCODE_DEPTH_RANGE
:
11542 CALL_DepthRange(ctx
->Exec
,
11543 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
11545 case OPCODE_DISABLE
:
11546 CALL_Disable(ctx
->Exec
, (n
[1].e
));
11548 case OPCODE_DISABLE_INDEXED
:
11549 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11551 case OPCODE_DRAW_BUFFER
:
11552 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
11554 case OPCODE_DRAW_PIXELS
:
11556 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11557 ctx
->Unpack
= ctx
->DefaultPacking
;
11558 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
11559 get_pointer(&n
[5])));
11560 ctx
->Unpack
= save
; /* restore */
11563 case OPCODE_ENABLE
:
11564 CALL_Enable(ctx
->Exec
, (n
[1].e
));
11566 case OPCODE_ENABLE_INDEXED
:
11567 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11569 case OPCODE_EVALMESH1
:
11570 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
11572 case OPCODE_EVALMESH2
:
11573 CALL_EvalMesh2(ctx
->Exec
,
11574 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11583 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
11586 case OPCODE_FRONT_FACE
:
11587 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
11589 case OPCODE_FRUSTUM
:
11590 CALL_Frustum(ctx
->Exec
,
11591 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11594 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11596 case OPCODE_INDEX_MASK
:
11597 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
11599 case OPCODE_INIT_NAMES
:
11600 CALL_InitNames(ctx
->Exec
, ());
11609 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
11612 case OPCODE_LIGHT_MODEL
:
11619 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
11622 case OPCODE_LINE_STIPPLE
:
11623 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
11625 case OPCODE_LINE_WIDTH
:
11626 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
11628 case OPCODE_LIST_BASE
:
11629 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
11631 case OPCODE_LOAD_IDENTITY
:
11632 CALL_LoadIdentity(ctx
->Exec
, ());
11634 case OPCODE_LOAD_MATRIX
:
11635 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
11636 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
11638 case OPCODE_LOAD_NAME
:
11639 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
11641 case OPCODE_LOGIC_OP
:
11642 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
11646 GLenum target
= n
[1].e
;
11647 GLint ustride
= _mesa_evaluator_components(target
);
11648 GLint uorder
= n
[5].i
;
11649 GLfloat u1
= n
[2].f
;
11650 GLfloat u2
= n
[3].f
;
11651 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11652 (GLfloat
*) get_pointer(&n
[6])));
11657 GLenum target
= n
[1].e
;
11658 GLfloat u1
= n
[2].f
;
11659 GLfloat u2
= n
[3].f
;
11660 GLfloat v1
= n
[4].f
;
11661 GLfloat v2
= n
[5].f
;
11662 GLint ustride
= n
[6].i
;
11663 GLint vstride
= n
[7].i
;
11664 GLint uorder
= n
[8].i
;
11665 GLint vorder
= n
[9].i
;
11666 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11667 v1
, v2
, vstride
, vorder
,
11668 (GLfloat
*) get_pointer(&n
[10])));
11671 case OPCODE_MAPGRID1
:
11672 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11674 case OPCODE_MAPGRID2
:
11675 CALL_MapGrid2f(ctx
->Exec
,
11676 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
11678 case OPCODE_MATRIX_MODE
:
11679 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
11681 case OPCODE_MULT_MATRIX
:
11682 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
11685 CALL_Ortho(ctx
->Exec
,
11686 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11688 case OPCODE_PASSTHROUGH
:
11689 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
11691 case OPCODE_PATCH_PARAMETER_I
:
11692 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11694 case OPCODE_PATCH_PARAMETER_FV_INNER
:
11697 params
[0] = n
[2].f
;
11698 params
[1] = n
[3].f
;
11699 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11702 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
11705 params
[0] = n
[2].f
;
11706 params
[1] = n
[3].f
;
11707 params
[2] = n
[4].f
;
11708 params
[3] = n
[5].f
;
11709 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11712 case OPCODE_PIXEL_MAP
:
11713 CALL_PixelMapfv(ctx
->Exec
,
11714 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
11716 case OPCODE_PIXEL_TRANSFER
:
11717 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11719 case OPCODE_PIXEL_ZOOM
:
11720 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11722 case OPCODE_POINT_SIZE
:
11723 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
11725 case OPCODE_POINT_PARAMETERS
:
11728 params
[0] = n
[2].f
;
11729 params
[1] = n
[3].f
;
11730 params
[2] = n
[4].f
;
11731 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11734 case OPCODE_POLYGON_MODE
:
11735 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11737 case OPCODE_POLYGON_STIPPLE
:
11739 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11740 ctx
->Unpack
= ctx
->DefaultPacking
;
11741 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
11742 ctx
->Unpack
= save
; /* restore */
11745 case OPCODE_POLYGON_OFFSET
:
11746 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11748 case OPCODE_POLYGON_OFFSET_CLAMP
:
11749 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11751 case OPCODE_POP_ATTRIB
:
11752 CALL_PopAttrib(ctx
->Exec
, ());
11754 case OPCODE_POP_MATRIX
:
11755 CALL_PopMatrix(ctx
->Exec
, ());
11757 case OPCODE_POP_NAME
:
11758 CALL_PopName(ctx
->Exec
, ());
11760 case OPCODE_PRIORITIZE_TEXTURE
:
11761 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
11763 case OPCODE_PUSH_ATTRIB
:
11764 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
11766 case OPCODE_PUSH_MATRIX
:
11767 CALL_PushMatrix(ctx
->Exec
, ());
11769 case OPCODE_PUSH_NAME
:
11770 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
11772 case OPCODE_RASTER_POS
:
11773 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11775 case OPCODE_READ_BUFFER
:
11776 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
11778 case OPCODE_ROTATE
:
11779 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11782 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11784 case OPCODE_SCISSOR
:
11785 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11787 case OPCODE_SHADE_MODEL
:
11788 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
11790 case OPCODE_PROVOKING_VERTEX
:
11791 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
11793 case OPCODE_STENCIL_FUNC
:
11794 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
11796 case OPCODE_STENCIL_MASK
:
11797 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
11799 case OPCODE_STENCIL_OP
:
11800 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
11802 case OPCODE_STENCIL_FUNC_SEPARATE
:
11803 CALL_StencilFuncSeparate(ctx
->Exec
,
11804 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
11806 case OPCODE_STENCIL_MASK_SEPARATE
:
11807 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11809 case OPCODE_STENCIL_OP_SEPARATE
:
11810 CALL_StencilOpSeparate(ctx
->Exec
,
11811 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11813 case OPCODE_TEXENV
:
11816 params
[0] = n
[3].f
;
11817 params
[1] = n
[4].f
;
11818 params
[2] = n
[5].f
;
11819 params
[3] = n
[6].f
;
11820 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11823 case OPCODE_TEXGEN
:
11826 params
[0] = n
[3].f
;
11827 params
[1] = n
[4].f
;
11828 params
[2] = n
[5].f
;
11829 params
[3] = n
[6].f
;
11830 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11833 case OPCODE_TEXPARAMETER
:
11836 params
[0] = n
[3].f
;
11837 params
[1] = n
[4].f
;
11838 params
[2] = n
[5].f
;
11839 params
[3] = n
[6].f
;
11840 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11843 case OPCODE_TEX_IMAGE1D
:
11845 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11846 ctx
->Unpack
= ctx
->DefaultPacking
;
11847 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11848 n
[2].i
, /* level */
11849 n
[3].i
, /* components */
11850 n
[4].i
, /* width */
11851 n
[5].e
, /* border */
11852 n
[6].e
, /* format */
11854 get_pointer(&n
[8])));
11855 ctx
->Unpack
= save
; /* restore */
11858 case OPCODE_TEX_IMAGE2D
:
11860 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11861 ctx
->Unpack
= ctx
->DefaultPacking
;
11862 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11863 n
[2].i
, /* level */
11864 n
[3].i
, /* components */
11865 n
[4].i
, /* width */
11866 n
[5].i
, /* height */
11867 n
[6].e
, /* border */
11868 n
[7].e
, /* format */
11870 get_pointer(&n
[9])));
11871 ctx
->Unpack
= save
; /* restore */
11874 case OPCODE_TEX_IMAGE3D
:
11876 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11877 ctx
->Unpack
= ctx
->DefaultPacking
;
11878 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11879 n
[2].i
, /* level */
11880 n
[3].i
, /* components */
11881 n
[4].i
, /* width */
11882 n
[5].i
, /* height */
11883 n
[6].i
, /* depth */
11884 n
[7].e
, /* border */
11885 n
[8].e
, /* format */
11887 get_pointer(&n
[10])));
11888 ctx
->Unpack
= save
; /* restore */
11891 case OPCODE_TEX_SUB_IMAGE1D
:
11893 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11894 ctx
->Unpack
= ctx
->DefaultPacking
;
11895 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11897 n
[6].e
, get_pointer(&n
[7])));
11898 ctx
->Unpack
= save
; /* restore */
11901 case OPCODE_TEX_SUB_IMAGE2D
:
11903 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11904 ctx
->Unpack
= ctx
->DefaultPacking
;
11905 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11907 n
[6].i
, n
[7].e
, n
[8].e
,
11908 get_pointer(&n
[9])));
11909 ctx
->Unpack
= save
; /* restore */
11912 case OPCODE_TEX_SUB_IMAGE3D
:
11914 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11915 ctx
->Unpack
= ctx
->DefaultPacking
;
11916 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11917 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11918 n
[8].i
, n
[9].e
, n
[10].e
,
11919 get_pointer(&n
[11])));
11920 ctx
->Unpack
= save
; /* restore */
11923 case OPCODE_TRANSLATE
:
11924 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11926 case OPCODE_VIEWPORT
:
11927 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11928 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11930 case OPCODE_WINDOW_POS
:
11931 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11933 case OPCODE_VIEWPORT_ARRAY_V
:
11934 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11935 get_pointer(&n
[3])));
11937 case OPCODE_VIEWPORT_INDEXED_F
:
11938 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11941 case OPCODE_VIEWPORT_INDEXED_FV
: {
11947 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11950 case OPCODE_SCISSOR_ARRAY_V
:
11951 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11952 get_pointer(&n
[3])));
11954 case OPCODE_SCISSOR_INDEXED
:
11955 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11958 case OPCODE_SCISSOR_INDEXED_V
: {
11964 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11967 case OPCODE_DEPTH_ARRAY_V
:
11968 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11969 get_pointer(&n
[3])));
11971 case OPCODE_DEPTH_INDEXED
:
11972 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11974 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11975 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11977 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11978 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11979 n
[4].i
, n
[5].i
, n
[6].i
,
11980 get_pointer(&n
[7])));
11982 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11983 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11984 n
[4].i
, n
[5].i
, n
[6].i
,
11985 n
[7].i
, get_pointer(&n
[8])));
11987 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11988 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11989 n
[4].i
, n
[5].i
, n
[6].i
,
11991 get_pointer(&n
[9])));
11993 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11994 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11995 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11997 get_pointer(&n
[7])));
11999 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
12000 CALL_CompressedTexSubImage2D(ctx
->Exec
,
12001 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12002 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
12003 get_pointer(&n
[9])));
12005 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
12006 CALL_CompressedTexSubImage3D(ctx
->Exec
,
12007 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12008 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12010 get_pointer(&n
[11])));
12012 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
12013 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
12015 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
12016 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12018 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
12019 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12021 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
12022 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
12023 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
12026 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
12027 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
12029 case OPCODE_DEPTH_BOUNDS_EXT
:
12030 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12032 case OPCODE_PROGRAM_STRING_ARB
:
12033 CALL_ProgramStringARB(ctx
->Exec
,
12034 (n
[1].e
, n
[2].e
, n
[3].i
,
12035 get_pointer(&n
[4])));
12037 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
12038 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
12042 case OPCODE_BEGIN_QUERY_ARB
:
12043 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12045 case OPCODE_END_QUERY_ARB
:
12046 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
12048 case OPCODE_QUERY_COUNTER
:
12049 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
12051 case OPCODE_BEGIN_QUERY_INDEXED
:
12052 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
12054 case OPCODE_END_QUERY_INDEXED
:
12055 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12057 case OPCODE_DRAW_BUFFERS_ARB
:
12059 GLenum buffers
[MAX_DRAW_BUFFERS
];
12060 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
12061 for (i
= 0; i
< count
; i
++)
12062 buffers
[i
] = n
[2 + i
].e
;
12063 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
12066 case OPCODE_BLIT_FRAMEBUFFER
:
12067 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
12068 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12071 case OPCODE_PRIMITIVE_RESTART_NV
:
12072 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
12075 case OPCODE_USE_PROGRAM
:
12076 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
12078 case OPCODE_UNIFORM_1F
:
12079 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
12081 case OPCODE_UNIFORM_2F
:
12082 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
12084 case OPCODE_UNIFORM_3F
:
12085 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
12087 case OPCODE_UNIFORM_4F
:
12088 CALL_Uniform4f(ctx
->Exec
,
12089 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12091 case OPCODE_UNIFORM_1FV
:
12092 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12094 case OPCODE_UNIFORM_2FV
:
12095 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12097 case OPCODE_UNIFORM_3FV
:
12098 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12100 case OPCODE_UNIFORM_4FV
:
12101 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12103 case OPCODE_UNIFORM_1D
: {
12104 union float64_pair x
;
12106 x
.uint32
[0] = n
[2].ui
;
12107 x
.uint32
[1] = n
[3].ui
;
12109 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
12112 case OPCODE_UNIFORM_2D
: {
12113 union float64_pair x
;
12114 union float64_pair y
;
12116 x
.uint32
[0] = n
[2].ui
;
12117 x
.uint32
[1] = n
[3].ui
;
12118 y
.uint32
[0] = n
[4].ui
;
12119 y
.uint32
[1] = n
[5].ui
;
12121 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
12124 case OPCODE_UNIFORM_3D
: {
12125 union float64_pair x
;
12126 union float64_pair y
;
12127 union float64_pair z
;
12129 x
.uint32
[0] = n
[2].ui
;
12130 x
.uint32
[1] = n
[3].ui
;
12131 y
.uint32
[0] = n
[4].ui
;
12132 y
.uint32
[1] = n
[5].ui
;
12133 z
.uint32
[0] = n
[6].ui
;
12134 z
.uint32
[1] = n
[7].ui
;
12136 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
12139 case OPCODE_UNIFORM_4D
: {
12140 union float64_pair x
;
12141 union float64_pair y
;
12142 union float64_pair z
;
12143 union float64_pair w
;
12145 x
.uint32
[0] = n
[2].ui
;
12146 x
.uint32
[1] = n
[3].ui
;
12147 y
.uint32
[0] = n
[4].ui
;
12148 y
.uint32
[1] = n
[5].ui
;
12149 z
.uint32
[0] = n
[6].ui
;
12150 z
.uint32
[1] = n
[7].ui
;
12151 w
.uint32
[0] = n
[8].ui
;
12152 w
.uint32
[1] = n
[9].ui
;
12154 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
12157 case OPCODE_UNIFORM_1DV
:
12158 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12160 case OPCODE_UNIFORM_2DV
:
12161 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12163 case OPCODE_UNIFORM_3DV
:
12164 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12166 case OPCODE_UNIFORM_4DV
:
12167 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12169 case OPCODE_UNIFORM_1I
:
12170 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12172 case OPCODE_UNIFORM_2I
:
12173 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12175 case OPCODE_UNIFORM_3I
:
12176 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12178 case OPCODE_UNIFORM_4I
:
12179 CALL_Uniform4i(ctx
->Exec
,
12180 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12182 case OPCODE_UNIFORM_1IV
:
12183 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12185 case OPCODE_UNIFORM_2IV
:
12186 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12188 case OPCODE_UNIFORM_3IV
:
12189 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12191 case OPCODE_UNIFORM_4IV
:
12192 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12194 case OPCODE_UNIFORM_1UI
:
12195 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12197 case OPCODE_UNIFORM_2UI
:
12198 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12200 case OPCODE_UNIFORM_3UI
:
12201 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12203 case OPCODE_UNIFORM_4UI
:
12204 CALL_Uniform4ui(ctx
->Exec
,
12205 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12207 case OPCODE_UNIFORM_1UIV
:
12208 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12210 case OPCODE_UNIFORM_2UIV
:
12211 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12213 case OPCODE_UNIFORM_3UIV
:
12214 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12216 case OPCODE_UNIFORM_4UIV
:
12217 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12219 case OPCODE_UNIFORM_MATRIX22
:
12220 CALL_UniformMatrix2fv(ctx
->Exec
,
12221 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12223 case OPCODE_UNIFORM_MATRIX33
:
12224 CALL_UniformMatrix3fv(ctx
->Exec
,
12225 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12227 case OPCODE_UNIFORM_MATRIX44
:
12228 CALL_UniformMatrix4fv(ctx
->Exec
,
12229 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12231 case OPCODE_UNIFORM_MATRIX23
:
12232 CALL_UniformMatrix2x3fv(ctx
->Exec
,
12233 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12235 case OPCODE_UNIFORM_MATRIX32
:
12236 CALL_UniformMatrix3x2fv(ctx
->Exec
,
12237 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12239 case OPCODE_UNIFORM_MATRIX24
:
12240 CALL_UniformMatrix2x4fv(ctx
->Exec
,
12241 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12243 case OPCODE_UNIFORM_MATRIX42
:
12244 CALL_UniformMatrix4x2fv(ctx
->Exec
,
12245 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12247 case OPCODE_UNIFORM_MATRIX34
:
12248 CALL_UniformMatrix3x4fv(ctx
->Exec
,
12249 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12251 case OPCODE_UNIFORM_MATRIX43
:
12252 CALL_UniformMatrix4x3fv(ctx
->Exec
,
12253 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12255 case OPCODE_UNIFORM_MATRIX22D
:
12256 CALL_UniformMatrix2dv(ctx
->Exec
,
12257 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12259 case OPCODE_UNIFORM_MATRIX33D
:
12260 CALL_UniformMatrix3dv(ctx
->Exec
,
12261 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12263 case OPCODE_UNIFORM_MATRIX44D
:
12264 CALL_UniformMatrix4dv(ctx
->Exec
,
12265 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12267 case OPCODE_UNIFORM_MATRIX23D
:
12268 CALL_UniformMatrix2x3dv(ctx
->Exec
,
12269 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12271 case OPCODE_UNIFORM_MATRIX32D
:
12272 CALL_UniformMatrix3x2dv(ctx
->Exec
,
12273 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12275 case OPCODE_UNIFORM_MATRIX24D
:
12276 CALL_UniformMatrix2x4dv(ctx
->Exec
,
12277 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12279 case OPCODE_UNIFORM_MATRIX42D
:
12280 CALL_UniformMatrix4x2dv(ctx
->Exec
,
12281 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12283 case OPCODE_UNIFORM_MATRIX34D
:
12284 CALL_UniformMatrix3x4dv(ctx
->Exec
,
12285 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12287 case OPCODE_UNIFORM_MATRIX43D
:
12288 CALL_UniformMatrix4x3dv(ctx
->Exec
,
12289 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12292 case OPCODE_UNIFORM_1I64
: {
12293 union int64_pair x
;
12295 x
.int32
[0] = n
[2].i
;
12296 x
.int32
[1] = n
[3].i
;
12298 CALL_Uniform1i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
));
12301 case OPCODE_UNIFORM_2I64
: {
12302 union int64_pair x
;
12303 union int64_pair y
;
12305 x
.int32
[0] = n
[2].i
;
12306 x
.int32
[1] = n
[3].i
;
12307 y
.int32
[0] = n
[4].i
;
12308 y
.int32
[1] = n
[5].i
;
12310 CALL_Uniform2i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
));
12313 case OPCODE_UNIFORM_3I64
: {
12314 union int64_pair x
;
12315 union int64_pair y
;
12316 union int64_pair z
;
12318 x
.int32
[0] = n
[2].i
;
12319 x
.int32
[1] = n
[3].i
;
12320 y
.int32
[0] = n
[4].i
;
12321 y
.int32
[1] = n
[5].i
;
12322 z
.int32
[0] = n
[6].i
;
12323 z
.int32
[1] = n
[7].i
;
12326 CALL_Uniform3i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
));
12329 case OPCODE_UNIFORM_4I64
: {
12330 union int64_pair x
;
12331 union int64_pair y
;
12332 union int64_pair z
;
12333 union int64_pair w
;
12335 x
.int32
[0] = n
[2].i
;
12336 x
.int32
[1] = n
[3].i
;
12337 y
.int32
[0] = n
[4].i
;
12338 y
.int32
[1] = n
[5].i
;
12339 z
.int32
[0] = n
[6].i
;
12340 z
.int32
[1] = n
[7].i
;
12341 w
.int32
[0] = n
[8].i
;
12342 w
.int32
[1] = n
[9].i
;
12344 CALL_Uniform4i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
, w
.int64
));
12347 case OPCODE_UNIFORM_1I64V
:
12348 CALL_Uniform1i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12350 case OPCODE_UNIFORM_2I64V
:
12351 CALL_Uniform2i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12353 case OPCODE_UNIFORM_3I64V
:
12354 CALL_Uniform3i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12356 case OPCODE_UNIFORM_4I64V
:
12357 CALL_Uniform4i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12359 case OPCODE_UNIFORM_1UI64
: {
12360 union uint64_pair x
;
12362 x
.uint32
[0] = n
[2].ui
;
12363 x
.uint32
[1] = n
[3].ui
;
12365 CALL_Uniform1ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
));
12368 case OPCODE_UNIFORM_2UI64
: {
12369 union uint64_pair x
;
12370 union uint64_pair y
;
12372 x
.uint32
[0] = n
[2].ui
;
12373 x
.uint32
[1] = n
[3].ui
;
12374 y
.uint32
[0] = n
[4].ui
;
12375 y
.uint32
[1] = n
[5].ui
;
12377 CALL_Uniform2ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
));
12380 case OPCODE_UNIFORM_3UI64
: {
12381 union uint64_pair x
;
12382 union uint64_pair y
;
12383 union uint64_pair z
;
12385 x
.uint32
[0] = n
[2].ui
;
12386 x
.uint32
[1] = n
[3].ui
;
12387 y
.uint32
[0] = n
[4].ui
;
12388 y
.uint32
[1] = n
[5].ui
;
12389 z
.uint32
[0] = n
[6].ui
;
12390 z
.uint32
[1] = n
[7].ui
;
12393 CALL_Uniform3ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12397 case OPCODE_UNIFORM_4UI64
: {
12398 union uint64_pair x
;
12399 union uint64_pair y
;
12400 union uint64_pair z
;
12401 union uint64_pair w
;
12403 x
.uint32
[0] = n
[2].ui
;
12404 x
.uint32
[1] = n
[3].ui
;
12405 y
.uint32
[0] = n
[4].ui
;
12406 y
.uint32
[1] = n
[5].ui
;
12407 z
.uint32
[0] = n
[6].ui
;
12408 z
.uint32
[1] = n
[7].ui
;
12409 w
.uint32
[0] = n
[8].ui
;
12410 w
.uint32
[1] = n
[9].ui
;
12412 CALL_Uniform4ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12413 z
.uint64
, w
.uint64
));
12416 case OPCODE_UNIFORM_1UI64V
:
12417 CALL_Uniform1ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12418 get_pointer(&n
[3])));
12420 case OPCODE_UNIFORM_2UI64V
:
12421 CALL_Uniform2ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12422 get_pointer(&n
[3])));
12424 case OPCODE_UNIFORM_3UI64V
:
12425 CALL_Uniform3ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12426 get_pointer(&n
[3])));
12428 case OPCODE_UNIFORM_4UI64V
:
12429 CALL_Uniform4ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12430 get_pointer(&n
[3])));
12433 case OPCODE_PROGRAM_UNIFORM_1I64
: {
12434 union int64_pair x
;
12436 x
.int32
[0] = n
[3].i
;
12437 x
.int32
[1] = n
[4].i
;
12439 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
));
12442 case OPCODE_PROGRAM_UNIFORM_2I64
: {
12443 union int64_pair x
;
12444 union int64_pair y
;
12446 x
.int32
[0] = n
[3].i
;
12447 x
.int32
[1] = n
[4].i
;
12448 y
.int32
[0] = n
[5].i
;
12449 y
.int32
[1] = n
[6].i
;
12451 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12455 case OPCODE_PROGRAM_UNIFORM_3I64
: {
12456 union int64_pair x
;
12457 union int64_pair y
;
12458 union int64_pair z
;
12460 x
.int32
[0] = n
[3].i
;
12461 x
.int32
[1] = n
[4].i
;
12462 y
.int32
[0] = n
[5].i
;
12463 y
.int32
[1] = n
[6].i
;
12464 z
.int32
[0] = n
[7].i
;
12465 z
.int32
[1] = n
[8].i
;
12467 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12468 y
.int64
, z
.int64
));
12471 case OPCODE_PROGRAM_UNIFORM_4I64
: {
12472 union int64_pair x
;
12473 union int64_pair y
;
12474 union int64_pair z
;
12475 union int64_pair w
;
12477 x
.int32
[0] = n
[3].i
;
12478 x
.int32
[1] = n
[4].i
;
12479 y
.int32
[0] = n
[5].i
;
12480 y
.int32
[1] = n
[6].i
;
12481 z
.int32
[0] = n
[7].i
;
12482 z
.int32
[1] = n
[8].i
;
12483 w
.int32
[0] = n
[9].i
;
12484 w
.int32
[1] = n
[10].i
;
12486 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12487 y
.int64
, z
.int64
, w
.int64
));
12490 case OPCODE_PROGRAM_UNIFORM_1I64V
:
12491 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12492 get_pointer(&n
[4])));
12494 case OPCODE_PROGRAM_UNIFORM_2I64V
:
12495 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12496 get_pointer(&n
[4])));
12498 case OPCODE_PROGRAM_UNIFORM_3I64V
:
12499 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12500 get_pointer(&n
[4])));
12502 case OPCODE_PROGRAM_UNIFORM_4I64V
:
12503 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12504 get_pointer(&n
[4])));
12506 case OPCODE_PROGRAM_UNIFORM_1UI64
: {
12507 union uint64_pair x
;
12509 x
.uint32
[0] = n
[3].ui
;
12510 x
.uint32
[1] = n
[4].ui
;
12512 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
));
12515 case OPCODE_PROGRAM_UNIFORM_2UI64
: {
12516 union uint64_pair x
;
12517 union uint64_pair y
;
12519 x
.uint32
[0] = n
[3].ui
;
12520 x
.uint32
[1] = n
[4].ui
;
12521 y
.uint32
[0] = n
[5].ui
;
12522 y
.uint32
[1] = n
[6].ui
;
12524 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12528 case OPCODE_PROGRAM_UNIFORM_3UI64
: {
12529 union uint64_pair x
;
12530 union uint64_pair y
;
12531 union uint64_pair z
;
12533 x
.uint32
[0] = n
[3].ui
;
12534 x
.uint32
[1] = n
[4].ui
;
12535 y
.uint32
[0] = n
[5].ui
;
12536 y
.uint32
[1] = n
[6].ui
;
12537 z
.uint32
[0] = n
[7].ui
;
12538 z
.uint32
[1] = n
[8].ui
;
12540 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12541 y
.uint64
, z
.uint64
));
12544 case OPCODE_PROGRAM_UNIFORM_4UI64
: {
12545 union uint64_pair x
;
12546 union uint64_pair y
;
12547 union uint64_pair z
;
12548 union uint64_pair w
;
12550 x
.uint32
[0] = n
[3].ui
;
12551 x
.uint32
[1] = n
[4].ui
;
12552 y
.uint32
[0] = n
[5].ui
;
12553 y
.uint32
[1] = n
[6].ui
;
12554 z
.uint32
[0] = n
[7].ui
;
12555 z
.uint32
[1] = n
[8].ui
;
12556 w
.uint32
[0] = n
[9].ui
;
12557 w
.uint32
[1] = n
[10].ui
;
12559 CALL_ProgramUniform4ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12560 y
.uint64
, z
.uint64
, w
.uint64
));
12563 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
12564 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12565 get_pointer(&n
[4])));
12567 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
12568 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12569 get_pointer(&n
[4])));
12571 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
12572 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12573 get_pointer(&n
[4])));
12575 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
12576 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12577 get_pointer(&n
[4])));
12580 case OPCODE_USE_PROGRAM_STAGES
:
12581 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12583 case OPCODE_PROGRAM_UNIFORM_1F
:
12584 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
12586 case OPCODE_PROGRAM_UNIFORM_2F
:
12587 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
12589 case OPCODE_PROGRAM_UNIFORM_3F
:
12590 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12591 n
[3].f
, n
[4].f
, n
[5].f
));
12593 case OPCODE_PROGRAM_UNIFORM_4F
:
12594 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12595 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12597 case OPCODE_PROGRAM_UNIFORM_1FV
:
12598 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12599 get_pointer(&n
[4])));
12601 case OPCODE_PROGRAM_UNIFORM_2FV
:
12602 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12603 get_pointer(&n
[4])));
12605 case OPCODE_PROGRAM_UNIFORM_3FV
:
12606 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12607 get_pointer(&n
[4])));
12609 case OPCODE_PROGRAM_UNIFORM_4FV
:
12610 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12611 get_pointer(&n
[4])));
12613 case OPCODE_PROGRAM_UNIFORM_1D
: {
12614 union float64_pair x
;
12616 x
.uint32
[0] = n
[3].ui
;
12617 x
.uint32
[1] = n
[4].ui
;
12619 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
12622 case OPCODE_PROGRAM_UNIFORM_2D
: {
12623 union float64_pair x
;
12624 union float64_pair y
;
12626 x
.uint32
[0] = n
[3].ui
;
12627 x
.uint32
[1] = n
[4].ui
;
12628 y
.uint32
[0] = n
[5].ui
;
12629 y
.uint32
[1] = n
[6].ui
;
12631 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
12634 case OPCODE_PROGRAM_UNIFORM_3D
: {
12635 union float64_pair x
;
12636 union float64_pair y
;
12637 union float64_pair z
;
12639 x
.uint32
[0] = n
[3].ui
;
12640 x
.uint32
[1] = n
[4].ui
;
12641 y
.uint32
[0] = n
[5].ui
;
12642 y
.uint32
[1] = n
[6].ui
;
12643 z
.uint32
[0] = n
[7].ui
;
12644 z
.uint32
[1] = n
[8].ui
;
12646 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12650 case OPCODE_PROGRAM_UNIFORM_4D
: {
12651 union float64_pair x
;
12652 union float64_pair y
;
12653 union float64_pair z
;
12654 union float64_pair w
;
12656 x
.uint32
[0] = n
[3].ui
;
12657 x
.uint32
[1] = n
[4].ui
;
12658 y
.uint32
[0] = n
[5].ui
;
12659 y
.uint32
[1] = n
[6].ui
;
12660 z
.uint32
[0] = n
[7].ui
;
12661 z
.uint32
[1] = n
[8].ui
;
12662 w
.uint32
[0] = n
[9].ui
;
12663 w
.uint32
[1] = n
[10].ui
;
12665 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12666 x
.d
, y
.d
, z
.d
, w
.d
));
12669 case OPCODE_PROGRAM_UNIFORM_1DV
:
12670 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12671 get_pointer(&n
[4])));
12673 case OPCODE_PROGRAM_UNIFORM_2DV
:
12674 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12675 get_pointer(&n
[4])));
12677 case OPCODE_PROGRAM_UNIFORM_3DV
:
12678 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12679 get_pointer(&n
[4])));
12681 case OPCODE_PROGRAM_UNIFORM_4DV
:
12682 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12683 get_pointer(&n
[4])));
12685 case OPCODE_PROGRAM_UNIFORM_1I
:
12686 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
12688 case OPCODE_PROGRAM_UNIFORM_2I
:
12689 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
12691 case OPCODE_PROGRAM_UNIFORM_3I
:
12692 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12693 n
[3].i
, n
[4].i
, n
[5].i
));
12695 case OPCODE_PROGRAM_UNIFORM_4I
:
12696 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12697 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
12699 case OPCODE_PROGRAM_UNIFORM_1IV
:
12700 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12701 get_pointer(&n
[4])));
12703 case OPCODE_PROGRAM_UNIFORM_2IV
:
12704 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12705 get_pointer(&n
[4])));
12707 case OPCODE_PROGRAM_UNIFORM_3IV
:
12708 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12709 get_pointer(&n
[4])));
12711 case OPCODE_PROGRAM_UNIFORM_4IV
:
12712 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12713 get_pointer(&n
[4])));
12715 case OPCODE_PROGRAM_UNIFORM_1UI
:
12716 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
12718 case OPCODE_PROGRAM_UNIFORM_2UI
:
12719 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12720 n
[3].ui
, n
[4].ui
));
12722 case OPCODE_PROGRAM_UNIFORM_3UI
:
12723 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12724 n
[3].ui
, n
[4].ui
, n
[5].ui
));
12726 case OPCODE_PROGRAM_UNIFORM_4UI
:
12727 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12729 n
[4].ui
, n
[5].ui
, n
[6].ui
));
12731 case OPCODE_PROGRAM_UNIFORM_1UIV
:
12732 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12733 get_pointer(&n
[4])));
12735 case OPCODE_PROGRAM_UNIFORM_2UIV
:
12736 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12737 get_pointer(&n
[4])));
12739 case OPCODE_PROGRAM_UNIFORM_3UIV
:
12740 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12741 get_pointer(&n
[4])));
12743 case OPCODE_PROGRAM_UNIFORM_4UIV
:
12744 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12745 get_pointer(&n
[4])));
12747 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
12748 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
12749 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12750 get_pointer(&n
[5])));
12752 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
12753 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
12754 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12755 get_pointer(&n
[5])));
12757 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
12758 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
12759 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12760 get_pointer(&n
[5])));
12762 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
12763 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
12764 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12765 get_pointer(&n
[5])));
12767 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
12768 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
12769 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12770 get_pointer(&n
[5])));
12772 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
12773 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
12774 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12775 get_pointer(&n
[5])));
12777 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
12778 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
12779 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12780 get_pointer(&n
[5])));
12782 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
12783 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
12784 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12785 get_pointer(&n
[5])));
12787 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
12788 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
12789 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12790 get_pointer(&n
[5])));
12792 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
12793 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
12794 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12795 get_pointer(&n
[5])));
12797 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
12798 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
12799 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12800 get_pointer(&n
[5])));
12802 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
12803 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
12804 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12805 get_pointer(&n
[5])));
12807 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
12808 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
12809 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12810 get_pointer(&n
[5])));
12812 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
12813 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
12814 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12815 get_pointer(&n
[5])));
12817 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
12818 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
12819 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12820 get_pointer(&n
[5])));
12822 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
12823 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
12824 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12825 get_pointer(&n
[5])));
12827 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
12828 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
12829 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12830 get_pointer(&n
[5])));
12832 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
12833 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
12834 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12835 get_pointer(&n
[5])));
12838 case OPCODE_CLIP_CONTROL
:
12839 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12842 case OPCODE_CLAMP_COLOR
:
12843 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12846 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
12847 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
12849 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
12850 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
12852 case OPCODE_ATTR_1F_NV
:
12853 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12855 case OPCODE_ATTR_2F_NV
:
12856 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12858 case OPCODE_ATTR_3F_NV
:
12859 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12861 case OPCODE_ATTR_4F_NV
:
12862 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12864 case OPCODE_ATTR_1F_ARB
:
12865 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12867 case OPCODE_ATTR_2F_ARB
:
12868 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12870 case OPCODE_ATTR_3F_ARB
:
12871 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12873 case OPCODE_ATTR_4F_ARB
:
12874 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12876 case OPCODE_ATTR_1I
:
12877 CALL_VertexAttribI1iEXT(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12879 case OPCODE_ATTR_2I
:
12880 CALL_VertexAttribI2ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12882 case OPCODE_ATTR_3I
:
12883 CALL_VertexAttribI3ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12885 case OPCODE_ATTR_4I
:
12886 CALL_VertexAttribI4ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12888 case OPCODE_ATTR_1D
: {
12889 GLdouble
*d
= (GLdouble
*) &n
[2];
12890 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
12893 case OPCODE_ATTR_2D
: {
12894 GLdouble
*d
= (GLdouble
*) &n
[2];
12895 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
12898 case OPCODE_ATTR_3D
: {
12899 GLdouble
*d
= (GLdouble
*) &n
[2];
12900 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
12903 case OPCODE_ATTR_4D
: {
12904 GLdouble
*d
= (GLdouble
*) &n
[2];
12905 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
12908 case OPCODE_ATTR_1UI64
: {
12909 uint64_t *ui64
= (uint64_t *) &n
[2];
12910 CALL_VertexAttribL1ui64ARB(ctx
->Exec
, (n
[1].ui
, *ui64
));
12913 case OPCODE_MATERIAL
:
12914 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
12917 CALL_Begin(ctx
->Exec
, (n
[1].e
));
12920 CALL_End(ctx
->Exec
, ());
12923 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12925 case OPCODE_EVAL_C1
:
12926 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
12928 case OPCODE_EVAL_C2
:
12929 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12931 case OPCODE_EVAL_P1
:
12932 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
12934 case OPCODE_EVAL_P2
:
12935 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12938 /* GL_EXT_texture_integer */
12939 case OPCODE_CLEARCOLOR_I
:
12940 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12942 case OPCODE_CLEARCOLOR_UI
:
12943 CALL_ClearColorIuiEXT(ctx
->Exec
,
12944 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
12946 case OPCODE_TEXPARAMETER_I
:
12949 params
[0] = n
[3].i
;
12950 params
[1] = n
[4].i
;
12951 params
[2] = n
[5].i
;
12952 params
[3] = n
[6].i
;
12953 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12956 case OPCODE_TEXPARAMETER_UI
:
12959 params
[0] = n
[3].ui
;
12960 params
[1] = n
[4].ui
;
12961 params
[2] = n
[5].ui
;
12962 params
[3] = n
[6].ui
;
12963 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12967 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
12968 /* GL_ARB_instanced_arrays */
12969 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12972 case OPCODE_TEXTURE_BARRIER_NV
:
12973 CALL_TextureBarrierNV(ctx
->Exec
, ());
12976 /* GL_EXT/ARB_transform_feedback */
12977 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
12978 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
12980 case OPCODE_END_TRANSFORM_FEEDBACK
:
12981 CALL_EndTransformFeedback(ctx
->Exec
, ());
12983 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
12984 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12986 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
12987 CALL_PauseTransformFeedback(ctx
->Exec
, ());
12989 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
12990 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
12992 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
12993 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12995 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
12996 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
12997 (n
[1].e
, n
[2].ui
, n
[3].ui
));
12999 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
13000 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
13001 (n
[1].e
, n
[2].ui
, n
[3].si
));
13003 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
13004 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
13005 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
13009 case OPCODE_BIND_SAMPLER
:
13010 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13012 case OPCODE_SAMPLER_PARAMETERIV
:
13015 params
[0] = n
[3].i
;
13016 params
[1] = n
[4].i
;
13017 params
[2] = n
[5].i
;
13018 params
[3] = n
[6].i
;
13019 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13022 case OPCODE_SAMPLER_PARAMETERFV
:
13025 params
[0] = n
[3].f
;
13026 params
[1] = n
[4].f
;
13027 params
[2] = n
[5].f
;
13028 params
[3] = n
[6].f
;
13029 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13032 case OPCODE_SAMPLER_PARAMETERIIV
:
13035 params
[0] = n
[3].i
;
13036 params
[1] = n
[4].i
;
13037 params
[2] = n
[5].i
;
13038 params
[3] = n
[6].i
;
13039 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13042 case OPCODE_SAMPLER_PARAMETERUIV
:
13045 params
[0] = n
[3].ui
;
13046 params
[1] = n
[4].ui
;
13047 params
[2] = n
[5].ui
;
13048 params
[3] = n
[6].ui
;
13049 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13053 /* ARB_compute_shader */
13054 case OPCODE_DISPATCH_COMPUTE
:
13055 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13059 case OPCODE_WAIT_SYNC
:
13061 union uint64_pair p
;
13062 p
.uint32
[0] = n
[2].ui
;
13063 p
.uint32
[1] = n
[3].ui
;
13064 CALL_WaitSync(ctx
->Exec
,
13065 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
13069 /* GL_NV_conditional_render */
13070 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
13071 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
13073 case OPCODE_END_CONDITIONAL_RENDER
:
13074 CALL_EndConditionalRender(ctx
->Exec
, ());
13077 case OPCODE_UNIFORM_BLOCK_BINDING
:
13078 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13081 case OPCODE_UNIFORM_SUBROUTINES
:
13082 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
13083 get_pointer(&n
[3])));
13086 /* GL_EXT_window_rectangles */
13087 case OPCODE_WINDOW_RECTANGLES
:
13088 CALL_WindowRectanglesEXT(
13089 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
13092 /* GL_NV_conservative_raster */
13093 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
13094 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13097 /* GL_NV_conservative_raster_dilate */
13098 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
13099 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
13102 /* GL_NV_conservative_raster_pre_snap_triangles */
13103 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
13104 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
13107 /* GL_EXT_direct_state_access */
13108 case OPCODE_MATRIX_LOAD
:
13109 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13111 case OPCODE_MATRIX_MULT
:
13112 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13114 case OPCODE_MATRIX_ROTATE
:
13115 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
13117 case OPCODE_MATRIX_SCALE
:
13118 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13120 case OPCODE_MATRIX_TRANSLATE
:
13121 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13123 case OPCODE_MATRIX_LOAD_IDENTITY
:
13124 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
13126 case OPCODE_MATRIX_ORTHO
:
13127 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
13128 n
[2].f
, n
[3].f
, n
[4].f
,
13129 n
[5].f
, n
[6].f
, n
[7].f
));
13131 case OPCODE_MATRIX_FRUSTUM
:
13132 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
13133 n
[2].f
, n
[3].f
, n
[4].f
,
13134 n
[5].f
, n
[6].f
, n
[7].f
));
13136 case OPCODE_MATRIX_PUSH
:
13137 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
13139 case OPCODE_MATRIX_POP
:
13140 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
13142 case OPCODE_TEXTUREPARAMETER_F
:
13145 params
[0] = n
[4].f
;
13146 params
[1] = n
[5].f
;
13147 params
[2] = n
[6].f
;
13148 params
[3] = n
[7].f
;
13149 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13152 case OPCODE_TEXTUREPARAMETER_I
:
13155 params
[0] = n
[4].i
;
13156 params
[1] = n
[5].i
;
13157 params
[2] = n
[6].i
;
13158 params
[3] = n
[7].i
;
13159 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13162 case OPCODE_TEXTUREPARAMETER_II
:
13165 params
[0] = n
[4].i
;
13166 params
[1] = n
[5].i
;
13167 params
[2] = n
[6].i
;
13168 params
[3] = n
[7].i
;
13169 CALL_TextureParameterIivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13172 case OPCODE_TEXTUREPARAMETER_IUI
:
13175 params
[0] = n
[4].ui
;
13176 params
[1] = n
[5].ui
;
13177 params
[2] = n
[6].ui
;
13178 params
[3] = n
[7].ui
;
13179 CALL_TextureParameterIuivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13182 case OPCODE_TEXTURE_IMAGE1D
:
13184 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13185 ctx
->Unpack
= ctx
->DefaultPacking
;
13186 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13187 n
[2].e
, /* target */
13188 n
[3].i
, /* level */
13189 n
[4].i
, /* components */
13190 n
[5].i
, /* width */
13191 n
[6].e
, /* border */
13192 n
[7].e
, /* format */
13194 get_pointer(&n
[9])));
13195 ctx
->Unpack
= save
; /* restore */
13198 case OPCODE_TEXTURE_IMAGE2D
:
13200 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13201 ctx
->Unpack
= ctx
->DefaultPacking
;
13202 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13203 n
[2].e
, /* target */
13204 n
[3].i
, /* level */
13205 n
[4].i
, /* components */
13206 n
[5].i
, /* width */
13207 n
[6].i
, /* height */
13208 n
[7].e
, /* border */
13209 n
[8].e
, /* format */
13211 get_pointer(&n
[10])));
13212 ctx
->Unpack
= save
; /* restore */
13215 case OPCODE_TEXTURE_IMAGE3D
:
13217 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13218 ctx
->Unpack
= ctx
->DefaultPacking
;
13219 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13220 n
[2].e
, /* target */
13221 n
[3].i
, /* level */
13222 n
[4].i
, /* components */
13223 n
[5].i
, /* width */
13224 n
[6].i
, /* height */
13225 n
[7].i
, /* depth */
13226 n
[8].e
, /* border */
13227 n
[9].e
, /* format */
13228 n
[10].e
, /* type */
13229 get_pointer(&n
[11])));
13230 ctx
->Unpack
= save
; /* restore */
13233 case OPCODE_TEXTURE_SUB_IMAGE1D
:
13235 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13236 ctx
->Unpack
= ctx
->DefaultPacking
;
13237 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13238 n
[4].i
, n
[5].i
, n
[6].e
,
13239 n
[7].e
, get_pointer(&n
[8])));
13240 ctx
->Unpack
= save
; /* restore */
13243 case OPCODE_TEXTURE_SUB_IMAGE2D
:
13245 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13246 ctx
->Unpack
= ctx
->DefaultPacking
;
13247 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13248 n
[4].i
, n
[5].i
, n
[6].e
,
13249 n
[7].i
, n
[8].e
, n
[9].e
,
13250 get_pointer(&n
[10])));
13251 ctx
->Unpack
= save
;
13254 case OPCODE_TEXTURE_SUB_IMAGE3D
:
13256 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13257 ctx
->Unpack
= ctx
->DefaultPacking
;
13258 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13259 n
[4].i
, n
[5].i
, n
[6].i
,
13260 n
[7].i
, n
[8].i
, n
[9].i
,
13262 get_pointer(&n
[12])));
13263 ctx
->Unpack
= save
; /* restore */
13266 case OPCODE_COPY_TEXTURE_IMAGE1D
:
13267 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13268 n
[4].e
, n
[5].i
, n
[6].i
,
13271 case OPCODE_COPY_TEXTURE_IMAGE2D
:
13272 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13273 n
[4].e
, n
[5].i
, n
[6].i
,
13274 n
[7].i
, n
[8].i
, n
[9].i
));
13276 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
13277 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13278 n
[4].i
, n
[5].i
, n
[6].i
,
13281 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
13282 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13283 n
[4].i
, n
[5].i
, n
[6].i
,
13284 n
[7].i
, n
[8].i
, n
[9].i
));
13286 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
13287 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13288 n
[4].i
, n
[5].i
, n
[6].i
,
13289 n
[7].i
, n
[8].i
, n
[9].i
,
13292 case OPCODE_BIND_MULTITEXTURE
:
13293 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
13295 case OPCODE_MULTITEXPARAMETER_F
:
13298 params
[0] = n
[4].f
;
13299 params
[1] = n
[5].f
;
13300 params
[2] = n
[6].f
;
13301 params
[3] = n
[7].f
;
13302 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13305 case OPCODE_MULTITEXPARAMETER_I
:
13308 params
[0] = n
[4].i
;
13309 params
[1] = n
[5].i
;
13310 params
[2] = n
[6].i
;
13311 params
[3] = n
[7].i
;
13312 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13315 case OPCODE_MULTITEXPARAMETER_II
:
13318 params
[0] = n
[4].i
;
13319 params
[1] = n
[5].i
;
13320 params
[2] = n
[6].i
;
13321 params
[3] = n
[7].i
;
13322 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13325 case OPCODE_MULTITEXPARAMETER_IUI
:
13328 params
[0] = n
[4].ui
;
13329 params
[1] = n
[5].ui
;
13330 params
[2] = n
[6].ui
;
13331 params
[3] = n
[7].ui
;
13332 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13335 case OPCODE_MULTITEX_IMAGE1D
:
13337 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13338 ctx
->Unpack
= ctx
->DefaultPacking
;
13339 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13340 n
[2].e
, /* target */
13341 n
[3].i
, /* level */
13342 n
[4].i
, /* components */
13343 n
[5].i
, /* width */
13344 n
[6].e
, /* border */
13345 n
[7].e
, /* format */
13347 get_pointer(&n
[9])));
13348 ctx
->Unpack
= save
; /* restore */
13351 case OPCODE_MULTITEX_IMAGE2D
:
13353 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13354 ctx
->Unpack
= ctx
->DefaultPacking
;
13355 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13356 n
[2].e
, /* target */
13357 n
[3].i
, /* level */
13358 n
[4].i
, /* components */
13359 n
[5].i
, /* width */
13360 n
[6].i
, /* height */
13361 n
[7].e
, /* border */
13362 n
[8].e
, /* format */
13364 get_pointer(&n
[10])));
13365 ctx
->Unpack
= save
; /* restore */
13368 case OPCODE_MULTITEX_IMAGE3D
:
13370 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13371 ctx
->Unpack
= ctx
->DefaultPacking
;
13372 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13373 n
[2].e
, /* target */
13374 n
[3].i
, /* level */
13375 n
[4].i
, /* components */
13376 n
[5].i
, /* width */
13377 n
[6].i
, /* height */
13378 n
[7].i
, /* depth */
13379 n
[8].e
, /* border */
13380 n
[9].e
, /* format */
13381 n
[10].e
, /* type */
13382 get_pointer(&n
[11])));
13383 ctx
->Unpack
= save
; /* restore */
13386 case OPCODE_MULTITEX_SUB_IMAGE1D
:
13388 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13389 ctx
->Unpack
= ctx
->DefaultPacking
;
13390 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13391 n
[4].i
, n
[5].i
, n
[6].e
,
13392 n
[7].e
, get_pointer(&n
[8])));
13393 ctx
->Unpack
= save
; /* restore */
13396 case OPCODE_MULTITEX_SUB_IMAGE2D
:
13398 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13399 ctx
->Unpack
= ctx
->DefaultPacking
;
13400 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13401 n
[4].i
, n
[5].i
, n
[6].e
,
13402 n
[7].i
, n
[8].e
, n
[9].e
,
13403 get_pointer(&n
[10])));
13404 ctx
->Unpack
= save
; /* restore */
13407 case OPCODE_MULTITEX_SUB_IMAGE3D
:
13409 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13410 ctx
->Unpack
= ctx
->DefaultPacking
;
13411 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13412 n
[4].i
, n
[5].i
, n
[6].i
,
13413 n
[7].i
, n
[8].i
, n
[9].i
,
13415 get_pointer(&n
[12])));
13416 ctx
->Unpack
= save
; /* restore */
13419 case OPCODE_COPY_MULTITEX_IMAGE1D
:
13420 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13421 n
[4].e
, n
[5].i
, n
[6].i
,
13424 case OPCODE_COPY_MULTITEX_IMAGE2D
:
13425 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13426 n
[4].e
, n
[5].i
, n
[6].i
,
13427 n
[7].i
, n
[8].i
, n
[9].i
));
13429 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
13430 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13431 n
[4].i
, n
[5].i
, n
[6].i
,
13434 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
13435 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13436 n
[4].i
, n
[5].i
, n
[6].i
,
13437 n
[7].i
, n
[8].i
, n
[9].i
));
13439 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
13440 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13441 n
[4].i
, n
[5].i
, n
[6].i
,
13442 n
[7].i
, n
[8].i
, n
[9].i
,
13445 case OPCODE_MULTITEXENV
:
13448 params
[0] = n
[4].f
;
13449 params
[1] = n
[5].f
;
13450 params
[2] = n
[6].f
;
13451 params
[3] = n
[7].f
;
13452 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13455 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
13456 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13457 n
[4].e
, n
[5].i
, n
[6].i
,
13458 n
[7].i
, get_pointer(&n
[8])));
13460 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
13461 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13462 n
[4].e
, n
[5].i
, n
[6].i
,
13464 get_pointer(&n
[9])));
13466 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
13467 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13468 n
[4].e
, n
[5].i
, n
[6].i
,
13469 n
[7].i
, n
[8].i
, n
[9].i
,
13470 get_pointer(&n
[10])));
13472 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
13473 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
13474 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13475 n
[5].i
, n
[6].e
, n
[7].i
,
13476 get_pointer(&n
[8])));
13478 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
13479 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
13480 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13481 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13482 n
[9].i
, get_pointer(&n
[10])));
13484 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
13485 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
13486 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13487 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13488 n
[9].i
, n
[10].e
, n
[11].i
,
13489 get_pointer(&n
[12])));
13491 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
13492 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13493 n
[4].e
, n
[5].i
, n
[6].i
,
13494 n
[7].i
, get_pointer(&n
[8])));
13496 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
13497 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13498 n
[4].e
, n
[5].i
, n
[6].i
,
13500 get_pointer(&n
[9])));
13502 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
13503 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13504 n
[4].e
, n
[5].i
, n
[6].i
,
13505 n
[7].i
, n
[8].i
, n
[9].i
,
13506 get_pointer(&n
[10])));
13508 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
13509 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
,
13510 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13511 n
[5].i
, n
[6].e
, n
[7].i
,
13512 get_pointer(&n
[8])));
13514 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
13515 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
13516 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13517 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13518 n
[9].i
, get_pointer(&n
[10])));
13520 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
13521 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
13522 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13523 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13524 n
[9].i
, n
[10].e
, n
[11].i
,
13525 get_pointer(&n
[12])));
13527 case OPCODE_NAMED_PROGRAM_STRING
:
13528 CALL_NamedProgramStringEXT(ctx
->Exec
,
13529 (n
[1].ui
, n
[2].e
, n
[3].e
, n
[4].i
,
13530 get_pointer(&n
[5])));
13532 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
:
13533 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
,
13534 (n
[1].ui
, n
[2].e
, n
[3].ui
, n
[4].f
,
13535 n
[5].f
, n
[6].f
, n
[7].f
));
13538 case OPCODE_CONTINUE
:
13539 n
= (Node
*) get_pointer(&n
[1]);
13544 case OPCODE_END_OF_LIST
:
13550 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
13552 _mesa_problem(ctx
, "%s", msg
);
13557 /* increment n to point to next compiled command */
13558 if (opcode
!= OPCODE_CONTINUE
) {
13559 assert(InstSize
[opcode
] > 0);
13560 n
+= InstSize
[opcode
];
13565 vbo_save_EndCallList(ctx
);
13567 ctx
->ListState
.CallDepth
--;
13572 /**********************************************************************/
13574 /**********************************************************************/
13577 * Test if a display list number is valid.
13579 GLboolean GLAPIENTRY
13580 _mesa_IsList(GLuint list
)
13582 GET_CURRENT_CONTEXT(ctx
);
13583 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13584 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
13585 return islist(ctx
, list
);
13590 * Delete a sequence of consecutive display lists.
13593 _mesa_DeleteLists(GLuint list
, GLsizei range
)
13595 GET_CURRENT_CONTEXT(ctx
);
13597 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13598 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13601 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
13606 /* We may be deleting a set of bitmap lists. See if there's a
13607 * bitmap atlas to free.
13609 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
13611 _mesa_delete_bitmap_atlas(ctx
, atlas
);
13612 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
13616 for (i
= list
; i
< list
+ range
; i
++) {
13617 destroy_list(ctx
, i
);
13623 * Return a display list number, n, such that lists n through n+range-1
13627 _mesa_GenLists(GLsizei range
)
13629 GET_CURRENT_CONTEXT(ctx
);
13631 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13632 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
13635 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
13643 * Make this an atomic operation
13645 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
13647 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
13649 /* reserve the list IDs by with empty/dummy lists */
13651 for (i
= 0; i
< range
; i
++) {
13652 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
13653 make_list(base
+ i
, 1));
13657 if (USE_BITMAP_ATLAS
&&
13659 ctx
->Driver
.DrawAtlasBitmaps
) {
13660 /* "range > 16" is a rough heuristic to guess when glGenLists might be
13661 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
13662 * Create the empty atlas now.
13664 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
13666 atlas
= alloc_bitmap_atlas(ctx
, base
);
13669 /* Atlas _should_ be new/empty now, but clobbering is OK */
13670 assert(atlas
->numBitmaps
== 0);
13671 atlas
->numBitmaps
= range
;
13675 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
13682 * Begin a new display list.
13685 _mesa_NewList(GLuint name
, GLenum mode
)
13687 GET_CURRENT_CONTEXT(ctx
);
13689 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
13690 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13692 if (MESA_VERBOSE
& VERBOSE_API
)
13693 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
13694 _mesa_enum_to_string(mode
));
13697 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
13701 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
13702 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
13706 if (ctx
->ListState
.CurrentList
) {
13707 /* already compiling a display list */
13708 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
13712 ctx
->CompileFlag
= GL_TRUE
;
13713 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
13715 /* Reset accumulated list state */
13716 invalidate_saved_current_state( ctx
);
13718 /* Allocate new display list */
13719 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
13720 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
13721 ctx
->ListState
.CurrentPos
= 0;
13723 vbo_save_NewList(ctx
, name
, mode
);
13725 ctx
->CurrentServerDispatch
= ctx
->Save
;
13726 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13727 if (ctx
->MarshalExec
== NULL
) {
13728 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13734 * End definition of current display list.
13737 _mesa_EndList(void)
13739 GET_CURRENT_CONTEXT(ctx
);
13740 SAVE_FLUSH_VERTICES(ctx
);
13741 FLUSH_VERTICES(ctx
, 0);
13743 if (MESA_VERBOSE
& VERBOSE_API
)
13744 _mesa_debug(ctx
, "glEndList\n");
13746 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
13747 _mesa_error(ctx
, GL_INVALID_OPERATION
,
13748 "glEndList() called inside glBegin/End");
13751 /* Check that a list is under construction */
13752 if (!ctx
->ListState
.CurrentList
) {
13753 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
13757 /* Call before emitting END_OF_LIST, in case the driver wants to
13758 * emit opcodes itself.
13760 vbo_save_EndList(ctx
);
13762 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
13766 /* Destroy old list, if any */
13767 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
13769 /* Install the new list */
13770 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
13771 ctx
->ListState
.CurrentList
->Name
,
13772 ctx
->ListState
.CurrentList
);
13775 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
13776 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
13778 ctx
->ListState
.CurrentList
= NULL
;
13779 ctx
->ListState
.CurrentBlock
= NULL
;
13780 ctx
->ListState
.CurrentPos
= 0;
13781 ctx
->ExecuteFlag
= GL_TRUE
;
13782 ctx
->CompileFlag
= GL_FALSE
;
13784 ctx
->CurrentServerDispatch
= ctx
->Exec
;
13785 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13786 if (ctx
->MarshalExec
== NULL
) {
13787 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13793 _mesa_CallList(GLuint list
)
13795 GLboolean save_compile_flag
;
13796 GET_CURRENT_CONTEXT(ctx
);
13797 FLUSH_CURRENT(ctx
, 0);
13799 if (MESA_VERBOSE
& VERBOSE_API
)
13800 _mesa_debug(ctx
, "glCallList %d\n", list
);
13803 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
13808 mesa_print_display_list( list
);
13810 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
13811 * execute the display list, and restore the CompileFlag.
13813 save_compile_flag
= ctx
->CompileFlag
;
13814 if (save_compile_flag
) {
13815 ctx
->CompileFlag
= GL_FALSE
;
13818 execute_list(ctx
, list
);
13819 ctx
->CompileFlag
= save_compile_flag
;
13821 /* also restore API function pointers to point to "save" versions */
13822 if (save_compile_flag
) {
13823 ctx
->CurrentServerDispatch
= ctx
->Save
;
13824 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13825 if (ctx
->MarshalExec
== NULL
) {
13826 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13833 * Try to execute a glCallLists() command where the display lists contain
13834 * glBitmap commands with a texture atlas.
13835 * \return true for success, false otherwise
13838 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
13841 struct gl_bitmap_atlas
*atlas
;
13844 if (!USE_BITMAP_ATLAS
||
13845 !ctx
->Current
.RasterPosValid
||
13846 ctx
->List
.ListBase
== 0 ||
13847 type
!= GL_UNSIGNED_BYTE
||
13848 !ctx
->Driver
.DrawAtlasBitmaps
) {
13853 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13856 /* Even if glGenLists wasn't called, we can still try to create
13859 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13862 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
13863 /* Try to build the bitmap atlas now.
13864 * If the atlas was created in glGenLists, we'll have recorded the
13865 * number of lists (bitmaps). Otherwise, take a guess at 256.
13867 if (atlas
->numBitmaps
== 0)
13868 atlas
->numBitmaps
= 256;
13869 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
13872 if (!atlas
|| !atlas
->complete
) {
13876 /* check that all display list IDs are in the atlas */
13877 for (i
= 0; i
< n
; i
++) {
13878 const GLubyte
*ids
= (const GLubyte
*) lists
;
13880 if (ids
[i
] >= atlas
->numBitmaps
) {
13885 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
13892 * Execute glCallLists: call multiple display lists.
13895 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
13897 GET_CURRENT_CONTEXT(ctx
);
13899 GLboolean save_compile_flag
;
13901 if (MESA_VERBOSE
& VERBOSE_API
)
13902 _mesa_debug(ctx
, "glCallLists %d\n", n
);
13906 case GL_UNSIGNED_BYTE
:
13908 case GL_UNSIGNED_SHORT
:
13910 case GL_UNSIGNED_INT
:
13918 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
13923 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
13925 } else if (n
== 0 || lists
== NULL
) {
13926 /* nothing to do */
13930 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
13934 /* Save the CompileFlag status, turn it off, execute display list,
13935 * and restore the CompileFlag.
13937 save_compile_flag
= ctx
->CompileFlag
;
13938 ctx
->CompileFlag
= GL_FALSE
;
13940 for (i
= 0; i
< n
; i
++) {
13941 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
13942 execute_list(ctx
, list
);
13945 ctx
->CompileFlag
= save_compile_flag
;
13947 /* also restore API function pointers to point to "save" versions */
13948 if (save_compile_flag
) {
13949 ctx
->CurrentServerDispatch
= ctx
->Save
;
13950 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13951 if (ctx
->MarshalExec
== NULL
) {
13952 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13959 * Set the offset added to list numbers in glCallLists.
13962 _mesa_ListBase(GLuint base
)
13964 GET_CURRENT_CONTEXT(ctx
);
13965 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13966 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13967 ctx
->List
.ListBase
= base
;
13971 * Setup the given dispatch table to point to Mesa's display list
13972 * building functions.
13974 * This does not include any of the tnl functions - they are
13975 * initialized from _mesa_init_api_defaults and from the active vtxfmt
13979 _mesa_initialize_save_table(const struct gl_context
*ctx
)
13981 struct _glapi_table
*table
= ctx
->Save
;
13982 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
13984 /* Initially populate the dispatch table with the contents of the
13985 * normal-execution dispatch table. This lets us skip populating functions
13986 * that should be called directly instead of compiled into display lists.
13988 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
13990 _mesa_loopback_init_api_table(ctx
, table
);
13992 /* VBO functions */
13993 vbo_initialize_save_dispatch(ctx
, table
);
13996 SET_Accum(table
, save_Accum
);
13997 SET_AlphaFunc(table
, save_AlphaFunc
);
13998 SET_Bitmap(table
, save_Bitmap
);
13999 SET_BlendFunc(table
, save_BlendFunc
);
14000 SET_CallList(table
, save_CallList
);
14001 SET_CallLists(table
, save_CallLists
);
14002 SET_Clear(table
, save_Clear
);
14003 SET_ClearAccum(table
, save_ClearAccum
);
14004 SET_ClearColor(table
, save_ClearColor
);
14005 SET_ClearDepth(table
, save_ClearDepth
);
14006 SET_ClearIndex(table
, save_ClearIndex
);
14007 SET_ClearStencil(table
, save_ClearStencil
);
14008 SET_ClipPlane(table
, save_ClipPlane
);
14009 SET_ColorMask(table
, save_ColorMask
);
14010 SET_ColorMaski(table
, save_ColorMaskIndexed
);
14011 SET_ColorMaterial(table
, save_ColorMaterial
);
14012 SET_CopyPixels(table
, save_CopyPixels
);
14013 SET_CullFace(table
, save_CullFace
);
14014 SET_DepthFunc(table
, save_DepthFunc
);
14015 SET_DepthMask(table
, save_DepthMask
);
14016 SET_DepthRange(table
, save_DepthRange
);
14017 SET_Disable(table
, save_Disable
);
14018 SET_Disablei(table
, save_DisableIndexed
);
14019 SET_DrawBuffer(table
, save_DrawBuffer
);
14020 SET_DrawPixels(table
, save_DrawPixels
);
14021 SET_Enable(table
, save_Enable
);
14022 SET_Enablei(table
, save_EnableIndexed
);
14023 SET_EvalMesh1(table
, save_EvalMesh1
);
14024 SET_EvalMesh2(table
, save_EvalMesh2
);
14025 SET_Fogf(table
, save_Fogf
);
14026 SET_Fogfv(table
, save_Fogfv
);
14027 SET_Fogi(table
, save_Fogi
);
14028 SET_Fogiv(table
, save_Fogiv
);
14029 SET_FrontFace(table
, save_FrontFace
);
14030 SET_Frustum(table
, save_Frustum
);
14031 SET_Hint(table
, save_Hint
);
14032 SET_IndexMask(table
, save_IndexMask
);
14033 SET_InitNames(table
, save_InitNames
);
14034 SET_LightModelf(table
, save_LightModelf
);
14035 SET_LightModelfv(table
, save_LightModelfv
);
14036 SET_LightModeli(table
, save_LightModeli
);
14037 SET_LightModeliv(table
, save_LightModeliv
);
14038 SET_Lightf(table
, save_Lightf
);
14039 SET_Lightfv(table
, save_Lightfv
);
14040 SET_Lighti(table
, save_Lighti
);
14041 SET_Lightiv(table
, save_Lightiv
);
14042 SET_LineStipple(table
, save_LineStipple
);
14043 SET_LineWidth(table
, save_LineWidth
);
14044 SET_ListBase(table
, save_ListBase
);
14045 SET_LoadIdentity(table
, save_LoadIdentity
);
14046 SET_LoadMatrixd(table
, save_LoadMatrixd
);
14047 SET_LoadMatrixf(table
, save_LoadMatrixf
);
14048 SET_LoadName(table
, save_LoadName
);
14049 SET_LogicOp(table
, save_LogicOp
);
14050 SET_Map1d(table
, save_Map1d
);
14051 SET_Map1f(table
, save_Map1f
);
14052 SET_Map2d(table
, save_Map2d
);
14053 SET_Map2f(table
, save_Map2f
);
14054 SET_MapGrid1d(table
, save_MapGrid1d
);
14055 SET_MapGrid1f(table
, save_MapGrid1f
);
14056 SET_MapGrid2d(table
, save_MapGrid2d
);
14057 SET_MapGrid2f(table
, save_MapGrid2f
);
14058 SET_MatrixMode(table
, save_MatrixMode
);
14059 SET_MultMatrixd(table
, save_MultMatrixd
);
14060 SET_MultMatrixf(table
, save_MultMatrixf
);
14061 SET_NewList(table
, save_NewList
);
14062 SET_Ortho(table
, save_Ortho
);
14063 SET_PassThrough(table
, save_PassThrough
);
14064 SET_PixelMapfv(table
, save_PixelMapfv
);
14065 SET_PixelMapuiv(table
, save_PixelMapuiv
);
14066 SET_PixelMapusv(table
, save_PixelMapusv
);
14067 SET_PixelTransferf(table
, save_PixelTransferf
);
14068 SET_PixelTransferi(table
, save_PixelTransferi
);
14069 SET_PixelZoom(table
, save_PixelZoom
);
14070 SET_PointSize(table
, save_PointSize
);
14071 SET_PolygonMode(table
, save_PolygonMode
);
14072 SET_PolygonOffset(table
, save_PolygonOffset
);
14073 SET_PolygonStipple(table
, save_PolygonStipple
);
14074 SET_PopAttrib(table
, save_PopAttrib
);
14075 SET_PopMatrix(table
, save_PopMatrix
);
14076 SET_PopName(table
, save_PopName
);
14077 SET_PushAttrib(table
, save_PushAttrib
);
14078 SET_PushMatrix(table
, save_PushMatrix
);
14079 SET_PushName(table
, save_PushName
);
14080 SET_RasterPos2d(table
, save_RasterPos2d
);
14081 SET_RasterPos2dv(table
, save_RasterPos2dv
);
14082 SET_RasterPos2f(table
, save_RasterPos2f
);
14083 SET_RasterPos2fv(table
, save_RasterPos2fv
);
14084 SET_RasterPos2i(table
, save_RasterPos2i
);
14085 SET_RasterPos2iv(table
, save_RasterPos2iv
);
14086 SET_RasterPos2s(table
, save_RasterPos2s
);
14087 SET_RasterPos2sv(table
, save_RasterPos2sv
);
14088 SET_RasterPos3d(table
, save_RasterPos3d
);
14089 SET_RasterPos3dv(table
, save_RasterPos3dv
);
14090 SET_RasterPos3f(table
, save_RasterPos3f
);
14091 SET_RasterPos3fv(table
, save_RasterPos3fv
);
14092 SET_RasterPos3i(table
, save_RasterPos3i
);
14093 SET_RasterPos3iv(table
, save_RasterPos3iv
);
14094 SET_RasterPos3s(table
, save_RasterPos3s
);
14095 SET_RasterPos3sv(table
, save_RasterPos3sv
);
14096 SET_RasterPos4d(table
, save_RasterPos4d
);
14097 SET_RasterPos4dv(table
, save_RasterPos4dv
);
14098 SET_RasterPos4f(table
, save_RasterPos4f
);
14099 SET_RasterPos4fv(table
, save_RasterPos4fv
);
14100 SET_RasterPos4i(table
, save_RasterPos4i
);
14101 SET_RasterPos4iv(table
, save_RasterPos4iv
);
14102 SET_RasterPos4s(table
, save_RasterPos4s
);
14103 SET_RasterPos4sv(table
, save_RasterPos4sv
);
14104 SET_ReadBuffer(table
, save_ReadBuffer
);
14105 SET_Rectf(table
, save_Rectf
);
14106 SET_Rotated(table
, save_Rotated
);
14107 SET_Rotatef(table
, save_Rotatef
);
14108 SET_Scaled(table
, save_Scaled
);
14109 SET_Scalef(table
, save_Scalef
);
14110 SET_Scissor(table
, save_Scissor
);
14111 SET_ShadeModel(table
, save_ShadeModel
);
14112 SET_StencilFunc(table
, save_StencilFunc
);
14113 SET_StencilMask(table
, save_StencilMask
);
14114 SET_StencilOp(table
, save_StencilOp
);
14115 SET_TexEnvf(table
, save_TexEnvf
);
14116 SET_TexEnvfv(table
, save_TexEnvfv
);
14117 SET_TexEnvi(table
, save_TexEnvi
);
14118 SET_TexEnviv(table
, save_TexEnviv
);
14119 SET_TexGend(table
, save_TexGend
);
14120 SET_TexGendv(table
, save_TexGendv
);
14121 SET_TexGenf(table
, save_TexGenf
);
14122 SET_TexGenfv(table
, save_TexGenfv
);
14123 SET_TexGeni(table
, save_TexGeni
);
14124 SET_TexGeniv(table
, save_TexGeniv
);
14125 SET_TexImage1D(table
, save_TexImage1D
);
14126 SET_TexImage2D(table
, save_TexImage2D
);
14127 SET_TexParameterf(table
, save_TexParameterf
);
14128 SET_TexParameterfv(table
, save_TexParameterfv
);
14129 SET_TexParameteri(table
, save_TexParameteri
);
14130 SET_TexParameteriv(table
, save_TexParameteriv
);
14131 SET_Translated(table
, save_Translated
);
14132 SET_Translatef(table
, save_Translatef
);
14133 SET_Viewport(table
, save_Viewport
);
14136 SET_BindTexture(table
, save_BindTexture
);
14137 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
14138 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
14139 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
14140 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
14141 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
14142 SET_TexSubImage1D(table
, save_TexSubImage1D
);
14143 SET_TexSubImage2D(table
, save_TexSubImage2D
);
14146 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
14147 SET_TexImage3D(table
, save_TexImage3D
);
14148 SET_TexSubImage3D(table
, save_TexSubImage3D
);
14151 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
14152 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
14153 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
14155 /* ATI_separate_stencil */
14156 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
14158 /* GL_ARB_imaging */
14159 /* Not all are supported */
14160 SET_BlendColor(table
, save_BlendColor
);
14161 SET_BlendEquation(table
, save_BlendEquation
);
14163 /* 2. GL_EXT_blend_color */
14165 SET_BlendColorEXT(table
, save_BlendColorEXT
);
14168 /* 6. GL_EXT_texture3d */
14170 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
14171 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
14172 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
14175 /* 37. GL_EXT_blend_minmax */
14177 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
14180 /* 54. GL_EXT_point_parameters */
14181 SET_PointParameterf(table
, save_PointParameterfEXT
);
14182 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
14184 /* 91. GL_ARB_tessellation_shader */
14185 SET_PatchParameteri(table
, save_PatchParameteri
);
14186 SET_PatchParameterfv(table
, save_PatchParameterfv
);
14188 /* 100. ARB_viewport_array */
14189 SET_ViewportArrayv(table
, save_ViewportArrayv
);
14190 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
14191 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
14192 SET_ScissorArrayv(table
, save_ScissorArrayv
);
14193 SET_ScissorIndexed(table
, save_ScissorIndexed
);
14194 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
14195 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
14196 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
14198 /* 122. ARB_compute_shader */
14199 SET_DispatchCompute(table
, save_DispatchCompute
);
14200 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
14202 /* 173. GL_EXT_blend_func_separate */
14203 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
14205 /* 197. GL_MESA_window_pos */
14206 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
14207 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
14208 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
14209 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
14210 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
14211 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
14212 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
14213 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
14214 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
14215 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
14216 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
14217 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
14218 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
14219 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
14220 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
14221 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
14222 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
14223 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
14224 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
14225 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
14226 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
14227 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
14228 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
14229 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
14231 /* 245. GL_ATI_fragment_shader */
14232 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
14233 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
14235 /* 262. GL_NV_point_sprite */
14236 SET_PointParameteri(table
, save_PointParameteriNV
);
14237 SET_PointParameteriv(table
, save_PointParameterivNV
);
14239 /* 268. GL_EXT_stencil_two_side */
14240 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
14242 /* ???. GL_EXT_depth_bounds_test */
14243 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
14245 /* ARB 1. GL_ARB_multitexture */
14246 SET_ActiveTexture(table
, save_ActiveTextureARB
);
14248 /* ARB 3. GL_ARB_transpose_matrix */
14249 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
14250 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
14251 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
14252 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
14254 /* ARB 5. GL_ARB_multisample */
14255 SET_SampleCoverage(table
, save_SampleCoverageARB
);
14257 /* ARB 12. GL_ARB_texture_compression */
14258 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
14259 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
14260 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
14261 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
14262 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
14263 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
14265 /* ARB 14. GL_ARB_point_parameters */
14266 /* aliased with EXT_point_parameters functions */
14268 /* ARB 25. GL_ARB_window_pos */
14269 /* aliased with MESA_window_pos functions */
14271 /* ARB 26. GL_ARB_vertex_program */
14272 /* ARB 27. GL_ARB_fragment_program */
14273 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
14274 SET_ProgramStringARB(table
, save_ProgramStringARB
);
14275 SET_BindProgramARB(table
, save_BindProgramARB
);
14276 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
14277 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
14278 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
14279 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
14280 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
14281 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
14282 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
14283 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
14285 SET_BeginQuery(table
, save_BeginQueryARB
);
14286 SET_EndQuery(table
, save_EndQueryARB
);
14287 SET_QueryCounter(table
, save_QueryCounter
);
14289 SET_DrawBuffers(table
, save_DrawBuffersARB
);
14291 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
14293 SET_UseProgram(table
, save_UseProgram
);
14294 SET_Uniform1f(table
, save_Uniform1fARB
);
14295 SET_Uniform2f(table
, save_Uniform2fARB
);
14296 SET_Uniform3f(table
, save_Uniform3fARB
);
14297 SET_Uniform4f(table
, save_Uniform4fARB
);
14298 SET_Uniform1fv(table
, save_Uniform1fvARB
);
14299 SET_Uniform2fv(table
, save_Uniform2fvARB
);
14300 SET_Uniform3fv(table
, save_Uniform3fvARB
);
14301 SET_Uniform4fv(table
, save_Uniform4fvARB
);
14302 SET_Uniform1i(table
, save_Uniform1iARB
);
14303 SET_Uniform2i(table
, save_Uniform2iARB
);
14304 SET_Uniform3i(table
, save_Uniform3iARB
);
14305 SET_Uniform4i(table
, save_Uniform4iARB
);
14306 SET_Uniform1iv(table
, save_Uniform1ivARB
);
14307 SET_Uniform2iv(table
, save_Uniform2ivARB
);
14308 SET_Uniform3iv(table
, save_Uniform3ivARB
);
14309 SET_Uniform4iv(table
, save_Uniform4ivARB
);
14310 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
14311 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
14312 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
14313 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
14314 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
14315 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
14316 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
14317 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
14318 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
14320 /* 299. GL_EXT_blend_equation_separate */
14321 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
14323 /* GL_EXT_gpu_program_parameters */
14324 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
14325 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
14327 /* 364. GL_EXT_provoking_vertex */
14328 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
14330 /* GL_EXT_texture_integer */
14331 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
14332 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
14333 SET_TexParameterIiv(table
, save_TexParameterIiv
);
14334 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
14336 /* GL_ARB_clip_control */
14337 SET_ClipControl(table
, save_ClipControl
);
14339 /* GL_ARB_color_buffer_float */
14340 SET_ClampColor(table
, save_ClampColorARB
);
14343 SET_ClearBufferiv(table
, save_ClearBufferiv
);
14344 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
14345 SET_ClearBufferfv(table
, save_ClearBufferfv
);
14346 SET_ClearBufferfi(table
, save_ClearBufferfi
);
14347 SET_Uniform1ui(table
, save_Uniform1ui
);
14348 SET_Uniform2ui(table
, save_Uniform2ui
);
14349 SET_Uniform3ui(table
, save_Uniform3ui
);
14350 SET_Uniform4ui(table
, save_Uniform4ui
);
14351 SET_Uniform1uiv(table
, save_Uniform1uiv
);
14352 SET_Uniform2uiv(table
, save_Uniform2uiv
);
14353 SET_Uniform3uiv(table
, save_Uniform3uiv
);
14354 SET_Uniform4uiv(table
, save_Uniform4uiv
);
14356 /* GL_ARB_gpu_shader_fp64 */
14357 SET_Uniform1d(table
, save_Uniform1d
);
14358 SET_Uniform2d(table
, save_Uniform2d
);
14359 SET_Uniform3d(table
, save_Uniform3d
);
14360 SET_Uniform4d(table
, save_Uniform4d
);
14361 SET_Uniform1dv(table
, save_Uniform1dv
);
14362 SET_Uniform2dv(table
, save_Uniform2dv
);
14363 SET_Uniform3dv(table
, save_Uniform3dv
);
14364 SET_Uniform4dv(table
, save_Uniform4dv
);
14365 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
14366 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
14367 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
14368 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
14369 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
14370 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
14371 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
14372 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
14373 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
14375 /* GL_ARB_gpu_shader_int64 */
14376 SET_Uniform1i64ARB(table
, save_Uniform1i64ARB
);
14377 SET_Uniform2i64ARB(table
, save_Uniform2i64ARB
);
14378 SET_Uniform3i64ARB(table
, save_Uniform3i64ARB
);
14379 SET_Uniform4i64ARB(table
, save_Uniform4i64ARB
);
14380 SET_Uniform1i64vARB(table
, save_Uniform1i64vARB
);
14381 SET_Uniform2i64vARB(table
, save_Uniform2i64vARB
);
14382 SET_Uniform3i64vARB(table
, save_Uniform3i64vARB
);
14383 SET_Uniform4i64vARB(table
, save_Uniform4i64vARB
);
14384 SET_Uniform1ui64ARB(table
, save_Uniform1ui64ARB
);
14385 SET_Uniform2ui64ARB(table
, save_Uniform2ui64ARB
);
14386 SET_Uniform3ui64ARB(table
, save_Uniform3ui64ARB
);
14387 SET_Uniform4ui64ARB(table
, save_Uniform4ui64ARB
);
14388 SET_Uniform1ui64vARB(table
, save_Uniform1ui64vARB
);
14389 SET_Uniform2ui64vARB(table
, save_Uniform2ui64vARB
);
14390 SET_Uniform3ui64vARB(table
, save_Uniform3ui64vARB
);
14391 SET_Uniform4ui64vARB(table
, save_Uniform4ui64vARB
);
14393 SET_ProgramUniform1i64ARB(table
, save_ProgramUniform1i64ARB
);
14394 SET_ProgramUniform2i64ARB(table
, save_ProgramUniform2i64ARB
);
14395 SET_ProgramUniform3i64ARB(table
, save_ProgramUniform3i64ARB
);
14396 SET_ProgramUniform4i64ARB(table
, save_ProgramUniform4i64ARB
);
14397 SET_ProgramUniform1i64vARB(table
, save_ProgramUniform1i64vARB
);
14398 SET_ProgramUniform2i64vARB(table
, save_ProgramUniform2i64vARB
);
14399 SET_ProgramUniform3i64vARB(table
, save_ProgramUniform3i64vARB
);
14400 SET_ProgramUniform4i64vARB(table
, save_ProgramUniform4i64vARB
);
14401 SET_ProgramUniform1ui64ARB(table
, save_ProgramUniform1ui64ARB
);
14402 SET_ProgramUniform2ui64ARB(table
, save_ProgramUniform2ui64ARB
);
14403 SET_ProgramUniform3ui64ARB(table
, save_ProgramUniform3ui64ARB
);
14404 SET_ProgramUniform4ui64ARB(table
, save_ProgramUniform4ui64ARB
);
14405 SET_ProgramUniform1ui64vARB(table
, save_ProgramUniform1ui64vARB
);
14406 SET_ProgramUniform2ui64vARB(table
, save_ProgramUniform2ui64vARB
);
14407 SET_ProgramUniform3ui64vARB(table
, save_ProgramUniform3ui64vARB
);
14408 SET_ProgramUniform4ui64vARB(table
, save_ProgramUniform4ui64vARB
);
14411 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
14412 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
14413 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
14414 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
14415 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
14416 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
14417 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
14418 SET_DrawTransformFeedbackInstanced(table
,
14419 save_DrawTransformFeedbackInstanced
);
14420 SET_DrawTransformFeedbackStreamInstanced(table
,
14421 save_DrawTransformFeedbackStreamInstanced
);
14422 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
14423 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
14425 /* GL_ARB_instanced_arrays */
14426 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
14428 /* GL_NV_texture_barrier */
14429 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
14431 SET_BindSampler(table
, save_BindSampler
);
14432 SET_SamplerParameteri(table
, save_SamplerParameteri
);
14433 SET_SamplerParameterf(table
, save_SamplerParameterf
);
14434 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
14435 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
14436 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
14437 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
14439 /* GL_ARB_draw_buffer_blend */
14440 SET_BlendFunciARB(table
, save_BlendFunci
);
14441 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
14442 SET_BlendEquationiARB(table
, save_BlendEquationi
);
14443 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
14445 /* GL_NV_conditional_render */
14446 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
14447 SET_EndConditionalRender(table
, save_EndConditionalRender
);
14450 SET_WaitSync(table
, save_WaitSync
);
14452 /* GL_ARB_uniform_buffer_object */
14453 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
14455 /* GL_ARB_shader_subroutines */
14456 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
14458 /* GL_ARB_draw_instanced */
14459 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
14460 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
14462 /* GL_ARB_draw_elements_base_vertex */
14463 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
14465 /* GL_ARB_base_instance */
14466 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
14467 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
14468 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
14470 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
14471 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
14472 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
14473 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
14474 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
14476 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
14477 SET_UseProgramStages(table
, save_UseProgramStages
);
14478 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
14479 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
14480 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
14481 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
14482 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
14483 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
14484 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
14485 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
14486 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
14487 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
14488 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
14489 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
14490 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
14491 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
14492 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
14493 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
14494 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
14495 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
14496 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
14497 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
14498 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
14499 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
14500 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
14501 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
14502 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
14503 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
14504 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
14505 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
14506 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
14507 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
14508 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
14509 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
14510 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
14511 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
14512 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
14513 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
14514 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
14515 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
14516 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
14517 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
14518 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
14519 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
14520 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
14521 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
14522 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
14523 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
14524 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
14525 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
14526 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
14527 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
14529 /* GL_{ARB,EXT}_polygon_offset_clamp */
14530 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
14532 /* GL_EXT_window_rectangles */
14533 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
14535 /* GL_NV_conservative_raster */
14536 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
14538 /* GL_NV_conservative_raster_dilate */
14539 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
14541 /* GL_NV_conservative_raster_pre_snap_triangles */
14542 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
14544 /* GL_EXT_direct_state_access */
14545 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
14546 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
14547 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
14548 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
14549 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
14550 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
14551 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
14552 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
14553 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
14554 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
14555 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
14556 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
14557 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
14558 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
14559 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
14560 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
14561 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
14562 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
14563 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
14564 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
14565 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
14566 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
14567 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
14568 SET_TextureParameterIivEXT(table
, save_TextureParameterIivEXT
);
14569 SET_TextureParameterIuivEXT(table
, save_TextureParameterIuivEXT
);
14570 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
14571 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
14572 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
14573 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
14574 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
14575 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
14576 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
14577 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
14578 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
14579 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
14580 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
14581 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
14582 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
14583 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
14584 SET_MultiTexParameterIivEXT(table
, save_MultiTexParameterIivEXT
);
14585 SET_MultiTexParameterIuivEXT(table
, save_MultiTexParameterIuivEXT
);
14586 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
14587 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
14588 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
14589 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
14590 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
14591 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
14592 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
14593 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
14594 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
14595 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
14596 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
14597 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
14598 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
14599 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
14600 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
14601 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
14602 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
14603 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
14604 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
14605 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
14606 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
14607 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
14608 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
14609 SET_CompressedMultiTexImage1DEXT(table
, save_CompressedMultiTexImage1DEXT
);
14610 SET_CompressedMultiTexImage2DEXT(table
, save_CompressedMultiTexImage2DEXT
);
14611 SET_CompressedMultiTexImage3DEXT(table
, save_CompressedMultiTexImage3DEXT
);
14612 SET_CompressedMultiTexSubImage1DEXT(table
, save_CompressedMultiTexSubImage1DEXT
);
14613 SET_CompressedMultiTexSubImage2DEXT(table
, save_CompressedMultiTexSubImage2DEXT
);
14614 SET_CompressedMultiTexSubImage3DEXT(table
, save_CompressedMultiTexSubImage3DEXT
);
14615 SET_NamedProgramStringEXT(table
, save_NamedProgramStringEXT
);
14616 SET_NamedProgramLocalParameter4dEXT(table
, save_NamedProgramLocalParameter4dEXT
);
14617 SET_NamedProgramLocalParameter4dvEXT(table
, save_NamedProgramLocalParameter4dvEXT
);
14618 SET_NamedProgramLocalParameter4fEXT(table
, save_NamedProgramLocalParameter4fEXT
);
14619 SET_NamedProgramLocalParameter4fvEXT(table
, save_NamedProgramLocalParameter4fvEXT
);
14624 static const char *
14625 enum_string(GLenum k
)
14627 return _mesa_enum_to_string(k
);
14632 * Print the commands in a display list. For debugging only.
14633 * TODO: many commands aren't handled yet.
14634 * \param fname filename to write display list to. If null, use stdout.
14636 static void GLAPIENTRY
14637 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
14639 struct gl_display_list
*dlist
;
14645 f
= fopen(fname
, "w");
14650 if (!islist(ctx
, list
)) {
14651 fprintf(f
, "%u is not a display list ID\n", list
);
14655 dlist
= _mesa_lookup_list(ctx
, list
);
14662 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
14664 done
= n
? GL_FALSE
: GL_TRUE
;
14666 const OpCode opcode
= n
[0].opcode
;
14668 if (is_ext_opcode(opcode
)) {
14669 n
+= ext_opcode_print(ctx
, n
, f
);
14674 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
14676 case OPCODE_ACTIVE_TEXTURE
:
14677 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
14679 case OPCODE_BITMAP
:
14680 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
14681 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
14682 get_pointer(&n
[7]));
14684 case OPCODE_BLEND_COLOR
:
14685 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
14686 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14688 case OPCODE_BLEND_EQUATION
:
14689 fprintf(f
, "BlendEquation %s\n",
14690 enum_string(n
[1].e
));
14692 case OPCODE_BLEND_EQUATION_SEPARATE
:
14693 fprintf(f
, "BlendEquationSeparate %s, %s\n",
14694 enum_string(n
[1].e
),
14695 enum_string(n
[2].e
));
14697 case OPCODE_BLEND_FUNC_SEPARATE
:
14698 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
14699 enum_string(n
[1].e
),
14700 enum_string(n
[2].e
),
14701 enum_string(n
[3].e
),
14702 enum_string(n
[4].e
));
14704 case OPCODE_BLEND_EQUATION_I
:
14705 fprintf(f
, "BlendEquationi %u, %s\n",
14706 n
[1].ui
, enum_string(n
[2].e
));
14708 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
14709 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
14710 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14712 case OPCODE_BLEND_FUNC_I
:
14713 fprintf(f
, "BlendFunci %u, %s, %s\n",
14714 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14716 case OPCODE_BLEND_FUNC_SEPARATE_I
:
14717 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
14719 enum_string(n
[2].e
),
14720 enum_string(n
[3].e
),
14721 enum_string(n
[4].e
),
14722 enum_string(n
[5].e
));
14724 case OPCODE_CALL_LIST
:
14725 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
14727 case OPCODE_CALL_LISTS
:
14728 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
14730 case OPCODE_DISABLE
:
14731 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
14733 case OPCODE_ENABLE
:
14734 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
14736 case OPCODE_FRUSTUM
:
14737 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
14738 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14740 case OPCODE_LINE_STIPPLE
:
14741 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
14743 case OPCODE_LINE_WIDTH
:
14744 fprintf(f
, "LineWidth %f\n", n
[1].f
);
14746 case OPCODE_LOAD_IDENTITY
:
14747 fprintf(f
, "LoadIdentity\n");
14749 case OPCODE_LOAD_MATRIX
:
14750 fprintf(f
, "LoadMatrix\n");
14751 fprintf(f
, " %8f %8f %8f %8f\n",
14752 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14753 fprintf(f
, " %8f %8f %8f %8f\n",
14754 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14755 fprintf(f
, " %8f %8f %8f %8f\n",
14756 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14757 fprintf(f
, " %8f %8f %8f %8f\n",
14758 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14760 case OPCODE_MULT_MATRIX
:
14761 fprintf(f
, "MultMatrix (or Rotate)\n");
14762 fprintf(f
, " %8f %8f %8f %8f\n",
14763 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14764 fprintf(f
, " %8f %8f %8f %8f\n",
14765 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14766 fprintf(f
, " %8f %8f %8f %8f\n",
14767 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14768 fprintf(f
, " %8f %8f %8f %8f\n",
14769 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14772 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
14773 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14775 case OPCODE_POINT_SIZE
:
14776 fprintf(f
, "PointSize %f\n", n
[1].f
);
14778 case OPCODE_POP_ATTRIB
:
14779 fprintf(f
, "PopAttrib\n");
14781 case OPCODE_POP_MATRIX
:
14782 fprintf(f
, "PopMatrix\n");
14784 case OPCODE_POP_NAME
:
14785 fprintf(f
, "PopName\n");
14787 case OPCODE_PUSH_ATTRIB
:
14788 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
14790 case OPCODE_PUSH_MATRIX
:
14791 fprintf(f
, "PushMatrix\n");
14793 case OPCODE_PUSH_NAME
:
14794 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
14796 case OPCODE_RASTER_POS
:
14797 fprintf(f
, "RasterPos %g %g %g %g\n",
14798 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14800 case OPCODE_ROTATE
:
14801 fprintf(f
, "Rotate %g %g %g %g\n",
14802 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14805 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14807 case OPCODE_TRANSLATE
:
14808 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14810 case OPCODE_BIND_TEXTURE
:
14811 fprintf(f
, "BindTexture %s %d\n",
14812 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
14814 case OPCODE_SHADE_MODEL
:
14815 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
14818 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
14819 _mesa_enum_to_string(n
[1].ui
),
14820 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
14823 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
14824 _mesa_enum_to_string(n
[1].ui
),
14825 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
14826 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
14828 case OPCODE_MAPGRID1
:
14829 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
14831 case OPCODE_MAPGRID2
:
14832 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
14833 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
14835 case OPCODE_EVALMESH1
:
14836 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
14838 case OPCODE_EVALMESH2
:
14839 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
14840 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
14843 case OPCODE_ATTR_1F_NV
:
14844 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
14846 case OPCODE_ATTR_2F_NV
:
14847 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
14848 n
[1].i
, n
[2].f
, n
[3].f
);
14850 case OPCODE_ATTR_3F_NV
:
14851 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
14852 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14854 case OPCODE_ATTR_4F_NV
:
14855 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
14856 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14858 case OPCODE_ATTR_1F_ARB
:
14859 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
14861 case OPCODE_ATTR_2F_ARB
:
14862 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
14863 n
[1].i
, n
[2].f
, n
[3].f
);
14865 case OPCODE_ATTR_3F_ARB
:
14866 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
14867 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14869 case OPCODE_ATTR_4F_ARB
:
14870 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
14871 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14874 case OPCODE_MATERIAL
:
14875 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
14876 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14879 fprintf(f
, "BEGIN %x\n", n
[1].i
);
14882 fprintf(f
, "END\n");
14885 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
14888 case OPCODE_EVAL_C1
:
14889 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
14891 case OPCODE_EVAL_C2
:
14892 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
14894 case OPCODE_EVAL_P1
:
14895 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
14897 case OPCODE_EVAL_P2
:
14898 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
14901 case OPCODE_PROVOKING_VERTEX
:
14902 fprintf(f
, "ProvokingVertex %s\n",
14903 _mesa_enum_to_string(n
[1].ui
));
14907 * meta opcodes/commands
14910 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
14911 (const char *) get_pointer(&n
[2]));
14913 case OPCODE_CONTINUE
:
14914 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
14915 n
= (Node
*) get_pointer(&n
[1]);
14918 fprintf(f
, "NOP\n");
14920 case OPCODE_END_OF_LIST
:
14921 fprintf(f
, "END-LIST %u\n", list
);
14925 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
14927 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
14928 opcode
, (void *) n
);
14932 fprintf(f
, "command %d, %u operands\n", opcode
,
14936 /* increment n to point to next compiled command */
14937 if (opcode
!= OPCODE_CONTINUE
) {
14938 assert(InstSize
[opcode
] > 0);
14939 n
+= InstSize
[opcode
];
14953 * Clients may call this function to help debug display list problems.
14954 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14955 * changed, or break in the future without notice.
14958 mesa_print_display_list(GLuint list
)
14960 GET_CURRENT_CONTEXT(ctx
);
14961 print_list(ctx
, list
, NULL
);
14965 /**********************************************************************/
14966 /***** Initialization *****/
14967 /**********************************************************************/
14970 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
14971 const GLvertexformat
*vfmt
)
14973 SET_CallList(disp
, vfmt
->CallList
);
14974 SET_CallLists(disp
, vfmt
->CallLists
);
14979 * Initialize display list state for given context.
14982 _mesa_init_display_list(struct gl_context
*ctx
)
14984 static GLboolean tableInitialized
= GL_FALSE
;
14985 GLvertexformat
*vfmt
= &ctx
->ListState
.ListVtxfmt
;
14987 /* zero-out the instruction size table, just once */
14988 if (!tableInitialized
) {
14989 memset(InstSize
, 0, sizeof(InstSize
));
14990 tableInitialized
= GL_TRUE
;
14993 /* extension info */
14994 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
14997 ctx
->ListState
.CallDepth
= 0;
14998 ctx
->ExecuteFlag
= GL_TRUE
;
14999 ctx
->CompileFlag
= GL_FALSE
;
15000 ctx
->ListState
.CurrentBlock
= NULL
;
15001 ctx
->ListState
.CurrentPos
= 0;
15003 /* Display List group */
15004 ctx
->List
.ListBase
= 0;
15006 InstSize
[OPCODE_NOP
] = 1;
15008 #define NAME_AE(x) _ae_##x
15009 #define NAME_CALLLIST(x) save_##x
15010 #define NAME(x) save_##x
15011 #define NAME_ES(x) save_##x##ARB
15013 #include "vbo/vbo_init_tmp.h"
15018 _mesa_free_display_list_data(struct gl_context
*ctx
)
15020 free(ctx
->ListExt
);
15021 ctx
->ListExt
= NULL
;