2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
73 #include "vbo/vbo_util.h"
74 #include "util/format_r11g11b10f.h"
76 #include "util/u_memory.h"
78 #define USE_BITMAP_ATLAS 1
83 * Other parts of Mesa (such as the VBO module) can plug into the display
84 * list system. This structure describes new display list instructions.
86 struct gl_list_instruction
89 void (*Execute
)( struct gl_context
*ctx
, void *data
);
90 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
91 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
95 #define MAX_DLIST_EXT_OPCODES 16
98 * Used by device drivers to hook new commands into display lists.
100 struct gl_list_extensions
102 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
111 * \param ctx GL context.
113 * Checks if dd_function_table::SaveNeedFlush is marked to flush
114 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
116 #define SAVE_FLUSH_VERTICES(ctx) \
118 if (ctx->Driver.SaveNeedFlush) \
119 vbo_save_SaveFlushVertices(ctx); \
124 * Macro to assert that the API call was made outside the
125 * glBegin()/glEnd() pair, with return value.
127 * \param ctx GL context.
128 * \param retval value to return value in case the assertion fails.
130 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
132 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
133 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
139 * Macro to assert that the API call was made outside the
140 * glBegin()/glEnd() pair.
142 * \param ctx GL context.
144 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
146 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
147 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices.
156 * \param ctx GL context.
158 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
160 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
161 SAVE_FLUSH_VERTICES(ctx); \
165 * Macro to assert that the API call was made outside the
166 * glBegin()/glEnd() pair and flush the vertices, with return value.
168 * \param ctx GL context.
169 * \param retval value to return value in case the assertion fails.
171 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
173 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
174 SAVE_FLUSH_VERTICES(ctx); \
179 * Display list opcodes.
181 * The fact that these identifiers are assigned consecutive
182 * integer values starting at 0 is very important, see InstSize array usage)
186 OPCODE_INVALID
= -1, /* Force signed enum */
192 OPCODE_BLEND_EQUATION
,
193 OPCODE_BLEND_EQUATION_SEPARATE
,
194 OPCODE_BLEND_FUNC_SEPARATE
,
196 OPCODE_BLEND_EQUATION_I
,
197 OPCODE_BLEND_EQUATION_SEPARATE_I
,
199 OPCODE_BLEND_FUNC_SEPARATE_I
,
208 OPCODE_CLEAR_STENCIL
,
209 OPCODE_CLEAR_BUFFER_IV
,
210 OPCODE_CLEAR_BUFFER_UIV
,
211 OPCODE_CLEAR_BUFFER_FV
,
212 OPCODE_CLEAR_BUFFER_FI
,
215 OPCODE_COLOR_MASK_INDEXED
,
216 OPCODE_COLOR_MATERIAL
,
218 OPCODE_COPY_TEX_IMAGE1D
,
219 OPCODE_COPY_TEX_IMAGE2D
,
220 OPCODE_COPY_TEX_SUB_IMAGE1D
,
221 OPCODE_COPY_TEX_SUB_IMAGE2D
,
222 OPCODE_COPY_TEX_SUB_IMAGE3D
,
228 OPCODE_DISABLE_INDEXED
,
232 OPCODE_ENABLE_INDEXED
,
246 OPCODE_LOAD_IDENTITY
,
259 OPCODE_PIXEL_TRANSFER
,
262 OPCODE_POINT_PARAMETERS
,
264 OPCODE_POLYGON_STIPPLE
,
265 OPCODE_POLYGON_OFFSET
,
269 OPCODE_PRIORITIZE_TEXTURE
,
278 OPCODE_SELECT_TEXTURE_SGIS
,
279 OPCODE_SELECT_TEXTURE_COORD_SET
,
290 OPCODE_TEX_SUB_IMAGE1D
,
291 OPCODE_TEX_SUB_IMAGE2D
,
292 OPCODE_TEX_SUB_IMAGE3D
,
296 /* ARB_viewport_array */
297 OPCODE_VIEWPORT_ARRAY_V
,
298 OPCODE_VIEWPORT_INDEXED_F
,
299 OPCODE_VIEWPORT_INDEXED_FV
,
300 OPCODE_SCISSOR_ARRAY_V
,
301 OPCODE_SCISSOR_INDEXED
,
302 OPCODE_SCISSOR_INDEXED_V
,
303 OPCODE_DEPTH_ARRAY_V
,
304 OPCODE_DEPTH_INDEXED
,
305 /* GL_ARB_multitexture */
306 OPCODE_ACTIVE_TEXTURE
,
307 /* GL_ARB_texture_compression */
308 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
311 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
312 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
313 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
314 /* GL_ARB_multisample */
315 OPCODE_SAMPLE_COVERAGE
,
316 /* GL_ARB_window_pos */
317 OPCODE_WINDOW_POS_ARB
,
318 /* GL_ARB_vertex_program */
319 OPCODE_BIND_PROGRAM_ARB
,
320 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
321 /* GL_EXT_stencil_two_side */
322 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
323 /* GL_EXT_depth_bounds_test */
324 OPCODE_DEPTH_BOUNDS_EXT
,
325 /* GL_ARB_vertex/fragment_program */
326 OPCODE_PROGRAM_STRING_ARB
,
327 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
328 /* GL_ARB_occlusion_query */
329 OPCODE_BEGIN_QUERY_ARB
,
330 OPCODE_END_QUERY_ARB
,
331 /* GL_ARB_draw_buffers */
332 OPCODE_DRAW_BUFFERS_ARB
,
333 /* GL_ATI_fragment_shader */
334 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
335 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
337 OPCODE_STENCIL_FUNC_SEPARATE
,
338 OPCODE_STENCIL_OP_SEPARATE
,
339 OPCODE_STENCIL_MASK_SEPARATE
,
340 /* GL_NV_primitive_restart */
341 OPCODE_PRIMITIVE_RESTART_NV
,
342 /* GL_ARB_shader_objects */
360 OPCODE_UNIFORM_MATRIX22
,
361 OPCODE_UNIFORM_MATRIX33
,
362 OPCODE_UNIFORM_MATRIX44
,
363 OPCODE_UNIFORM_MATRIX23
,
364 OPCODE_UNIFORM_MATRIX32
,
365 OPCODE_UNIFORM_MATRIX24
,
366 OPCODE_UNIFORM_MATRIX42
,
367 OPCODE_UNIFORM_MATRIX34
,
368 OPCODE_UNIFORM_MATRIX43
,
380 /* GL_ARB_gpu_shader_fp64 */
389 OPCODE_UNIFORM_MATRIX22D
,
390 OPCODE_UNIFORM_MATRIX33D
,
391 OPCODE_UNIFORM_MATRIX44D
,
392 OPCODE_UNIFORM_MATRIX23D
,
393 OPCODE_UNIFORM_MATRIX32D
,
394 OPCODE_UNIFORM_MATRIX24D
,
395 OPCODE_UNIFORM_MATRIX42D
,
396 OPCODE_UNIFORM_MATRIX34D
,
397 OPCODE_UNIFORM_MATRIX43D
,
399 /* GL_ARB_gpu_shader_int64 */
404 OPCODE_UNIFORM_1I64V
,
405 OPCODE_UNIFORM_2I64V
,
406 OPCODE_UNIFORM_3I64V
,
407 OPCODE_UNIFORM_4I64V
,
408 OPCODE_UNIFORM_1UI64
,
409 OPCODE_UNIFORM_2UI64
,
410 OPCODE_UNIFORM_3UI64
,
411 OPCODE_UNIFORM_4UI64
,
412 OPCODE_UNIFORM_1UI64V
,
413 OPCODE_UNIFORM_2UI64V
,
414 OPCODE_UNIFORM_3UI64V
,
415 OPCODE_UNIFORM_4UI64V
,
416 OPCODE_PROGRAM_UNIFORM_1I64
,
417 OPCODE_PROGRAM_UNIFORM_2I64
,
418 OPCODE_PROGRAM_UNIFORM_3I64
,
419 OPCODE_PROGRAM_UNIFORM_4I64
,
420 OPCODE_PROGRAM_UNIFORM_1I64V
,
421 OPCODE_PROGRAM_UNIFORM_2I64V
,
422 OPCODE_PROGRAM_UNIFORM_3I64V
,
423 OPCODE_PROGRAM_UNIFORM_4I64V
,
424 OPCODE_PROGRAM_UNIFORM_1UI64
,
425 OPCODE_PROGRAM_UNIFORM_2UI64
,
426 OPCODE_PROGRAM_UNIFORM_3UI64
,
427 OPCODE_PROGRAM_UNIFORM_4UI64
,
428 OPCODE_PROGRAM_UNIFORM_1UI64V
,
429 OPCODE_PROGRAM_UNIFORM_2UI64V
,
430 OPCODE_PROGRAM_UNIFORM_3UI64V
,
431 OPCODE_PROGRAM_UNIFORM_4UI64V
,
433 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
434 OPCODE_PATCH_PARAMETER_I
,
435 OPCODE_PATCH_PARAMETER_FV_INNER
,
436 OPCODE_PATCH_PARAMETER_FV_OUTER
,
438 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
439 OPCODE_USE_PROGRAM_STAGES
,
440 OPCODE_PROGRAM_UNIFORM_1F
,
441 OPCODE_PROGRAM_UNIFORM_2F
,
442 OPCODE_PROGRAM_UNIFORM_3F
,
443 OPCODE_PROGRAM_UNIFORM_4F
,
444 OPCODE_PROGRAM_UNIFORM_1FV
,
445 OPCODE_PROGRAM_UNIFORM_2FV
,
446 OPCODE_PROGRAM_UNIFORM_3FV
,
447 OPCODE_PROGRAM_UNIFORM_4FV
,
448 OPCODE_PROGRAM_UNIFORM_1D
,
449 OPCODE_PROGRAM_UNIFORM_2D
,
450 OPCODE_PROGRAM_UNIFORM_3D
,
451 OPCODE_PROGRAM_UNIFORM_4D
,
452 OPCODE_PROGRAM_UNIFORM_1DV
,
453 OPCODE_PROGRAM_UNIFORM_2DV
,
454 OPCODE_PROGRAM_UNIFORM_3DV
,
455 OPCODE_PROGRAM_UNIFORM_4DV
,
456 OPCODE_PROGRAM_UNIFORM_1I
,
457 OPCODE_PROGRAM_UNIFORM_2I
,
458 OPCODE_PROGRAM_UNIFORM_3I
,
459 OPCODE_PROGRAM_UNIFORM_4I
,
460 OPCODE_PROGRAM_UNIFORM_1IV
,
461 OPCODE_PROGRAM_UNIFORM_2IV
,
462 OPCODE_PROGRAM_UNIFORM_3IV
,
463 OPCODE_PROGRAM_UNIFORM_4IV
,
464 OPCODE_PROGRAM_UNIFORM_1UI
,
465 OPCODE_PROGRAM_UNIFORM_2UI
,
466 OPCODE_PROGRAM_UNIFORM_3UI
,
467 OPCODE_PROGRAM_UNIFORM_4UI
,
468 OPCODE_PROGRAM_UNIFORM_1UIV
,
469 OPCODE_PROGRAM_UNIFORM_2UIV
,
470 OPCODE_PROGRAM_UNIFORM_3UIV
,
471 OPCODE_PROGRAM_UNIFORM_4UIV
,
472 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
473 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
474 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
475 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
476 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
477 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
478 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
479 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
480 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
481 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
482 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
483 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
484 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
485 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
486 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
487 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
488 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
489 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
491 /* GL_ARB_clip_control */
494 /* GL_ARB_color_buffer_float */
497 /* GL_EXT_framebuffer_blit */
498 OPCODE_BLIT_FRAMEBUFFER
,
500 /* Vertex attributes -- fallback for when optimized display
501 * list build isn't active.
529 /* GL_EXT_provoking_vertex */
530 OPCODE_PROVOKING_VERTEX
,
532 /* GL_EXT_transform_feedback */
533 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
534 OPCODE_END_TRANSFORM_FEEDBACK
,
535 OPCODE_BIND_TRANSFORM_FEEDBACK
,
536 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
537 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
538 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
540 /* GL_EXT_texture_integer */
542 OPCODE_CLEARCOLOR_UI
,
543 OPCODE_TEXPARAMETER_I
,
544 OPCODE_TEXPARAMETER_UI
,
546 /* GL_ARB_instanced_arrays */
547 OPCODE_VERTEX_ATTRIB_DIVISOR
,
549 /* GL_NV_texture_barrier */
550 OPCODE_TEXTURE_BARRIER_NV
,
552 /* GL_ARB_sampler_object */
554 OPCODE_SAMPLER_PARAMETERIV
,
555 OPCODE_SAMPLER_PARAMETERFV
,
556 OPCODE_SAMPLER_PARAMETERIIV
,
557 OPCODE_SAMPLER_PARAMETERUIV
,
559 /* ARB_compute_shader */
560 OPCODE_DISPATCH_COMPUTE
,
565 /* GL_NV_conditional_render */
566 OPCODE_BEGIN_CONDITIONAL_RENDER
,
567 OPCODE_END_CONDITIONAL_RENDER
,
569 /* ARB_timer_query */
570 OPCODE_QUERY_COUNTER
,
572 /* ARB_transform_feedback3 */
573 OPCODE_BEGIN_QUERY_INDEXED
,
574 OPCODE_END_QUERY_INDEXED
,
575 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
577 /* ARB_transform_feedback_instanced */
578 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
579 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
581 /* ARB_uniform_buffer_object */
582 OPCODE_UNIFORM_BLOCK_BINDING
,
584 /* ARB_shader_subroutines */
585 OPCODE_UNIFORM_SUBROUTINES
,
587 /* EXT_polygon_offset_clamp */
588 OPCODE_POLYGON_OFFSET_CLAMP
,
590 /* EXT_window_rectangles */
591 OPCODE_WINDOW_RECTANGLES
,
593 /* NV_conservative_raster */
594 OPCODE_SUBPIXEL_PRECISION_BIAS
,
596 /* NV_conservative_raster_dilate */
597 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
599 /* NV_conservative_raster_pre_snap_triangles */
600 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
602 /* EXT_direct_state_access */
605 OPCODE_MATRIX_ROTATE
,
607 OPCODE_MATRIX_TRANSLATE
,
608 OPCODE_MATRIX_LOAD_IDENTITY
,
610 OPCODE_MATRIX_FRUSTUM
,
613 OPCODE_TEXTUREPARAMETER_F
,
614 OPCODE_TEXTUREPARAMETER_I
,
615 OPCODE_TEXTUREPARAMETER_II
,
616 OPCODE_TEXTUREPARAMETER_IUI
,
617 OPCODE_TEXTURE_IMAGE1D
,
618 OPCODE_TEXTURE_IMAGE2D
,
619 OPCODE_TEXTURE_IMAGE3D
,
620 OPCODE_TEXTURE_SUB_IMAGE1D
,
621 OPCODE_TEXTURE_SUB_IMAGE2D
,
622 OPCODE_TEXTURE_SUB_IMAGE3D
,
623 OPCODE_COPY_TEXTURE_IMAGE1D
,
624 OPCODE_COPY_TEXTURE_IMAGE2D
,
625 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
626 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
627 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
628 OPCODE_BIND_MULTITEXTURE
,
629 OPCODE_MULTITEXPARAMETER_F
,
630 OPCODE_MULTITEXPARAMETER_I
,
631 OPCODE_MULTITEXPARAMETER_II
,
632 OPCODE_MULTITEXPARAMETER_IUI
,
633 OPCODE_MULTITEX_IMAGE1D
,
634 OPCODE_MULTITEX_IMAGE2D
,
635 OPCODE_MULTITEX_IMAGE3D
,
636 OPCODE_MULTITEX_SUB_IMAGE1D
,
637 OPCODE_MULTITEX_SUB_IMAGE2D
,
638 OPCODE_MULTITEX_SUB_IMAGE3D
,
639 OPCODE_COPY_MULTITEX_IMAGE1D
,
640 OPCODE_COPY_MULTITEX_IMAGE2D
,
641 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
642 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
643 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
645 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
646 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
647 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
648 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
649 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
650 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
651 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
652 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
653 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
654 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
655 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
656 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
657 OPCODE_NAMED_PROGRAM_STRING
,
658 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
,
660 /* The following three are meta instructions */
661 OPCODE_ERROR
, /* raise compiled-in error */
663 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
673 * Display list instructions are stored as sequences of "nodes". Nodes
674 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
675 * are linked together with a pointer.
677 * Each instruction in the display list is stored as a sequence of
678 * contiguous nodes in memory.
679 * Each node is the union of a variety of data types.
681 * Note, all of these members should be 4 bytes in size or less for the
682 * sake of compact display lists. We store 8-byte pointers in a pair of
683 * these nodes using the save/get_pointer() functions below.
701 typedef union gl_dlist_node Node
;
704 /** How many 4-byte dwords to store a pointer */
705 #define POINTER_DWORDS (sizeof(void *) / 4)
707 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
708 * space for display lists. The following types and functions are
709 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
714 GLuint dwords
[POINTER_DWORDS
];
719 * Save a 4 or 8-byte pointer at dest (and dest+1).
722 save_pointer(Node
*dest
, void *src
)
727 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
728 STATIC_ASSERT(sizeof(Node
) == 4);
732 for (i
= 0; i
< POINTER_DWORDS
; i
++)
733 dest
[i
].ui
= p
.dwords
[i
];
738 * Retrieve a 4 or 8-byte pointer from node (node+1).
741 get_pointer(const Node
*node
)
746 for (i
= 0; i
< POINTER_DWORDS
; i
++)
747 p
.dwords
[i
] = node
[i
].ui
;
754 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
776 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
778 union float64_pair tmp; \
780 n[idx].ui = tmp.uint32[0]; \
781 n[idx+1].ui = tmp.uint32[1]; \
784 #define ASSIGN_UINT64_TO_NODES(n, idx, value) \
786 union uint64_pair tmp; \
787 tmp.uint64 = value; \
788 n[idx].ui = tmp.uint32[0]; \
789 n[idx+1].ui = tmp.uint32[1]; \
792 #define ASSIGN_INT64_TO_NODES(n, idx, value) \
794 union int64_pair tmp; \
796 n[idx].i = tmp.int32[0]; \
797 n[idx+1].i = tmp.int32[1]; \
801 * How many nodes to allocate at a time. Note that bulk vertex data
802 * from glBegin/glVertex/glEnd primitives will typically wind up in
803 * a VBO, and not directly in the display list itself.
805 #define BLOCK_SIZE 256
810 * Number of nodes of storage needed for each instruction.
811 * Sizes for dynamically allocated opcodes are stored in the context struct.
813 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
816 void mesa_print_display_list(GLuint list
);
820 * Does the given display list only contain a single glBitmap call?
823 is_bitmap_list(const struct gl_display_list
*dlist
)
825 const Node
*n
= dlist
->Head
;
826 if (n
[0].opcode
== OPCODE_BITMAP
) {
827 n
+= InstSize
[OPCODE_BITMAP
];
828 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
836 * Is the given display list an empty list?
839 is_empty_list(const struct gl_display_list
*dlist
)
841 const Node
*n
= dlist
->Head
;
842 return n
[0].opcode
== OPCODE_END_OF_LIST
;
847 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
850 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
853 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
861 * Lookup a gl_bitmap_atlas by listBase ID.
863 static struct gl_bitmap_atlas
*
864 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
866 struct gl_bitmap_atlas
*atlas
;
868 assert(listBase
> 0);
869 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
875 * Create new bitmap atlas and insert into hash table.
877 static struct gl_bitmap_atlas
*
878 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
880 struct gl_bitmap_atlas
*atlas
;
882 assert(listBase
> 0);
883 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
885 atlas
= calloc(1, sizeof(*atlas
));
887 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
895 * Try to build a bitmap atlas. This involves examining a sequence of
896 * display lists which contain glBitmap commands and putting the bitmap
897 * images into a texture map (the atlas).
898 * If we succeed, gl_bitmap_atlas::complete will be set to true.
899 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
902 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
905 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
910 assert(!atlas
->complete
);
911 assert(atlas
->numBitmaps
> 0);
913 /* We use a rectangle texture (non-normalized coords) for the atlas */
914 assert(ctx
->Extensions
.NV_texture_rectangle
);
915 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
917 atlas
->texWidth
= 1024;
918 atlas
->texHeight
= 0; /* determined below */
920 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
921 if (!atlas
->glyphs
) {
923 atlas
->incomplete
= true;
927 /* Loop over the display lists. They should all contain a single glBitmap
928 * call. If not, bail out. Also, compute the position and sizes of each
929 * bitmap in the atlas to determine the texture atlas size.
931 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
932 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
934 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
935 unsigned bitmap_width
, bitmap_height
;
936 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
938 if (!list
|| is_empty_list(list
)) {
940 atlas
->numBitmaps
= i
;
944 if (!is_bitmap_list(list
)) {
945 /* This list does not contain exactly one glBitmap command. Give up. */
946 atlas
->incomplete
= true;
950 /* get bitmap info from the display list command */
952 assert(n
[0].opcode
== OPCODE_BITMAP
);
953 bitmap_width
= n
[1].i
;
954 bitmap_height
= n
[2].i
;
955 bitmap_xorig
= n
[3].f
;
956 bitmap_yorig
= n
[4].f
;
957 bitmap_xmove
= n
[5].f
;
958 bitmap_ymove
= n
[6].f
;
960 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
961 /* advance to the next row of the texture */
967 /* save the bitmap's position in the atlas */
971 g
->h
= bitmap_height
;
972 g
->xorig
= bitmap_xorig
;
973 g
->yorig
= bitmap_yorig
;
974 g
->xmove
= bitmap_xmove
;
975 g
->ymove
= bitmap_ymove
;
977 xpos
+= bitmap_width
;
979 /* keep track of tallest bitmap in the row */
980 row_height
= MAX2(row_height
, bitmap_height
);
983 /* Now we know the texture height */
984 atlas
->texHeight
= ypos
+ row_height
;
986 if (atlas
->texHeight
== 0) {
987 /* no glyphs found, give up */
990 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
991 /* too large, give up */
995 /* Create atlas texture (texture ID is irrelevant) */
996 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
997 if (!atlas
->texObj
) {
1001 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
1002 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
1003 atlas
->texObj
->MaxLevel
= 0;
1004 atlas
->texObj
->Immutable
= GL_TRUE
;
1006 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
1007 GL_TEXTURE_RECTANGLE
, 0);
1008 if (!atlas
->texImage
) {
1012 if (ctx
->Const
.BitmapUsesRed
)
1013 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1014 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1015 GL_RED
, MESA_FORMAT_R_UNORM8
);
1017 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1018 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1019 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
1021 /* alloc image storage */
1022 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
1026 /* map teximage, load with bitmap glyphs */
1027 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
1028 0, 0, atlas
->texWidth
, atlas
->texHeight
,
1029 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
1034 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
1035 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
1037 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
1038 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
1039 const Node
*n
= list
->Head
;
1041 assert(n
[0].opcode
== OPCODE_BITMAP
||
1042 n
[0].opcode
== OPCODE_END_OF_LIST
);
1044 if (n
[0].opcode
== OPCODE_BITMAP
) {
1045 unsigned bitmap_width
= n
[1].i
;
1046 unsigned bitmap_height
= n
[2].i
;
1047 unsigned xpos
= atlas
->glyphs
[i
].x
;
1048 unsigned ypos
= atlas
->glyphs
[i
].y
;
1049 const void *bitmap_image
= get_pointer(&n
[7]);
1051 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
1052 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
1054 /* put the bitmap image into the texture image */
1055 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
1056 &ctx
->DefaultPacking
, bitmap_image
,
1057 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
1062 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
1064 atlas
->complete
= true;
1069 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
1071 if (atlas
->texObj
) {
1072 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
1074 free(atlas
->glyphs
);
1075 atlas
->glyphs
= NULL
;
1076 atlas
->incomplete
= true;
1081 * Allocate a gl_display_list object with an initial block of storage.
1082 * \param count how many display list nodes/tokens to allocate
1084 static struct gl_display_list
*
1085 make_list(GLuint name
, GLuint count
)
1087 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1089 dlist
->Head
= malloc(sizeof(Node
) * count
);
1090 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1091 /* All InstSize[] entries must be non-zero */
1092 InstSize
[OPCODE_END_OF_LIST
] = 1;
1098 * Lookup function to just encapsulate casting.
1100 struct gl_display_list
*
1101 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1103 return (struct gl_display_list
*)
1104 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1108 /** Is the given opcode an extension code? */
1109 static inline GLboolean
1110 is_ext_opcode(OpCode opcode
)
1112 return (opcode
>= OPCODE_EXT_0
);
1116 /** Destroy an extended opcode instruction */
1118 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1120 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1122 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1123 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1128 /** Execute an extended opcode instruction */
1130 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1132 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1134 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1135 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1140 /** Print an extended opcode instruction */
1142 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1144 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1146 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1147 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1153 * Delete the named display list, but don't remove from hash table.
1154 * \param dlist - display list pointer
1157 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1162 n
= block
= dlist
->Head
;
1164 done
= block
? GL_FALSE
: GL_TRUE
;
1166 const OpCode opcode
= n
[0].opcode
;
1168 /* check for extension opcodes first */
1169 if (is_ext_opcode(opcode
)) {
1170 n
+= ext_opcode_destroy(ctx
, n
);
1174 /* for some commands, we need to free malloc'd memory */
1176 free(get_pointer(&n
[6]));
1179 free(get_pointer(&n
[10]));
1181 case OPCODE_CALL_LISTS
:
1182 free(get_pointer(&n
[3]));
1184 case OPCODE_DRAW_PIXELS
:
1185 free(get_pointer(&n
[5]));
1188 free(get_pointer(&n
[7]));
1190 case OPCODE_POLYGON_STIPPLE
:
1191 free(get_pointer(&n
[1]));
1193 case OPCODE_TEX_IMAGE1D
:
1194 free(get_pointer(&n
[8]));
1196 case OPCODE_TEX_IMAGE2D
:
1197 free(get_pointer(&n
[9]));
1199 case OPCODE_TEX_IMAGE3D
:
1200 free(get_pointer(&n
[10]));
1202 case OPCODE_TEX_SUB_IMAGE1D
:
1203 free(get_pointer(&n
[7]));
1205 case OPCODE_TEX_SUB_IMAGE2D
:
1206 free(get_pointer(&n
[9]));
1208 case OPCODE_TEX_SUB_IMAGE3D
:
1209 free(get_pointer(&n
[11]));
1211 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1212 free(get_pointer(&n
[7]));
1214 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1215 free(get_pointer(&n
[8]));
1217 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1218 free(get_pointer(&n
[9]));
1220 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1221 free(get_pointer(&n
[7]));
1223 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1224 free(get_pointer(&n
[9]));
1226 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1227 free(get_pointer(&n
[11]));
1229 case OPCODE_PROGRAM_STRING_ARB
:
1230 free(get_pointer(&n
[4])); /* program string */
1232 case OPCODE_UNIFORM_1FV
:
1233 case OPCODE_UNIFORM_2FV
:
1234 case OPCODE_UNIFORM_3FV
:
1235 case OPCODE_UNIFORM_4FV
:
1236 case OPCODE_UNIFORM_1DV
:
1237 case OPCODE_UNIFORM_2DV
:
1238 case OPCODE_UNIFORM_3DV
:
1239 case OPCODE_UNIFORM_4DV
:
1240 case OPCODE_UNIFORM_1IV
:
1241 case OPCODE_UNIFORM_2IV
:
1242 case OPCODE_UNIFORM_3IV
:
1243 case OPCODE_UNIFORM_4IV
:
1244 case OPCODE_UNIFORM_1UIV
:
1245 case OPCODE_UNIFORM_2UIV
:
1246 case OPCODE_UNIFORM_3UIV
:
1247 case OPCODE_UNIFORM_4UIV
:
1248 case OPCODE_UNIFORM_1I64V
:
1249 case OPCODE_UNIFORM_2I64V
:
1250 case OPCODE_UNIFORM_3I64V
:
1251 case OPCODE_UNIFORM_4I64V
:
1252 case OPCODE_UNIFORM_1UI64V
:
1253 case OPCODE_UNIFORM_2UI64V
:
1254 case OPCODE_UNIFORM_3UI64V
:
1255 case OPCODE_UNIFORM_4UI64V
:
1256 free(get_pointer(&n
[3]));
1258 case OPCODE_UNIFORM_MATRIX22
:
1259 case OPCODE_UNIFORM_MATRIX33
:
1260 case OPCODE_UNIFORM_MATRIX44
:
1261 case OPCODE_UNIFORM_MATRIX24
:
1262 case OPCODE_UNIFORM_MATRIX42
:
1263 case OPCODE_UNIFORM_MATRIX23
:
1264 case OPCODE_UNIFORM_MATRIX32
:
1265 case OPCODE_UNIFORM_MATRIX34
:
1266 case OPCODE_UNIFORM_MATRIX43
:
1267 case OPCODE_UNIFORM_MATRIX22D
:
1268 case OPCODE_UNIFORM_MATRIX33D
:
1269 case OPCODE_UNIFORM_MATRIX44D
:
1270 case OPCODE_UNIFORM_MATRIX24D
:
1271 case OPCODE_UNIFORM_MATRIX42D
:
1272 case OPCODE_UNIFORM_MATRIX23D
:
1273 case OPCODE_UNIFORM_MATRIX32D
:
1274 case OPCODE_UNIFORM_MATRIX34D
:
1275 case OPCODE_UNIFORM_MATRIX43D
:
1276 free(get_pointer(&n
[4]));
1278 case OPCODE_PROGRAM_UNIFORM_1FV
:
1279 case OPCODE_PROGRAM_UNIFORM_2FV
:
1280 case OPCODE_PROGRAM_UNIFORM_3FV
:
1281 case OPCODE_PROGRAM_UNIFORM_4FV
:
1282 case OPCODE_PROGRAM_UNIFORM_1DV
:
1283 case OPCODE_PROGRAM_UNIFORM_2DV
:
1284 case OPCODE_PROGRAM_UNIFORM_3DV
:
1285 case OPCODE_PROGRAM_UNIFORM_4DV
:
1286 case OPCODE_PROGRAM_UNIFORM_1IV
:
1287 case OPCODE_PROGRAM_UNIFORM_2IV
:
1288 case OPCODE_PROGRAM_UNIFORM_3IV
:
1289 case OPCODE_PROGRAM_UNIFORM_4IV
:
1290 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1291 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1292 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1293 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1294 case OPCODE_PROGRAM_UNIFORM_1I64V
:
1295 case OPCODE_PROGRAM_UNIFORM_2I64V
:
1296 case OPCODE_PROGRAM_UNIFORM_3I64V
:
1297 case OPCODE_PROGRAM_UNIFORM_4I64V
:
1298 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
1299 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
1300 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
1301 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
1302 free(get_pointer(&n
[4]));
1304 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1305 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1306 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1307 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1308 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1309 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1310 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1311 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1312 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1313 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1314 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1315 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1316 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1317 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1318 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1319 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1320 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1321 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1322 free(get_pointer(&n
[5]));
1324 case OPCODE_PIXEL_MAP
:
1325 free(get_pointer(&n
[3]));
1327 case OPCODE_VIEWPORT_ARRAY_V
:
1328 case OPCODE_SCISSOR_ARRAY_V
:
1329 case OPCODE_DEPTH_ARRAY_V
:
1330 case OPCODE_UNIFORM_SUBROUTINES
:
1331 case OPCODE_WINDOW_RECTANGLES
:
1332 free(get_pointer(&n
[3]));
1334 case OPCODE_TEXTURE_IMAGE1D
:
1335 case OPCODE_MULTITEX_IMAGE1D
:
1336 free(get_pointer(&n
[9]));
1338 case OPCODE_TEXTURE_IMAGE2D
:
1339 case OPCODE_MULTITEX_IMAGE2D
:
1340 free(get_pointer(&n
[10]));
1342 case OPCODE_TEXTURE_IMAGE3D
:
1343 case OPCODE_MULTITEX_IMAGE3D
:
1344 free(get_pointer(&n
[11]));
1346 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1347 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1348 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1349 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
1350 free(get_pointer(&n
[8]));
1352 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1353 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1354 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1355 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
1356 free(get_pointer(&n
[10]));
1358 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1359 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1360 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1361 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
1362 free(get_pointer(&n
[12]));
1364 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1365 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
1366 free(get_pointer(&n
[8]));
1368 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1369 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
1370 free(get_pointer(&n
[9]));
1372 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1373 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
1374 free(get_pointer(&n
[10]));
1376 case OPCODE_NAMED_PROGRAM_STRING
:
1377 free(get_pointer(&n
[5]));
1379 case OPCODE_CONTINUE
:
1380 n
= (Node
*) get_pointer(&n
[1]);
1384 case OPCODE_END_OF_LIST
:
1389 /* just increment 'n' pointer, below */
1393 if (opcode
!= OPCODE_CONTINUE
) {
1394 assert(InstSize
[opcode
] > 0);
1395 n
+= InstSize
[opcode
];
1406 * Called by _mesa_HashWalk() to check if a display list which is being
1407 * deleted belongs to a bitmap texture atlas.
1410 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1412 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1413 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1415 /* See if the list_id falls in the range contained in this texture atlas */
1416 if (atlas
->complete
&&
1417 list_id
>= atlas_id
&&
1418 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1419 /* Mark the atlas as incomplete so it doesn't get used. But don't
1420 * delete it yet since we don't want to try to recreate it in the next
1423 atlas
->complete
= false;
1424 atlas
->incomplete
= true;
1430 * Destroy a display list and remove from hash table.
1431 * \param list - display list number
1434 destroy_list(struct gl_context
*ctx
, GLuint list
)
1436 struct gl_display_list
*dlist
;
1441 dlist
= _mesa_lookup_list(ctx
, list
);
1445 if (is_bitmap_list(dlist
)) {
1446 /* If we're destroying a simple glBitmap display list, there's a
1447 * chance that we're destroying a bitmap image that's in a texture
1448 * atlas. Examine all atlases to see if that's the case. There's
1449 * usually few (if any) atlases so this isn't expensive.
1451 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1452 check_atlas_for_deleted_list
, &list
);
1455 _mesa_delete_list(ctx
, dlist
);
1456 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1461 * Translate the nth element of list from <type> to GLint.
1464 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1476 bptr
= (GLbyte
*) list
;
1477 return (GLint
) bptr
[n
];
1478 case GL_UNSIGNED_BYTE
:
1479 ubptr
= (GLubyte
*) list
;
1480 return (GLint
) ubptr
[n
];
1482 sptr
= (GLshort
*) list
;
1483 return (GLint
) sptr
[n
];
1484 case GL_UNSIGNED_SHORT
:
1485 usptr
= (GLushort
*) list
;
1486 return (GLint
) usptr
[n
];
1488 iptr
= (GLint
*) list
;
1490 case GL_UNSIGNED_INT
:
1491 uiptr
= (GLuint
*) list
;
1492 return (GLint
) uiptr
[n
];
1494 fptr
= (GLfloat
*) list
;
1495 return (GLint
) floorf(fptr
[n
]);
1497 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1498 return (GLint
) ubptr
[0] * 256
1501 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1502 return (GLint
) ubptr
[0] * 65536
1503 + (GLint
) ubptr
[1] * 256
1506 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1507 return (GLint
) ubptr
[0] * 16777216
1508 + (GLint
) ubptr
[1] * 65536
1509 + (GLint
) ubptr
[2] * 256
1518 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1519 * If width < 0 or height < 0 or format or type are invalid we'll just
1520 * return NULL. We will not generate an error since OpenGL command
1521 * arguments aren't error-checked until the command is actually executed
1522 * (not when they're compiled).
1523 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1526 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1527 GLsizei width
, GLsizei height
, GLsizei depth
,
1528 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1529 const struct gl_pixelstore_attrib
*unpack
)
1531 if (width
<= 0 || height
<= 0) {
1535 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1536 /* bad format and/or type */
1540 if (!unpack
->BufferObj
) {
1544 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1545 format
, type
, pixels
, unpack
);
1546 if (pixels
&& !image
) {
1547 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1551 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1552 depth
, format
, type
, INT_MAX
, pixels
)) {
1553 const GLubyte
*map
, *src
;
1557 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1558 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1561 /* unable to map src buffer! */
1562 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1566 src
= ADD_POINTERS(map
, pixels
);
1567 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1568 format
, type
, src
, unpack
);
1570 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1573 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1579 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1584 /** Return copy of memory */
1586 memdup(const void *src
, GLsizei bytes
)
1588 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1590 memcpy(b
, src
, bytes
);
1596 * Allocate space for a display list instruction (opcode + payload space).
1597 * \param opcode the instruction opcode (OPCODE_* value)
1598 * \param bytes instruction payload size (not counting opcode)
1599 * \param align8 does the payload need to be 8-byte aligned?
1600 * This is only relevant in 64-bit environments.
1601 * \return pointer to allocated memory (the payload will be at pointer+1)
1604 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1606 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1607 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1611 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1613 if (opcode
< OPCODE_EXT_0
) {
1614 if (InstSize
[opcode
] == 0) {
1615 /* save instruction size now */
1616 InstSize
[opcode
] = numNodes
;
1619 /* make sure instruction size agrees */
1620 assert(numNodes
== InstSize
[opcode
]);
1624 if (sizeof(void *) > sizeof(Node
) && align8
1625 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1626 /* The opcode would get placed at node[0] and the payload would start
1627 * at node[1]. But the payload needs to be at an even offset (8-byte
1636 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1638 /* This block is full. Allocate a new block and chain to it */
1640 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1641 n
[0].opcode
= OPCODE_CONTINUE
;
1642 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1644 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1648 /* a fresh block should be 8-byte aligned on 64-bit systems */
1649 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1651 save_pointer(&n
[1], newblock
);
1652 ctx
->ListState
.CurrentBlock
= newblock
;
1653 ctx
->ListState
.CurrentPos
= 0;
1655 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1656 * we have to insert a NOP so that the payload of the real opcode lands
1657 * on an even location:
1658 * node[0] = OPCODE_NOP
1659 * node[1] = OPCODE_x;
1660 * node[2] = start of payload
1662 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1665 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1667 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1668 n
[0].opcode
= OPCODE_NOP
;
1670 /* The "real" opcode will now be at an odd location and the payload
1671 * will be at an even location.
1674 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1676 n
[0].opcode
= opcode
;
1684 * Allocate space for a display list instruction. Used by callers outside
1685 * this file for things like VBO vertex data.
1687 * \param opcode the instruction opcode (OPCODE_* value)
1688 * \param bytes instruction size in bytes, not counting opcode.
1689 * \return pointer to the usable data area (not including the internal
1693 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1695 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1697 return n
+ 1; /* return pointer to payload area, after opcode */
1704 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1705 * aligned in 64-bit environments, 4-byte aligned otherwise.
1708 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1710 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1712 return n
+ 1; /* return pointer to payload area, after opcode */
1719 * This function allows modules and drivers to get their own opcodes
1720 * for extending display list functionality.
1721 * \param ctx the rendering context
1722 * \param size number of bytes for storing the new display list command
1723 * \param execute function to execute the new display list command
1724 * \param destroy function to destroy the new display list command
1725 * \param print function to print the new display list command
1726 * \return the new opcode number or -1 if error
1729 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1731 void (*execute
) (struct gl_context
*, void *),
1732 void (*destroy
) (struct gl_context
*, void *),
1733 void (*print
) (struct gl_context
*, void *, FILE *))
1735 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1736 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1737 ctx
->ListExt
->Opcode
[i
].Size
=
1738 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1739 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1740 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1741 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1742 return i
+ OPCODE_EXT_0
;
1749 * Allocate space for a display list instruction. The space is basically
1750 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1751 * function parameter, node[2] is the second parameter, etc.
1753 * \param opcode one of OPCODE_x
1754 * \param nparams number of function parameters
1755 * \return pointer to start of instruction space
1757 static inline Node
*
1758 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1760 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1765 * Called by EndList to try to reduce memory used for the list.
1768 trim_list(struct gl_context
*ctx
)
1770 /* If the list we're ending only has one allocated block of nodes/tokens
1771 * and its size isn't a full block size, realloc the block to use less
1772 * memory. This is important for apps that create many small display
1773 * lists and apps that use glXUseXFont (many lists each containing one
1775 * Note: we currently only trim display lists that allocated one block
1776 * of tokens. That hits the short list case which is what we're mainly
1777 * concerned with. Trimming longer lists would involve traversing the
1778 * linked list of blocks.
1780 struct gl_dlist_state
*list
= &ctx
->ListState
;
1782 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1783 (list
->CurrentPos
< BLOCK_SIZE
)) {
1784 /* There's only one block and it's not full, so realloc */
1785 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1786 list
->CurrentList
->Head
=
1787 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1788 if (!list
->CurrentBlock
) {
1789 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1797 * Display List compilation functions
1799 static void GLAPIENTRY
1800 save_Accum(GLenum op
, GLfloat value
)
1802 GET_CURRENT_CONTEXT(ctx
);
1804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1805 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1810 if (ctx
->ExecuteFlag
) {
1811 CALL_Accum(ctx
->Exec
, (op
, value
));
1816 static void GLAPIENTRY
1817 save_AlphaFunc(GLenum func
, GLclampf ref
)
1819 GET_CURRENT_CONTEXT(ctx
);
1821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1822 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1825 n
[2].f
= (GLfloat
) ref
;
1827 if (ctx
->ExecuteFlag
) {
1828 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1833 static void GLAPIENTRY
1834 save_BindTexture(GLenum target
, GLuint texture
)
1836 GET_CURRENT_CONTEXT(ctx
);
1838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1839 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1844 if (ctx
->ExecuteFlag
) {
1845 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1850 static void GLAPIENTRY
1851 save_Bitmap(GLsizei width
, GLsizei height
,
1852 GLfloat xorig
, GLfloat yorig
,
1853 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1855 GET_CURRENT_CONTEXT(ctx
);
1857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1858 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1860 n
[1].i
= (GLint
) width
;
1861 n
[2].i
= (GLint
) height
;
1867 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1868 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1870 if (ctx
->ExecuteFlag
) {
1871 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1872 xorig
, yorig
, xmove
, ymove
, pixels
));
1877 static void GLAPIENTRY
1878 save_BlendEquation(GLenum mode
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1887 if (ctx
->ExecuteFlag
) {
1888 CALL_BlendEquation(ctx
->Exec
, (mode
));
1893 static void GLAPIENTRY
1894 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1896 GET_CURRENT_CONTEXT(ctx
);
1898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1899 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1904 if (ctx
->ExecuteFlag
) {
1905 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1910 static void GLAPIENTRY
1911 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1912 GLenum sfactorA
, GLenum dfactorA
)
1914 GET_CURRENT_CONTEXT(ctx
);
1916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1917 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1919 n
[1].e
= sfactorRGB
;
1920 n
[2].e
= dfactorRGB
;
1924 if (ctx
->ExecuteFlag
) {
1925 CALL_BlendFuncSeparate(ctx
->Exec
,
1926 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1931 static void GLAPIENTRY
1932 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1934 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1938 static void GLAPIENTRY
1939 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1941 GET_CURRENT_CONTEXT(ctx
);
1943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1944 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1951 if (ctx
->ExecuteFlag
) {
1952 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1956 /* GL_ARB_draw_buffers_blend */
1957 static void GLAPIENTRY
1958 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1959 GLenum sfactorA
, GLenum dfactorA
)
1961 GET_CURRENT_CONTEXT(ctx
);
1963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1964 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1967 n
[2].e
= sfactorRGB
;
1968 n
[3].e
= dfactorRGB
;
1972 if (ctx
->ExecuteFlag
) {
1973 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1974 sfactorA
, dfactorA
));
1978 /* GL_ARB_draw_buffers_blend */
1979 static void GLAPIENTRY
1980 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1982 GET_CURRENT_CONTEXT(ctx
);
1984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1985 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1991 if (ctx
->ExecuteFlag
) {
1992 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1996 /* GL_ARB_draw_buffers_blend */
1997 static void GLAPIENTRY
1998 save_BlendEquationi(GLuint buf
, GLenum mode
)
2000 GET_CURRENT_CONTEXT(ctx
);
2002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2003 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
2008 if (ctx
->ExecuteFlag
) {
2009 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
2013 /* GL_ARB_draw_buffers_blend */
2014 static void GLAPIENTRY
2015 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
2017 GET_CURRENT_CONTEXT(ctx
);
2019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2020 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
2026 if (ctx
->ExecuteFlag
) {
2027 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
2032 /* GL_ARB_draw_instanced. */
2033 static void GLAPIENTRY
2034 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
2036 UNUSED GLsizei count
,
2037 UNUSED GLsizei primcount
)
2039 GET_CURRENT_CONTEXT(ctx
);
2040 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2041 "glDrawArraysInstanced() during display list compile");
2044 static void GLAPIENTRY
2045 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
2046 UNUSED GLsizei count
,
2048 UNUSED
const GLvoid
*indices
,
2049 UNUSED GLsizei primcount
)
2051 GET_CURRENT_CONTEXT(ctx
);
2052 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2053 "glDrawElementsInstanced() during display list compile");
2056 static void GLAPIENTRY
2057 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
2058 UNUSED GLsizei count
,
2060 UNUSED
const GLvoid
*indices
,
2061 UNUSED GLsizei primcount
,
2062 UNUSED GLint basevertex
)
2064 GET_CURRENT_CONTEXT(ctx
);
2065 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2066 "glDrawElementsInstancedBaseVertex() during display list compile");
2069 /* GL_ARB_base_instance. */
2070 static void GLAPIENTRY
2071 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
2073 UNUSED GLsizei count
,
2074 UNUSED GLsizei primcount
,
2075 UNUSED GLuint baseinstance
)
2077 GET_CURRENT_CONTEXT(ctx
);
2078 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2079 "glDrawArraysInstancedBaseInstance() during display list compile");
2082 static void APIENTRY
2083 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
2084 UNUSED GLsizei count
,
2086 UNUSED
const void *indices
,
2087 UNUSED GLsizei primcount
,
2088 UNUSED GLuint baseinstance
)
2090 GET_CURRENT_CONTEXT(ctx
);
2091 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2092 "glDrawElementsInstancedBaseInstance() during display list compile");
2095 static void APIENTRY
2096 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
2097 UNUSED GLsizei count
,
2099 UNUSED
const void *indices
,
2100 UNUSED GLsizei primcount
,
2101 UNUSED GLint basevertex
,
2102 UNUSED GLuint baseinstance
)
2104 GET_CURRENT_CONTEXT(ctx
);
2105 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2106 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2109 static void APIENTRY
2110 save_DrawArraysIndirect(UNUSED GLenum mode
,
2111 UNUSED
const void *indirect
)
2113 GET_CURRENT_CONTEXT(ctx
);
2114 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2115 "glDrawArraysIndirect() during display list compile");
2118 static void APIENTRY
2119 save_DrawElementsIndirect(UNUSED GLenum mode
,
2121 UNUSED
const void *indirect
)
2123 GET_CURRENT_CONTEXT(ctx
);
2124 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2125 "glDrawElementsIndirect() during display list compile");
2128 static void APIENTRY
2129 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2130 UNUSED
const void *indirect
,
2131 UNUSED GLsizei primcount
,
2132 UNUSED GLsizei stride
)
2134 GET_CURRENT_CONTEXT(ctx
);
2135 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2136 "glMultiDrawArraysIndirect() during display list compile");
2139 static void APIENTRY
2140 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2142 UNUSED
const void *indirect
,
2143 UNUSED GLsizei primcount
,
2144 UNUSED GLsizei stride
)
2146 GET_CURRENT_CONTEXT(ctx
);
2147 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2148 "glMultiDrawElementsIndirect() during display list compile");
2152 * While building a display list we cache some OpenGL state.
2153 * Under some circumstances we need to invalidate that state (immediately
2154 * when we start compiling a list, or after glCallList(s)).
2157 invalidate_saved_current_state(struct gl_context
*ctx
)
2161 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2162 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2164 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2165 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2167 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2169 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2173 static void GLAPIENTRY
2174 save_CallList(GLuint list
)
2176 GET_CURRENT_CONTEXT(ctx
);
2178 SAVE_FLUSH_VERTICES(ctx
);
2180 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2185 /* After this, we don't know what state we're in. Invalidate all
2186 * cached information previously gathered:
2188 invalidate_saved_current_state( ctx
);
2190 if (ctx
->ExecuteFlag
) {
2191 _mesa_CallList(list
);
2196 static void GLAPIENTRY
2197 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2199 GET_CURRENT_CONTEXT(ctx
);
2204 SAVE_FLUSH_VERTICES(ctx
);
2208 case GL_UNSIGNED_BYTE
:
2212 case GL_UNSIGNED_SHORT
:
2220 case GL_UNSIGNED_INT
:
2229 if (num
> 0 && type_size
> 0) {
2230 /* create a copy of the array of list IDs to save in the display list */
2231 lists_copy
= memdup(lists
, num
* type_size
);
2236 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2240 save_pointer(&n
[3], lists_copy
);
2243 /* After this, we don't know what state we're in. Invalidate all
2244 * cached information previously gathered:
2246 invalidate_saved_current_state( ctx
);
2248 if (ctx
->ExecuteFlag
) {
2249 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2254 static void GLAPIENTRY
2255 save_Clear(GLbitfield mask
)
2257 GET_CURRENT_CONTEXT(ctx
);
2259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2260 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2264 if (ctx
->ExecuteFlag
) {
2265 CALL_Clear(ctx
->Exec
, (mask
));
2270 static void GLAPIENTRY
2271 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2273 GET_CURRENT_CONTEXT(ctx
);
2275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2276 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2279 n
[2].i
= drawbuffer
;
2281 if (buffer
== GL_COLOR
) {
2292 if (ctx
->ExecuteFlag
) {
2293 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2298 static void GLAPIENTRY
2299 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2301 GET_CURRENT_CONTEXT(ctx
);
2303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2304 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2307 n
[2].i
= drawbuffer
;
2309 if (buffer
== GL_COLOR
) {
2320 if (ctx
->ExecuteFlag
) {
2321 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2326 static void GLAPIENTRY
2327 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2329 GET_CURRENT_CONTEXT(ctx
);
2331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2332 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2335 n
[2].i
= drawbuffer
;
2337 if (buffer
== GL_COLOR
) {
2348 if (ctx
->ExecuteFlag
) {
2349 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2354 static void GLAPIENTRY
2355 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2356 GLfloat depth
, GLint stencil
)
2358 GET_CURRENT_CONTEXT(ctx
);
2360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2361 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2364 n
[2].i
= drawbuffer
;
2368 if (ctx
->ExecuteFlag
) {
2369 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2374 static void GLAPIENTRY
2375 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2377 GET_CURRENT_CONTEXT(ctx
);
2379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2380 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2387 if (ctx
->ExecuteFlag
) {
2388 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2393 static void GLAPIENTRY
2394 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2396 GET_CURRENT_CONTEXT(ctx
);
2398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2399 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2406 if (ctx
->ExecuteFlag
) {
2407 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2412 static void GLAPIENTRY
2413 save_ClearDepth(GLclampd depth
)
2415 GET_CURRENT_CONTEXT(ctx
);
2417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2418 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2420 n
[1].f
= (GLfloat
) depth
;
2422 if (ctx
->ExecuteFlag
) {
2423 CALL_ClearDepth(ctx
->Exec
, (depth
));
2428 static void GLAPIENTRY
2429 save_ClearIndex(GLfloat c
)
2431 GET_CURRENT_CONTEXT(ctx
);
2433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2434 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2438 if (ctx
->ExecuteFlag
) {
2439 CALL_ClearIndex(ctx
->Exec
, (c
));
2444 static void GLAPIENTRY
2445 save_ClearStencil(GLint s
)
2447 GET_CURRENT_CONTEXT(ctx
);
2449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2450 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2454 if (ctx
->ExecuteFlag
) {
2455 CALL_ClearStencil(ctx
->Exec
, (s
));
2460 static void GLAPIENTRY
2461 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2463 GET_CURRENT_CONTEXT(ctx
);
2465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2466 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2469 n
[2].f
= (GLfloat
) equ
[0];
2470 n
[3].f
= (GLfloat
) equ
[1];
2471 n
[4].f
= (GLfloat
) equ
[2];
2472 n
[5].f
= (GLfloat
) equ
[3];
2474 if (ctx
->ExecuteFlag
) {
2475 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2481 static void GLAPIENTRY
2482 save_ColorMask(GLboolean red
, GLboolean green
,
2483 GLboolean blue
, GLboolean alpha
)
2485 GET_CURRENT_CONTEXT(ctx
);
2487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2488 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2495 if (ctx
->ExecuteFlag
) {
2496 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2501 static void GLAPIENTRY
2502 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2503 GLboolean blue
, GLboolean alpha
)
2505 GET_CURRENT_CONTEXT(ctx
);
2507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2508 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2516 if (ctx
->ExecuteFlag
) {
2517 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2522 static void GLAPIENTRY
2523 save_ColorMaterial(GLenum face
, GLenum mode
)
2525 GET_CURRENT_CONTEXT(ctx
);
2527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2529 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2534 if (ctx
->ExecuteFlag
) {
2535 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2540 static void GLAPIENTRY
2541 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2543 GET_CURRENT_CONTEXT(ctx
);
2545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2546 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2550 n
[3].i
= (GLint
) width
;
2551 n
[4].i
= (GLint
) height
;
2554 if (ctx
->ExecuteFlag
) {
2555 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2561 static void GLAPIENTRY
2562 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2563 GLint x
, GLint y
, GLsizei width
, GLint border
)
2565 GET_CURRENT_CONTEXT(ctx
);
2567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2568 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2572 n
[3].e
= internalformat
;
2578 if (ctx
->ExecuteFlag
) {
2579 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2580 x
, y
, width
, border
));
2585 static void GLAPIENTRY
2586 save_CopyTexImage2D(GLenum target
, GLint level
,
2587 GLenum internalformat
,
2588 GLint x
, GLint y
, GLsizei width
,
2589 GLsizei height
, GLint border
)
2591 GET_CURRENT_CONTEXT(ctx
);
2593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2594 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2598 n
[3].e
= internalformat
;
2605 if (ctx
->ExecuteFlag
) {
2606 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2607 x
, y
, width
, height
, border
));
2613 static void GLAPIENTRY
2614 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2615 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2617 GET_CURRENT_CONTEXT(ctx
);
2619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2620 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2629 if (ctx
->ExecuteFlag
) {
2630 CALL_CopyTexSubImage1D(ctx
->Exec
,
2631 (target
, level
, xoffset
, x
, y
, width
));
2636 static void GLAPIENTRY
2637 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2638 GLint xoffset
, GLint yoffset
,
2639 GLint x
, GLint y
, GLsizei width
, GLint height
)
2641 GET_CURRENT_CONTEXT(ctx
);
2643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2644 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2655 if (ctx
->ExecuteFlag
) {
2656 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2657 x
, y
, width
, height
));
2662 static void GLAPIENTRY
2663 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2664 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2665 GLint x
, GLint y
, GLsizei width
, GLint height
)
2667 GET_CURRENT_CONTEXT(ctx
);
2669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2670 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2682 if (ctx
->ExecuteFlag
) {
2683 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2684 xoffset
, yoffset
, zoffset
,
2685 x
, y
, width
, height
));
2690 static void GLAPIENTRY
2691 save_CullFace(GLenum mode
)
2693 GET_CURRENT_CONTEXT(ctx
);
2695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2696 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2700 if (ctx
->ExecuteFlag
) {
2701 CALL_CullFace(ctx
->Exec
, (mode
));
2706 static void GLAPIENTRY
2707 save_DepthFunc(GLenum func
)
2709 GET_CURRENT_CONTEXT(ctx
);
2711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2712 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2716 if (ctx
->ExecuteFlag
) {
2717 CALL_DepthFunc(ctx
->Exec
, (func
));
2722 static void GLAPIENTRY
2723 save_DepthMask(GLboolean mask
)
2725 GET_CURRENT_CONTEXT(ctx
);
2727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2728 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2732 if (ctx
->ExecuteFlag
) {
2733 CALL_DepthMask(ctx
->Exec
, (mask
));
2738 static void GLAPIENTRY
2739 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2741 GET_CURRENT_CONTEXT(ctx
);
2743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2744 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2746 n
[1].f
= (GLfloat
) nearval
;
2747 n
[2].f
= (GLfloat
) farval
;
2749 if (ctx
->ExecuteFlag
) {
2750 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2755 static void GLAPIENTRY
2756 save_Disable(GLenum cap
)
2758 GET_CURRENT_CONTEXT(ctx
);
2760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2761 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2765 if (ctx
->ExecuteFlag
) {
2766 CALL_Disable(ctx
->Exec
, (cap
));
2771 static void GLAPIENTRY
2772 save_DisableIndexed(GLuint index
, GLenum cap
)
2774 GET_CURRENT_CONTEXT(ctx
);
2776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2777 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2782 if (ctx
->ExecuteFlag
) {
2783 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2788 static void GLAPIENTRY
2789 save_DrawBuffer(GLenum mode
)
2791 GET_CURRENT_CONTEXT(ctx
);
2793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2794 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2798 if (ctx
->ExecuteFlag
) {
2799 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2804 static void GLAPIENTRY
2805 save_DrawPixels(GLsizei width
, GLsizei height
,
2806 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2808 GET_CURRENT_CONTEXT(ctx
);
2811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2813 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2820 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2821 pixels
, &ctx
->Unpack
));
2823 if (ctx
->ExecuteFlag
) {
2824 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2830 static void GLAPIENTRY
2831 save_Enable(GLenum cap
)
2833 GET_CURRENT_CONTEXT(ctx
);
2835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2836 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2840 if (ctx
->ExecuteFlag
) {
2841 CALL_Enable(ctx
->Exec
, (cap
));
2847 static void GLAPIENTRY
2848 save_EnableIndexed(GLuint index
, GLenum cap
)
2850 GET_CURRENT_CONTEXT(ctx
);
2852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2853 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2858 if (ctx
->ExecuteFlag
) {
2859 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2865 static void GLAPIENTRY
2866 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2868 GET_CURRENT_CONTEXT(ctx
);
2870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2871 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2877 if (ctx
->ExecuteFlag
) {
2878 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2883 static void GLAPIENTRY
2884 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2886 GET_CURRENT_CONTEXT(ctx
);
2888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2889 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2897 if (ctx
->ExecuteFlag
) {
2898 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2905 static void GLAPIENTRY
2906 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2908 GET_CURRENT_CONTEXT(ctx
);
2910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2911 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2919 if (ctx
->ExecuteFlag
) {
2920 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2925 static void GLAPIENTRY
2926 save_Fogf(GLenum pname
, GLfloat param
)
2930 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2931 save_Fogfv(pname
, parray
);
2935 static void GLAPIENTRY
2936 save_Fogiv(GLenum pname
, const GLint
*params
)
2941 case GL_FOG_DENSITY
:
2945 case GL_FOG_COORDINATE_SOURCE
:
2946 p
[0] = (GLfloat
) *params
;
2952 p
[0] = INT_TO_FLOAT(params
[0]);
2953 p
[1] = INT_TO_FLOAT(params
[1]);
2954 p
[2] = INT_TO_FLOAT(params
[2]);
2955 p
[3] = INT_TO_FLOAT(params
[3]);
2958 /* Error will be caught later in gl_Fogfv */
2959 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2961 save_Fogfv(pname
, p
);
2965 static void GLAPIENTRY
2966 save_Fogi(GLenum pname
, GLint param
)
2970 parray
[1] = parray
[2] = parray
[3] = 0;
2971 save_Fogiv(pname
, parray
);
2975 static void GLAPIENTRY
2976 save_FrontFace(GLenum mode
)
2978 GET_CURRENT_CONTEXT(ctx
);
2980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2981 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2985 if (ctx
->ExecuteFlag
) {
2986 CALL_FrontFace(ctx
->Exec
, (mode
));
2991 static void GLAPIENTRY
2992 save_Frustum(GLdouble left
, GLdouble right
,
2993 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2995 GET_CURRENT_CONTEXT(ctx
);
2997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2998 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
3000 n
[1].f
= (GLfloat
) left
;
3001 n
[2].f
= (GLfloat
) right
;
3002 n
[3].f
= (GLfloat
) bottom
;
3003 n
[4].f
= (GLfloat
) top
;
3004 n
[5].f
= (GLfloat
) nearval
;
3005 n
[6].f
= (GLfloat
) farval
;
3007 if (ctx
->ExecuteFlag
) {
3008 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3013 static void GLAPIENTRY
3014 save_Hint(GLenum target
, GLenum mode
)
3016 GET_CURRENT_CONTEXT(ctx
);
3018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3019 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
3024 if (ctx
->ExecuteFlag
) {
3025 CALL_Hint(ctx
->Exec
, (target
, mode
));
3030 static void GLAPIENTRY
3031 save_IndexMask(GLuint mask
)
3033 GET_CURRENT_CONTEXT(ctx
);
3035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3036 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
3040 if (ctx
->ExecuteFlag
) {
3041 CALL_IndexMask(ctx
->Exec
, (mask
));
3046 static void GLAPIENTRY
3047 save_InitNames(void)
3049 GET_CURRENT_CONTEXT(ctx
);
3050 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3051 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
3052 if (ctx
->ExecuteFlag
) {
3053 CALL_InitNames(ctx
->Exec
, ());
3058 static void GLAPIENTRY
3059 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
3061 GET_CURRENT_CONTEXT(ctx
);
3063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3064 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
3082 case GL_SPOT_DIRECTION
:
3085 case GL_SPOT_EXPONENT
:
3088 case GL_SPOT_CUTOFF
:
3091 case GL_CONSTANT_ATTENUATION
:
3094 case GL_LINEAR_ATTENUATION
:
3097 case GL_QUADRATIC_ATTENUATION
:
3103 for (i
= 0; i
< nParams
; i
++) {
3104 n
[3 + i
].f
= params
[i
];
3107 if (ctx
->ExecuteFlag
) {
3108 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3113 static void GLAPIENTRY
3114 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3118 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3119 save_Lightfv(light
, pname
, parray
);
3123 static void GLAPIENTRY
3124 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3131 fparam
[0] = INT_TO_FLOAT(params
[0]);
3132 fparam
[1] = INT_TO_FLOAT(params
[1]);
3133 fparam
[2] = INT_TO_FLOAT(params
[2]);
3134 fparam
[3] = INT_TO_FLOAT(params
[3]);
3137 fparam
[0] = (GLfloat
) params
[0];
3138 fparam
[1] = (GLfloat
) params
[1];
3139 fparam
[2] = (GLfloat
) params
[2];
3140 fparam
[3] = (GLfloat
) params
[3];
3142 case GL_SPOT_DIRECTION
:
3143 fparam
[0] = (GLfloat
) params
[0];
3144 fparam
[1] = (GLfloat
) params
[1];
3145 fparam
[2] = (GLfloat
) params
[2];
3147 case GL_SPOT_EXPONENT
:
3148 case GL_SPOT_CUTOFF
:
3149 case GL_CONSTANT_ATTENUATION
:
3150 case GL_LINEAR_ATTENUATION
:
3151 case GL_QUADRATIC_ATTENUATION
:
3152 fparam
[0] = (GLfloat
) params
[0];
3155 /* error will be caught later in gl_Lightfv */
3158 save_Lightfv(light
, pname
, fparam
);
3162 static void GLAPIENTRY
3163 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3167 parray
[1] = parray
[2] = parray
[3] = 0;
3168 save_Lightiv(light
, pname
, parray
);
3172 static void GLAPIENTRY
3173 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3175 GET_CURRENT_CONTEXT(ctx
);
3177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3178 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3186 if (ctx
->ExecuteFlag
) {
3187 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3192 static void GLAPIENTRY
3193 save_LightModelf(GLenum pname
, GLfloat param
)
3197 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3198 save_LightModelfv(pname
, parray
);
3202 static void GLAPIENTRY
3203 save_LightModeliv(GLenum pname
, const GLint
*params
)
3207 case GL_LIGHT_MODEL_AMBIENT
:
3208 fparam
[0] = INT_TO_FLOAT(params
[0]);
3209 fparam
[1] = INT_TO_FLOAT(params
[1]);
3210 fparam
[2] = INT_TO_FLOAT(params
[2]);
3211 fparam
[3] = INT_TO_FLOAT(params
[3]);
3213 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3214 case GL_LIGHT_MODEL_TWO_SIDE
:
3215 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3216 fparam
[0] = (GLfloat
) params
[0];
3222 /* Error will be caught later in gl_LightModelfv */
3223 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3225 save_LightModelfv(pname
, fparam
);
3229 static void GLAPIENTRY
3230 save_LightModeli(GLenum pname
, GLint param
)
3234 parray
[1] = parray
[2] = parray
[3] = 0;
3235 save_LightModeliv(pname
, parray
);
3239 static void GLAPIENTRY
3240 save_LineStipple(GLint factor
, GLushort pattern
)
3242 GET_CURRENT_CONTEXT(ctx
);
3244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3245 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3250 if (ctx
->ExecuteFlag
) {
3251 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3256 static void GLAPIENTRY
3257 save_LineWidth(GLfloat width
)
3259 GET_CURRENT_CONTEXT(ctx
);
3261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3262 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3266 if (ctx
->ExecuteFlag
) {
3267 CALL_LineWidth(ctx
->Exec
, (width
));
3272 static void GLAPIENTRY
3273 save_ListBase(GLuint base
)
3275 GET_CURRENT_CONTEXT(ctx
);
3277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3278 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3282 if (ctx
->ExecuteFlag
) {
3283 CALL_ListBase(ctx
->Exec
, (base
));
3288 static void GLAPIENTRY
3289 save_LoadIdentity(void)
3291 GET_CURRENT_CONTEXT(ctx
);
3292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3293 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3294 if (ctx
->ExecuteFlag
) {
3295 CALL_LoadIdentity(ctx
->Exec
, ());
3300 static void GLAPIENTRY
3301 save_LoadMatrixf(const GLfloat
* m
)
3303 GET_CURRENT_CONTEXT(ctx
);
3305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3306 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3309 for (i
= 0; i
< 16; i
++) {
3313 if (ctx
->ExecuteFlag
) {
3314 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3319 static void GLAPIENTRY
3320 save_LoadMatrixd(const GLdouble
* m
)
3324 for (i
= 0; i
< 16; i
++) {
3325 f
[i
] = (GLfloat
) m
[i
];
3327 save_LoadMatrixf(f
);
3331 static void GLAPIENTRY
3332 save_LoadName(GLuint name
)
3334 GET_CURRENT_CONTEXT(ctx
);
3336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3337 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3341 if (ctx
->ExecuteFlag
) {
3342 CALL_LoadName(ctx
->Exec
, (name
));
3347 static void GLAPIENTRY
3348 save_LogicOp(GLenum opcode
)
3350 GET_CURRENT_CONTEXT(ctx
);
3352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3353 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3357 if (ctx
->ExecuteFlag
) {
3358 CALL_LogicOp(ctx
->Exec
, (opcode
));
3363 static void GLAPIENTRY
3364 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3365 GLint order
, const GLdouble
* points
)
3367 GET_CURRENT_CONTEXT(ctx
);
3369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3370 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3372 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3374 n
[2].f
= (GLfloat
) u1
;
3375 n
[3].f
= (GLfloat
) u2
;
3376 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3378 save_pointer(&n
[6], pnts
);
3380 if (ctx
->ExecuteFlag
) {
3381 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3385 static void GLAPIENTRY
3386 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3387 GLint order
, const GLfloat
* points
)
3389 GET_CURRENT_CONTEXT(ctx
);
3391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3392 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3394 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3398 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3400 save_pointer(&n
[6], pnts
);
3402 if (ctx
->ExecuteFlag
) {
3403 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3408 static void GLAPIENTRY
3409 save_Map2d(GLenum target
,
3410 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3411 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3412 const GLdouble
* points
)
3414 GET_CURRENT_CONTEXT(ctx
);
3416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3417 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3419 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3420 vstride
, vorder
, points
);
3422 n
[2].f
= (GLfloat
) u1
;
3423 n
[3].f
= (GLfloat
) u2
;
3424 n
[4].f
= (GLfloat
) v1
;
3425 n
[5].f
= (GLfloat
) v2
;
3426 /* XXX verify these strides are correct */
3427 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3428 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3431 save_pointer(&n
[10], pnts
);
3433 if (ctx
->ExecuteFlag
) {
3434 CALL_Map2d(ctx
->Exec
, (target
,
3435 u1
, u2
, ustride
, uorder
,
3436 v1
, v2
, vstride
, vorder
, points
));
3441 static void GLAPIENTRY
3442 save_Map2f(GLenum target
,
3443 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3444 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3445 const GLfloat
* points
)
3447 GET_CURRENT_CONTEXT(ctx
);
3449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3450 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3452 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3453 vstride
, vorder
, points
);
3459 /* XXX verify these strides are correct */
3460 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3461 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3464 save_pointer(&n
[10], pnts
);
3466 if (ctx
->ExecuteFlag
) {
3467 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3468 v1
, v2
, vstride
, vorder
, points
));
3473 static void GLAPIENTRY
3474 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3476 GET_CURRENT_CONTEXT(ctx
);
3478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3479 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3485 if (ctx
->ExecuteFlag
) {
3486 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3491 static void GLAPIENTRY
3492 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3494 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3498 static void GLAPIENTRY
3499 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3500 GLint vn
, GLfloat v1
, GLfloat v2
)
3502 GET_CURRENT_CONTEXT(ctx
);
3504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3505 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3514 if (ctx
->ExecuteFlag
) {
3515 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3521 static void GLAPIENTRY
3522 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3523 GLint vn
, GLdouble v1
, GLdouble v2
)
3525 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3526 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3530 static void GLAPIENTRY
3531 save_MatrixMode(GLenum mode
)
3533 GET_CURRENT_CONTEXT(ctx
);
3535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3536 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3540 if (ctx
->ExecuteFlag
) {
3541 CALL_MatrixMode(ctx
->Exec
, (mode
));
3546 static void GLAPIENTRY
3547 save_MultMatrixf(const GLfloat
* m
)
3549 GET_CURRENT_CONTEXT(ctx
);
3551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3552 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3555 for (i
= 0; i
< 16; i
++) {
3559 if (ctx
->ExecuteFlag
) {
3560 CALL_MultMatrixf(ctx
->Exec
, (m
));
3565 static void GLAPIENTRY
3566 save_MultMatrixd(const GLdouble
* m
)
3570 for (i
= 0; i
< 16; i
++) {
3571 f
[i
] = (GLfloat
) m
[i
];
3573 save_MultMatrixf(f
);
3577 static void GLAPIENTRY
3578 save_NewList(GLuint name
, GLenum mode
)
3580 GET_CURRENT_CONTEXT(ctx
);
3581 /* It's an error to call this function while building a display list */
3582 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3589 static void GLAPIENTRY
3590 save_Ortho(GLdouble left
, GLdouble right
,
3591 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3593 GET_CURRENT_CONTEXT(ctx
);
3595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3596 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3598 n
[1].f
= (GLfloat
) left
;
3599 n
[2].f
= (GLfloat
) right
;
3600 n
[3].f
= (GLfloat
) bottom
;
3601 n
[4].f
= (GLfloat
) top
;
3602 n
[5].f
= (GLfloat
) nearval
;
3603 n
[6].f
= (GLfloat
) farval
;
3605 if (ctx
->ExecuteFlag
) {
3606 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3611 static void GLAPIENTRY
3612 save_PatchParameteri(GLenum pname
, const GLint value
)
3614 GET_CURRENT_CONTEXT(ctx
);
3616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3617 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3622 if (ctx
->ExecuteFlag
) {
3623 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3628 static void GLAPIENTRY
3629 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3631 GET_CURRENT_CONTEXT(ctx
);
3633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3635 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3636 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3638 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3639 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3643 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3653 if (ctx
->ExecuteFlag
) {
3654 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3659 static void GLAPIENTRY
3660 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3662 GET_CURRENT_CONTEXT(ctx
);
3664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3665 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3669 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3671 if (ctx
->ExecuteFlag
) {
3672 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3677 static void GLAPIENTRY
3678 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3680 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3682 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3683 for (i
= 0; i
< mapsize
; i
++) {
3684 fvalues
[i
] = (GLfloat
) values
[i
];
3688 for (i
= 0; i
< mapsize
; i
++) {
3689 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3692 save_PixelMapfv(map
, mapsize
, fvalues
);
3696 static void GLAPIENTRY
3697 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3699 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3701 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3702 for (i
= 0; i
< mapsize
; i
++) {
3703 fvalues
[i
] = (GLfloat
) values
[i
];
3707 for (i
= 0; i
< mapsize
; i
++) {
3708 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3711 save_PixelMapfv(map
, mapsize
, fvalues
);
3715 static void GLAPIENTRY
3716 save_PixelTransferf(GLenum pname
, GLfloat param
)
3718 GET_CURRENT_CONTEXT(ctx
);
3720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3721 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3726 if (ctx
->ExecuteFlag
) {
3727 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3732 static void GLAPIENTRY
3733 save_PixelTransferi(GLenum pname
, GLint param
)
3735 save_PixelTransferf(pname
, (GLfloat
) param
);
3739 static void GLAPIENTRY
3740 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3742 GET_CURRENT_CONTEXT(ctx
);
3744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3745 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3750 if (ctx
->ExecuteFlag
) {
3751 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3756 static void GLAPIENTRY
3757 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3759 GET_CURRENT_CONTEXT(ctx
);
3761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3762 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3769 if (ctx
->ExecuteFlag
) {
3770 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3775 static void GLAPIENTRY
3776 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3780 parray
[1] = parray
[2] = 0.0F
;
3781 save_PointParameterfvEXT(pname
, parray
);
3784 static void GLAPIENTRY
3785 save_PointParameteriNV(GLenum pname
, GLint param
)
3788 parray
[0] = (GLfloat
) param
;
3789 parray
[1] = parray
[2] = 0.0F
;
3790 save_PointParameterfvEXT(pname
, parray
);
3793 static void GLAPIENTRY
3794 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3797 parray
[0] = (GLfloat
) param
[0];
3798 parray
[1] = parray
[2] = 0.0F
;
3799 save_PointParameterfvEXT(pname
, parray
);
3803 static void GLAPIENTRY
3804 save_PointSize(GLfloat size
)
3806 GET_CURRENT_CONTEXT(ctx
);
3808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3809 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3813 if (ctx
->ExecuteFlag
) {
3814 CALL_PointSize(ctx
->Exec
, (size
));
3819 static void GLAPIENTRY
3820 save_PolygonMode(GLenum face
, GLenum mode
)
3822 GET_CURRENT_CONTEXT(ctx
);
3824 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3825 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3830 if (ctx
->ExecuteFlag
) {
3831 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3836 static void GLAPIENTRY
3837 save_PolygonStipple(const GLubyte
* pattern
)
3839 GET_CURRENT_CONTEXT(ctx
);
3842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3844 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3847 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3848 pattern
, &ctx
->Unpack
));
3850 if (ctx
->ExecuteFlag
) {
3851 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3856 static void GLAPIENTRY
3857 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3859 GET_CURRENT_CONTEXT(ctx
);
3861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3862 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3867 if (ctx
->ExecuteFlag
) {
3868 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3873 static void GLAPIENTRY
3874 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3876 GET_CURRENT_CONTEXT(ctx
);
3878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3879 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3885 if (ctx
->ExecuteFlag
) {
3886 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3890 static void GLAPIENTRY
3891 save_PopAttrib(void)
3893 GET_CURRENT_CONTEXT(ctx
);
3894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3895 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3896 if (ctx
->ExecuteFlag
) {
3897 CALL_PopAttrib(ctx
->Exec
, ());
3902 static void GLAPIENTRY
3903 save_PopMatrix(void)
3905 GET_CURRENT_CONTEXT(ctx
);
3906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3907 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3908 if (ctx
->ExecuteFlag
) {
3909 CALL_PopMatrix(ctx
->Exec
, ());
3914 static void GLAPIENTRY
3917 GET_CURRENT_CONTEXT(ctx
);
3918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3919 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3920 if (ctx
->ExecuteFlag
) {
3921 CALL_PopName(ctx
->Exec
, ());
3926 static void GLAPIENTRY
3927 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3928 const GLclampf
* priorities
)
3930 GET_CURRENT_CONTEXT(ctx
);
3932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3934 for (i
= 0; i
< num
; i
++) {
3936 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3938 n
[1].ui
= textures
[i
];
3939 n
[2].f
= priorities
[i
];
3942 if (ctx
->ExecuteFlag
) {
3943 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3948 static void GLAPIENTRY
3949 save_PushAttrib(GLbitfield mask
)
3951 GET_CURRENT_CONTEXT(ctx
);
3953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3954 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3958 if (ctx
->ExecuteFlag
) {
3959 CALL_PushAttrib(ctx
->Exec
, (mask
));
3964 static void GLAPIENTRY
3965 save_PushMatrix(void)
3967 GET_CURRENT_CONTEXT(ctx
);
3968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3969 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3970 if (ctx
->ExecuteFlag
) {
3971 CALL_PushMatrix(ctx
->Exec
, ());
3976 static void GLAPIENTRY
3977 save_PushName(GLuint name
)
3979 GET_CURRENT_CONTEXT(ctx
);
3981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3982 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3986 if (ctx
->ExecuteFlag
) {
3987 CALL_PushName(ctx
->Exec
, (name
));
3992 static void GLAPIENTRY
3993 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3995 GET_CURRENT_CONTEXT(ctx
);
3997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3998 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
4005 if (ctx
->ExecuteFlag
) {
4006 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
4010 static void GLAPIENTRY
4011 save_RasterPos2d(GLdouble x
, GLdouble y
)
4013 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4016 static void GLAPIENTRY
4017 save_RasterPos2f(GLfloat x
, GLfloat y
)
4019 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4022 static void GLAPIENTRY
4023 save_RasterPos2i(GLint x
, GLint y
)
4025 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4028 static void GLAPIENTRY
4029 save_RasterPos2s(GLshort x
, GLshort y
)
4031 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4034 static void GLAPIENTRY
4035 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
4037 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4040 static void GLAPIENTRY
4041 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
4043 save_RasterPos4f(x
, y
, z
, 1.0F
);
4046 static void GLAPIENTRY
4047 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
4049 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4052 static void GLAPIENTRY
4053 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
4055 save_RasterPos4f(x
, y
, z
, 1.0F
);
4058 static void GLAPIENTRY
4059 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4061 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4064 static void GLAPIENTRY
4065 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
4067 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4070 static void GLAPIENTRY
4071 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4073 save_RasterPos4f(x
, y
, z
, w
);
4076 static void GLAPIENTRY
4077 save_RasterPos2dv(const GLdouble
* v
)
4079 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4082 static void GLAPIENTRY
4083 save_RasterPos2fv(const GLfloat
* v
)
4085 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4088 static void GLAPIENTRY
4089 save_RasterPos2iv(const GLint
* v
)
4091 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4094 static void GLAPIENTRY
4095 save_RasterPos2sv(const GLshort
* v
)
4097 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4100 static void GLAPIENTRY
4101 save_RasterPos3dv(const GLdouble
* v
)
4103 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4106 static void GLAPIENTRY
4107 save_RasterPos3fv(const GLfloat
* v
)
4109 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4112 static void GLAPIENTRY
4113 save_RasterPos3iv(const GLint
* v
)
4115 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4118 static void GLAPIENTRY
4119 save_RasterPos3sv(const GLshort
* v
)
4121 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4124 static void GLAPIENTRY
4125 save_RasterPos4dv(const GLdouble
* v
)
4127 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4128 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4131 static void GLAPIENTRY
4132 save_RasterPos4fv(const GLfloat
* v
)
4134 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4137 static void GLAPIENTRY
4138 save_RasterPos4iv(const GLint
* v
)
4140 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4141 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4144 static void GLAPIENTRY
4145 save_RasterPos4sv(const GLshort
* v
)
4147 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4151 static void GLAPIENTRY
4152 save_PassThrough(GLfloat token
)
4154 GET_CURRENT_CONTEXT(ctx
);
4156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4157 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4161 if (ctx
->ExecuteFlag
) {
4162 CALL_PassThrough(ctx
->Exec
, (token
));
4167 static void GLAPIENTRY
4168 save_ReadBuffer(GLenum mode
)
4170 GET_CURRENT_CONTEXT(ctx
);
4172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4173 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4177 if (ctx
->ExecuteFlag
) {
4178 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4183 static void GLAPIENTRY
4184 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4186 GET_CURRENT_CONTEXT(ctx
);
4188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4189 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4196 if (ctx
->ExecuteFlag
) {
4197 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4202 static void GLAPIENTRY
4203 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4205 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4209 static void GLAPIENTRY
4210 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4212 GET_CURRENT_CONTEXT(ctx
);
4214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4215 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4221 if (ctx
->ExecuteFlag
) {
4222 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4227 static void GLAPIENTRY
4228 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4230 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4234 static void GLAPIENTRY
4235 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4237 GET_CURRENT_CONTEXT(ctx
);
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4240 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4247 if (ctx
->ExecuteFlag
) {
4248 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4253 static void GLAPIENTRY
4254 save_ShadeModel(GLenum mode
)
4256 GET_CURRENT_CONTEXT(ctx
);
4258 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4260 if (ctx
->ExecuteFlag
) {
4261 CALL_ShadeModel(ctx
->Exec
, (mode
));
4264 /* Don't compile this call if it's a no-op.
4265 * By avoiding this state change we have a better chance of
4266 * coalescing subsequent drawing commands into one batch.
4268 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4271 SAVE_FLUSH_VERTICES(ctx
);
4273 ctx
->ListState
.Current
.ShadeModel
= mode
;
4275 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4282 static void GLAPIENTRY
4283 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4285 GET_CURRENT_CONTEXT(ctx
);
4287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4288 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4294 if (ctx
->ExecuteFlag
) {
4295 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4300 static void GLAPIENTRY
4301 save_StencilMask(GLuint mask
)
4303 GET_CURRENT_CONTEXT(ctx
);
4305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4306 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4310 if (ctx
->ExecuteFlag
) {
4311 CALL_StencilMask(ctx
->Exec
, (mask
));
4316 static void GLAPIENTRY
4317 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4319 GET_CURRENT_CONTEXT(ctx
);
4321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4322 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4328 if (ctx
->ExecuteFlag
) {
4329 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4334 static void GLAPIENTRY
4335 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4337 GET_CURRENT_CONTEXT(ctx
);
4339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4340 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4347 if (ctx
->ExecuteFlag
) {
4348 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4353 static void GLAPIENTRY
4354 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4357 GET_CURRENT_CONTEXT(ctx
);
4359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4361 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4369 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4376 if (ctx
->ExecuteFlag
) {
4377 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4378 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4383 static void GLAPIENTRY
4384 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4386 GET_CURRENT_CONTEXT(ctx
);
4388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4389 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4394 if (ctx
->ExecuteFlag
) {
4395 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4400 static void GLAPIENTRY
4401 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4403 GET_CURRENT_CONTEXT(ctx
);
4405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4406 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4413 if (ctx
->ExecuteFlag
) {
4414 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4419 static void GLAPIENTRY
4420 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4422 GET_CURRENT_CONTEXT(ctx
);
4424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4425 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4429 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4437 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4440 if (ctx
->ExecuteFlag
) {
4441 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4446 static void GLAPIENTRY
4447 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4450 parray
[0] = (GLfloat
) param
;
4451 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4452 save_TexEnvfv(target
, pname
, parray
);
4456 static void GLAPIENTRY
4457 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4460 p
[0] = (GLfloat
) param
;
4461 p
[1] = p
[2] = p
[3] = 0.0F
;
4462 save_TexEnvfv(target
, pname
, p
);
4466 static void GLAPIENTRY
4467 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4470 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4471 p
[0] = INT_TO_FLOAT(param
[0]);
4472 p
[1] = INT_TO_FLOAT(param
[1]);
4473 p
[2] = INT_TO_FLOAT(param
[2]);
4474 p
[3] = INT_TO_FLOAT(param
[3]);
4477 p
[0] = (GLfloat
) param
[0];
4478 p
[1] = p
[2] = p
[3] = 0.0F
;
4480 save_TexEnvfv(target
, pname
, p
);
4484 static void GLAPIENTRY
4485 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4487 GET_CURRENT_CONTEXT(ctx
);
4489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4490 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4499 if (ctx
->ExecuteFlag
) {
4500 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4505 static void GLAPIENTRY
4506 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4509 p
[0] = (GLfloat
) params
[0];
4510 p
[1] = (GLfloat
) params
[1];
4511 p
[2] = (GLfloat
) params
[2];
4512 p
[3] = (GLfloat
) params
[3];
4513 save_TexGenfv(coord
, pname
, p
);
4517 static void GLAPIENTRY
4518 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4521 parray
[0] = (GLfloat
) param
;
4522 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4523 save_TexGenfv(coord
, pname
, parray
);
4527 static void GLAPIENTRY
4528 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4531 p
[0] = (GLfloat
) params
[0];
4532 p
[1] = (GLfloat
) params
[1];
4533 p
[2] = (GLfloat
) params
[2];
4534 p
[3] = (GLfloat
) params
[3];
4535 save_TexGenfv(coord
, pname
, p
);
4539 static void GLAPIENTRY
4540 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4544 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4545 save_TexGenfv(coord
, pname
, parray
);
4549 static void GLAPIENTRY
4550 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4554 parray
[1] = parray
[2] = parray
[3] = 0;
4555 save_TexGeniv(coord
, pname
, parray
);
4559 static void GLAPIENTRY
4560 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4562 GET_CURRENT_CONTEXT(ctx
);
4564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4565 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4574 if (ctx
->ExecuteFlag
) {
4575 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4580 static void GLAPIENTRY
4581 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4585 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4586 save_TexParameterfv(target
, pname
, parray
);
4590 static void GLAPIENTRY
4591 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4594 fparam
[0] = (GLfloat
) param
;
4595 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4596 save_TexParameterfv(target
, pname
, fparam
);
4600 static void GLAPIENTRY
4601 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4604 fparam
[0] = (GLfloat
) params
[0];
4605 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4606 save_TexParameterfv(target
, pname
, fparam
);
4610 static void GLAPIENTRY
4611 save_TexImage1D(GLenum target
,
4612 GLint level
, GLint components
,
4613 GLsizei width
, GLint border
,
4614 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4616 GET_CURRENT_CONTEXT(ctx
);
4617 if (target
== GL_PROXY_TEXTURE_1D
) {
4618 /* don't compile, execute immediately */
4619 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4620 border
, format
, type
, pixels
));
4624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4625 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4629 n
[3].i
= components
;
4630 n
[4].i
= (GLint
) width
;
4635 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4636 pixels
, &ctx
->Unpack
));
4638 if (ctx
->ExecuteFlag
) {
4639 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4640 border
, format
, type
, pixels
));
4646 static void GLAPIENTRY
4647 save_TexImage2D(GLenum target
,
4648 GLint level
, GLint components
,
4649 GLsizei width
, GLsizei height
, GLint border
,
4650 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4652 GET_CURRENT_CONTEXT(ctx
);
4653 if (target
== GL_PROXY_TEXTURE_2D
) {
4654 /* don't compile, execute immediately */
4655 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4656 height
, border
, format
, type
, pixels
));
4660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4661 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4665 n
[3].i
= components
;
4666 n
[4].i
= (GLint
) width
;
4667 n
[5].i
= (GLint
) height
;
4672 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4673 pixels
, &ctx
->Unpack
));
4675 if (ctx
->ExecuteFlag
) {
4676 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4677 height
, border
, format
, type
, pixels
));
4683 static void GLAPIENTRY
4684 save_TexImage3D(GLenum target
,
4685 GLint level
, GLint internalFormat
,
4686 GLsizei width
, GLsizei height
, GLsizei depth
,
4688 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4690 GET_CURRENT_CONTEXT(ctx
);
4691 if (target
== GL_PROXY_TEXTURE_3D
) {
4692 /* don't compile, execute immediately */
4693 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4694 height
, depth
, border
, format
, type
,
4699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4700 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4704 n
[3].i
= (GLint
) internalFormat
;
4705 n
[4].i
= (GLint
) width
;
4706 n
[5].i
= (GLint
) height
;
4707 n
[6].i
= (GLint
) depth
;
4711 save_pointer(&n
[10],
4712 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4713 pixels
, &ctx
->Unpack
));
4715 if (ctx
->ExecuteFlag
) {
4716 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4717 height
, depth
, border
, format
, type
,
4724 static void GLAPIENTRY
4725 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4726 GLsizei width
, GLenum format
, GLenum type
,
4727 const GLvoid
* pixels
)
4729 GET_CURRENT_CONTEXT(ctx
);
4732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4734 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4739 n
[4].i
= (GLint
) width
;
4743 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4744 pixels
, &ctx
->Unpack
));
4746 if (ctx
->ExecuteFlag
) {
4747 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4748 format
, type
, pixels
));
4753 static void GLAPIENTRY
4754 save_TexSubImage2D(GLenum target
, GLint level
,
4755 GLint xoffset
, GLint yoffset
,
4756 GLsizei width
, GLsizei height
,
4757 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4759 GET_CURRENT_CONTEXT(ctx
);
4762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4764 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4770 n
[5].i
= (GLint
) width
;
4771 n
[6].i
= (GLint
) height
;
4775 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4776 pixels
, &ctx
->Unpack
));
4778 if (ctx
->ExecuteFlag
) {
4779 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4780 width
, height
, format
, type
, pixels
));
4785 static void GLAPIENTRY
4786 save_TexSubImage3D(GLenum target
, GLint level
,
4787 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4788 GLsizei width
, GLsizei height
, GLsizei depth
,
4789 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4791 GET_CURRENT_CONTEXT(ctx
);
4794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4796 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4803 n
[6].i
= (GLint
) width
;
4804 n
[7].i
= (GLint
) height
;
4805 n
[8].i
= (GLint
) depth
;
4808 save_pointer(&n
[11],
4809 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4810 pixels
, &ctx
->Unpack
));
4812 if (ctx
->ExecuteFlag
) {
4813 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4814 xoffset
, yoffset
, zoffset
,
4815 width
, height
, depth
, format
, type
,
4821 static void GLAPIENTRY
4822 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4824 GET_CURRENT_CONTEXT(ctx
);
4826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4827 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4833 if (ctx
->ExecuteFlag
) {
4834 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4839 static void GLAPIENTRY
4840 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4842 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4847 static void GLAPIENTRY
4848 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4850 GET_CURRENT_CONTEXT(ctx
);
4852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4853 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4857 n
[3].i
= (GLint
) width
;
4858 n
[4].i
= (GLint
) height
;
4860 if (ctx
->ExecuteFlag
) {
4861 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4865 static void GLAPIENTRY
4866 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4869 GET_CURRENT_CONTEXT(ctx
);
4871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4872 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4880 if (ctx
->ExecuteFlag
) {
4881 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4885 static void GLAPIENTRY
4886 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4888 GET_CURRENT_CONTEXT(ctx
);
4890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4891 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4899 if (ctx
->ExecuteFlag
) {
4900 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4904 static void GLAPIENTRY
4905 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4907 GET_CURRENT_CONTEXT(ctx
);
4909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4910 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4914 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4916 if (ctx
->ExecuteFlag
) {
4917 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4921 static void GLAPIENTRY
4922 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4925 GET_CURRENT_CONTEXT(ctx
);
4927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4928 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4936 if (ctx
->ExecuteFlag
) {
4937 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4941 static void GLAPIENTRY
4942 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4944 GET_CURRENT_CONTEXT(ctx
);
4946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4947 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4955 if (ctx
->ExecuteFlag
) {
4956 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4960 static void GLAPIENTRY
4961 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4963 GET_CURRENT_CONTEXT(ctx
);
4965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4966 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4970 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4972 if (ctx
->ExecuteFlag
) {
4973 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4977 static void GLAPIENTRY
4978 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4980 GET_CURRENT_CONTEXT(ctx
);
4982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4983 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4986 /* Mesa stores these as floats internally so we deliberately convert
4987 * them to a float here.
4992 if (ctx
->ExecuteFlag
) {
4993 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4997 static void GLAPIENTRY
4998 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
5000 GET_CURRENT_CONTEXT(ctx
);
5002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5003 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
5007 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
5009 if (ctx
->ExecuteFlag
) {
5010 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
5014 static void GLAPIENTRY
5015 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5017 GET_CURRENT_CONTEXT(ctx
);
5019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5020 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
5027 if (ctx
->ExecuteFlag
) {
5028 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
5032 static void GLAPIENTRY
5033 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
5035 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5038 static void GLAPIENTRY
5039 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
5041 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5044 static void GLAPIENTRY
5045 save_WindowPos2iMESA(GLint x
, GLint y
)
5047 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5050 static void GLAPIENTRY
5051 save_WindowPos2sMESA(GLshort x
, GLshort y
)
5053 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5056 static void GLAPIENTRY
5057 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
5059 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5062 static void GLAPIENTRY
5063 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
5065 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5068 static void GLAPIENTRY
5069 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
5071 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5074 static void GLAPIENTRY
5075 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
5077 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5080 static void GLAPIENTRY
5081 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5083 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5086 static void GLAPIENTRY
5087 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
5089 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5092 static void GLAPIENTRY
5093 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
5095 save_WindowPos4fMESA(x
, y
, z
, w
);
5098 static void GLAPIENTRY
5099 save_WindowPos2dvMESA(const GLdouble
* v
)
5101 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5104 static void GLAPIENTRY
5105 save_WindowPos2fvMESA(const GLfloat
* v
)
5107 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5110 static void GLAPIENTRY
5111 save_WindowPos2ivMESA(const GLint
* v
)
5113 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5116 static void GLAPIENTRY
5117 save_WindowPos2svMESA(const GLshort
* v
)
5119 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5122 static void GLAPIENTRY
5123 save_WindowPos3dvMESA(const GLdouble
* v
)
5125 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5128 static void GLAPIENTRY
5129 save_WindowPos3fvMESA(const GLfloat
* v
)
5131 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5134 static void GLAPIENTRY
5135 save_WindowPos3ivMESA(const GLint
* v
)
5137 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5140 static void GLAPIENTRY
5141 save_WindowPos3svMESA(const GLshort
* v
)
5143 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5146 static void GLAPIENTRY
5147 save_WindowPos4dvMESA(const GLdouble
* v
)
5149 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5150 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5153 static void GLAPIENTRY
5154 save_WindowPos4fvMESA(const GLfloat
* v
)
5156 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5159 static void GLAPIENTRY
5160 save_WindowPos4ivMESA(const GLint
* v
)
5162 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5163 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5166 static void GLAPIENTRY
5167 save_WindowPos4svMESA(const GLshort
* v
)
5169 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5174 /* GL_ARB_multitexture */
5175 static void GLAPIENTRY
5176 save_ActiveTextureARB(GLenum target
)
5178 GET_CURRENT_CONTEXT(ctx
);
5180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5181 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5185 if (ctx
->ExecuteFlag
) {
5186 CALL_ActiveTexture(ctx
->Exec
, (target
));
5191 /* GL_ARB_transpose_matrix */
5193 static void GLAPIENTRY
5194 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5197 _math_transposefd(tm
, m
);
5198 save_LoadMatrixf(tm
);
5202 static void GLAPIENTRY
5203 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5206 _math_transposef(tm
, m
);
5207 save_LoadMatrixf(tm
);
5211 static void GLAPIENTRY
5212 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5215 _math_transposefd(tm
, m
);
5216 save_MultMatrixf(tm
);
5220 static void GLAPIENTRY
5221 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5224 _math_transposef(tm
, m
);
5225 save_MultMatrixf(tm
);
5228 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5230 GET_CURRENT_CONTEXT(ctx
);
5236 image
= malloc(size
);
5238 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5241 memcpy(image
, data
, size
);
5247 /* GL_ARB_texture_compression */
5248 static void GLAPIENTRY
5249 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5250 GLenum internalFormat
, GLsizei width
,
5251 GLint border
, GLsizei imageSize
,
5252 const GLvoid
* data
)
5254 GET_CURRENT_CONTEXT(ctx
);
5255 if (target
== GL_PROXY_TEXTURE_1D
) {
5256 /* don't compile, execute immediately */
5257 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5258 width
, border
, imageSize
,
5263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5265 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5266 6 + POINTER_DWORDS
);
5270 n
[3].e
= internalFormat
;
5271 n
[4].i
= (GLint
) width
;
5275 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5277 if (ctx
->ExecuteFlag
) {
5278 CALL_CompressedTexImage1D(ctx
->Exec
,
5279 (target
, level
, internalFormat
, width
,
5280 border
, imageSize
, data
));
5286 static void GLAPIENTRY
5287 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5288 GLenum internalFormat
, GLsizei width
,
5289 GLsizei height
, GLint border
, GLsizei imageSize
,
5290 const GLvoid
* data
)
5292 GET_CURRENT_CONTEXT(ctx
);
5293 if (target
== GL_PROXY_TEXTURE_2D
) {
5294 /* don't compile, execute immediately */
5295 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5296 width
, height
, border
,
5301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5303 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5304 7 + POINTER_DWORDS
);
5308 n
[3].e
= internalFormat
;
5309 n
[4].i
= (GLint
) width
;
5310 n
[5].i
= (GLint
) height
;
5314 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5316 if (ctx
->ExecuteFlag
) {
5317 CALL_CompressedTexImage2D(ctx
->Exec
,
5318 (target
, level
, internalFormat
, width
,
5319 height
, border
, imageSize
, data
));
5325 static void GLAPIENTRY
5326 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5327 GLenum internalFormat
, GLsizei width
,
5328 GLsizei height
, GLsizei depth
, GLint border
,
5329 GLsizei imageSize
, const GLvoid
* data
)
5331 GET_CURRENT_CONTEXT(ctx
);
5332 if (target
== GL_PROXY_TEXTURE_3D
) {
5333 /* don't compile, execute immediately */
5334 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5335 width
, height
, depth
, border
,
5340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5342 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5343 8 + POINTER_DWORDS
);
5347 n
[3].e
= internalFormat
;
5348 n
[4].i
= (GLint
) width
;
5349 n
[5].i
= (GLint
) height
;
5350 n
[6].i
= (GLint
) depth
;
5354 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5356 if (ctx
->ExecuteFlag
) {
5357 CALL_CompressedTexImage3D(ctx
->Exec
,
5358 (target
, level
, internalFormat
, width
,
5359 height
, depth
, border
, imageSize
,
5366 static void GLAPIENTRY
5367 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5368 GLsizei width
, GLenum format
,
5369 GLsizei imageSize
, const GLvoid
* data
)
5372 GET_CURRENT_CONTEXT(ctx
);
5373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5375 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5376 6 + POINTER_DWORDS
);
5381 n
[4].i
= (GLint
) width
;
5385 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5387 if (ctx
->ExecuteFlag
) {
5388 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5389 width
, format
, imageSize
,
5395 static void GLAPIENTRY
5396 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5397 GLint yoffset
, GLsizei width
, GLsizei height
,
5398 GLenum format
, GLsizei imageSize
,
5399 const GLvoid
* data
)
5402 GET_CURRENT_CONTEXT(ctx
);
5403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5405 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5406 8 + POINTER_DWORDS
);
5412 n
[5].i
= (GLint
) width
;
5413 n
[6].i
= (GLint
) height
;
5417 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5419 if (ctx
->ExecuteFlag
) {
5420 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5421 (target
, level
, xoffset
, yoffset
, width
,
5422 height
, format
, imageSize
, data
));
5427 static void GLAPIENTRY
5428 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5429 GLint yoffset
, GLint zoffset
, GLsizei width
,
5430 GLsizei height
, GLsizei depth
, GLenum format
,
5431 GLsizei imageSize
, const GLvoid
* data
)
5434 GET_CURRENT_CONTEXT(ctx
);
5435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5437 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5438 10 + POINTER_DWORDS
);
5445 n
[6].i
= (GLint
) width
;
5446 n
[7].i
= (GLint
) height
;
5447 n
[8].i
= (GLint
) depth
;
5449 n
[10].i
= imageSize
;
5450 save_pointer(&n
[11],
5451 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5453 if (ctx
->ExecuteFlag
) {
5454 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5455 (target
, level
, xoffset
, yoffset
,
5456 zoffset
, width
, height
, depth
, format
,
5462 /* GL_ARB_multisample */
5463 static void GLAPIENTRY
5464 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5466 GET_CURRENT_CONTEXT(ctx
);
5468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5469 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5474 if (ctx
->ExecuteFlag
) {
5475 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5481 * GL_ARB_vertex_program
5483 static void GLAPIENTRY
5484 save_BindProgramARB(GLenum target
, GLuint id
)
5486 GET_CURRENT_CONTEXT(ctx
);
5488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5489 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5494 if (ctx
->ExecuteFlag
) {
5495 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5499 static void GLAPIENTRY
5500 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5501 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5503 GET_CURRENT_CONTEXT(ctx
);
5505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5506 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5515 if (ctx
->ExecuteFlag
) {
5516 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5521 static void GLAPIENTRY
5522 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5523 const GLfloat
*params
)
5525 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5526 params
[2], params
[3]);
5530 static void GLAPIENTRY
5531 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5532 const GLfloat
* params
)
5534 GET_CURRENT_CONTEXT(ctx
);
5536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5540 const GLfloat
* p
= params
;
5542 for (i
= 0 ; i
< count
; i
++) {
5543 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5556 if (ctx
->ExecuteFlag
) {
5557 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5562 static void GLAPIENTRY
5563 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5564 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5566 save_ProgramEnvParameter4fARB(target
, index
,
5568 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5572 static void GLAPIENTRY
5573 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5574 const GLdouble
*params
)
5576 save_ProgramEnvParameter4fARB(target
, index
,
5577 (GLfloat
) params
[0],
5578 (GLfloat
) params
[1],
5579 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5583 static void GLAPIENTRY
5584 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5585 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5587 GET_CURRENT_CONTEXT(ctx
);
5589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5590 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5599 if (ctx
->ExecuteFlag
) {
5600 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5605 static void GLAPIENTRY
5606 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5607 const GLfloat
*params
)
5609 GET_CURRENT_CONTEXT(ctx
);
5611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5612 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5621 if (ctx
->ExecuteFlag
) {
5622 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5627 static void GLAPIENTRY
5628 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5629 const GLfloat
*params
)
5631 GET_CURRENT_CONTEXT(ctx
);
5633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5637 const GLfloat
* p
= params
;
5639 for (i
= 0 ; i
< count
; i
++) {
5640 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5653 if (ctx
->ExecuteFlag
) {
5654 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5659 static void GLAPIENTRY
5660 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5661 GLdouble x
, GLdouble y
,
5662 GLdouble z
, GLdouble w
)
5664 GET_CURRENT_CONTEXT(ctx
);
5666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5667 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5671 n
[3].f
= (GLfloat
) x
;
5672 n
[4].f
= (GLfloat
) y
;
5673 n
[5].f
= (GLfloat
) z
;
5674 n
[6].f
= (GLfloat
) w
;
5676 if (ctx
->ExecuteFlag
) {
5677 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5682 static void GLAPIENTRY
5683 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5684 const GLdouble
*params
)
5686 GET_CURRENT_CONTEXT(ctx
);
5688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5689 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5693 n
[3].f
= (GLfloat
) params
[0];
5694 n
[4].f
= (GLfloat
) params
[1];
5695 n
[5].f
= (GLfloat
) params
[2];
5696 n
[6].f
= (GLfloat
) params
[3];
5698 if (ctx
->ExecuteFlag
) {
5699 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5704 /* GL_EXT_stencil_two_side */
5705 static void GLAPIENTRY
5706 save_ActiveStencilFaceEXT(GLenum face
)
5708 GET_CURRENT_CONTEXT(ctx
);
5710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5711 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5715 if (ctx
->ExecuteFlag
) {
5716 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5721 /* GL_EXT_depth_bounds_test */
5722 static void GLAPIENTRY
5723 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5725 GET_CURRENT_CONTEXT(ctx
);
5727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5728 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5730 n
[1].f
= (GLfloat
) zmin
;
5731 n
[2].f
= (GLfloat
) zmax
;
5733 if (ctx
->ExecuteFlag
) {
5734 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5740 static void GLAPIENTRY
5741 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5742 const GLvoid
* string
)
5744 GET_CURRENT_CONTEXT(ctx
);
5747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5749 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5751 GLubyte
*programCopy
= malloc(len
);
5753 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5756 memcpy(programCopy
, string
, len
);
5760 save_pointer(&n
[4], programCopy
);
5762 if (ctx
->ExecuteFlag
) {
5763 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5768 static void GLAPIENTRY
5769 save_BeginQueryARB(GLenum target
, GLuint id
)
5771 GET_CURRENT_CONTEXT(ctx
);
5773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5774 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5779 if (ctx
->ExecuteFlag
) {
5780 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5784 static void GLAPIENTRY
5785 save_EndQueryARB(GLenum target
)
5787 GET_CURRENT_CONTEXT(ctx
);
5789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5790 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5794 if (ctx
->ExecuteFlag
) {
5795 CALL_EndQuery(ctx
->Exec
, (target
));
5799 static void GLAPIENTRY
5800 save_QueryCounter(GLuint id
, GLenum target
)
5802 GET_CURRENT_CONTEXT(ctx
);
5804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5805 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5810 if (ctx
->ExecuteFlag
) {
5811 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5815 static void GLAPIENTRY
5816 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5818 GET_CURRENT_CONTEXT(ctx
);
5820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5821 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5827 if (ctx
->ExecuteFlag
) {
5828 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5832 static void GLAPIENTRY
5833 save_EndQueryIndexed(GLenum target
, GLuint index
)
5835 GET_CURRENT_CONTEXT(ctx
);
5837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5838 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5843 if (ctx
->ExecuteFlag
) {
5844 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5849 static void GLAPIENTRY
5850 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5852 GET_CURRENT_CONTEXT(ctx
);
5854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5855 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5859 if (count
> MAX_DRAW_BUFFERS
)
5860 count
= MAX_DRAW_BUFFERS
;
5861 for (i
= 0; i
< count
; i
++) {
5862 n
[2 + i
].e
= buffers
[i
];
5865 if (ctx
->ExecuteFlag
) {
5866 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5870 static void GLAPIENTRY
5871 save_BindFragmentShaderATI(GLuint id
)
5873 GET_CURRENT_CONTEXT(ctx
);
5876 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5880 if (ctx
->ExecuteFlag
) {
5881 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5885 static void GLAPIENTRY
5886 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5888 GET_CURRENT_CONTEXT(ctx
);
5891 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5899 if (ctx
->ExecuteFlag
) {
5900 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5904 static void GLAPIENTRY
5905 save_EvalCoord1f(GLfloat x
)
5907 GET_CURRENT_CONTEXT(ctx
);
5909 SAVE_FLUSH_VERTICES(ctx
);
5910 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5914 if (ctx
->ExecuteFlag
) {
5915 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5919 static void GLAPIENTRY
5920 save_EvalCoord1fv(const GLfloat
* v
)
5922 save_EvalCoord1f(v
[0]);
5925 static void GLAPIENTRY
5926 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5928 GET_CURRENT_CONTEXT(ctx
);
5930 SAVE_FLUSH_VERTICES(ctx
);
5931 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5936 if (ctx
->ExecuteFlag
) {
5937 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5941 static void GLAPIENTRY
5942 save_EvalCoord2fv(const GLfloat
* v
)
5944 save_EvalCoord2f(v
[0], v
[1]);
5948 static void GLAPIENTRY
5949 save_EvalPoint1(GLint x
)
5951 GET_CURRENT_CONTEXT(ctx
);
5953 SAVE_FLUSH_VERTICES(ctx
);
5954 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5958 if (ctx
->ExecuteFlag
) {
5959 CALL_EvalPoint1(ctx
->Exec
, (x
));
5963 static void GLAPIENTRY
5964 save_EvalPoint2(GLint x
, GLint y
)
5966 GET_CURRENT_CONTEXT(ctx
);
5968 SAVE_FLUSH_VERTICES(ctx
);
5969 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5974 if (ctx
->ExecuteFlag
) {
5975 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5981 * Compare 'count' elements of vectors 'a' and 'b'.
5982 * \return GL_TRUE if equal, GL_FALSE if different.
5984 static inline GLboolean
5985 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
5987 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5992 * This glMaterial function is used for glMaterial calls that are outside
5993 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5995 static void GLAPIENTRY
5996 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5998 GET_CURRENT_CONTEXT(ctx
);
6006 case GL_FRONT_AND_BACK
:
6009 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6018 case GL_AMBIENT_AND_DIFFUSE
:
6024 case GL_COLOR_INDEXES
:
6028 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6032 if (ctx
->ExecuteFlag
) {
6033 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6036 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6038 /* Try to eliminate redundant statechanges. Because it is legal to
6039 * call glMaterial even inside begin/end calls, don't need to worry
6040 * about ctx->Driver.CurrentSavePrimitive here.
6042 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6043 if (bitmask
& (1 << i
)) {
6044 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6045 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6046 /* no change in material value */
6047 bitmask
&= ~(1 << i
);
6050 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6051 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6056 /* If this call has no effect, return early */
6060 SAVE_FLUSH_VERTICES(ctx
);
6062 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6066 for (i
= 0; i
< args
; i
++)
6067 n
[3 + i
].f
= param
[i
];
6071 static void GLAPIENTRY
6072 save_Begin(GLenum mode
)
6074 GET_CURRENT_CONTEXT(ctx
);
6076 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6077 /* compile this error into the display list */
6078 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6080 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6081 /* compile this error into the display list */
6082 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6085 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6087 vbo_save_NotifyBegin(ctx
, mode
, false);
6091 static void GLAPIENTRY
6094 GET_CURRENT_CONTEXT(ctx
);
6095 SAVE_FLUSH_VERTICES(ctx
);
6096 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6097 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6098 if (ctx
->ExecuteFlag
) {
6099 CALL_End(ctx
->Exec
, ());
6103 static void GLAPIENTRY
6104 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6106 GET_CURRENT_CONTEXT(ctx
);
6108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6109 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6116 if (ctx
->ExecuteFlag
) {
6117 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6121 static void GLAPIENTRY
6122 save_PrimitiveRestartNV(void)
6124 /* Note: this is used when outside a glBegin/End pair in a display list */
6125 GET_CURRENT_CONTEXT(ctx
);
6126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6127 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6128 if (ctx
->ExecuteFlag
) {
6129 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6134 static void GLAPIENTRY
6135 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6136 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6137 GLbitfield mask
, GLenum filter
)
6139 GET_CURRENT_CONTEXT(ctx
);
6141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6142 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6155 if (ctx
->ExecuteFlag
) {
6156 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6157 dstX0
, dstY0
, dstX1
, dstY1
,
6163 /** GL_EXT_provoking_vertex */
6164 static void GLAPIENTRY
6165 save_ProvokingVertexEXT(GLenum mode
)
6167 GET_CURRENT_CONTEXT(ctx
);
6169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6170 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6174 if (ctx
->ExecuteFlag
) {
6175 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6176 _mesa_ProvokingVertex(mode
);
6181 /** GL_EXT_transform_feedback */
6182 static void GLAPIENTRY
6183 save_BeginTransformFeedback(GLenum mode
)
6185 GET_CURRENT_CONTEXT(ctx
);
6187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6188 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6192 if (ctx
->ExecuteFlag
) {
6193 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6198 /** GL_EXT_transform_feedback */
6199 static void GLAPIENTRY
6200 save_EndTransformFeedback(void)
6202 GET_CURRENT_CONTEXT(ctx
);
6203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6204 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6205 if (ctx
->ExecuteFlag
) {
6206 CALL_EndTransformFeedback(ctx
->Exec
, ());
6210 static void GLAPIENTRY
6211 save_BindTransformFeedback(GLenum target
, GLuint name
)
6213 GET_CURRENT_CONTEXT(ctx
);
6215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6216 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6221 if (ctx
->ExecuteFlag
) {
6222 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6226 static void GLAPIENTRY
6227 save_PauseTransformFeedback(void)
6229 GET_CURRENT_CONTEXT(ctx
);
6230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6231 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6232 if (ctx
->ExecuteFlag
) {
6233 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6237 static void GLAPIENTRY
6238 save_ResumeTransformFeedback(void)
6240 GET_CURRENT_CONTEXT(ctx
);
6241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6242 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6243 if (ctx
->ExecuteFlag
) {
6244 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6248 static void GLAPIENTRY
6249 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6251 GET_CURRENT_CONTEXT(ctx
);
6253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6254 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6259 if (ctx
->ExecuteFlag
) {
6260 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6264 static void GLAPIENTRY
6265 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6267 GET_CURRENT_CONTEXT(ctx
);
6269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6270 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6276 if (ctx
->ExecuteFlag
) {
6277 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6281 static void GLAPIENTRY
6282 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6285 GET_CURRENT_CONTEXT(ctx
);
6287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6288 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6292 n
[3].si
= primcount
;
6294 if (ctx
->ExecuteFlag
) {
6295 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6299 static void GLAPIENTRY
6300 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6301 GLuint stream
, GLsizei primcount
)
6303 GET_CURRENT_CONTEXT(ctx
);
6305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6306 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6311 n
[4].si
= primcount
;
6313 if (ctx
->ExecuteFlag
) {
6314 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6319 static void GLAPIENTRY
6320 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6321 GLuint num_groups_z
)
6323 GET_CURRENT_CONTEXT(ctx
);
6325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6326 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6328 n
[1].ui
= num_groups_x
;
6329 n
[2].ui
= num_groups_y
;
6330 n
[3].ui
= num_groups_z
;
6332 if (ctx
->ExecuteFlag
) {
6333 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6338 static void GLAPIENTRY
6339 save_DispatchComputeIndirect(GLintptr indirect
)
6341 GET_CURRENT_CONTEXT(ctx
);
6342 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6343 "glDispatchComputeIndirect() during display list compile");
6346 static void ALWAYS_INLINE
6347 save_Attr32bit(struct gl_context
*ctx
, unsigned attr
, unsigned size
,
6348 GLenum type
, uint32_t x
, uint32_t y
, uint32_t z
, uint32_t w
)
6351 SAVE_FLUSH_VERTICES(ctx
);
6353 unsigned index
= attr
;
6355 /* We don't care about GL_INT vs GL_UNSIGNED_INT. The idea is to get W=1
6356 * right for 3 or lower number of components, so only distinguish between
6359 if (type
== GL_FLOAT
) {
6360 if (attr
>= VERT_ATTRIB_GENERIC0
) {
6361 base_op
= OPCODE_ATTR_1F_ARB
;
6362 attr
-= VERT_ATTRIB_GENERIC0
;
6364 base_op
= OPCODE_ATTR_1F_NV
;
6367 base_op
= OPCODE_ATTR_1I
;
6368 attr
-= VERT_ATTRIB_GENERIC0
;
6371 n
= alloc_instruction(ctx
, base_op
+ size
- 1, 1 + size
);
6375 if (size
>= 2) n
[3].ui
= y
;
6376 if (size
>= 3) n
[4].ui
= z
;
6377 if (size
>= 4) n
[5].ui
= w
;
6380 ctx
->ListState
.ActiveAttribSize
[index
] = size
;
6381 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[index
], x
, y
, z
, w
);
6383 if (ctx
->ExecuteFlag
) {
6384 if (type
== GL_FLOAT
) {
6385 if (base_op
== OPCODE_ATTR_1F_NV
) {
6387 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
), uif(w
)));
6389 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
)));
6391 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, uif(x
), uif(y
)));
6393 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, uif(x
)));
6396 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
), uif(w
)));
6398 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
), uif(z
)));
6400 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, uif(x
), uif(y
)));
6402 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, uif(x
)));
6406 CALL_VertexAttribI4iEXT(ctx
->Exec
, (attr
, x
, y
, z
, w
));
6408 CALL_VertexAttribI3iEXT(ctx
->Exec
, (attr
, x
, y
, z
));
6410 CALL_VertexAttribI2iEXT(ctx
->Exec
, (attr
, x
, y
));
6412 CALL_VertexAttribI1iEXT(ctx
->Exec
, (attr
, x
));
6417 static void ALWAYS_INLINE
6418 save_Attr64bit(struct gl_context
*ctx
, unsigned attr
, unsigned size
,
6419 GLenum type
, uint64_t x
, uint64_t y
, uint64_t z
, uint64_t w
)
6422 SAVE_FLUSH_VERTICES(ctx
);
6424 unsigned index
= attr
;
6426 if (type
== GL_DOUBLE
) {
6427 base_op
= OPCODE_ATTR_1D
;
6429 base_op
= OPCODE_ATTR_1UI64
;
6433 attr
-= VERT_ATTRIB_GENERIC0
;
6434 n
= alloc_instruction(ctx
, base_op
+ size
- 1, 1 + size
* 2);
6437 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
6438 if (size
>= 2) ASSIGN_UINT64_TO_NODES(n
, 4, y
);
6439 if (size
>= 3) ASSIGN_UINT64_TO_NODES(n
, 6, z
);
6440 if (size
>= 4) ASSIGN_UINT64_TO_NODES(n
, 8, w
);
6443 ctx
->ListState
.ActiveAttribSize
[index
] = size
;
6444 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], size
* sizeof(uint64_t));
6446 if (ctx
->ExecuteFlag
) {
6447 uint64_t v
[] = {x
, y
, z
, w
};
6448 if (type
== GL_DOUBLE
) {
6450 CALL_VertexAttribL4dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6452 CALL_VertexAttribL3dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6454 CALL_VertexAttribL2dv(ctx
->Exec
, (attr
, (GLdouble
*)v
));
6456 CALL_VertexAttribL1d(ctx
->Exec
, (attr
, UINT64_AS_DOUBLE(x
)));
6458 CALL_VertexAttribL1ui64ARB(ctx
->Exec
, (attr
, x
));
6464 * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
6465 * It depends on a few things, including whether we're inside or outside
6469 is_vertex_position(const struct gl_context
*ctx
, GLuint index
)
6471 return (index
== 0 &&
6472 _mesa_attr_zero_aliases_vertex(ctx
) &&
6473 _mesa_inside_dlist_begin_end(ctx
));
6477 * This macro is used to implement all the glVertex, glColor, glTexCoord,
6478 * glVertexAttrib, etc functions.
6479 * \param A VBO_ATTRIB_x attribute index
6480 * \param N attribute size (1..4)
6481 * \param T type (GL_FLOAT, GL_DOUBLE, GL_INT, GL_UNSIGNED_INT)
6482 * \param C cast type (uint32_t or uint64_t)
6483 * \param V0, V1, v2, V3 attribute value
6485 #define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) \
6487 if (sizeof(C) == 4) { \
6488 save_Attr32bit(ctx, A, N, T, V0, V1, V2, V3); \
6490 save_Attr64bit(ctx, A, N, T, V0, V1, V2, V3); \
6495 #define ERROR(err) _mesa_error(ctx, err, __func__)
6496 #define TAG(x) save_##x
6498 #define VBO_ATTRIB_POS VERT_ATTRIB_POS
6499 #define VBO_ATTRIB_NORMAL VERT_ATTRIB_NORMAL
6500 #define VBO_ATTRIB_COLOR0 VERT_ATTRIB_COLOR0
6501 #define VBO_ATTRIB_COLOR1 VERT_ATTRIB_COLOR1
6502 #define VBO_ATTRIB_FOG VERT_ATTRIB_FOG
6503 #define VBO_ATTRIB_COLOR_INDEX VERT_ATTRIB_COLOR_INDEX
6504 #define VBO_ATTRIB_EDGEFLAG VERT_ATTRIB_EDGEFLAG
6505 #define VBO_ATTRIB_TEX0 VERT_ATTRIB_TEX0
6506 #define VBO_ATTRIB_GENERIC0 VERT_ATTRIB_GENERIC0
6507 #define VBO_ATTRIB_MAX VERT_ATTRIB_MAX
6509 #include "vbo/vbo_attrib_tmp.h"
6511 static void GLAPIENTRY
6512 save_UseProgram(GLuint program
)
6514 GET_CURRENT_CONTEXT(ctx
);
6516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6517 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6521 if (ctx
->ExecuteFlag
) {
6522 CALL_UseProgram(ctx
->Exec
, (program
));
6527 static void GLAPIENTRY
6528 save_Uniform1fARB(GLint location
, GLfloat x
)
6530 GET_CURRENT_CONTEXT(ctx
);
6532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6533 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6538 if (ctx
->ExecuteFlag
) {
6539 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6544 static void GLAPIENTRY
6545 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6547 GET_CURRENT_CONTEXT(ctx
);
6549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6550 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6556 if (ctx
->ExecuteFlag
) {
6557 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6562 static void GLAPIENTRY
6563 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6565 GET_CURRENT_CONTEXT(ctx
);
6567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6568 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6575 if (ctx
->ExecuteFlag
) {
6576 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6581 static void GLAPIENTRY
6582 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6584 GET_CURRENT_CONTEXT(ctx
);
6586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6587 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6595 if (ctx
->ExecuteFlag
) {
6596 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6601 static void GLAPIENTRY
6602 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6604 GET_CURRENT_CONTEXT(ctx
);
6606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6607 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6611 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6613 if (ctx
->ExecuteFlag
) {
6614 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6618 static void GLAPIENTRY
6619 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6621 GET_CURRENT_CONTEXT(ctx
);
6623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6624 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6628 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6630 if (ctx
->ExecuteFlag
) {
6631 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6635 static void GLAPIENTRY
6636 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6638 GET_CURRENT_CONTEXT(ctx
);
6640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6641 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6645 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
6647 if (ctx
->ExecuteFlag
) {
6648 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
6652 static void GLAPIENTRY
6653 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6655 GET_CURRENT_CONTEXT(ctx
);
6657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6658 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
6662 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6664 if (ctx
->ExecuteFlag
) {
6665 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
6670 static void GLAPIENTRY
6671 save_Uniform1d(GLint location
, GLdouble x
)
6673 GET_CURRENT_CONTEXT(ctx
);
6675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6676 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
6679 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6681 if (ctx
->ExecuteFlag
) {
6682 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
6687 static void GLAPIENTRY
6688 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
6690 GET_CURRENT_CONTEXT(ctx
);
6692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6693 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
6696 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6697 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6699 if (ctx
->ExecuteFlag
) {
6700 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
6705 static void GLAPIENTRY
6706 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
6708 GET_CURRENT_CONTEXT(ctx
);
6710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
6714 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6715 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6716 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6718 if (ctx
->ExecuteFlag
) {
6719 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
6724 static void GLAPIENTRY
6725 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
6727 GET_CURRENT_CONTEXT(ctx
);
6729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6730 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
6733 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6734 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6735 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6736 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6738 if (ctx
->ExecuteFlag
) {
6739 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
6744 static void GLAPIENTRY
6745 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6747 GET_CURRENT_CONTEXT(ctx
);
6749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6750 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
6754 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
6756 if (ctx
->ExecuteFlag
) {
6757 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
6762 static void GLAPIENTRY
6763 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6765 GET_CURRENT_CONTEXT(ctx
);
6767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6768 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
6772 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
6774 if (ctx
->ExecuteFlag
) {
6775 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
6780 static void GLAPIENTRY
6781 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6783 GET_CURRENT_CONTEXT(ctx
);
6785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6786 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
6790 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
6792 if (ctx
->ExecuteFlag
) {
6793 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
6798 static void GLAPIENTRY
6799 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
6801 GET_CURRENT_CONTEXT(ctx
);
6803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6804 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
6808 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
6810 if (ctx
->ExecuteFlag
) {
6811 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
6816 static void GLAPIENTRY
6817 save_Uniform1iARB(GLint location
, GLint x
)
6819 GET_CURRENT_CONTEXT(ctx
);
6821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6822 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6827 if (ctx
->ExecuteFlag
) {
6828 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
6832 static void GLAPIENTRY
6833 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6835 GET_CURRENT_CONTEXT(ctx
);
6837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6838 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6844 if (ctx
->ExecuteFlag
) {
6845 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
6849 static void GLAPIENTRY
6850 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6852 GET_CURRENT_CONTEXT(ctx
);
6854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6855 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6862 if (ctx
->ExecuteFlag
) {
6863 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
6867 static void GLAPIENTRY
6868 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6870 GET_CURRENT_CONTEXT(ctx
);
6872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6873 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6881 if (ctx
->ExecuteFlag
) {
6882 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
6888 static void GLAPIENTRY
6889 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6891 GET_CURRENT_CONTEXT(ctx
);
6893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6894 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
6898 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
6900 if (ctx
->ExecuteFlag
) {
6901 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
6905 static void GLAPIENTRY
6906 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6908 GET_CURRENT_CONTEXT(ctx
);
6910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6911 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
6915 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
6917 if (ctx
->ExecuteFlag
) {
6918 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
6922 static void GLAPIENTRY
6923 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6925 GET_CURRENT_CONTEXT(ctx
);
6927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6928 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
6932 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
6934 if (ctx
->ExecuteFlag
) {
6935 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
6939 static void GLAPIENTRY
6940 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6942 GET_CURRENT_CONTEXT(ctx
);
6944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6945 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
6949 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
6951 if (ctx
->ExecuteFlag
) {
6952 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
6958 static void GLAPIENTRY
6959 save_Uniform1ui(GLint location
, GLuint x
)
6961 GET_CURRENT_CONTEXT(ctx
);
6963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6964 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6969 if (ctx
->ExecuteFlag
) {
6970 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
6974 static void GLAPIENTRY
6975 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6977 GET_CURRENT_CONTEXT(ctx
);
6979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6980 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6986 if (ctx
->ExecuteFlag
) {
6987 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
6991 static void GLAPIENTRY
6992 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6994 GET_CURRENT_CONTEXT(ctx
);
6996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6997 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7004 if (ctx
->ExecuteFlag
) {
7005 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7009 static void GLAPIENTRY
7010 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7012 GET_CURRENT_CONTEXT(ctx
);
7014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7015 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7023 if (ctx
->ExecuteFlag
) {
7024 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7030 static void GLAPIENTRY
7031 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7033 GET_CURRENT_CONTEXT(ctx
);
7035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7036 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7040 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7042 if (ctx
->ExecuteFlag
) {
7043 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7047 static void GLAPIENTRY
7048 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7050 GET_CURRENT_CONTEXT(ctx
);
7052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7053 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7057 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7059 if (ctx
->ExecuteFlag
) {
7060 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7064 static void GLAPIENTRY
7065 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7067 GET_CURRENT_CONTEXT(ctx
);
7069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7070 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7074 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7076 if (ctx
->ExecuteFlag
) {
7077 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7081 static void GLAPIENTRY
7082 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7084 GET_CURRENT_CONTEXT(ctx
);
7086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7087 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7091 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7093 if (ctx
->ExecuteFlag
) {
7094 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7100 static void GLAPIENTRY
7101 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7104 GET_CURRENT_CONTEXT(ctx
);
7106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7107 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7112 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7114 if (ctx
->ExecuteFlag
) {
7115 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7119 static void GLAPIENTRY
7120 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7123 GET_CURRENT_CONTEXT(ctx
);
7125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7126 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7131 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7133 if (ctx
->ExecuteFlag
) {
7134 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7138 static void GLAPIENTRY
7139 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7142 GET_CURRENT_CONTEXT(ctx
);
7144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7145 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7150 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7152 if (ctx
->ExecuteFlag
) {
7153 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7158 static void GLAPIENTRY
7159 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7162 GET_CURRENT_CONTEXT(ctx
);
7164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7165 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7170 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7172 if (ctx
->ExecuteFlag
) {
7173 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7177 static void GLAPIENTRY
7178 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7181 GET_CURRENT_CONTEXT(ctx
);
7183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7184 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7189 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7191 if (ctx
->ExecuteFlag
) {
7192 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7197 static void GLAPIENTRY
7198 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7201 GET_CURRENT_CONTEXT(ctx
);
7203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7204 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7209 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7211 if (ctx
->ExecuteFlag
) {
7212 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7216 static void GLAPIENTRY
7217 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7220 GET_CURRENT_CONTEXT(ctx
);
7222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7223 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7228 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7230 if (ctx
->ExecuteFlag
) {
7231 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7236 static void GLAPIENTRY
7237 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7240 GET_CURRENT_CONTEXT(ctx
);
7242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7243 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7248 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7250 if (ctx
->ExecuteFlag
) {
7251 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7255 static void GLAPIENTRY
7256 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7259 GET_CURRENT_CONTEXT(ctx
);
7261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7262 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7267 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7269 if (ctx
->ExecuteFlag
) {
7270 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7275 static void GLAPIENTRY
7276 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7279 GET_CURRENT_CONTEXT(ctx
);
7281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7282 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7287 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7289 if (ctx
->ExecuteFlag
) {
7290 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7294 static void GLAPIENTRY
7295 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7298 GET_CURRENT_CONTEXT(ctx
);
7300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7301 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7306 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7308 if (ctx
->ExecuteFlag
) {
7309 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7313 static void GLAPIENTRY
7314 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7317 GET_CURRENT_CONTEXT(ctx
);
7319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7320 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7325 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7327 if (ctx
->ExecuteFlag
) {
7328 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7333 static void GLAPIENTRY
7334 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7337 GET_CURRENT_CONTEXT(ctx
);
7339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7340 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7345 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7347 if (ctx
->ExecuteFlag
) {
7348 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7353 static void GLAPIENTRY
7354 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7357 GET_CURRENT_CONTEXT(ctx
);
7359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7360 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7365 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7367 if (ctx
->ExecuteFlag
) {
7368 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7373 static void GLAPIENTRY
7374 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7377 GET_CURRENT_CONTEXT(ctx
);
7379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7380 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7385 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7387 if (ctx
->ExecuteFlag
) {
7388 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7392 static void GLAPIENTRY
7393 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7396 GET_CURRENT_CONTEXT(ctx
);
7398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7399 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7404 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7406 if (ctx
->ExecuteFlag
) {
7407 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7412 static void GLAPIENTRY
7413 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7416 GET_CURRENT_CONTEXT(ctx
);
7418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7419 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7424 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7426 if (ctx
->ExecuteFlag
) {
7427 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7432 static void GLAPIENTRY
7433 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7436 GET_CURRENT_CONTEXT(ctx
);
7438 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7439 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7444 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7446 if (ctx
->ExecuteFlag
) {
7447 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7451 static void GLAPIENTRY
7452 save_Uniform1i64ARB(GLint location
, GLint64 x
)
7454 GET_CURRENT_CONTEXT(ctx
);
7456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7457 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64
, 3);
7460 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7462 if (ctx
->ExecuteFlag
) {
7463 CALL_Uniform1i64ARB(ctx
->Exec
, (location
, x
));
7467 static void GLAPIENTRY
7468 save_Uniform2i64ARB(GLint location
, GLint64 x
, GLint64 y
)
7470 GET_CURRENT_CONTEXT(ctx
);
7472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7473 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64
, 5);
7476 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7477 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7479 if (ctx
->ExecuteFlag
) {
7480 CALL_Uniform2i64ARB(ctx
->Exec
, (location
, x
, y
));
7484 static void GLAPIENTRY
7485 save_Uniform3i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
)
7487 GET_CURRENT_CONTEXT(ctx
);
7489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7490 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64
, 7);
7493 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7494 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7495 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7497 if (ctx
->ExecuteFlag
) {
7498 CALL_Uniform3i64ARB(ctx
->Exec
, (location
, x
, y
, z
));
7502 static void GLAPIENTRY
7503 save_Uniform4i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
, GLint64 w
)
7505 GET_CURRENT_CONTEXT(ctx
);
7507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7508 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64
, 9);
7511 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7512 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7513 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7514 ASSIGN_INT64_TO_NODES(n
, 8, w
);
7516 if (ctx
->ExecuteFlag
) {
7517 CALL_Uniform4i64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
7521 static void GLAPIENTRY
7522 save_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7524 GET_CURRENT_CONTEXT(ctx
);
7526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7527 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64V
, 2 + POINTER_DWORDS
);
7531 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint64
)));
7533 if (ctx
->ExecuteFlag
) {
7534 CALL_Uniform1i64vARB(ctx
->Exec
, (location
, count
, v
));
7538 static void GLAPIENTRY
7539 save_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7541 GET_CURRENT_CONTEXT(ctx
);
7543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7544 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64V
, 2 + POINTER_DWORDS
);
7548 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint64
)));
7550 if (ctx
->ExecuteFlag
) {
7551 CALL_Uniform2i64vARB(ctx
->Exec
, (location
, count
, v
));
7555 static void GLAPIENTRY
7556 save_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7558 GET_CURRENT_CONTEXT(ctx
);
7560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7561 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64V
, 2 + POINTER_DWORDS
);
7565 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint64
)));
7567 if (ctx
->ExecuteFlag
) {
7568 CALL_Uniform3i64vARB(ctx
->Exec
, (location
, count
, v
));
7572 static void GLAPIENTRY
7573 save_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7575 GET_CURRENT_CONTEXT(ctx
);
7577 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7578 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64V
, 2 + POINTER_DWORDS
);
7582 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint64
)));
7584 if (ctx
->ExecuteFlag
) {
7585 CALL_Uniform4i64vARB(ctx
->Exec
, (location
, count
, v
));
7589 static void GLAPIENTRY
7590 save_Uniform1ui64ARB(GLint location
, GLuint64 x
)
7592 GET_CURRENT_CONTEXT(ctx
);
7594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7595 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64
, 3);
7598 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7600 if (ctx
->ExecuteFlag
) {
7601 CALL_Uniform1ui64ARB(ctx
->Exec
, (location
, x
));
7605 static void GLAPIENTRY
7606 save_Uniform2ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
)
7608 GET_CURRENT_CONTEXT(ctx
);
7610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7611 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64
, 5);
7614 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7615 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7617 if (ctx
->ExecuteFlag
) {
7618 CALL_Uniform2ui64ARB(ctx
->Exec
, (location
, x
, y
));
7622 static void GLAPIENTRY
7623 save_Uniform3ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
)
7625 GET_CURRENT_CONTEXT(ctx
);
7627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7628 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64
, 7);
7631 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7632 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7633 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
7635 if (ctx
->ExecuteFlag
) {
7636 CALL_Uniform3ui64ARB(ctx
->Exec
, (location
, x
, y
, z
));
7640 static void GLAPIENTRY
7641 save_Uniform4ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
, GLuint64 w
)
7643 GET_CURRENT_CONTEXT(ctx
);
7645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7646 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64
, 9);
7649 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
7650 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
7651 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
7652 ASSIGN_UINT64_TO_NODES(n
, 8, w
);
7654 if (ctx
->ExecuteFlag
) {
7655 CALL_Uniform4ui64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
7659 static void GLAPIENTRY
7660 save_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7662 GET_CURRENT_CONTEXT(ctx
);
7664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7665 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64V
, 2 + POINTER_DWORDS
);
7669 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7671 if (ctx
->ExecuteFlag
) {
7672 CALL_Uniform1ui64vARB(ctx
->Exec
, (location
, count
, v
));
7676 static void GLAPIENTRY
7677 save_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7679 GET_CURRENT_CONTEXT(ctx
);
7681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7682 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64V
, 2 + POINTER_DWORDS
);
7686 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLuint64
)));
7688 if (ctx
->ExecuteFlag
) {
7689 CALL_Uniform2ui64vARB(ctx
->Exec
, (location
, count
, v
));
7693 static void GLAPIENTRY
7694 save_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7696 GET_CURRENT_CONTEXT(ctx
);
7698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7699 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64V
, 2 + POINTER_DWORDS
);
7703 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLuint64
)));
7705 if (ctx
->ExecuteFlag
) {
7706 CALL_Uniform3ui64vARB(ctx
->Exec
, (location
, count
, v
));
7710 static void GLAPIENTRY
7711 save_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
7713 GET_CURRENT_CONTEXT(ctx
);
7715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7716 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64V
, 2 + POINTER_DWORDS
);
7720 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLuint64
)));
7722 if (ctx
->ExecuteFlag
) {
7723 CALL_Uniform4ui64vARB(ctx
->Exec
, (location
, count
, v
));
7727 static void GLAPIENTRY
7728 save_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 x
)
7730 GET_CURRENT_CONTEXT(ctx
);
7732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7733 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64
, 4);
7737 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7739 if (ctx
->ExecuteFlag
) {
7740 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (program
, location
, x
));
7744 static void GLAPIENTRY
7745 save_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 x
,
7748 GET_CURRENT_CONTEXT(ctx
);
7750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7751 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64
, 6);
7755 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7756 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7758 if (ctx
->ExecuteFlag
) {
7759 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (program
, location
, x
, y
));
7763 static void GLAPIENTRY
7764 save_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 x
,
7765 GLint64 y
, GLint64 z
)
7767 GET_CURRENT_CONTEXT(ctx
);
7769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7770 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64
, 8);
7774 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7775 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7776 ASSIGN_INT64_TO_NODES(n
, 7, z
);
7778 if (ctx
->ExecuteFlag
) {
7779 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
7783 static void GLAPIENTRY
7784 save_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 x
,
7785 GLint64 y
, GLint64 z
, GLint64 w
)
7787 GET_CURRENT_CONTEXT(ctx
);
7789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7790 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64
, 10);
7794 ASSIGN_INT64_TO_NODES(n
, 3, x
);
7795 ASSIGN_INT64_TO_NODES(n
, 5, y
);
7796 ASSIGN_INT64_TO_NODES(n
, 7, z
);
7797 ASSIGN_INT64_TO_NODES(n
, 9, w
);
7799 if (ctx
->ExecuteFlag
) {
7800 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7804 static void GLAPIENTRY
7805 save_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
,
7808 GET_CURRENT_CONTEXT(ctx
);
7810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7811 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64V
, 3 + POINTER_DWORDS
);
7816 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7818 if (ctx
->ExecuteFlag
) {
7819 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7823 static void GLAPIENTRY
7824 save_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
,
7827 GET_CURRENT_CONTEXT(ctx
);
7829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7830 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64V
, 3 + POINTER_DWORDS
);
7835 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7837 if (ctx
->ExecuteFlag
) {
7838 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7842 static void GLAPIENTRY
7843 save_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
,
7846 GET_CURRENT_CONTEXT(ctx
);
7848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7849 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64V
, 3 + POINTER_DWORDS
);
7854 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7856 if (ctx
->ExecuteFlag
) {
7857 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7861 static void GLAPIENTRY
7862 save_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
,
7865 GET_CURRENT_CONTEXT(ctx
);
7867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7868 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64V
, 3 + POINTER_DWORDS
);
7873 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
7875 if (ctx
->ExecuteFlag
) {
7876 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7880 static void GLAPIENTRY
7881 save_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 x
)
7883 GET_CURRENT_CONTEXT(ctx
);
7885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7886 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64
, 4);
7890 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7892 if (ctx
->ExecuteFlag
) {
7893 CALL_ProgramUniform1ui64ARB(ctx
->Exec
, (program
, location
, x
));
7897 static void GLAPIENTRY
7898 save_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7901 GET_CURRENT_CONTEXT(ctx
);
7903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7904 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64
, 6);
7908 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7909 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7911 if (ctx
->ExecuteFlag
) {
7912 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (program
, location
, x
, y
));
7916 static void GLAPIENTRY
7917 save_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7918 GLuint64 y
, GLuint64 z
)
7920 GET_CURRENT_CONTEXT(ctx
);
7922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7923 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64
, 8);
7927 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7928 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7929 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
7931 if (ctx
->ExecuteFlag
) {
7932 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
7936 static void GLAPIENTRY
7937 save_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
7938 GLuint64 y
, GLuint64 z
, GLuint64 w
)
7940 GET_CURRENT_CONTEXT(ctx
);
7942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7943 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64
, 10);
7947 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
7948 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
7949 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
7950 ASSIGN_UINT64_TO_NODES(n
, 9, w
);
7952 if (ctx
->ExecuteFlag
) {
7953 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7957 static void GLAPIENTRY
7958 save_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
,
7961 GET_CURRENT_CONTEXT(ctx
);
7963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7964 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64V
,
7965 3 + POINTER_DWORDS
);
7970 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7972 if (ctx
->ExecuteFlag
) {
7973 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7977 static void GLAPIENTRY
7978 save_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
,
7981 GET_CURRENT_CONTEXT(ctx
);
7983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7984 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64V
,
7985 3 + POINTER_DWORDS
);
7990 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
7992 if (ctx
->ExecuteFlag
) {
7993 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
7997 static void GLAPIENTRY
7998 save_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8001 GET_CURRENT_CONTEXT(ctx
);
8003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8004 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64V
,
8005 3 + POINTER_DWORDS
);
8010 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8012 if (ctx
->ExecuteFlag
) {
8013 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8017 static void GLAPIENTRY
8018 save_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8021 GET_CURRENT_CONTEXT(ctx
);
8023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8024 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64V
,
8025 3 + POINTER_DWORDS
);
8030 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8032 if (ctx
->ExecuteFlag
) {
8033 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8038 static void GLAPIENTRY
8039 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
8041 GET_CURRENT_CONTEXT(ctx
);
8043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8044 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
8050 if (ctx
->ExecuteFlag
) {
8051 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
8055 static void GLAPIENTRY
8056 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
8058 GET_CURRENT_CONTEXT(ctx
);
8060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8061 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
8067 if (ctx
->ExecuteFlag
) {
8068 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
8072 static void GLAPIENTRY
8073 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
8075 GET_CURRENT_CONTEXT(ctx
);
8077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8078 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
8085 if (ctx
->ExecuteFlag
) {
8086 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
8090 static void GLAPIENTRY
8091 save_ProgramUniform3f(GLuint program
, GLint location
,
8092 GLfloat x
, GLfloat y
, GLfloat z
)
8094 GET_CURRENT_CONTEXT(ctx
);
8096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8097 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
8105 if (ctx
->ExecuteFlag
) {
8106 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
8110 static void GLAPIENTRY
8111 save_ProgramUniform4f(GLuint program
, GLint location
,
8112 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
8114 GET_CURRENT_CONTEXT(ctx
);
8116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8117 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
8126 if (ctx
->ExecuteFlag
) {
8127 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8131 static void GLAPIENTRY
8132 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
8135 GET_CURRENT_CONTEXT(ctx
);
8137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8138 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
8143 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
8145 if (ctx
->ExecuteFlag
) {
8146 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
8150 static void GLAPIENTRY
8151 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
8154 GET_CURRENT_CONTEXT(ctx
);
8156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8157 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
8162 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
8164 if (ctx
->ExecuteFlag
) {
8165 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
8169 static void GLAPIENTRY
8170 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
8173 GET_CURRENT_CONTEXT(ctx
);
8175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8176 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
8181 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
8183 if (ctx
->ExecuteFlag
) {
8184 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
8188 static void GLAPIENTRY
8189 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
8192 GET_CURRENT_CONTEXT(ctx
);
8194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8195 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
8200 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
8202 if (ctx
->ExecuteFlag
) {
8203 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
8207 static void GLAPIENTRY
8208 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
8210 GET_CURRENT_CONTEXT(ctx
);
8212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8213 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8217 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8219 if (ctx
->ExecuteFlag
) {
8220 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8224 static void GLAPIENTRY
8225 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8227 GET_CURRENT_CONTEXT(ctx
);
8229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8230 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8234 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8235 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8237 if (ctx
->ExecuteFlag
) {
8238 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8242 static void GLAPIENTRY
8243 save_ProgramUniform3d(GLuint program
, GLint location
,
8244 GLdouble x
, GLdouble y
, GLdouble z
)
8246 GET_CURRENT_CONTEXT(ctx
);
8248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8249 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8253 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8254 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8255 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8257 if (ctx
->ExecuteFlag
) {
8258 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8262 static void GLAPIENTRY
8263 save_ProgramUniform4d(GLuint program
, GLint location
,
8264 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8266 GET_CURRENT_CONTEXT(ctx
);
8268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8269 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8273 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8274 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8275 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8276 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8278 if (ctx
->ExecuteFlag
) {
8279 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8283 static void GLAPIENTRY
8284 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8287 GET_CURRENT_CONTEXT(ctx
);
8289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8290 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8295 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8297 if (ctx
->ExecuteFlag
) {
8298 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8302 static void GLAPIENTRY
8303 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8306 GET_CURRENT_CONTEXT(ctx
);
8308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8309 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8314 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8316 if (ctx
->ExecuteFlag
) {
8317 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8321 static void GLAPIENTRY
8322 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8325 GET_CURRENT_CONTEXT(ctx
);
8327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8328 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8333 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8335 if (ctx
->ExecuteFlag
) {
8336 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8340 static void GLAPIENTRY
8341 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8344 GET_CURRENT_CONTEXT(ctx
);
8346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8347 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8352 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8354 if (ctx
->ExecuteFlag
) {
8355 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8359 static void GLAPIENTRY
8360 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8362 GET_CURRENT_CONTEXT(ctx
);
8364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8365 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8371 if (ctx
->ExecuteFlag
) {
8372 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8376 static void GLAPIENTRY
8377 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8379 GET_CURRENT_CONTEXT(ctx
);
8381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8382 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8389 if (ctx
->ExecuteFlag
) {
8390 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8394 static void GLAPIENTRY
8395 save_ProgramUniform3i(GLuint program
, GLint location
,
8396 GLint x
, GLint y
, GLint z
)
8398 GET_CURRENT_CONTEXT(ctx
);
8400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8401 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8409 if (ctx
->ExecuteFlag
) {
8410 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8414 static void GLAPIENTRY
8415 save_ProgramUniform4i(GLuint program
, GLint location
,
8416 GLint x
, GLint y
, GLint z
, GLint w
)
8418 GET_CURRENT_CONTEXT(ctx
);
8420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8421 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8430 if (ctx
->ExecuteFlag
) {
8431 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8435 static void GLAPIENTRY
8436 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8439 GET_CURRENT_CONTEXT(ctx
);
8441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8442 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8447 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8449 if (ctx
->ExecuteFlag
) {
8450 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8454 static void GLAPIENTRY
8455 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8458 GET_CURRENT_CONTEXT(ctx
);
8460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8461 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8466 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8468 if (ctx
->ExecuteFlag
) {
8469 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8473 static void GLAPIENTRY
8474 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8477 GET_CURRENT_CONTEXT(ctx
);
8479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8480 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8485 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8487 if (ctx
->ExecuteFlag
) {
8488 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8492 static void GLAPIENTRY
8493 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8496 GET_CURRENT_CONTEXT(ctx
);
8498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8499 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8504 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8506 if (ctx
->ExecuteFlag
) {
8507 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8511 static void GLAPIENTRY
8512 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8514 GET_CURRENT_CONTEXT(ctx
);
8516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8517 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8523 if (ctx
->ExecuteFlag
) {
8524 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8528 static void GLAPIENTRY
8529 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8531 GET_CURRENT_CONTEXT(ctx
);
8533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8534 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8541 if (ctx
->ExecuteFlag
) {
8542 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8546 static void GLAPIENTRY
8547 save_ProgramUniform3ui(GLuint program
, GLint location
,
8548 GLuint x
, GLuint y
, GLuint z
)
8550 GET_CURRENT_CONTEXT(ctx
);
8552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8553 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8561 if (ctx
->ExecuteFlag
) {
8562 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8566 static void GLAPIENTRY
8567 save_ProgramUniform4ui(GLuint program
, GLint location
,
8568 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8570 GET_CURRENT_CONTEXT(ctx
);
8572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8573 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8582 if (ctx
->ExecuteFlag
) {
8583 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8587 static void GLAPIENTRY
8588 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8591 GET_CURRENT_CONTEXT(ctx
);
8593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8594 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8599 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8601 if (ctx
->ExecuteFlag
) {
8602 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8606 static void GLAPIENTRY
8607 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8610 GET_CURRENT_CONTEXT(ctx
);
8612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8613 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8618 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8620 if (ctx
->ExecuteFlag
) {
8621 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8625 static void GLAPIENTRY
8626 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8629 GET_CURRENT_CONTEXT(ctx
);
8631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8632 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8637 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8639 if (ctx
->ExecuteFlag
) {
8640 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8644 static void GLAPIENTRY
8645 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8648 GET_CURRENT_CONTEXT(ctx
);
8650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8651 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8656 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8658 if (ctx
->ExecuteFlag
) {
8659 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8663 static void GLAPIENTRY
8664 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8665 GLboolean transpose
, const GLfloat
*v
)
8667 GET_CURRENT_CONTEXT(ctx
);
8669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8670 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8671 4 + POINTER_DWORDS
);
8677 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8679 if (ctx
->ExecuteFlag
) {
8680 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8681 (program
, location
, count
, transpose
, v
));
8685 static void GLAPIENTRY
8686 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8687 GLboolean transpose
, const GLfloat
*v
)
8689 GET_CURRENT_CONTEXT(ctx
);
8691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8692 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8693 4 + POINTER_DWORDS
);
8699 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8701 if (ctx
->ExecuteFlag
) {
8702 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8703 (program
, location
, count
, transpose
, v
));
8707 static void GLAPIENTRY
8708 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8709 GLboolean transpose
, const GLfloat
*v
)
8711 GET_CURRENT_CONTEXT(ctx
);
8713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8714 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8715 4 + POINTER_DWORDS
);
8721 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8723 if (ctx
->ExecuteFlag
) {
8724 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8725 (program
, location
, count
, transpose
, v
));
8729 static void GLAPIENTRY
8730 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8731 GLboolean transpose
, const GLfloat
*v
)
8733 GET_CURRENT_CONTEXT(ctx
);
8735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8736 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8737 4 + POINTER_DWORDS
);
8743 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8745 if (ctx
->ExecuteFlag
) {
8746 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8747 (program
, location
, count
, transpose
, v
));
8751 static void GLAPIENTRY
8752 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8753 GLboolean transpose
, const GLfloat
*v
)
8755 GET_CURRENT_CONTEXT(ctx
);
8757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8758 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8759 4 + POINTER_DWORDS
);
8765 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8767 if (ctx
->ExecuteFlag
) {
8768 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8769 (program
, location
, count
, transpose
, v
));
8773 static void GLAPIENTRY
8774 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8775 GLboolean transpose
, const GLfloat
*v
)
8777 GET_CURRENT_CONTEXT(ctx
);
8779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8780 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8781 4 + POINTER_DWORDS
);
8787 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8789 if (ctx
->ExecuteFlag
) {
8790 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8791 (program
, location
, count
, transpose
, v
));
8795 static void GLAPIENTRY
8796 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8797 GLboolean transpose
, const GLfloat
*v
)
8799 GET_CURRENT_CONTEXT(ctx
);
8801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8802 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8803 4 + POINTER_DWORDS
);
8809 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8811 if (ctx
->ExecuteFlag
) {
8812 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8813 (program
, location
, count
, transpose
, v
));
8817 static void GLAPIENTRY
8818 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8819 GLboolean transpose
, const GLfloat
*v
)
8821 GET_CURRENT_CONTEXT(ctx
);
8823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8824 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8825 4 + POINTER_DWORDS
);
8831 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8833 if (ctx
->ExecuteFlag
) {
8834 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8835 (program
, location
, count
, transpose
, v
));
8839 static void GLAPIENTRY
8840 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8841 GLboolean transpose
, const GLfloat
*v
)
8843 GET_CURRENT_CONTEXT(ctx
);
8845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8846 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8847 4 + POINTER_DWORDS
);
8853 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8855 if (ctx
->ExecuteFlag
) {
8856 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8857 (program
, location
, count
, transpose
, v
));
8861 static void GLAPIENTRY
8862 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8863 GLboolean transpose
, const GLdouble
*v
)
8865 GET_CURRENT_CONTEXT(ctx
);
8867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8868 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8869 4 + POINTER_DWORDS
);
8875 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8877 if (ctx
->ExecuteFlag
) {
8878 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8879 (program
, location
, count
, transpose
, v
));
8883 static void GLAPIENTRY
8884 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8885 GLboolean transpose
, const GLdouble
*v
)
8887 GET_CURRENT_CONTEXT(ctx
);
8889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8890 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8891 4 + POINTER_DWORDS
);
8897 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8899 if (ctx
->ExecuteFlag
) {
8900 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8901 (program
, location
, count
, transpose
, v
));
8905 static void GLAPIENTRY
8906 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8907 GLboolean transpose
, const GLdouble
*v
)
8909 GET_CURRENT_CONTEXT(ctx
);
8911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8912 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8913 4 + POINTER_DWORDS
);
8919 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8921 if (ctx
->ExecuteFlag
) {
8922 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8923 (program
, location
, count
, transpose
, v
));
8927 static void GLAPIENTRY
8928 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8929 GLboolean transpose
, const GLdouble
*v
)
8931 GET_CURRENT_CONTEXT(ctx
);
8933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8934 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8935 4 + POINTER_DWORDS
);
8941 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8943 if (ctx
->ExecuteFlag
) {
8944 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8945 (program
, location
, count
, transpose
, v
));
8949 static void GLAPIENTRY
8950 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8951 GLboolean transpose
, const GLdouble
*v
)
8953 GET_CURRENT_CONTEXT(ctx
);
8955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8956 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8957 4 + POINTER_DWORDS
);
8963 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8965 if (ctx
->ExecuteFlag
) {
8966 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8967 (program
, location
, count
, transpose
, v
));
8971 static void GLAPIENTRY
8972 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8973 GLboolean transpose
, const GLdouble
*v
)
8975 GET_CURRENT_CONTEXT(ctx
);
8977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8978 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8979 4 + POINTER_DWORDS
);
8985 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8987 if (ctx
->ExecuteFlag
) {
8988 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8989 (program
, location
, count
, transpose
, v
));
8993 static void GLAPIENTRY
8994 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8995 GLboolean transpose
, const GLdouble
*v
)
8997 GET_CURRENT_CONTEXT(ctx
);
8999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9000 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
9001 4 + POINTER_DWORDS
);
9007 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
9009 if (ctx
->ExecuteFlag
) {
9010 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
9011 (program
, location
, count
, transpose
, v
));
9015 static void GLAPIENTRY
9016 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
9017 GLboolean transpose
, const GLdouble
*v
)
9019 GET_CURRENT_CONTEXT(ctx
);
9021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9022 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
9023 4 + POINTER_DWORDS
);
9029 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
9031 if (ctx
->ExecuteFlag
) {
9032 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
9033 (program
, location
, count
, transpose
, v
));
9037 static void GLAPIENTRY
9038 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
9039 GLboolean transpose
, const GLdouble
*v
)
9041 GET_CURRENT_CONTEXT(ctx
);
9043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9044 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
9045 4 + POINTER_DWORDS
);
9051 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
9053 if (ctx
->ExecuteFlag
) {
9054 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
9055 (program
, location
, count
, transpose
, v
));
9059 static void GLAPIENTRY
9060 save_ClipControl(GLenum origin
, GLenum depth
)
9062 GET_CURRENT_CONTEXT(ctx
);
9064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9065 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
9070 if (ctx
->ExecuteFlag
) {
9071 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
9075 static void GLAPIENTRY
9076 save_ClampColorARB(GLenum target
, GLenum clamp
)
9078 GET_CURRENT_CONTEXT(ctx
);
9080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9081 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
9086 if (ctx
->ExecuteFlag
) {
9087 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
9091 /** GL_EXT_texture_integer */
9092 static void GLAPIENTRY
9093 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
9095 GET_CURRENT_CONTEXT(ctx
);
9097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9098 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
9105 if (ctx
->ExecuteFlag
) {
9106 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9110 /** GL_EXT_texture_integer */
9111 static void GLAPIENTRY
9112 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
9114 GET_CURRENT_CONTEXT(ctx
);
9116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9117 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
9124 if (ctx
->ExecuteFlag
) {
9125 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9129 /** GL_EXT_texture_integer */
9130 static void GLAPIENTRY
9131 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
9133 GET_CURRENT_CONTEXT(ctx
);
9135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9136 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
9145 if (ctx
->ExecuteFlag
) {
9146 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
9150 /** GL_EXT_texture_integer */
9151 static void GLAPIENTRY
9152 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
9154 GET_CURRENT_CONTEXT(ctx
);
9156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9157 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
9161 n
[3].ui
= params
[0];
9162 n
[4].ui
= params
[1];
9163 n
[5].ui
= params
[2];
9164 n
[6].ui
= params
[3];
9166 if (ctx
->ExecuteFlag
) {
9167 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
9171 /* GL_ARB_instanced_arrays */
9172 static void GLAPIENTRY
9173 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
9175 GET_CURRENT_CONTEXT(ctx
);
9177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9178 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
9183 if (ctx
->ExecuteFlag
) {
9184 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
9189 /* GL_NV_texture_barrier */
9190 static void GLAPIENTRY
9191 save_TextureBarrierNV(void)
9193 GET_CURRENT_CONTEXT(ctx
);
9194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9195 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
9196 if (ctx
->ExecuteFlag
) {
9197 CALL_TextureBarrierNV(ctx
->Exec
, ());
9202 /* GL_ARB_sampler_objects */
9203 static void GLAPIENTRY
9204 save_BindSampler(GLuint unit
, GLuint sampler
)
9207 GET_CURRENT_CONTEXT(ctx
);
9208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9209 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
9214 if (ctx
->ExecuteFlag
) {
9215 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9219 static void GLAPIENTRY
9220 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9223 GET_CURRENT_CONTEXT(ctx
);
9224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9225 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9230 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9236 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9239 if (ctx
->ExecuteFlag
) {
9240 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9244 static void GLAPIENTRY
9245 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9249 parray
[1] = parray
[2] = parray
[3] = 0;
9250 save_SamplerParameteriv(sampler
, pname
, parray
);
9253 static void GLAPIENTRY
9254 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9257 GET_CURRENT_CONTEXT(ctx
);
9258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9259 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9264 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9270 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9273 if (ctx
->ExecuteFlag
) {
9274 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9278 static void GLAPIENTRY
9279 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9283 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9284 save_SamplerParameterfv(sampler
, pname
, parray
);
9287 static void GLAPIENTRY
9288 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9291 GET_CURRENT_CONTEXT(ctx
);
9292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9293 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9298 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9304 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9307 if (ctx
->ExecuteFlag
) {
9308 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9312 static void GLAPIENTRY
9313 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9316 GET_CURRENT_CONTEXT(ctx
);
9317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9318 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9322 n
[3].ui
= params
[0];
9323 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9324 n
[4].ui
= params
[1];
9325 n
[5].ui
= params
[2];
9326 n
[6].ui
= params
[3];
9329 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9332 if (ctx
->ExecuteFlag
) {
9333 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9337 static void GLAPIENTRY
9338 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9341 GET_CURRENT_CONTEXT(ctx
);
9342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9343 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9345 union uint64_pair p
;
9348 n
[2].ui
= p
.uint32
[0];
9349 n
[3].ui
= p
.uint32
[1];
9350 save_pointer(&n
[4], sync
);
9352 if (ctx
->ExecuteFlag
) {
9353 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9358 /** GL_NV_conditional_render */
9359 static void GLAPIENTRY
9360 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9362 GET_CURRENT_CONTEXT(ctx
);
9364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9365 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9370 if (ctx
->ExecuteFlag
) {
9371 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9375 static void GLAPIENTRY
9376 save_EndConditionalRender(void)
9378 GET_CURRENT_CONTEXT(ctx
);
9379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9380 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9381 if (ctx
->ExecuteFlag
) {
9382 CALL_EndConditionalRender(ctx
->Exec
, ());
9386 static void GLAPIENTRY
9387 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9389 GET_CURRENT_CONTEXT(ctx
);
9391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9392 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9398 if (ctx
->ExecuteFlag
) {
9399 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9403 static void GLAPIENTRY
9404 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9405 const GLuint
*indices
)
9407 GET_CURRENT_CONTEXT(ctx
);
9409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9410 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9412 GLint
*indices_copy
= NULL
;
9415 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9416 n
[1].e
= shadertype
;
9418 save_pointer(&n
[3], indices_copy
);
9420 if (ctx
->ExecuteFlag
) {
9421 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9425 /** GL_EXT_window_rectangles */
9426 static void GLAPIENTRY
9427 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9429 GET_CURRENT_CONTEXT(ctx
);
9431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9432 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9434 GLint
*box_copy
= NULL
;
9437 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9440 save_pointer(&n
[3], box_copy
);
9442 if (ctx
->ExecuteFlag
) {
9443 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9448 /** GL_NV_conservative_raster */
9449 static void GLAPIENTRY
9450 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9452 GET_CURRENT_CONTEXT(ctx
);
9454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9455 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9460 if (ctx
->ExecuteFlag
) {
9461 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9465 /** GL_NV_conservative_raster_dilate */
9466 static void GLAPIENTRY
9467 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9469 GET_CURRENT_CONTEXT(ctx
);
9471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9472 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9477 if (ctx
->ExecuteFlag
) {
9478 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9482 /** GL_NV_conservative_raster_pre_snap_triangles */
9483 static void GLAPIENTRY
9484 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9486 GET_CURRENT_CONTEXT(ctx
);
9488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9489 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9494 if (ctx
->ExecuteFlag
) {
9495 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9499 /** GL_EXT_direct_state_access */
9501 static void GLAPIENTRY
9502 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9504 GET_CURRENT_CONTEXT(ctx
);
9506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9507 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9509 n
[1].e
= matrixMode
;
9510 for (unsigned i
= 0; i
< 16; i
++) {
9514 if (ctx
->ExecuteFlag
) {
9515 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9519 static void GLAPIENTRY
9520 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9523 for (unsigned i
= 0; i
< 16; i
++) {
9524 f
[i
] = (GLfloat
) m
[i
];
9526 save_MatrixLoadfEXT(matrixMode
, f
);
9529 static void GLAPIENTRY
9530 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9532 GET_CURRENT_CONTEXT(ctx
);
9534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9535 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9537 n
[1].e
= matrixMode
;
9538 for (unsigned i
= 0; i
< 16; i
++) {
9542 if (ctx
->ExecuteFlag
) {
9543 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9547 static void GLAPIENTRY
9548 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9551 for (unsigned i
= 0; i
< 16; i
++) {
9552 f
[i
] = (GLfloat
) m
[i
];
9554 save_MatrixMultfEXT(matrixMode
, f
);
9557 static void GLAPIENTRY
9558 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9560 GET_CURRENT_CONTEXT(ctx
);
9562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9563 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9565 n
[1].e
= matrixMode
;
9571 if (ctx
->ExecuteFlag
) {
9572 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9576 static void GLAPIENTRY
9577 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9579 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9582 static void GLAPIENTRY
9583 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9585 GET_CURRENT_CONTEXT(ctx
);
9587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9588 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9590 n
[1].e
= matrixMode
;
9595 if (ctx
->ExecuteFlag
) {
9596 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9600 static void GLAPIENTRY
9601 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9603 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9606 static void GLAPIENTRY
9607 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9609 GET_CURRENT_CONTEXT(ctx
);
9611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9612 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9614 n
[1].e
= matrixMode
;
9619 if (ctx
->ExecuteFlag
) {
9620 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9624 static void GLAPIENTRY
9625 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9627 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9630 static void GLAPIENTRY
9631 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9633 GET_CURRENT_CONTEXT(ctx
);
9635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9636 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9638 n
[1].e
= matrixMode
;
9640 if (ctx
->ExecuteFlag
) {
9641 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9645 static void GLAPIENTRY
9646 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9647 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9649 GET_CURRENT_CONTEXT(ctx
);
9651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9652 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9654 n
[1].e
= matrixMode
;
9655 n
[2].f
= (GLfloat
) left
;
9656 n
[3].f
= (GLfloat
) right
;
9657 n
[4].f
= (GLfloat
) bottom
;
9658 n
[5].f
= (GLfloat
) top
;
9659 n
[6].f
= (GLfloat
) nearval
;
9660 n
[7].f
= (GLfloat
) farval
;
9662 if (ctx
->ExecuteFlag
) {
9663 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9668 static void GLAPIENTRY
9669 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9670 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9672 GET_CURRENT_CONTEXT(ctx
);
9674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9675 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9677 n
[1].e
= matrixMode
;
9678 n
[2].f
= (GLfloat
) left
;
9679 n
[3].f
= (GLfloat
) right
;
9680 n
[4].f
= (GLfloat
) bottom
;
9681 n
[5].f
= (GLfloat
) top
;
9682 n
[6].f
= (GLfloat
) nearval
;
9683 n
[7].f
= (GLfloat
) farval
;
9685 if (ctx
->ExecuteFlag
) {
9686 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9690 static void GLAPIENTRY
9691 save_MatrixPushEXT(GLenum matrixMode
)
9693 GET_CURRENT_CONTEXT(ctx
);
9695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9696 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9698 n
[1].e
= matrixMode
;
9700 if (ctx
->ExecuteFlag
) {
9701 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9705 static void GLAPIENTRY
9706 save_MatrixPopEXT(GLenum matrixMode
)
9708 GET_CURRENT_CONTEXT(ctx
);
9710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9711 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9713 n
[1].e
= matrixMode
;
9715 if (ctx
->ExecuteFlag
) {
9716 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9720 static void GLAPIENTRY
9721 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9724 _math_transposef(tm
, m
);
9725 save_MatrixLoadfEXT(matrixMode
, tm
);
9728 static void GLAPIENTRY
9729 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9732 _math_transposefd(tm
, m
);
9733 save_MatrixLoadfEXT(matrixMode
, tm
);
9736 static void GLAPIENTRY
9737 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9740 _math_transposef(tm
, m
);
9741 save_MatrixMultfEXT(matrixMode
, tm
);
9744 static void GLAPIENTRY
9745 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9748 _math_transposefd(tm
, m
);
9749 save_MatrixMultfEXT(matrixMode
, tm
);
9752 static void GLAPIENTRY
9753 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9754 const GLfloat
*params
)
9756 GET_CURRENT_CONTEXT(ctx
);
9758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9759 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9769 if (ctx
->ExecuteFlag
) {
9770 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9775 static void GLAPIENTRY
9776 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9780 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9781 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9784 static void GLAPIENTRY
9785 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9787 GET_CURRENT_CONTEXT(ctx
);
9789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9790 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9800 if (ctx
->ExecuteFlag
) {
9801 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9805 static void GLAPIENTRY
9806 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9810 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9811 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9814 static void GLAPIENTRY
9815 save_TextureParameterIivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
* params
)
9817 GET_CURRENT_CONTEXT(ctx
);
9819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9820 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_II
, 7);
9830 if (ctx
->ExecuteFlag
) {
9831 CALL_TextureParameterIivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9835 static void GLAPIENTRY
9836 save_TextureParameterIuivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLuint
* params
)
9838 GET_CURRENT_CONTEXT(ctx
);
9840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9841 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_IUI
, 7);
9846 n
[4].ui
= params
[0];
9847 n
[5].ui
= params
[1];
9848 n
[6].ui
= params
[2];
9849 n
[7].ui
= params
[3];
9851 if (ctx
->ExecuteFlag
) {
9852 CALL_TextureParameterIuivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9857 static void GLAPIENTRY
9858 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9859 GLint level
, GLint components
,
9860 GLsizei width
, GLint border
,
9861 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9863 GET_CURRENT_CONTEXT(ctx
);
9864 if (target
== GL_PROXY_TEXTURE_1D
) {
9865 /* don't compile, execute immediately */
9866 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9867 border
, format
, type
, pixels
));
9871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9872 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9877 n
[4].i
= components
;
9878 n
[5].i
= (GLint
) width
;
9883 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9884 pixels
, &ctx
->Unpack
));
9886 if (ctx
->ExecuteFlag
) {
9887 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9888 border
, format
, type
, pixels
));
9894 static void GLAPIENTRY
9895 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9896 GLint level
, GLint components
,
9897 GLsizei width
, GLsizei height
, GLint border
,
9898 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9900 GET_CURRENT_CONTEXT(ctx
);
9901 if (target
== GL_PROXY_TEXTURE_2D
) {
9902 /* don't compile, execute immediately */
9903 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9904 height
, border
, format
, type
, pixels
));
9908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9909 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9914 n
[4].i
= components
;
9915 n
[5].i
= (GLint
) width
;
9916 n
[6].i
= (GLint
) height
;
9920 save_pointer(&n
[10],
9921 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9922 pixels
, &ctx
->Unpack
));
9924 if (ctx
->ExecuteFlag
) {
9925 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9926 height
, border
, format
, type
, pixels
));
9932 static void GLAPIENTRY
9933 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9934 GLint level
, GLint internalFormat
,
9935 GLsizei width
, GLsizei height
, GLsizei depth
,
9937 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9939 GET_CURRENT_CONTEXT(ctx
);
9940 if (target
== GL_PROXY_TEXTURE_3D
) {
9941 /* don't compile, execute immediately */
9942 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9943 height
, depth
, border
, format
, type
,
9948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9949 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9954 n
[4].i
= (GLint
) internalFormat
;
9955 n
[5].i
= (GLint
) width
;
9956 n
[6].i
= (GLint
) height
;
9957 n
[7].i
= (GLint
) depth
;
9961 save_pointer(&n
[11],
9962 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9963 pixels
, &ctx
->Unpack
));
9965 if (ctx
->ExecuteFlag
) {
9966 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9967 width
, height
, depth
, border
, format
,
9974 static void GLAPIENTRY
9975 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9976 GLsizei width
, GLenum format
, GLenum type
,
9977 const GLvoid
* pixels
)
9979 GET_CURRENT_CONTEXT(ctx
);
9982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9984 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9990 n
[5].i
= (GLint
) width
;
9994 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9995 pixels
, &ctx
->Unpack
));
9997 if (ctx
->ExecuteFlag
) {
9998 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9999 format
, type
, pixels
));
10004 static void GLAPIENTRY
10005 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10006 GLint xoffset
, GLint yoffset
,
10007 GLsizei width
, GLsizei height
,
10008 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10010 GET_CURRENT_CONTEXT(ctx
);
10013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10015 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10022 n
[6].i
= (GLint
) width
;
10023 n
[7].i
= (GLint
) height
;
10026 save_pointer(&n
[10],
10027 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10028 pixels
, &ctx
->Unpack
));
10030 if (ctx
->ExecuteFlag
) {
10031 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
10032 width
, height
, format
, type
, pixels
));
10037 static void GLAPIENTRY
10038 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10039 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10040 GLsizei width
, GLsizei height
, GLsizei depth
,
10041 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10043 GET_CURRENT_CONTEXT(ctx
);
10046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10048 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10056 n
[7].i
= (GLint
) width
;
10057 n
[8].i
= (GLint
) height
;
10058 n
[9].i
= (GLint
) depth
;
10061 save_pointer(&n
[12],
10062 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10063 pixels
, &ctx
->Unpack
));
10065 if (ctx
->ExecuteFlag
) {
10066 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10067 xoffset
, yoffset
, zoffset
,
10068 width
, height
, depth
, format
, type
,
10073 static void GLAPIENTRY
10074 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10075 GLenum internalformat
, GLint x
, GLint y
,
10076 GLsizei width
, GLint border
)
10078 GET_CURRENT_CONTEXT(ctx
);
10080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10081 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
10086 n
[4].e
= internalformat
;
10092 if (ctx
->ExecuteFlag
) {
10093 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10094 internalformat
, x
, y
,
10099 static void GLAPIENTRY
10100 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10101 GLenum internalformat
,
10102 GLint x
, GLint y
, GLsizei width
,
10103 GLsizei height
, GLint border
)
10105 GET_CURRENT_CONTEXT(ctx
);
10107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10108 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
10113 n
[4].e
= internalformat
;
10120 if (ctx
->ExecuteFlag
) {
10121 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10122 internalformat
, x
, y
,
10123 width
, height
, border
));
10127 static void GLAPIENTRY
10128 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10129 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10131 GET_CURRENT_CONTEXT(ctx
);
10133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10134 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
10144 if (ctx
->ExecuteFlag
) {
10145 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
10146 (texture
, target
, level
, xoffset
, x
, y
, width
));
10150 static void GLAPIENTRY
10151 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10152 GLint xoffset
, GLint yoffset
,
10153 GLint x
, GLint y
, GLsizei width
, GLint height
)
10155 GET_CURRENT_CONTEXT(ctx
);
10157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10158 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
10170 if (ctx
->ExecuteFlag
) {
10171 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10173 x
, y
, width
, height
));
10178 static void GLAPIENTRY
10179 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10180 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10181 GLint x
, GLint y
, GLsizei width
, GLint height
)
10183 GET_CURRENT_CONTEXT(ctx
);
10185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10186 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
10199 if (ctx
->ExecuteFlag
) {
10200 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10201 xoffset
, yoffset
, zoffset
,
10202 x
, y
, width
, height
));
10207 static void GLAPIENTRY
10208 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
10210 GET_CURRENT_CONTEXT(ctx
);
10212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10213 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
10219 if (ctx
->ExecuteFlag
) {
10220 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
10225 static void GLAPIENTRY
10226 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
10227 const GLfloat
*params
)
10229 GET_CURRENT_CONTEXT(ctx
);
10231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10232 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
10237 n
[4].f
= params
[0];
10238 n
[5].f
= params
[1];
10239 n
[6].f
= params
[2];
10240 n
[7].f
= params
[3];
10242 if (ctx
->ExecuteFlag
) {
10243 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10248 static void GLAPIENTRY
10249 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10253 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10254 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
10257 static void GLAPIENTRY
10258 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10260 GET_CURRENT_CONTEXT(ctx
);
10262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10263 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10268 n
[4].i
= params
[0];
10269 n
[5].i
= params
[1];
10270 n
[6].i
= params
[2];
10271 n
[7].i
= params
[3];
10273 if (ctx
->ExecuteFlag
) {
10274 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10278 static void GLAPIENTRY
10279 save_MultiTexParameterIivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10281 GET_CURRENT_CONTEXT(ctx
);
10283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10284 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_II
, 7);
10289 n
[4].i
= params
[0];
10290 n
[5].i
= params
[1];
10291 n
[6].i
= params
[2];
10292 n
[7].i
= params
[3];
10294 if (ctx
->ExecuteFlag
) {
10295 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10299 static void GLAPIENTRY
10300 save_MultiTexParameterIuivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLuint
*params
)
10302 GET_CURRENT_CONTEXT(ctx
);
10304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10305 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_IUI
, 7);
10310 n
[4].ui
= params
[0];
10311 n
[5].ui
= params
[1];
10312 n
[6].ui
= params
[2];
10313 n
[7].ui
= params
[3];
10315 if (ctx
->ExecuteFlag
) {
10316 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10320 static void GLAPIENTRY
10321 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10325 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10326 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10330 static void GLAPIENTRY
10331 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10332 GLint level
, GLint components
,
10333 GLsizei width
, GLint border
,
10334 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10336 GET_CURRENT_CONTEXT(ctx
);
10337 if (target
== GL_PROXY_TEXTURE_1D
) {
10338 /* don't compile, execute immediately */
10339 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10340 border
, format
, type
, pixels
));
10344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10345 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10350 n
[4].i
= components
;
10351 n
[5].i
= (GLint
) width
;
10355 save_pointer(&n
[9],
10356 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10357 pixels
, &ctx
->Unpack
));
10359 if (ctx
->ExecuteFlag
) {
10360 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10361 border
, format
, type
, pixels
));
10367 static void GLAPIENTRY
10368 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10369 GLint level
, GLint components
,
10370 GLsizei width
, GLsizei height
, GLint border
,
10371 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10373 GET_CURRENT_CONTEXT(ctx
);
10374 if (target
== GL_PROXY_TEXTURE_2D
) {
10375 /* don't compile, execute immediately */
10376 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10377 height
, border
, format
, type
, pixels
));
10381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10382 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10387 n
[4].i
= components
;
10388 n
[5].i
= (GLint
) width
;
10389 n
[6].i
= (GLint
) height
;
10393 save_pointer(&n
[10],
10394 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10395 pixels
, &ctx
->Unpack
));
10397 if (ctx
->ExecuteFlag
) {
10398 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10399 height
, border
, format
, type
, pixels
));
10405 static void GLAPIENTRY
10406 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10407 GLint level
, GLint internalFormat
,
10408 GLsizei width
, GLsizei height
, GLsizei depth
,
10410 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10412 GET_CURRENT_CONTEXT(ctx
);
10413 if (target
== GL_PROXY_TEXTURE_3D
) {
10414 /* don't compile, execute immediately */
10415 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10416 height
, depth
, border
, format
, type
,
10421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10422 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10427 n
[4].i
= (GLint
) internalFormat
;
10428 n
[5].i
= (GLint
) width
;
10429 n
[6].i
= (GLint
) height
;
10430 n
[7].i
= (GLint
) depth
;
10434 save_pointer(&n
[11],
10435 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10436 pixels
, &ctx
->Unpack
));
10438 if (ctx
->ExecuteFlag
) {
10439 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10440 width
, height
, depth
, border
, format
,
10447 static void GLAPIENTRY
10448 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10449 GLsizei width
, GLenum format
, GLenum type
,
10450 const GLvoid
* pixels
)
10452 GET_CURRENT_CONTEXT(ctx
);
10455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10457 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10463 n
[5].i
= (GLint
) width
;
10466 save_pointer(&n
[8],
10467 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10468 pixels
, &ctx
->Unpack
));
10470 if (ctx
->ExecuteFlag
) {
10471 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10472 format
, type
, pixels
));
10477 static void GLAPIENTRY
10478 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10479 GLint xoffset
, GLint yoffset
,
10480 GLsizei width
, GLsizei height
,
10481 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10483 GET_CURRENT_CONTEXT(ctx
);
10486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10488 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10495 n
[6].i
= (GLint
) width
;
10496 n
[7].i
= (GLint
) height
;
10499 save_pointer(&n
[10],
10500 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10501 pixels
, &ctx
->Unpack
));
10503 if (ctx
->ExecuteFlag
) {
10504 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10505 width
, height
, format
, type
, pixels
));
10510 static void GLAPIENTRY
10511 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10512 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10513 GLsizei width
, GLsizei height
, GLsizei depth
,
10514 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10516 GET_CURRENT_CONTEXT(ctx
);
10519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10521 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10529 n
[7].i
= (GLint
) width
;
10530 n
[8].i
= (GLint
) height
;
10531 n
[9].i
= (GLint
) depth
;
10534 save_pointer(&n
[12],
10535 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10536 pixels
, &ctx
->Unpack
));
10538 if (ctx
->ExecuteFlag
) {
10539 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10540 xoffset
, yoffset
, zoffset
,
10541 width
, height
, depth
, format
, type
,
10547 static void GLAPIENTRY
10548 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10549 GLenum internalformat
, GLint x
, GLint y
,
10550 GLsizei width
, GLint border
)
10552 GET_CURRENT_CONTEXT(ctx
);
10554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10555 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10560 n
[4].e
= internalformat
;
10566 if (ctx
->ExecuteFlag
) {
10567 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10568 internalformat
, x
, y
,
10574 static void GLAPIENTRY
10575 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10576 GLenum internalformat
,
10577 GLint x
, GLint y
, GLsizei width
,
10578 GLsizei height
, GLint border
)
10580 GET_CURRENT_CONTEXT(ctx
);
10582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10583 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10588 n
[4].e
= internalformat
;
10595 if (ctx
->ExecuteFlag
) {
10596 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10597 internalformat
, x
, y
,
10598 width
, height
, border
));
10603 static void GLAPIENTRY
10604 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10605 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10607 GET_CURRENT_CONTEXT(ctx
);
10609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10610 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10620 if (ctx
->ExecuteFlag
) {
10621 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10622 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10627 static void GLAPIENTRY
10628 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10629 GLint xoffset
, GLint yoffset
,
10630 GLint x
, GLint y
, GLsizei width
, GLint height
)
10632 GET_CURRENT_CONTEXT(ctx
);
10634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10635 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10647 if (ctx
->ExecuteFlag
) {
10648 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10650 x
, y
, width
, height
));
10655 static void GLAPIENTRY
10656 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10657 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10658 GLint x
, GLint y
, GLsizei width
, GLint height
)
10660 GET_CURRENT_CONTEXT(ctx
);
10662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10663 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10676 if (ctx
->ExecuteFlag
) {
10677 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10678 xoffset
, yoffset
, zoffset
,
10679 x
, y
, width
, height
));
10684 static void GLAPIENTRY
10685 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10687 GET_CURRENT_CONTEXT(ctx
);
10689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10690 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10695 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10696 n
[4].f
= params
[0];
10697 n
[5].f
= params
[1];
10698 n
[6].f
= params
[2];
10699 n
[7].f
= params
[3];
10702 n
[4].f
= params
[0];
10703 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10706 if (ctx
->ExecuteFlag
) {
10707 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10712 static void GLAPIENTRY
10713 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10716 parray
[0] = (GLfloat
) param
;
10717 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10718 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10722 static void GLAPIENTRY
10723 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10726 p
[0] = (GLfloat
) param
;
10727 p
[1] = p
[2] = p
[3] = 0.0F
;
10728 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10732 static void GLAPIENTRY
10733 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10736 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10737 p
[0] = INT_TO_FLOAT(param
[0]);
10738 p
[1] = INT_TO_FLOAT(param
[1]);
10739 p
[2] = INT_TO_FLOAT(param
[2]);
10740 p
[3] = INT_TO_FLOAT(param
[3]);
10743 p
[0] = (GLfloat
) param
[0];
10744 p
[1] = p
[2] = p
[3] = 0.0F
;
10746 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10750 static void GLAPIENTRY
10751 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10752 GLenum internalFormat
, GLsizei width
,
10753 GLint border
, GLsizei imageSize
,
10754 const GLvoid
* data
)
10756 GET_CURRENT_CONTEXT(ctx
);
10757 if (target
== GL_PROXY_TEXTURE_1D
) {
10758 /* don't compile, execute immediately */
10759 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10760 internalFormat
, width
,
10766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10768 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
10769 7 + POINTER_DWORDS
);
10774 n
[4].e
= internalFormat
;
10775 n
[5].i
= (GLint
) width
;
10777 n
[7].i
= imageSize
;
10778 save_pointer(&n
[8],
10779 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
10781 if (ctx
->ExecuteFlag
) {
10782 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
10783 (texture
, target
, level
, internalFormat
,
10784 width
, border
, imageSize
, data
));
10790 static void GLAPIENTRY
10791 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10792 GLenum internalFormat
, GLsizei width
,
10793 GLsizei height
, GLint border
, GLsizei imageSize
,
10794 const GLvoid
* data
)
10796 GET_CURRENT_CONTEXT(ctx
);
10797 if (target
== GL_PROXY_TEXTURE_2D
) {
10798 /* don't compile, execute immediately */
10799 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10800 internalFormat
, width
, height
,
10801 border
, imageSize
, data
));
10805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10807 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
10808 8 + POINTER_DWORDS
);
10813 n
[4].e
= internalFormat
;
10814 n
[5].i
= (GLint
) width
;
10815 n
[6].i
= (GLint
) height
;
10817 n
[8].i
= imageSize
;
10818 save_pointer(&n
[9],
10819 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
10821 if (ctx
->ExecuteFlag
) {
10822 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
10823 (texture
, target
, level
, internalFormat
,
10824 width
, height
, border
, imageSize
, data
));
10830 static void GLAPIENTRY
10831 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10832 GLenum internalFormat
, GLsizei width
,
10833 GLsizei height
, GLsizei depth
, GLint border
,
10834 GLsizei imageSize
, const GLvoid
* data
)
10836 GET_CURRENT_CONTEXT(ctx
);
10837 if (target
== GL_PROXY_TEXTURE_3D
) {
10838 /* don't compile, execute immediately */
10839 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10840 internalFormat
, width
,
10841 height
, depth
, border
,
10846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10848 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
10849 9 + POINTER_DWORDS
);
10854 n
[4].e
= internalFormat
;
10855 n
[5].i
= (GLint
) width
;
10856 n
[6].i
= (GLint
) height
;
10857 n
[7].i
= (GLint
) depth
;
10859 n
[9].i
= imageSize
;
10860 save_pointer(&n
[10],
10861 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
10863 if (ctx
->ExecuteFlag
) {
10864 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
10865 (texture
, target
, level
, internalFormat
,
10866 width
, height
, depth
, border
, imageSize
,
10873 static void GLAPIENTRY
10874 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10875 GLsizei width
, GLenum format
,
10876 GLsizei imageSize
, const GLvoid
* data
)
10879 GET_CURRENT_CONTEXT(ctx
);
10880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10882 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
10883 7 + POINTER_DWORDS
);
10889 n
[5].i
= (GLint
) width
;
10891 n
[7].i
= imageSize
;
10892 save_pointer(&n
[8],
10893 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
10895 if (ctx
->ExecuteFlag
) {
10896 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
10897 width
, format
, imageSize
, data
));
10902 static void GLAPIENTRY
10903 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10904 GLint yoffset
, GLsizei width
, GLsizei height
,
10905 GLenum format
, GLsizei imageSize
,
10906 const GLvoid
* data
)
10909 GET_CURRENT_CONTEXT(ctx
);
10910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10912 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10913 9 + POINTER_DWORDS
);
10920 n
[6].i
= (GLint
) width
;
10921 n
[7].i
= (GLint
) height
;
10923 n
[9].i
= imageSize
;
10924 save_pointer(&n
[10],
10925 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10927 if (ctx
->ExecuteFlag
) {
10928 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10929 (texture
, target
, level
, xoffset
, yoffset
,
10930 width
, height
, format
, imageSize
, data
));
10935 static void GLAPIENTRY
10936 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10937 GLint yoffset
, GLint zoffset
, GLsizei width
,
10938 GLsizei height
, GLsizei depth
, GLenum format
,
10939 GLsizei imageSize
, const GLvoid
* data
)
10942 GET_CURRENT_CONTEXT(ctx
);
10943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10945 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
10946 11 + POINTER_DWORDS
);
10954 n
[7].i
= (GLint
) width
;
10955 n
[8].i
= (GLint
) height
;
10956 n
[9].i
= (GLint
) depth
;
10958 n
[11].i
= imageSize
;
10959 save_pointer(&n
[12],
10960 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
10962 if (ctx
->ExecuteFlag
) {
10963 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
10964 (texture
, target
, level
, xoffset
, yoffset
,
10965 zoffset
, width
, height
, depth
, format
,
10971 static void GLAPIENTRY
10972 save_CompressedMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10973 GLenum internalFormat
, GLsizei width
,
10974 GLint border
, GLsizei imageSize
,
10975 const GLvoid
* data
)
10977 GET_CURRENT_CONTEXT(ctx
);
10978 if (target
== GL_PROXY_TEXTURE_1D
) {
10979 /* don't compile, execute immediately */
10980 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10981 internalFormat
, width
,
10987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10989 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
10990 7 + POINTER_DWORDS
);
10995 n
[4].e
= internalFormat
;
10996 n
[5].i
= (GLint
) width
;
10998 n
[7].i
= imageSize
;
10999 save_pointer(&n
[8],
11000 copy_data(data
, imageSize
, "glCompressedMultiTexImage1DEXT"));
11002 if (ctx
->ExecuteFlag
) {
11003 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
,
11004 (texunit
, target
, level
, internalFormat
,
11005 width
, border
, imageSize
, data
));
11011 static void GLAPIENTRY
11012 save_CompressedMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
11013 GLenum internalFormat
, GLsizei width
,
11014 GLsizei height
, GLint border
, GLsizei imageSize
,
11015 const GLvoid
* data
)
11017 GET_CURRENT_CONTEXT(ctx
);
11018 if (target
== GL_PROXY_TEXTURE_2D
) {
11019 /* don't compile, execute immediately */
11020 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
11021 internalFormat
, width
, height
,
11022 border
, imageSize
, data
));
11026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11028 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
11029 8 + POINTER_DWORDS
);
11034 n
[4].e
= internalFormat
;
11035 n
[5].i
= (GLint
) width
;
11036 n
[6].i
= (GLint
) height
;
11038 n
[8].i
= imageSize
;
11039 save_pointer(&n
[9],
11040 copy_data(data
, imageSize
, "glCompressedMultiTexImage2DEXT"));
11042 if (ctx
->ExecuteFlag
) {
11043 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
,
11044 (texunit
, target
, level
, internalFormat
,
11045 width
, height
, border
, imageSize
, data
));
11051 static void GLAPIENTRY
11052 save_CompressedMultiTexImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
11053 GLenum internalFormat
, GLsizei width
,
11054 GLsizei height
, GLsizei depth
, GLint border
,
11055 GLsizei imageSize
, const GLvoid
* data
)
11057 GET_CURRENT_CONTEXT(ctx
);
11058 if (target
== GL_PROXY_TEXTURE_3D
) {
11059 /* don't compile, execute immediately */
11060 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
11061 internalFormat
, width
,
11062 height
, depth
, border
,
11067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11069 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
11070 9 + POINTER_DWORDS
);
11075 n
[4].e
= internalFormat
;
11076 n
[5].i
= (GLint
) width
;
11077 n
[6].i
= (GLint
) height
;
11078 n
[7].i
= (GLint
) depth
;
11080 n
[9].i
= imageSize
;
11081 save_pointer(&n
[10],
11082 copy_data(data
, imageSize
, "glCompressedMultiTexImage3DEXT"));
11084 if (ctx
->ExecuteFlag
) {
11085 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
,
11086 (texunit
, target
, level
, internalFormat
,
11087 width
, height
, depth
, border
, imageSize
,
11094 static void GLAPIENTRY
11095 save_CompressedMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11096 GLsizei width
, GLenum format
,
11097 GLsizei imageSize
, const GLvoid
* data
)
11100 GET_CURRENT_CONTEXT(ctx
);
11101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11103 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
11104 7 + POINTER_DWORDS
);
11110 n
[5].i
= (GLint
) width
;
11112 n
[7].i
= imageSize
;
11113 save_pointer(&n
[8],
11114 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage1DEXT"));
11116 if (ctx
->ExecuteFlag
) {
11117 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
,
11118 width
, format
, imageSize
, data
));
11123 static void GLAPIENTRY
11124 save_CompressedMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11125 GLint yoffset
, GLsizei width
, GLsizei height
,
11126 GLenum format
, GLsizei imageSize
,
11127 const GLvoid
* data
)
11130 GET_CURRENT_CONTEXT(ctx
);
11131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11133 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
11134 9 + POINTER_DWORDS
);
11141 n
[6].i
= (GLint
) width
;
11142 n
[7].i
= (GLint
) height
;
11144 n
[9].i
= imageSize
;
11145 save_pointer(&n
[10],
11146 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage2DEXT"));
11148 if (ctx
->ExecuteFlag
) {
11149 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
11150 (texunit
, target
, level
, xoffset
, yoffset
,
11151 width
, height
, format
, imageSize
, data
));
11156 static void GLAPIENTRY
11157 save_CompressedMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11158 GLint yoffset
, GLint zoffset
, GLsizei width
,
11159 GLsizei height
, GLsizei depth
, GLenum format
,
11160 GLsizei imageSize
, const GLvoid
* data
)
11163 GET_CURRENT_CONTEXT(ctx
);
11164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11166 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
11167 11 + POINTER_DWORDS
);
11175 n
[7].i
= (GLint
) width
;
11176 n
[8].i
= (GLint
) height
;
11177 n
[9].i
= (GLint
) depth
;
11179 n
[11].i
= imageSize
;
11180 save_pointer(&n
[12],
11181 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage3DEXT"));
11183 if (ctx
->ExecuteFlag
) {
11184 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
11185 (texunit
, target
, level
, xoffset
, yoffset
,
11186 zoffset
, width
, height
, depth
, format
,
11192 static void GLAPIENTRY
11193 save_NamedProgramStringEXT(GLuint program
, GLenum target
, GLenum format
, GLsizei len
,
11194 const GLvoid
* string
)
11196 GET_CURRENT_CONTEXT(ctx
);
11199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11201 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_STRING
, 4 + POINTER_DWORDS
);
11203 GLubyte
*programCopy
= malloc(len
);
11204 if (!programCopy
) {
11205 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glNamedProgramStringEXT");
11208 memcpy(programCopy
, string
, len
);
11213 save_pointer(&n
[5], programCopy
);
11215 if (ctx
->ExecuteFlag
) {
11216 CALL_NamedProgramStringEXT(ctx
->Exec
, (program
, target
, format
, len
, string
));
11221 static void GLAPIENTRY
11222 save_NamedProgramLocalParameter4fEXT(GLuint program
, GLenum target
, GLuint index
,
11223 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
11225 GET_CURRENT_CONTEXT(ctx
);
11227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11228 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
, 7);
11238 if (ctx
->ExecuteFlag
) {
11239 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
, (program
, target
, index
, x
, y
, z
, w
));
11244 static void GLAPIENTRY
11245 save_NamedProgramLocalParameter4fvEXT(GLuint program
, GLenum target
, GLuint index
,
11246 const GLfloat
*params
)
11248 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, params
[0],
11249 params
[1], params
[2], params
[3]);
11253 static void GLAPIENTRY
11254 save_NamedProgramLocalParameter4dEXT(GLuint program
, GLenum target
, GLuint index
,
11255 GLdouble x
, GLdouble y
,
11256 GLdouble z
, GLdouble w
)
11258 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) x
,
11259 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
11263 static void GLAPIENTRY
11264 save_NamedProgramLocalParameter4dvEXT(GLuint program
, GLenum target
, GLuint index
,
11265 const GLdouble
*params
)
11267 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) params
[0],
11268 (GLfloat
) params
[1], (GLfloat
) params
[2],
11269 (GLfloat
) params
[3]);
11274 * Save an error-generating command into display list.
11276 * KW: Will appear in the list before the vertex buffer containing the
11277 * command that provoked the error. I don't see this as a problem.
11280 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11283 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
11286 save_pointer(&n
[2], (void *) s
);
11287 /* note: the data/string here doesn't have to be freed in
11288 * _mesa_delete_list() since the string is never dynamically
11296 * Compile an error into current display list.
11299 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11301 if (ctx
->CompileFlag
)
11302 save_error(ctx
, error
, s
);
11303 if (ctx
->ExecuteFlag
)
11304 _mesa_error(ctx
, error
, "%s", s
);
11309 * Test if ID names a display list.
11312 islist(struct gl_context
*ctx
, GLuint list
)
11314 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
11324 /**********************************************************************/
11325 /* Display list execution */
11326 /**********************************************************************/
11330 * Execute a display list. Note that the ListBase offset must have already
11331 * been added before calling this function. I.e. the list argument is
11332 * the absolute list number, not relative to ListBase.
11333 * \param list - display list number
11336 execute_list(struct gl_context
*ctx
, GLuint list
)
11338 struct gl_display_list
*dlist
;
11342 if (list
== 0 || !islist(ctx
, list
))
11345 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
11346 /* raise an error? */
11350 dlist
= _mesa_lookup_list(ctx
, list
);
11354 ctx
->ListState
.CallDepth
++;
11356 vbo_save_BeginCallList(ctx
, dlist
);
11362 const OpCode opcode
= n
[0].opcode
;
11364 if (is_ext_opcode(opcode
)) {
11365 n
+= ext_opcode_execute(ctx
, n
);
11370 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
11373 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11375 case OPCODE_ALPHA_FUNC
:
11376 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11378 case OPCODE_BIND_TEXTURE
:
11379 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11381 case OPCODE_BITMAP
:
11383 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11384 ctx
->Unpack
= ctx
->DefaultPacking
;
11385 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
11386 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11387 get_pointer(&n
[7])));
11388 ctx
->Unpack
= save
; /* restore */
11391 case OPCODE_BLEND_COLOR
:
11392 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11394 case OPCODE_BLEND_EQUATION
:
11395 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
11397 case OPCODE_BLEND_EQUATION_SEPARATE
:
11398 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11400 case OPCODE_BLEND_FUNC_SEPARATE
:
11401 CALL_BlendFuncSeparate(ctx
->Exec
,
11402 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11405 case OPCODE_BLEND_FUNC_I
:
11406 /* GL_ARB_draw_buffers_blend */
11407 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
11409 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11410 /* GL_ARB_draw_buffers_blend */
11411 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
11414 case OPCODE_BLEND_EQUATION_I
:
11415 /* GL_ARB_draw_buffers_blend */
11416 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11418 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11419 /* GL_ARB_draw_buffers_blend */
11420 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
11421 (n
[1].ui
, n
[2].e
, n
[3].e
));
11424 case OPCODE_CALL_LIST
:
11425 /* Generated by glCallList(), don't add ListBase */
11426 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11427 execute_list(ctx
, n
[1].ui
);
11430 case OPCODE_CALL_LISTS
:
11431 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11432 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
11436 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
11438 case OPCODE_CLEAR_BUFFER_IV
:
11445 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11448 case OPCODE_CLEAR_BUFFER_UIV
:
11451 value
[0] = n
[3].ui
;
11452 value
[1] = n
[4].ui
;
11453 value
[2] = n
[5].ui
;
11454 value
[3] = n
[6].ui
;
11455 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11458 case OPCODE_CLEAR_BUFFER_FV
:
11465 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11468 case OPCODE_CLEAR_BUFFER_FI
:
11469 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
11471 case OPCODE_CLEAR_COLOR
:
11472 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11474 case OPCODE_CLEAR_ACCUM
:
11475 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11477 case OPCODE_CLEAR_DEPTH
:
11478 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
11480 case OPCODE_CLEAR_INDEX
:
11481 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
11483 case OPCODE_CLEAR_STENCIL
:
11484 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
11486 case OPCODE_CLIP_PLANE
:
11493 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
11496 case OPCODE_COLOR_MASK
:
11497 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
11499 case OPCODE_COLOR_MASK_INDEXED
:
11500 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
11503 case OPCODE_COLOR_MATERIAL
:
11504 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11506 case OPCODE_COPY_PIXELS
:
11507 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11508 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
11511 case OPCODE_COPY_TEX_IMAGE1D
:
11512 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11513 n
[5].i
, n
[6].i
, n
[7].i
));
11515 case OPCODE_COPY_TEX_IMAGE2D
:
11516 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11517 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
11519 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
11520 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11521 n
[4].i
, n
[5].i
, n
[6].i
));
11523 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
11524 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11525 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11528 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
11529 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11530 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11533 case OPCODE_CULL_FACE
:
11534 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
11536 case OPCODE_DEPTH_FUNC
:
11537 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
11539 case OPCODE_DEPTH_MASK
:
11540 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
11542 case OPCODE_DEPTH_RANGE
:
11543 CALL_DepthRange(ctx
->Exec
,
11544 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
11546 case OPCODE_DISABLE
:
11547 CALL_Disable(ctx
->Exec
, (n
[1].e
));
11549 case OPCODE_DISABLE_INDEXED
:
11550 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11552 case OPCODE_DRAW_BUFFER
:
11553 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
11555 case OPCODE_DRAW_PIXELS
:
11557 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11558 ctx
->Unpack
= ctx
->DefaultPacking
;
11559 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
11560 get_pointer(&n
[5])));
11561 ctx
->Unpack
= save
; /* restore */
11564 case OPCODE_ENABLE
:
11565 CALL_Enable(ctx
->Exec
, (n
[1].e
));
11567 case OPCODE_ENABLE_INDEXED
:
11568 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11570 case OPCODE_EVALMESH1
:
11571 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
11573 case OPCODE_EVALMESH2
:
11574 CALL_EvalMesh2(ctx
->Exec
,
11575 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11584 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
11587 case OPCODE_FRONT_FACE
:
11588 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
11590 case OPCODE_FRUSTUM
:
11591 CALL_Frustum(ctx
->Exec
,
11592 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11595 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11597 case OPCODE_INDEX_MASK
:
11598 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
11600 case OPCODE_INIT_NAMES
:
11601 CALL_InitNames(ctx
->Exec
, ());
11610 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
11613 case OPCODE_LIGHT_MODEL
:
11620 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
11623 case OPCODE_LINE_STIPPLE
:
11624 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
11626 case OPCODE_LINE_WIDTH
:
11627 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
11629 case OPCODE_LIST_BASE
:
11630 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
11632 case OPCODE_LOAD_IDENTITY
:
11633 CALL_LoadIdentity(ctx
->Exec
, ());
11635 case OPCODE_LOAD_MATRIX
:
11636 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
11637 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
11639 case OPCODE_LOAD_NAME
:
11640 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
11642 case OPCODE_LOGIC_OP
:
11643 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
11647 GLenum target
= n
[1].e
;
11648 GLint ustride
= _mesa_evaluator_components(target
);
11649 GLint uorder
= n
[5].i
;
11650 GLfloat u1
= n
[2].f
;
11651 GLfloat u2
= n
[3].f
;
11652 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11653 (GLfloat
*) get_pointer(&n
[6])));
11658 GLenum target
= n
[1].e
;
11659 GLfloat u1
= n
[2].f
;
11660 GLfloat u2
= n
[3].f
;
11661 GLfloat v1
= n
[4].f
;
11662 GLfloat v2
= n
[5].f
;
11663 GLint ustride
= n
[6].i
;
11664 GLint vstride
= n
[7].i
;
11665 GLint uorder
= n
[8].i
;
11666 GLint vorder
= n
[9].i
;
11667 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11668 v1
, v2
, vstride
, vorder
,
11669 (GLfloat
*) get_pointer(&n
[10])));
11672 case OPCODE_MAPGRID1
:
11673 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11675 case OPCODE_MAPGRID2
:
11676 CALL_MapGrid2f(ctx
->Exec
,
11677 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
11679 case OPCODE_MATRIX_MODE
:
11680 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
11682 case OPCODE_MULT_MATRIX
:
11683 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
11686 CALL_Ortho(ctx
->Exec
,
11687 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11689 case OPCODE_PASSTHROUGH
:
11690 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
11692 case OPCODE_PATCH_PARAMETER_I
:
11693 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11695 case OPCODE_PATCH_PARAMETER_FV_INNER
:
11698 params
[0] = n
[2].f
;
11699 params
[1] = n
[3].f
;
11700 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11703 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
11706 params
[0] = n
[2].f
;
11707 params
[1] = n
[3].f
;
11708 params
[2] = n
[4].f
;
11709 params
[3] = n
[5].f
;
11710 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11713 case OPCODE_PIXEL_MAP
:
11714 CALL_PixelMapfv(ctx
->Exec
,
11715 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
11717 case OPCODE_PIXEL_TRANSFER
:
11718 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11720 case OPCODE_PIXEL_ZOOM
:
11721 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11723 case OPCODE_POINT_SIZE
:
11724 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
11726 case OPCODE_POINT_PARAMETERS
:
11729 params
[0] = n
[2].f
;
11730 params
[1] = n
[3].f
;
11731 params
[2] = n
[4].f
;
11732 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11735 case OPCODE_POLYGON_MODE
:
11736 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11738 case OPCODE_POLYGON_STIPPLE
:
11740 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11741 ctx
->Unpack
= ctx
->DefaultPacking
;
11742 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
11743 ctx
->Unpack
= save
; /* restore */
11746 case OPCODE_POLYGON_OFFSET
:
11747 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11749 case OPCODE_POLYGON_OFFSET_CLAMP
:
11750 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11752 case OPCODE_POP_ATTRIB
:
11753 CALL_PopAttrib(ctx
->Exec
, ());
11755 case OPCODE_POP_MATRIX
:
11756 CALL_PopMatrix(ctx
->Exec
, ());
11758 case OPCODE_POP_NAME
:
11759 CALL_PopName(ctx
->Exec
, ());
11761 case OPCODE_PRIORITIZE_TEXTURE
:
11762 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
11764 case OPCODE_PUSH_ATTRIB
:
11765 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
11767 case OPCODE_PUSH_MATRIX
:
11768 CALL_PushMatrix(ctx
->Exec
, ());
11770 case OPCODE_PUSH_NAME
:
11771 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
11773 case OPCODE_RASTER_POS
:
11774 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11776 case OPCODE_READ_BUFFER
:
11777 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
11779 case OPCODE_ROTATE
:
11780 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11783 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11785 case OPCODE_SCISSOR
:
11786 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11788 case OPCODE_SHADE_MODEL
:
11789 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
11791 case OPCODE_PROVOKING_VERTEX
:
11792 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
11794 case OPCODE_STENCIL_FUNC
:
11795 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
11797 case OPCODE_STENCIL_MASK
:
11798 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
11800 case OPCODE_STENCIL_OP
:
11801 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
11803 case OPCODE_STENCIL_FUNC_SEPARATE
:
11804 CALL_StencilFuncSeparate(ctx
->Exec
,
11805 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
11807 case OPCODE_STENCIL_MASK_SEPARATE
:
11808 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11810 case OPCODE_STENCIL_OP_SEPARATE
:
11811 CALL_StencilOpSeparate(ctx
->Exec
,
11812 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11814 case OPCODE_TEXENV
:
11817 params
[0] = n
[3].f
;
11818 params
[1] = n
[4].f
;
11819 params
[2] = n
[5].f
;
11820 params
[3] = n
[6].f
;
11821 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11824 case OPCODE_TEXGEN
:
11827 params
[0] = n
[3].f
;
11828 params
[1] = n
[4].f
;
11829 params
[2] = n
[5].f
;
11830 params
[3] = n
[6].f
;
11831 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11834 case OPCODE_TEXPARAMETER
:
11837 params
[0] = n
[3].f
;
11838 params
[1] = n
[4].f
;
11839 params
[2] = n
[5].f
;
11840 params
[3] = n
[6].f
;
11841 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11844 case OPCODE_TEX_IMAGE1D
:
11846 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11847 ctx
->Unpack
= ctx
->DefaultPacking
;
11848 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11849 n
[2].i
, /* level */
11850 n
[3].i
, /* components */
11851 n
[4].i
, /* width */
11852 n
[5].e
, /* border */
11853 n
[6].e
, /* format */
11855 get_pointer(&n
[8])));
11856 ctx
->Unpack
= save
; /* restore */
11859 case OPCODE_TEX_IMAGE2D
:
11861 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11862 ctx
->Unpack
= ctx
->DefaultPacking
;
11863 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11864 n
[2].i
, /* level */
11865 n
[3].i
, /* components */
11866 n
[4].i
, /* width */
11867 n
[5].i
, /* height */
11868 n
[6].e
, /* border */
11869 n
[7].e
, /* format */
11871 get_pointer(&n
[9])));
11872 ctx
->Unpack
= save
; /* restore */
11875 case OPCODE_TEX_IMAGE3D
:
11877 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11878 ctx
->Unpack
= ctx
->DefaultPacking
;
11879 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11880 n
[2].i
, /* level */
11881 n
[3].i
, /* components */
11882 n
[4].i
, /* width */
11883 n
[5].i
, /* height */
11884 n
[6].i
, /* depth */
11885 n
[7].e
, /* border */
11886 n
[8].e
, /* format */
11888 get_pointer(&n
[10])));
11889 ctx
->Unpack
= save
; /* restore */
11892 case OPCODE_TEX_SUB_IMAGE1D
:
11894 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11895 ctx
->Unpack
= ctx
->DefaultPacking
;
11896 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11898 n
[6].e
, get_pointer(&n
[7])));
11899 ctx
->Unpack
= save
; /* restore */
11902 case OPCODE_TEX_SUB_IMAGE2D
:
11904 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11905 ctx
->Unpack
= ctx
->DefaultPacking
;
11906 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11908 n
[6].i
, n
[7].e
, n
[8].e
,
11909 get_pointer(&n
[9])));
11910 ctx
->Unpack
= save
; /* restore */
11913 case OPCODE_TEX_SUB_IMAGE3D
:
11915 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11916 ctx
->Unpack
= ctx
->DefaultPacking
;
11917 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11918 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11919 n
[8].i
, n
[9].e
, n
[10].e
,
11920 get_pointer(&n
[11])));
11921 ctx
->Unpack
= save
; /* restore */
11924 case OPCODE_TRANSLATE
:
11925 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11927 case OPCODE_VIEWPORT
:
11928 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11929 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11931 case OPCODE_WINDOW_POS
:
11932 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11934 case OPCODE_VIEWPORT_ARRAY_V
:
11935 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11936 get_pointer(&n
[3])));
11938 case OPCODE_VIEWPORT_INDEXED_F
:
11939 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11942 case OPCODE_VIEWPORT_INDEXED_FV
: {
11948 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11951 case OPCODE_SCISSOR_ARRAY_V
:
11952 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11953 get_pointer(&n
[3])));
11955 case OPCODE_SCISSOR_INDEXED
:
11956 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11959 case OPCODE_SCISSOR_INDEXED_V
: {
11965 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11968 case OPCODE_DEPTH_ARRAY_V
:
11969 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11970 get_pointer(&n
[3])));
11972 case OPCODE_DEPTH_INDEXED
:
11973 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11975 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11976 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11978 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11979 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11980 n
[4].i
, n
[5].i
, n
[6].i
,
11981 get_pointer(&n
[7])));
11983 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11984 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11985 n
[4].i
, n
[5].i
, n
[6].i
,
11986 n
[7].i
, get_pointer(&n
[8])));
11988 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11989 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11990 n
[4].i
, n
[5].i
, n
[6].i
,
11992 get_pointer(&n
[9])));
11994 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11995 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11996 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11998 get_pointer(&n
[7])));
12000 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
12001 CALL_CompressedTexSubImage2D(ctx
->Exec
,
12002 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12003 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
12004 get_pointer(&n
[9])));
12006 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
12007 CALL_CompressedTexSubImage3D(ctx
->Exec
,
12008 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12009 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12011 get_pointer(&n
[11])));
12013 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
12014 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
12016 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
12017 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12019 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
12020 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12022 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
12023 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
12024 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
12027 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
12028 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
12030 case OPCODE_DEPTH_BOUNDS_EXT
:
12031 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12033 case OPCODE_PROGRAM_STRING_ARB
:
12034 CALL_ProgramStringARB(ctx
->Exec
,
12035 (n
[1].e
, n
[2].e
, n
[3].i
,
12036 get_pointer(&n
[4])));
12038 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
12039 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
12043 case OPCODE_BEGIN_QUERY_ARB
:
12044 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12046 case OPCODE_END_QUERY_ARB
:
12047 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
12049 case OPCODE_QUERY_COUNTER
:
12050 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
12052 case OPCODE_BEGIN_QUERY_INDEXED
:
12053 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
12055 case OPCODE_END_QUERY_INDEXED
:
12056 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12058 case OPCODE_DRAW_BUFFERS_ARB
:
12060 GLenum buffers
[MAX_DRAW_BUFFERS
];
12061 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
12062 for (i
= 0; i
< count
; i
++)
12063 buffers
[i
] = n
[2 + i
].e
;
12064 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
12067 case OPCODE_BLIT_FRAMEBUFFER
:
12068 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
12069 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12072 case OPCODE_PRIMITIVE_RESTART_NV
:
12073 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
12076 case OPCODE_USE_PROGRAM
:
12077 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
12079 case OPCODE_UNIFORM_1F
:
12080 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
12082 case OPCODE_UNIFORM_2F
:
12083 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
12085 case OPCODE_UNIFORM_3F
:
12086 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
12088 case OPCODE_UNIFORM_4F
:
12089 CALL_Uniform4f(ctx
->Exec
,
12090 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12092 case OPCODE_UNIFORM_1FV
:
12093 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12095 case OPCODE_UNIFORM_2FV
:
12096 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12098 case OPCODE_UNIFORM_3FV
:
12099 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12101 case OPCODE_UNIFORM_4FV
:
12102 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12104 case OPCODE_UNIFORM_1D
: {
12105 union float64_pair x
;
12107 x
.uint32
[0] = n
[2].ui
;
12108 x
.uint32
[1] = n
[3].ui
;
12110 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
12113 case OPCODE_UNIFORM_2D
: {
12114 union float64_pair x
;
12115 union float64_pair y
;
12117 x
.uint32
[0] = n
[2].ui
;
12118 x
.uint32
[1] = n
[3].ui
;
12119 y
.uint32
[0] = n
[4].ui
;
12120 y
.uint32
[1] = n
[5].ui
;
12122 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
12125 case OPCODE_UNIFORM_3D
: {
12126 union float64_pair x
;
12127 union float64_pair y
;
12128 union float64_pair z
;
12130 x
.uint32
[0] = n
[2].ui
;
12131 x
.uint32
[1] = n
[3].ui
;
12132 y
.uint32
[0] = n
[4].ui
;
12133 y
.uint32
[1] = n
[5].ui
;
12134 z
.uint32
[0] = n
[6].ui
;
12135 z
.uint32
[1] = n
[7].ui
;
12137 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
12140 case OPCODE_UNIFORM_4D
: {
12141 union float64_pair x
;
12142 union float64_pair y
;
12143 union float64_pair z
;
12144 union float64_pair w
;
12146 x
.uint32
[0] = n
[2].ui
;
12147 x
.uint32
[1] = n
[3].ui
;
12148 y
.uint32
[0] = n
[4].ui
;
12149 y
.uint32
[1] = n
[5].ui
;
12150 z
.uint32
[0] = n
[6].ui
;
12151 z
.uint32
[1] = n
[7].ui
;
12152 w
.uint32
[0] = n
[8].ui
;
12153 w
.uint32
[1] = n
[9].ui
;
12155 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
12158 case OPCODE_UNIFORM_1DV
:
12159 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12161 case OPCODE_UNIFORM_2DV
:
12162 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12164 case OPCODE_UNIFORM_3DV
:
12165 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12167 case OPCODE_UNIFORM_4DV
:
12168 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12170 case OPCODE_UNIFORM_1I
:
12171 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12173 case OPCODE_UNIFORM_2I
:
12174 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12176 case OPCODE_UNIFORM_3I
:
12177 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12179 case OPCODE_UNIFORM_4I
:
12180 CALL_Uniform4i(ctx
->Exec
,
12181 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12183 case OPCODE_UNIFORM_1IV
:
12184 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12186 case OPCODE_UNIFORM_2IV
:
12187 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12189 case OPCODE_UNIFORM_3IV
:
12190 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12192 case OPCODE_UNIFORM_4IV
:
12193 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12195 case OPCODE_UNIFORM_1UI
:
12196 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12198 case OPCODE_UNIFORM_2UI
:
12199 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12201 case OPCODE_UNIFORM_3UI
:
12202 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12204 case OPCODE_UNIFORM_4UI
:
12205 CALL_Uniform4ui(ctx
->Exec
,
12206 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12208 case OPCODE_UNIFORM_1UIV
:
12209 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12211 case OPCODE_UNIFORM_2UIV
:
12212 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12214 case OPCODE_UNIFORM_3UIV
:
12215 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12217 case OPCODE_UNIFORM_4UIV
:
12218 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12220 case OPCODE_UNIFORM_MATRIX22
:
12221 CALL_UniformMatrix2fv(ctx
->Exec
,
12222 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12224 case OPCODE_UNIFORM_MATRIX33
:
12225 CALL_UniformMatrix3fv(ctx
->Exec
,
12226 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12228 case OPCODE_UNIFORM_MATRIX44
:
12229 CALL_UniformMatrix4fv(ctx
->Exec
,
12230 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12232 case OPCODE_UNIFORM_MATRIX23
:
12233 CALL_UniformMatrix2x3fv(ctx
->Exec
,
12234 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12236 case OPCODE_UNIFORM_MATRIX32
:
12237 CALL_UniformMatrix3x2fv(ctx
->Exec
,
12238 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12240 case OPCODE_UNIFORM_MATRIX24
:
12241 CALL_UniformMatrix2x4fv(ctx
->Exec
,
12242 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12244 case OPCODE_UNIFORM_MATRIX42
:
12245 CALL_UniformMatrix4x2fv(ctx
->Exec
,
12246 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12248 case OPCODE_UNIFORM_MATRIX34
:
12249 CALL_UniformMatrix3x4fv(ctx
->Exec
,
12250 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12252 case OPCODE_UNIFORM_MATRIX43
:
12253 CALL_UniformMatrix4x3fv(ctx
->Exec
,
12254 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12256 case OPCODE_UNIFORM_MATRIX22D
:
12257 CALL_UniformMatrix2dv(ctx
->Exec
,
12258 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12260 case OPCODE_UNIFORM_MATRIX33D
:
12261 CALL_UniformMatrix3dv(ctx
->Exec
,
12262 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12264 case OPCODE_UNIFORM_MATRIX44D
:
12265 CALL_UniformMatrix4dv(ctx
->Exec
,
12266 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12268 case OPCODE_UNIFORM_MATRIX23D
:
12269 CALL_UniformMatrix2x3dv(ctx
->Exec
,
12270 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12272 case OPCODE_UNIFORM_MATRIX32D
:
12273 CALL_UniformMatrix3x2dv(ctx
->Exec
,
12274 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12276 case OPCODE_UNIFORM_MATRIX24D
:
12277 CALL_UniformMatrix2x4dv(ctx
->Exec
,
12278 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12280 case OPCODE_UNIFORM_MATRIX42D
:
12281 CALL_UniformMatrix4x2dv(ctx
->Exec
,
12282 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12284 case OPCODE_UNIFORM_MATRIX34D
:
12285 CALL_UniformMatrix3x4dv(ctx
->Exec
,
12286 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12288 case OPCODE_UNIFORM_MATRIX43D
:
12289 CALL_UniformMatrix4x3dv(ctx
->Exec
,
12290 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12293 case OPCODE_UNIFORM_1I64
: {
12294 union int64_pair x
;
12296 x
.int32
[0] = n
[2].i
;
12297 x
.int32
[1] = n
[3].i
;
12299 CALL_Uniform1i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
));
12302 case OPCODE_UNIFORM_2I64
: {
12303 union int64_pair x
;
12304 union int64_pair y
;
12306 x
.int32
[0] = n
[2].i
;
12307 x
.int32
[1] = n
[3].i
;
12308 y
.int32
[0] = n
[4].i
;
12309 y
.int32
[1] = n
[5].i
;
12311 CALL_Uniform2i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
));
12314 case OPCODE_UNIFORM_3I64
: {
12315 union int64_pair x
;
12316 union int64_pair y
;
12317 union int64_pair z
;
12319 x
.int32
[0] = n
[2].i
;
12320 x
.int32
[1] = n
[3].i
;
12321 y
.int32
[0] = n
[4].i
;
12322 y
.int32
[1] = n
[5].i
;
12323 z
.int32
[0] = n
[6].i
;
12324 z
.int32
[1] = n
[7].i
;
12327 CALL_Uniform3i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
));
12330 case OPCODE_UNIFORM_4I64
: {
12331 union int64_pair x
;
12332 union int64_pair y
;
12333 union int64_pair z
;
12334 union int64_pair w
;
12336 x
.int32
[0] = n
[2].i
;
12337 x
.int32
[1] = n
[3].i
;
12338 y
.int32
[0] = n
[4].i
;
12339 y
.int32
[1] = n
[5].i
;
12340 z
.int32
[0] = n
[6].i
;
12341 z
.int32
[1] = n
[7].i
;
12342 w
.int32
[0] = n
[8].i
;
12343 w
.int32
[1] = n
[9].i
;
12345 CALL_Uniform4i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
, w
.int64
));
12348 case OPCODE_UNIFORM_1I64V
:
12349 CALL_Uniform1i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12351 case OPCODE_UNIFORM_2I64V
:
12352 CALL_Uniform2i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12354 case OPCODE_UNIFORM_3I64V
:
12355 CALL_Uniform3i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12357 case OPCODE_UNIFORM_4I64V
:
12358 CALL_Uniform4i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12360 case OPCODE_UNIFORM_1UI64
: {
12361 union uint64_pair x
;
12363 x
.uint32
[0] = n
[2].ui
;
12364 x
.uint32
[1] = n
[3].ui
;
12366 CALL_Uniform1ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
));
12369 case OPCODE_UNIFORM_2UI64
: {
12370 union uint64_pair x
;
12371 union uint64_pair y
;
12373 x
.uint32
[0] = n
[2].ui
;
12374 x
.uint32
[1] = n
[3].ui
;
12375 y
.uint32
[0] = n
[4].ui
;
12376 y
.uint32
[1] = n
[5].ui
;
12378 CALL_Uniform2ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
));
12381 case OPCODE_UNIFORM_3UI64
: {
12382 union uint64_pair x
;
12383 union uint64_pair y
;
12384 union uint64_pair z
;
12386 x
.uint32
[0] = n
[2].ui
;
12387 x
.uint32
[1] = n
[3].ui
;
12388 y
.uint32
[0] = n
[4].ui
;
12389 y
.uint32
[1] = n
[5].ui
;
12390 z
.uint32
[0] = n
[6].ui
;
12391 z
.uint32
[1] = n
[7].ui
;
12394 CALL_Uniform3ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12398 case OPCODE_UNIFORM_4UI64
: {
12399 union uint64_pair x
;
12400 union uint64_pair y
;
12401 union uint64_pair z
;
12402 union uint64_pair w
;
12404 x
.uint32
[0] = n
[2].ui
;
12405 x
.uint32
[1] = n
[3].ui
;
12406 y
.uint32
[0] = n
[4].ui
;
12407 y
.uint32
[1] = n
[5].ui
;
12408 z
.uint32
[0] = n
[6].ui
;
12409 z
.uint32
[1] = n
[7].ui
;
12410 w
.uint32
[0] = n
[8].ui
;
12411 w
.uint32
[1] = n
[9].ui
;
12413 CALL_Uniform4ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12414 z
.uint64
, w
.uint64
));
12417 case OPCODE_UNIFORM_1UI64V
:
12418 CALL_Uniform1ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12419 get_pointer(&n
[3])));
12421 case OPCODE_UNIFORM_2UI64V
:
12422 CALL_Uniform2ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12423 get_pointer(&n
[3])));
12425 case OPCODE_UNIFORM_3UI64V
:
12426 CALL_Uniform3ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12427 get_pointer(&n
[3])));
12429 case OPCODE_UNIFORM_4UI64V
:
12430 CALL_Uniform4ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12431 get_pointer(&n
[3])));
12434 case OPCODE_PROGRAM_UNIFORM_1I64
: {
12435 union int64_pair x
;
12437 x
.int32
[0] = n
[3].i
;
12438 x
.int32
[1] = n
[4].i
;
12440 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
));
12443 case OPCODE_PROGRAM_UNIFORM_2I64
: {
12444 union int64_pair x
;
12445 union int64_pair y
;
12447 x
.int32
[0] = n
[3].i
;
12448 x
.int32
[1] = n
[4].i
;
12449 y
.int32
[0] = n
[5].i
;
12450 y
.int32
[1] = n
[6].i
;
12452 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12456 case OPCODE_PROGRAM_UNIFORM_3I64
: {
12457 union int64_pair x
;
12458 union int64_pair y
;
12459 union int64_pair z
;
12461 x
.int32
[0] = n
[3].i
;
12462 x
.int32
[1] = n
[4].i
;
12463 y
.int32
[0] = n
[5].i
;
12464 y
.int32
[1] = n
[6].i
;
12465 z
.int32
[0] = n
[7].i
;
12466 z
.int32
[1] = n
[8].i
;
12468 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12469 y
.int64
, z
.int64
));
12472 case OPCODE_PROGRAM_UNIFORM_4I64
: {
12473 union int64_pair x
;
12474 union int64_pair y
;
12475 union int64_pair z
;
12476 union int64_pair w
;
12478 x
.int32
[0] = n
[3].i
;
12479 x
.int32
[1] = n
[4].i
;
12480 y
.int32
[0] = n
[5].i
;
12481 y
.int32
[1] = n
[6].i
;
12482 z
.int32
[0] = n
[7].i
;
12483 z
.int32
[1] = n
[8].i
;
12484 w
.int32
[0] = n
[9].i
;
12485 w
.int32
[1] = n
[10].i
;
12487 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12488 y
.int64
, z
.int64
, w
.int64
));
12491 case OPCODE_PROGRAM_UNIFORM_1I64V
:
12492 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12493 get_pointer(&n
[4])));
12495 case OPCODE_PROGRAM_UNIFORM_2I64V
:
12496 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12497 get_pointer(&n
[4])));
12499 case OPCODE_PROGRAM_UNIFORM_3I64V
:
12500 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12501 get_pointer(&n
[4])));
12503 case OPCODE_PROGRAM_UNIFORM_4I64V
:
12504 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12505 get_pointer(&n
[4])));
12507 case OPCODE_PROGRAM_UNIFORM_1UI64
: {
12508 union uint64_pair x
;
12510 x
.uint32
[0] = n
[3].ui
;
12511 x
.uint32
[1] = n
[4].ui
;
12513 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
));
12516 case OPCODE_PROGRAM_UNIFORM_2UI64
: {
12517 union uint64_pair x
;
12518 union uint64_pair y
;
12520 x
.uint32
[0] = n
[3].ui
;
12521 x
.uint32
[1] = n
[4].ui
;
12522 y
.uint32
[0] = n
[5].ui
;
12523 y
.uint32
[1] = n
[6].ui
;
12525 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12529 case OPCODE_PROGRAM_UNIFORM_3UI64
: {
12530 union uint64_pair x
;
12531 union uint64_pair y
;
12532 union uint64_pair z
;
12534 x
.uint32
[0] = n
[3].ui
;
12535 x
.uint32
[1] = n
[4].ui
;
12536 y
.uint32
[0] = n
[5].ui
;
12537 y
.uint32
[1] = n
[6].ui
;
12538 z
.uint32
[0] = n
[7].ui
;
12539 z
.uint32
[1] = n
[8].ui
;
12541 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12542 y
.uint64
, z
.uint64
));
12545 case OPCODE_PROGRAM_UNIFORM_4UI64
: {
12546 union uint64_pair x
;
12547 union uint64_pair y
;
12548 union uint64_pair z
;
12549 union uint64_pair w
;
12551 x
.uint32
[0] = n
[3].ui
;
12552 x
.uint32
[1] = n
[4].ui
;
12553 y
.uint32
[0] = n
[5].ui
;
12554 y
.uint32
[1] = n
[6].ui
;
12555 z
.uint32
[0] = n
[7].ui
;
12556 z
.uint32
[1] = n
[8].ui
;
12557 w
.uint32
[0] = n
[9].ui
;
12558 w
.uint32
[1] = n
[10].ui
;
12560 CALL_ProgramUniform4ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12561 y
.uint64
, z
.uint64
, w
.uint64
));
12564 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
12565 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12566 get_pointer(&n
[4])));
12568 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
12569 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12570 get_pointer(&n
[4])));
12572 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
12573 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12574 get_pointer(&n
[4])));
12576 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
12577 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12578 get_pointer(&n
[4])));
12581 case OPCODE_USE_PROGRAM_STAGES
:
12582 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12584 case OPCODE_PROGRAM_UNIFORM_1F
:
12585 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
12587 case OPCODE_PROGRAM_UNIFORM_2F
:
12588 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
12590 case OPCODE_PROGRAM_UNIFORM_3F
:
12591 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12592 n
[3].f
, n
[4].f
, n
[5].f
));
12594 case OPCODE_PROGRAM_UNIFORM_4F
:
12595 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12596 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12598 case OPCODE_PROGRAM_UNIFORM_1FV
:
12599 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12600 get_pointer(&n
[4])));
12602 case OPCODE_PROGRAM_UNIFORM_2FV
:
12603 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12604 get_pointer(&n
[4])));
12606 case OPCODE_PROGRAM_UNIFORM_3FV
:
12607 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12608 get_pointer(&n
[4])));
12610 case OPCODE_PROGRAM_UNIFORM_4FV
:
12611 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12612 get_pointer(&n
[4])));
12614 case OPCODE_PROGRAM_UNIFORM_1D
: {
12615 union float64_pair x
;
12617 x
.uint32
[0] = n
[3].ui
;
12618 x
.uint32
[1] = n
[4].ui
;
12620 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
12623 case OPCODE_PROGRAM_UNIFORM_2D
: {
12624 union float64_pair x
;
12625 union float64_pair y
;
12627 x
.uint32
[0] = n
[3].ui
;
12628 x
.uint32
[1] = n
[4].ui
;
12629 y
.uint32
[0] = n
[5].ui
;
12630 y
.uint32
[1] = n
[6].ui
;
12632 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
12635 case OPCODE_PROGRAM_UNIFORM_3D
: {
12636 union float64_pair x
;
12637 union float64_pair y
;
12638 union float64_pair z
;
12640 x
.uint32
[0] = n
[3].ui
;
12641 x
.uint32
[1] = n
[4].ui
;
12642 y
.uint32
[0] = n
[5].ui
;
12643 y
.uint32
[1] = n
[6].ui
;
12644 z
.uint32
[0] = n
[7].ui
;
12645 z
.uint32
[1] = n
[8].ui
;
12647 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12651 case OPCODE_PROGRAM_UNIFORM_4D
: {
12652 union float64_pair x
;
12653 union float64_pair y
;
12654 union float64_pair z
;
12655 union float64_pair w
;
12657 x
.uint32
[0] = n
[3].ui
;
12658 x
.uint32
[1] = n
[4].ui
;
12659 y
.uint32
[0] = n
[5].ui
;
12660 y
.uint32
[1] = n
[6].ui
;
12661 z
.uint32
[0] = n
[7].ui
;
12662 z
.uint32
[1] = n
[8].ui
;
12663 w
.uint32
[0] = n
[9].ui
;
12664 w
.uint32
[1] = n
[10].ui
;
12666 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12667 x
.d
, y
.d
, z
.d
, w
.d
));
12670 case OPCODE_PROGRAM_UNIFORM_1DV
:
12671 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12672 get_pointer(&n
[4])));
12674 case OPCODE_PROGRAM_UNIFORM_2DV
:
12675 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12676 get_pointer(&n
[4])));
12678 case OPCODE_PROGRAM_UNIFORM_3DV
:
12679 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12680 get_pointer(&n
[4])));
12682 case OPCODE_PROGRAM_UNIFORM_4DV
:
12683 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12684 get_pointer(&n
[4])));
12686 case OPCODE_PROGRAM_UNIFORM_1I
:
12687 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
12689 case OPCODE_PROGRAM_UNIFORM_2I
:
12690 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
12692 case OPCODE_PROGRAM_UNIFORM_3I
:
12693 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12694 n
[3].i
, n
[4].i
, n
[5].i
));
12696 case OPCODE_PROGRAM_UNIFORM_4I
:
12697 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12698 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
12700 case OPCODE_PROGRAM_UNIFORM_1IV
:
12701 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12702 get_pointer(&n
[4])));
12704 case OPCODE_PROGRAM_UNIFORM_2IV
:
12705 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12706 get_pointer(&n
[4])));
12708 case OPCODE_PROGRAM_UNIFORM_3IV
:
12709 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12710 get_pointer(&n
[4])));
12712 case OPCODE_PROGRAM_UNIFORM_4IV
:
12713 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12714 get_pointer(&n
[4])));
12716 case OPCODE_PROGRAM_UNIFORM_1UI
:
12717 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
12719 case OPCODE_PROGRAM_UNIFORM_2UI
:
12720 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12721 n
[3].ui
, n
[4].ui
));
12723 case OPCODE_PROGRAM_UNIFORM_3UI
:
12724 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12725 n
[3].ui
, n
[4].ui
, n
[5].ui
));
12727 case OPCODE_PROGRAM_UNIFORM_4UI
:
12728 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12730 n
[4].ui
, n
[5].ui
, n
[6].ui
));
12732 case OPCODE_PROGRAM_UNIFORM_1UIV
:
12733 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12734 get_pointer(&n
[4])));
12736 case OPCODE_PROGRAM_UNIFORM_2UIV
:
12737 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12738 get_pointer(&n
[4])));
12740 case OPCODE_PROGRAM_UNIFORM_3UIV
:
12741 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12742 get_pointer(&n
[4])));
12744 case OPCODE_PROGRAM_UNIFORM_4UIV
:
12745 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12746 get_pointer(&n
[4])));
12748 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
12749 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
12750 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12751 get_pointer(&n
[5])));
12753 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
12754 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
12755 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12756 get_pointer(&n
[5])));
12758 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
12759 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
12760 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12761 get_pointer(&n
[5])));
12763 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
12764 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
12765 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12766 get_pointer(&n
[5])));
12768 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
12769 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
12770 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12771 get_pointer(&n
[5])));
12773 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
12774 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
12775 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12776 get_pointer(&n
[5])));
12778 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
12779 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
12780 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12781 get_pointer(&n
[5])));
12783 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
12784 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
12785 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12786 get_pointer(&n
[5])));
12788 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
12789 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
12790 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12791 get_pointer(&n
[5])));
12793 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
12794 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
12795 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12796 get_pointer(&n
[5])));
12798 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
12799 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
12800 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12801 get_pointer(&n
[5])));
12803 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
12804 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
12805 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12806 get_pointer(&n
[5])));
12808 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
12809 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
12810 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12811 get_pointer(&n
[5])));
12813 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
12814 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
12815 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12816 get_pointer(&n
[5])));
12818 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
12819 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
12820 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12821 get_pointer(&n
[5])));
12823 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
12824 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
12825 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12826 get_pointer(&n
[5])));
12828 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
12829 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
12830 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12831 get_pointer(&n
[5])));
12833 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
12834 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
12835 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12836 get_pointer(&n
[5])));
12839 case OPCODE_CLIP_CONTROL
:
12840 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12843 case OPCODE_CLAMP_COLOR
:
12844 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12847 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
12848 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
12850 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
12851 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
12853 case OPCODE_ATTR_1F_NV
:
12854 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12856 case OPCODE_ATTR_2F_NV
:
12857 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12859 case OPCODE_ATTR_3F_NV
:
12860 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12862 case OPCODE_ATTR_4F_NV
:
12863 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12865 case OPCODE_ATTR_1F_ARB
:
12866 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12868 case OPCODE_ATTR_2F_ARB
:
12869 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12871 case OPCODE_ATTR_3F_ARB
:
12872 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12874 case OPCODE_ATTR_4F_ARB
:
12875 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12877 case OPCODE_ATTR_1I
:
12878 CALL_VertexAttribI1iEXT(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12880 case OPCODE_ATTR_2I
:
12881 CALL_VertexAttribI2ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12883 case OPCODE_ATTR_3I
:
12884 CALL_VertexAttribI3ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12886 case OPCODE_ATTR_4I
:
12887 CALL_VertexAttribI4ivEXT(ctx
->Exec
, (n
[1].e
, &n
[2].i
));
12889 case OPCODE_ATTR_1D
: {
12890 GLdouble
*d
= (GLdouble
*) &n
[2];
12891 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
12894 case OPCODE_ATTR_2D
: {
12895 GLdouble
*d
= (GLdouble
*) &n
[2];
12896 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
12899 case OPCODE_ATTR_3D
: {
12900 GLdouble
*d
= (GLdouble
*) &n
[2];
12901 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
12904 case OPCODE_ATTR_4D
: {
12905 GLdouble
*d
= (GLdouble
*) &n
[2];
12906 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
12909 case OPCODE_ATTR_1UI64
: {
12910 uint64_t *ui64
= (uint64_t *) &n
[2];
12911 CALL_VertexAttribL1ui64ARB(ctx
->Exec
, (n
[1].ui
, *ui64
));
12914 case OPCODE_MATERIAL
:
12915 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
12918 CALL_Begin(ctx
->Exec
, (n
[1].e
));
12921 CALL_End(ctx
->Exec
, ());
12924 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12926 case OPCODE_EVAL_C1
:
12927 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
12929 case OPCODE_EVAL_C2
:
12930 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12932 case OPCODE_EVAL_P1
:
12933 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
12935 case OPCODE_EVAL_P2
:
12936 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12939 /* GL_EXT_texture_integer */
12940 case OPCODE_CLEARCOLOR_I
:
12941 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12943 case OPCODE_CLEARCOLOR_UI
:
12944 CALL_ClearColorIuiEXT(ctx
->Exec
,
12945 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
12947 case OPCODE_TEXPARAMETER_I
:
12950 params
[0] = n
[3].i
;
12951 params
[1] = n
[4].i
;
12952 params
[2] = n
[5].i
;
12953 params
[3] = n
[6].i
;
12954 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12957 case OPCODE_TEXPARAMETER_UI
:
12960 params
[0] = n
[3].ui
;
12961 params
[1] = n
[4].ui
;
12962 params
[2] = n
[5].ui
;
12963 params
[3] = n
[6].ui
;
12964 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12968 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
12969 /* GL_ARB_instanced_arrays */
12970 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12973 case OPCODE_TEXTURE_BARRIER_NV
:
12974 CALL_TextureBarrierNV(ctx
->Exec
, ());
12977 /* GL_EXT/ARB_transform_feedback */
12978 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
12979 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
12981 case OPCODE_END_TRANSFORM_FEEDBACK
:
12982 CALL_EndTransformFeedback(ctx
->Exec
, ());
12984 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
12985 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12987 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
12988 CALL_PauseTransformFeedback(ctx
->Exec
, ());
12990 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
12991 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
12993 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
12994 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12996 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
12997 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
12998 (n
[1].e
, n
[2].ui
, n
[3].ui
));
13000 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
13001 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
13002 (n
[1].e
, n
[2].ui
, n
[3].si
));
13004 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
13005 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
13006 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
13010 case OPCODE_BIND_SAMPLER
:
13011 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13013 case OPCODE_SAMPLER_PARAMETERIV
:
13016 params
[0] = n
[3].i
;
13017 params
[1] = n
[4].i
;
13018 params
[2] = n
[5].i
;
13019 params
[3] = n
[6].i
;
13020 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13023 case OPCODE_SAMPLER_PARAMETERFV
:
13026 params
[0] = n
[3].f
;
13027 params
[1] = n
[4].f
;
13028 params
[2] = n
[5].f
;
13029 params
[3] = n
[6].f
;
13030 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13033 case OPCODE_SAMPLER_PARAMETERIIV
:
13036 params
[0] = n
[3].i
;
13037 params
[1] = n
[4].i
;
13038 params
[2] = n
[5].i
;
13039 params
[3] = n
[6].i
;
13040 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13043 case OPCODE_SAMPLER_PARAMETERUIV
:
13046 params
[0] = n
[3].ui
;
13047 params
[1] = n
[4].ui
;
13048 params
[2] = n
[5].ui
;
13049 params
[3] = n
[6].ui
;
13050 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13054 /* ARB_compute_shader */
13055 case OPCODE_DISPATCH_COMPUTE
:
13056 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13060 case OPCODE_WAIT_SYNC
:
13062 union uint64_pair p
;
13063 p
.uint32
[0] = n
[2].ui
;
13064 p
.uint32
[1] = n
[3].ui
;
13065 CALL_WaitSync(ctx
->Exec
,
13066 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
13070 /* GL_NV_conditional_render */
13071 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
13072 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
13074 case OPCODE_END_CONDITIONAL_RENDER
:
13075 CALL_EndConditionalRender(ctx
->Exec
, ());
13078 case OPCODE_UNIFORM_BLOCK_BINDING
:
13079 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13082 case OPCODE_UNIFORM_SUBROUTINES
:
13083 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
13084 get_pointer(&n
[3])));
13087 /* GL_EXT_window_rectangles */
13088 case OPCODE_WINDOW_RECTANGLES
:
13089 CALL_WindowRectanglesEXT(
13090 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
13093 /* GL_NV_conservative_raster */
13094 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
13095 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13098 /* GL_NV_conservative_raster_dilate */
13099 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
13100 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
13103 /* GL_NV_conservative_raster_pre_snap_triangles */
13104 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
13105 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
13108 /* GL_EXT_direct_state_access */
13109 case OPCODE_MATRIX_LOAD
:
13110 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13112 case OPCODE_MATRIX_MULT
:
13113 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13115 case OPCODE_MATRIX_ROTATE
:
13116 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
13118 case OPCODE_MATRIX_SCALE
:
13119 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13121 case OPCODE_MATRIX_TRANSLATE
:
13122 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13124 case OPCODE_MATRIX_LOAD_IDENTITY
:
13125 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
13127 case OPCODE_MATRIX_ORTHO
:
13128 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
13129 n
[2].f
, n
[3].f
, n
[4].f
,
13130 n
[5].f
, n
[6].f
, n
[7].f
));
13132 case OPCODE_MATRIX_FRUSTUM
:
13133 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
13134 n
[2].f
, n
[3].f
, n
[4].f
,
13135 n
[5].f
, n
[6].f
, n
[7].f
));
13137 case OPCODE_MATRIX_PUSH
:
13138 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
13140 case OPCODE_MATRIX_POP
:
13141 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
13143 case OPCODE_TEXTUREPARAMETER_F
:
13146 params
[0] = n
[4].f
;
13147 params
[1] = n
[5].f
;
13148 params
[2] = n
[6].f
;
13149 params
[3] = n
[7].f
;
13150 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13153 case OPCODE_TEXTUREPARAMETER_I
:
13156 params
[0] = n
[4].i
;
13157 params
[1] = n
[5].i
;
13158 params
[2] = n
[6].i
;
13159 params
[3] = n
[7].i
;
13160 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13163 case OPCODE_TEXTUREPARAMETER_II
:
13166 params
[0] = n
[4].i
;
13167 params
[1] = n
[5].i
;
13168 params
[2] = n
[6].i
;
13169 params
[3] = n
[7].i
;
13170 CALL_TextureParameterIivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13173 case OPCODE_TEXTUREPARAMETER_IUI
:
13176 params
[0] = n
[4].ui
;
13177 params
[1] = n
[5].ui
;
13178 params
[2] = n
[6].ui
;
13179 params
[3] = n
[7].ui
;
13180 CALL_TextureParameterIuivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13183 case OPCODE_TEXTURE_IMAGE1D
:
13185 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13186 ctx
->Unpack
= ctx
->DefaultPacking
;
13187 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13188 n
[2].e
, /* target */
13189 n
[3].i
, /* level */
13190 n
[4].i
, /* components */
13191 n
[5].i
, /* width */
13192 n
[6].e
, /* border */
13193 n
[7].e
, /* format */
13195 get_pointer(&n
[9])));
13196 ctx
->Unpack
= save
; /* restore */
13199 case OPCODE_TEXTURE_IMAGE2D
:
13201 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13202 ctx
->Unpack
= ctx
->DefaultPacking
;
13203 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13204 n
[2].e
, /* target */
13205 n
[3].i
, /* level */
13206 n
[4].i
, /* components */
13207 n
[5].i
, /* width */
13208 n
[6].i
, /* height */
13209 n
[7].e
, /* border */
13210 n
[8].e
, /* format */
13212 get_pointer(&n
[10])));
13213 ctx
->Unpack
= save
; /* restore */
13216 case OPCODE_TEXTURE_IMAGE3D
:
13218 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13219 ctx
->Unpack
= ctx
->DefaultPacking
;
13220 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13221 n
[2].e
, /* target */
13222 n
[3].i
, /* level */
13223 n
[4].i
, /* components */
13224 n
[5].i
, /* width */
13225 n
[6].i
, /* height */
13226 n
[7].i
, /* depth */
13227 n
[8].e
, /* border */
13228 n
[9].e
, /* format */
13229 n
[10].e
, /* type */
13230 get_pointer(&n
[11])));
13231 ctx
->Unpack
= save
; /* restore */
13234 case OPCODE_TEXTURE_SUB_IMAGE1D
:
13236 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13237 ctx
->Unpack
= ctx
->DefaultPacking
;
13238 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13239 n
[4].i
, n
[5].i
, n
[6].e
,
13240 n
[7].e
, get_pointer(&n
[8])));
13241 ctx
->Unpack
= save
; /* restore */
13244 case OPCODE_TEXTURE_SUB_IMAGE2D
:
13246 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13247 ctx
->Unpack
= ctx
->DefaultPacking
;
13248 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13249 n
[4].i
, n
[5].i
, n
[6].e
,
13250 n
[7].i
, n
[8].e
, n
[9].e
,
13251 get_pointer(&n
[10])));
13252 ctx
->Unpack
= save
;
13255 case OPCODE_TEXTURE_SUB_IMAGE3D
:
13257 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13258 ctx
->Unpack
= ctx
->DefaultPacking
;
13259 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13260 n
[4].i
, n
[5].i
, n
[6].i
,
13261 n
[7].i
, n
[8].i
, n
[9].i
,
13263 get_pointer(&n
[12])));
13264 ctx
->Unpack
= save
; /* restore */
13267 case OPCODE_COPY_TEXTURE_IMAGE1D
:
13268 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13269 n
[4].e
, n
[5].i
, n
[6].i
,
13272 case OPCODE_COPY_TEXTURE_IMAGE2D
:
13273 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13274 n
[4].e
, n
[5].i
, n
[6].i
,
13275 n
[7].i
, n
[8].i
, n
[9].i
));
13277 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
13278 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13279 n
[4].i
, n
[5].i
, n
[6].i
,
13282 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
13283 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13284 n
[4].i
, n
[5].i
, n
[6].i
,
13285 n
[7].i
, n
[8].i
, n
[9].i
));
13287 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
13288 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13289 n
[4].i
, n
[5].i
, n
[6].i
,
13290 n
[7].i
, n
[8].i
, n
[9].i
,
13293 case OPCODE_BIND_MULTITEXTURE
:
13294 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
13296 case OPCODE_MULTITEXPARAMETER_F
:
13299 params
[0] = n
[4].f
;
13300 params
[1] = n
[5].f
;
13301 params
[2] = n
[6].f
;
13302 params
[3] = n
[7].f
;
13303 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13306 case OPCODE_MULTITEXPARAMETER_I
:
13309 params
[0] = n
[4].i
;
13310 params
[1] = n
[5].i
;
13311 params
[2] = n
[6].i
;
13312 params
[3] = n
[7].i
;
13313 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13316 case OPCODE_MULTITEXPARAMETER_II
:
13319 params
[0] = n
[4].i
;
13320 params
[1] = n
[5].i
;
13321 params
[2] = n
[6].i
;
13322 params
[3] = n
[7].i
;
13323 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13326 case OPCODE_MULTITEXPARAMETER_IUI
:
13329 params
[0] = n
[4].ui
;
13330 params
[1] = n
[5].ui
;
13331 params
[2] = n
[6].ui
;
13332 params
[3] = n
[7].ui
;
13333 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13336 case OPCODE_MULTITEX_IMAGE1D
:
13338 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13339 ctx
->Unpack
= ctx
->DefaultPacking
;
13340 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13341 n
[2].e
, /* target */
13342 n
[3].i
, /* level */
13343 n
[4].i
, /* components */
13344 n
[5].i
, /* width */
13345 n
[6].e
, /* border */
13346 n
[7].e
, /* format */
13348 get_pointer(&n
[9])));
13349 ctx
->Unpack
= save
; /* restore */
13352 case OPCODE_MULTITEX_IMAGE2D
:
13354 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13355 ctx
->Unpack
= ctx
->DefaultPacking
;
13356 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13357 n
[2].e
, /* target */
13358 n
[3].i
, /* level */
13359 n
[4].i
, /* components */
13360 n
[5].i
, /* width */
13361 n
[6].i
, /* height */
13362 n
[7].e
, /* border */
13363 n
[8].e
, /* format */
13365 get_pointer(&n
[10])));
13366 ctx
->Unpack
= save
; /* restore */
13369 case OPCODE_MULTITEX_IMAGE3D
:
13371 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13372 ctx
->Unpack
= ctx
->DefaultPacking
;
13373 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13374 n
[2].e
, /* target */
13375 n
[3].i
, /* level */
13376 n
[4].i
, /* components */
13377 n
[5].i
, /* width */
13378 n
[6].i
, /* height */
13379 n
[7].i
, /* depth */
13380 n
[8].e
, /* border */
13381 n
[9].e
, /* format */
13382 n
[10].e
, /* type */
13383 get_pointer(&n
[11])));
13384 ctx
->Unpack
= save
; /* restore */
13387 case OPCODE_MULTITEX_SUB_IMAGE1D
:
13389 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13390 ctx
->Unpack
= ctx
->DefaultPacking
;
13391 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13392 n
[4].i
, n
[5].i
, n
[6].e
,
13393 n
[7].e
, get_pointer(&n
[8])));
13394 ctx
->Unpack
= save
; /* restore */
13397 case OPCODE_MULTITEX_SUB_IMAGE2D
:
13399 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13400 ctx
->Unpack
= ctx
->DefaultPacking
;
13401 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13402 n
[4].i
, n
[5].i
, n
[6].e
,
13403 n
[7].i
, n
[8].e
, n
[9].e
,
13404 get_pointer(&n
[10])));
13405 ctx
->Unpack
= save
; /* restore */
13408 case OPCODE_MULTITEX_SUB_IMAGE3D
:
13410 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13411 ctx
->Unpack
= ctx
->DefaultPacking
;
13412 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13413 n
[4].i
, n
[5].i
, n
[6].i
,
13414 n
[7].i
, n
[8].i
, n
[9].i
,
13416 get_pointer(&n
[12])));
13417 ctx
->Unpack
= save
; /* restore */
13420 case OPCODE_COPY_MULTITEX_IMAGE1D
:
13421 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13422 n
[4].e
, n
[5].i
, n
[6].i
,
13425 case OPCODE_COPY_MULTITEX_IMAGE2D
:
13426 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13427 n
[4].e
, n
[5].i
, n
[6].i
,
13428 n
[7].i
, n
[8].i
, n
[9].i
));
13430 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
13431 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13432 n
[4].i
, n
[5].i
, n
[6].i
,
13435 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
13436 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13437 n
[4].i
, n
[5].i
, n
[6].i
,
13438 n
[7].i
, n
[8].i
, n
[9].i
));
13440 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
13441 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13442 n
[4].i
, n
[5].i
, n
[6].i
,
13443 n
[7].i
, n
[8].i
, n
[9].i
,
13446 case OPCODE_MULTITEXENV
:
13449 params
[0] = n
[4].f
;
13450 params
[1] = n
[5].f
;
13451 params
[2] = n
[6].f
;
13452 params
[3] = n
[7].f
;
13453 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13456 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
13457 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13458 n
[4].e
, n
[5].i
, n
[6].i
,
13459 n
[7].i
, get_pointer(&n
[8])));
13461 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
13462 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13463 n
[4].e
, n
[5].i
, n
[6].i
,
13465 get_pointer(&n
[9])));
13467 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
13468 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13469 n
[4].e
, n
[5].i
, n
[6].i
,
13470 n
[7].i
, n
[8].i
, n
[9].i
,
13471 get_pointer(&n
[10])));
13473 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
13474 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
13475 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13476 n
[5].i
, n
[6].e
, n
[7].i
,
13477 get_pointer(&n
[8])));
13479 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
13480 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
13481 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13482 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13483 n
[9].i
, get_pointer(&n
[10])));
13485 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
13486 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
13487 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13488 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13489 n
[9].i
, n
[10].e
, n
[11].i
,
13490 get_pointer(&n
[12])));
13492 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
13493 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13494 n
[4].e
, n
[5].i
, n
[6].i
,
13495 n
[7].i
, get_pointer(&n
[8])));
13497 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
13498 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13499 n
[4].e
, n
[5].i
, n
[6].i
,
13501 get_pointer(&n
[9])));
13503 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
13504 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13505 n
[4].e
, n
[5].i
, n
[6].i
,
13506 n
[7].i
, n
[8].i
, n
[9].i
,
13507 get_pointer(&n
[10])));
13509 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
13510 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
,
13511 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13512 n
[5].i
, n
[6].e
, n
[7].i
,
13513 get_pointer(&n
[8])));
13515 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
13516 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
13517 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13518 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13519 n
[9].i
, get_pointer(&n
[10])));
13521 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
13522 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
13523 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13524 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13525 n
[9].i
, n
[10].e
, n
[11].i
,
13526 get_pointer(&n
[12])));
13528 case OPCODE_NAMED_PROGRAM_STRING
:
13529 CALL_NamedProgramStringEXT(ctx
->Exec
,
13530 (n
[1].ui
, n
[2].e
, n
[3].e
, n
[4].i
,
13531 get_pointer(&n
[5])));
13533 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
:
13534 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
,
13535 (n
[1].ui
, n
[2].e
, n
[3].ui
, n
[4].f
,
13536 n
[5].f
, n
[6].f
, n
[7].f
));
13539 case OPCODE_CONTINUE
:
13540 n
= (Node
*) get_pointer(&n
[1]);
13545 case OPCODE_END_OF_LIST
:
13551 snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
13553 _mesa_problem(ctx
, "%s", msg
);
13558 /* increment n to point to next compiled command */
13559 if (opcode
!= OPCODE_CONTINUE
) {
13560 assert(InstSize
[opcode
] > 0);
13561 n
+= InstSize
[opcode
];
13566 vbo_save_EndCallList(ctx
);
13568 ctx
->ListState
.CallDepth
--;
13573 /**********************************************************************/
13575 /**********************************************************************/
13578 * Test if a display list number is valid.
13580 GLboolean GLAPIENTRY
13581 _mesa_IsList(GLuint list
)
13583 GET_CURRENT_CONTEXT(ctx
);
13584 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13585 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
13586 return islist(ctx
, list
);
13591 * Delete a sequence of consecutive display lists.
13594 _mesa_DeleteLists(GLuint list
, GLsizei range
)
13596 GET_CURRENT_CONTEXT(ctx
);
13598 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13599 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13602 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
13607 /* We may be deleting a set of bitmap lists. See if there's a
13608 * bitmap atlas to free.
13610 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
13612 _mesa_delete_bitmap_atlas(ctx
, atlas
);
13613 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
13617 for (i
= list
; i
< list
+ range
; i
++) {
13618 destroy_list(ctx
, i
);
13624 * Return a display list number, n, such that lists n through n+range-1
13628 _mesa_GenLists(GLsizei range
)
13630 GET_CURRENT_CONTEXT(ctx
);
13632 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13633 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
13636 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
13644 * Make this an atomic operation
13646 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
13648 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
13650 /* reserve the list IDs by with empty/dummy lists */
13652 for (i
= 0; i
< range
; i
++) {
13653 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
13654 make_list(base
+ i
, 1));
13658 if (USE_BITMAP_ATLAS
&&
13660 ctx
->Driver
.DrawAtlasBitmaps
) {
13661 /* "range > 16" is a rough heuristic to guess when glGenLists might be
13662 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
13663 * Create the empty atlas now.
13665 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
13667 atlas
= alloc_bitmap_atlas(ctx
, base
);
13670 /* Atlas _should_ be new/empty now, but clobbering is OK */
13671 assert(atlas
->numBitmaps
== 0);
13672 atlas
->numBitmaps
= range
;
13676 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
13683 * Begin a new display list.
13686 _mesa_NewList(GLuint name
, GLenum mode
)
13688 GET_CURRENT_CONTEXT(ctx
);
13690 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
13691 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13693 if (MESA_VERBOSE
& VERBOSE_API
)
13694 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
13695 _mesa_enum_to_string(mode
));
13698 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
13702 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
13703 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
13707 if (ctx
->ListState
.CurrentList
) {
13708 /* already compiling a display list */
13709 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
13713 ctx
->CompileFlag
= GL_TRUE
;
13714 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
13716 /* Reset accumulated list state */
13717 invalidate_saved_current_state( ctx
);
13719 /* Allocate new display list */
13720 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
13721 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
13722 ctx
->ListState
.CurrentPos
= 0;
13724 vbo_save_NewList(ctx
, name
, mode
);
13726 ctx
->CurrentServerDispatch
= ctx
->Save
;
13727 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13728 if (ctx
->MarshalExec
== NULL
) {
13729 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13735 * End definition of current display list.
13738 _mesa_EndList(void)
13740 GET_CURRENT_CONTEXT(ctx
);
13741 SAVE_FLUSH_VERTICES(ctx
);
13742 FLUSH_VERTICES(ctx
, 0);
13744 if (MESA_VERBOSE
& VERBOSE_API
)
13745 _mesa_debug(ctx
, "glEndList\n");
13747 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
13748 _mesa_error(ctx
, GL_INVALID_OPERATION
,
13749 "glEndList() called inside glBegin/End");
13752 /* Check that a list is under construction */
13753 if (!ctx
->ListState
.CurrentList
) {
13754 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
13758 /* Call before emitting END_OF_LIST, in case the driver wants to
13759 * emit opcodes itself.
13761 vbo_save_EndList(ctx
);
13763 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
13767 /* Destroy old list, if any */
13768 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
13770 /* Install the new list */
13771 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
13772 ctx
->ListState
.CurrentList
->Name
,
13773 ctx
->ListState
.CurrentList
);
13776 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
13777 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
13779 ctx
->ListState
.CurrentList
= NULL
;
13780 ctx
->ListState
.CurrentBlock
= NULL
;
13781 ctx
->ListState
.CurrentPos
= 0;
13782 ctx
->ExecuteFlag
= GL_TRUE
;
13783 ctx
->CompileFlag
= GL_FALSE
;
13785 ctx
->CurrentServerDispatch
= ctx
->Exec
;
13786 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13787 if (ctx
->MarshalExec
== NULL
) {
13788 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13794 _mesa_CallList(GLuint list
)
13796 GLboolean save_compile_flag
;
13797 GET_CURRENT_CONTEXT(ctx
);
13798 FLUSH_CURRENT(ctx
, 0);
13800 if (MESA_VERBOSE
& VERBOSE_API
)
13801 _mesa_debug(ctx
, "glCallList %d\n", list
);
13804 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
13809 mesa_print_display_list( list
);
13811 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
13812 * execute the display list, and restore the CompileFlag.
13814 save_compile_flag
= ctx
->CompileFlag
;
13815 if (save_compile_flag
) {
13816 ctx
->CompileFlag
= GL_FALSE
;
13819 execute_list(ctx
, list
);
13820 ctx
->CompileFlag
= save_compile_flag
;
13822 /* also restore API function pointers to point to "save" versions */
13823 if (save_compile_flag
) {
13824 ctx
->CurrentServerDispatch
= ctx
->Save
;
13825 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13826 if (ctx
->MarshalExec
== NULL
) {
13827 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13834 * Try to execute a glCallLists() command where the display lists contain
13835 * glBitmap commands with a texture atlas.
13836 * \return true for success, false otherwise
13839 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
13842 struct gl_bitmap_atlas
*atlas
;
13845 if (!USE_BITMAP_ATLAS
||
13846 !ctx
->Current
.RasterPosValid
||
13847 ctx
->List
.ListBase
== 0 ||
13848 type
!= GL_UNSIGNED_BYTE
||
13849 !ctx
->Driver
.DrawAtlasBitmaps
) {
13854 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13857 /* Even if glGenLists wasn't called, we can still try to create
13860 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13863 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
13864 /* Try to build the bitmap atlas now.
13865 * If the atlas was created in glGenLists, we'll have recorded the
13866 * number of lists (bitmaps). Otherwise, take a guess at 256.
13868 if (atlas
->numBitmaps
== 0)
13869 atlas
->numBitmaps
= 256;
13870 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
13873 if (!atlas
|| !atlas
->complete
) {
13877 /* check that all display list IDs are in the atlas */
13878 for (i
= 0; i
< n
; i
++) {
13879 const GLubyte
*ids
= (const GLubyte
*) lists
;
13881 if (ids
[i
] >= atlas
->numBitmaps
) {
13886 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
13893 * Execute glCallLists: call multiple display lists.
13896 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
13898 GET_CURRENT_CONTEXT(ctx
);
13900 GLboolean save_compile_flag
;
13902 if (MESA_VERBOSE
& VERBOSE_API
)
13903 _mesa_debug(ctx
, "glCallLists %d\n", n
);
13907 case GL_UNSIGNED_BYTE
:
13909 case GL_UNSIGNED_SHORT
:
13911 case GL_UNSIGNED_INT
:
13919 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
13924 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
13926 } else if (n
== 0 || lists
== NULL
) {
13927 /* nothing to do */
13931 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
13935 /* Save the CompileFlag status, turn it off, execute display list,
13936 * and restore the CompileFlag.
13938 save_compile_flag
= ctx
->CompileFlag
;
13939 ctx
->CompileFlag
= GL_FALSE
;
13941 for (i
= 0; i
< n
; i
++) {
13942 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
13943 execute_list(ctx
, list
);
13946 ctx
->CompileFlag
= save_compile_flag
;
13948 /* also restore API function pointers to point to "save" versions */
13949 if (save_compile_flag
) {
13950 ctx
->CurrentServerDispatch
= ctx
->Save
;
13951 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13952 if (ctx
->MarshalExec
== NULL
) {
13953 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13960 * Set the offset added to list numbers in glCallLists.
13963 _mesa_ListBase(GLuint base
)
13965 GET_CURRENT_CONTEXT(ctx
);
13966 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13967 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13968 ctx
->List
.ListBase
= base
;
13972 * Setup the given dispatch table to point to Mesa's display list
13973 * building functions.
13975 * This does not include any of the tnl functions - they are
13976 * initialized from _mesa_init_api_defaults and from the active vtxfmt
13980 _mesa_initialize_save_table(const struct gl_context
*ctx
)
13982 struct _glapi_table
*table
= ctx
->Save
;
13983 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
13985 /* Initially populate the dispatch table with the contents of the
13986 * normal-execution dispatch table. This lets us skip populating functions
13987 * that should be called directly instead of compiled into display lists.
13989 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
13991 _mesa_loopback_init_api_table(ctx
, table
);
13993 /* VBO functions */
13994 vbo_initialize_save_dispatch(ctx
, table
);
13997 SET_Accum(table
, save_Accum
);
13998 SET_AlphaFunc(table
, save_AlphaFunc
);
13999 SET_Bitmap(table
, save_Bitmap
);
14000 SET_BlendFunc(table
, save_BlendFunc
);
14001 SET_CallList(table
, save_CallList
);
14002 SET_CallLists(table
, save_CallLists
);
14003 SET_Clear(table
, save_Clear
);
14004 SET_ClearAccum(table
, save_ClearAccum
);
14005 SET_ClearColor(table
, save_ClearColor
);
14006 SET_ClearDepth(table
, save_ClearDepth
);
14007 SET_ClearIndex(table
, save_ClearIndex
);
14008 SET_ClearStencil(table
, save_ClearStencil
);
14009 SET_ClipPlane(table
, save_ClipPlane
);
14010 SET_ColorMask(table
, save_ColorMask
);
14011 SET_ColorMaski(table
, save_ColorMaskIndexed
);
14012 SET_ColorMaterial(table
, save_ColorMaterial
);
14013 SET_CopyPixels(table
, save_CopyPixels
);
14014 SET_CullFace(table
, save_CullFace
);
14015 SET_DepthFunc(table
, save_DepthFunc
);
14016 SET_DepthMask(table
, save_DepthMask
);
14017 SET_DepthRange(table
, save_DepthRange
);
14018 SET_Disable(table
, save_Disable
);
14019 SET_Disablei(table
, save_DisableIndexed
);
14020 SET_DrawBuffer(table
, save_DrawBuffer
);
14021 SET_DrawPixels(table
, save_DrawPixels
);
14022 SET_Enable(table
, save_Enable
);
14023 SET_Enablei(table
, save_EnableIndexed
);
14024 SET_EvalMesh1(table
, save_EvalMesh1
);
14025 SET_EvalMesh2(table
, save_EvalMesh2
);
14026 SET_Fogf(table
, save_Fogf
);
14027 SET_Fogfv(table
, save_Fogfv
);
14028 SET_Fogi(table
, save_Fogi
);
14029 SET_Fogiv(table
, save_Fogiv
);
14030 SET_FrontFace(table
, save_FrontFace
);
14031 SET_Frustum(table
, save_Frustum
);
14032 SET_Hint(table
, save_Hint
);
14033 SET_IndexMask(table
, save_IndexMask
);
14034 SET_InitNames(table
, save_InitNames
);
14035 SET_LightModelf(table
, save_LightModelf
);
14036 SET_LightModelfv(table
, save_LightModelfv
);
14037 SET_LightModeli(table
, save_LightModeli
);
14038 SET_LightModeliv(table
, save_LightModeliv
);
14039 SET_Lightf(table
, save_Lightf
);
14040 SET_Lightfv(table
, save_Lightfv
);
14041 SET_Lighti(table
, save_Lighti
);
14042 SET_Lightiv(table
, save_Lightiv
);
14043 SET_LineStipple(table
, save_LineStipple
);
14044 SET_LineWidth(table
, save_LineWidth
);
14045 SET_ListBase(table
, save_ListBase
);
14046 SET_LoadIdentity(table
, save_LoadIdentity
);
14047 SET_LoadMatrixd(table
, save_LoadMatrixd
);
14048 SET_LoadMatrixf(table
, save_LoadMatrixf
);
14049 SET_LoadName(table
, save_LoadName
);
14050 SET_LogicOp(table
, save_LogicOp
);
14051 SET_Map1d(table
, save_Map1d
);
14052 SET_Map1f(table
, save_Map1f
);
14053 SET_Map2d(table
, save_Map2d
);
14054 SET_Map2f(table
, save_Map2f
);
14055 SET_MapGrid1d(table
, save_MapGrid1d
);
14056 SET_MapGrid1f(table
, save_MapGrid1f
);
14057 SET_MapGrid2d(table
, save_MapGrid2d
);
14058 SET_MapGrid2f(table
, save_MapGrid2f
);
14059 SET_MatrixMode(table
, save_MatrixMode
);
14060 SET_MultMatrixd(table
, save_MultMatrixd
);
14061 SET_MultMatrixf(table
, save_MultMatrixf
);
14062 SET_NewList(table
, save_NewList
);
14063 SET_Ortho(table
, save_Ortho
);
14064 SET_PassThrough(table
, save_PassThrough
);
14065 SET_PixelMapfv(table
, save_PixelMapfv
);
14066 SET_PixelMapuiv(table
, save_PixelMapuiv
);
14067 SET_PixelMapusv(table
, save_PixelMapusv
);
14068 SET_PixelTransferf(table
, save_PixelTransferf
);
14069 SET_PixelTransferi(table
, save_PixelTransferi
);
14070 SET_PixelZoom(table
, save_PixelZoom
);
14071 SET_PointSize(table
, save_PointSize
);
14072 SET_PolygonMode(table
, save_PolygonMode
);
14073 SET_PolygonOffset(table
, save_PolygonOffset
);
14074 SET_PolygonStipple(table
, save_PolygonStipple
);
14075 SET_PopAttrib(table
, save_PopAttrib
);
14076 SET_PopMatrix(table
, save_PopMatrix
);
14077 SET_PopName(table
, save_PopName
);
14078 SET_PushAttrib(table
, save_PushAttrib
);
14079 SET_PushMatrix(table
, save_PushMatrix
);
14080 SET_PushName(table
, save_PushName
);
14081 SET_RasterPos2d(table
, save_RasterPos2d
);
14082 SET_RasterPos2dv(table
, save_RasterPos2dv
);
14083 SET_RasterPos2f(table
, save_RasterPos2f
);
14084 SET_RasterPos2fv(table
, save_RasterPos2fv
);
14085 SET_RasterPos2i(table
, save_RasterPos2i
);
14086 SET_RasterPos2iv(table
, save_RasterPos2iv
);
14087 SET_RasterPos2s(table
, save_RasterPos2s
);
14088 SET_RasterPos2sv(table
, save_RasterPos2sv
);
14089 SET_RasterPos3d(table
, save_RasterPos3d
);
14090 SET_RasterPos3dv(table
, save_RasterPos3dv
);
14091 SET_RasterPos3f(table
, save_RasterPos3f
);
14092 SET_RasterPos3fv(table
, save_RasterPos3fv
);
14093 SET_RasterPos3i(table
, save_RasterPos3i
);
14094 SET_RasterPos3iv(table
, save_RasterPos3iv
);
14095 SET_RasterPos3s(table
, save_RasterPos3s
);
14096 SET_RasterPos3sv(table
, save_RasterPos3sv
);
14097 SET_RasterPos4d(table
, save_RasterPos4d
);
14098 SET_RasterPos4dv(table
, save_RasterPos4dv
);
14099 SET_RasterPos4f(table
, save_RasterPos4f
);
14100 SET_RasterPos4fv(table
, save_RasterPos4fv
);
14101 SET_RasterPos4i(table
, save_RasterPos4i
);
14102 SET_RasterPos4iv(table
, save_RasterPos4iv
);
14103 SET_RasterPos4s(table
, save_RasterPos4s
);
14104 SET_RasterPos4sv(table
, save_RasterPos4sv
);
14105 SET_ReadBuffer(table
, save_ReadBuffer
);
14106 SET_Rectf(table
, save_Rectf
);
14107 SET_Rotated(table
, save_Rotated
);
14108 SET_Rotatef(table
, save_Rotatef
);
14109 SET_Scaled(table
, save_Scaled
);
14110 SET_Scalef(table
, save_Scalef
);
14111 SET_Scissor(table
, save_Scissor
);
14112 SET_ShadeModel(table
, save_ShadeModel
);
14113 SET_StencilFunc(table
, save_StencilFunc
);
14114 SET_StencilMask(table
, save_StencilMask
);
14115 SET_StencilOp(table
, save_StencilOp
);
14116 SET_TexEnvf(table
, save_TexEnvf
);
14117 SET_TexEnvfv(table
, save_TexEnvfv
);
14118 SET_TexEnvi(table
, save_TexEnvi
);
14119 SET_TexEnviv(table
, save_TexEnviv
);
14120 SET_TexGend(table
, save_TexGend
);
14121 SET_TexGendv(table
, save_TexGendv
);
14122 SET_TexGenf(table
, save_TexGenf
);
14123 SET_TexGenfv(table
, save_TexGenfv
);
14124 SET_TexGeni(table
, save_TexGeni
);
14125 SET_TexGeniv(table
, save_TexGeniv
);
14126 SET_TexImage1D(table
, save_TexImage1D
);
14127 SET_TexImage2D(table
, save_TexImage2D
);
14128 SET_TexParameterf(table
, save_TexParameterf
);
14129 SET_TexParameterfv(table
, save_TexParameterfv
);
14130 SET_TexParameteri(table
, save_TexParameteri
);
14131 SET_TexParameteriv(table
, save_TexParameteriv
);
14132 SET_Translated(table
, save_Translated
);
14133 SET_Translatef(table
, save_Translatef
);
14134 SET_Viewport(table
, save_Viewport
);
14137 SET_BindTexture(table
, save_BindTexture
);
14138 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
14139 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
14140 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
14141 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
14142 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
14143 SET_TexSubImage1D(table
, save_TexSubImage1D
);
14144 SET_TexSubImage2D(table
, save_TexSubImage2D
);
14147 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
14148 SET_TexImage3D(table
, save_TexImage3D
);
14149 SET_TexSubImage3D(table
, save_TexSubImage3D
);
14152 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
14153 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
14154 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
14156 /* ATI_separate_stencil */
14157 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
14159 /* GL_ARB_imaging */
14160 /* Not all are supported */
14161 SET_BlendColor(table
, save_BlendColor
);
14162 SET_BlendEquation(table
, save_BlendEquation
);
14164 /* 2. GL_EXT_blend_color */
14166 SET_BlendColorEXT(table
, save_BlendColorEXT
);
14169 /* 6. GL_EXT_texture3d */
14171 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
14172 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
14173 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
14176 /* 37. GL_EXT_blend_minmax */
14178 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
14181 /* 54. GL_EXT_point_parameters */
14182 SET_PointParameterf(table
, save_PointParameterfEXT
);
14183 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
14185 /* 91. GL_ARB_tessellation_shader */
14186 SET_PatchParameteri(table
, save_PatchParameteri
);
14187 SET_PatchParameterfv(table
, save_PatchParameterfv
);
14189 /* 100. ARB_viewport_array */
14190 SET_ViewportArrayv(table
, save_ViewportArrayv
);
14191 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
14192 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
14193 SET_ScissorArrayv(table
, save_ScissorArrayv
);
14194 SET_ScissorIndexed(table
, save_ScissorIndexed
);
14195 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
14196 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
14197 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
14199 /* 122. ARB_compute_shader */
14200 SET_DispatchCompute(table
, save_DispatchCompute
);
14201 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
14203 /* 173. GL_EXT_blend_func_separate */
14204 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
14206 /* 197. GL_MESA_window_pos */
14207 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
14208 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
14209 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
14210 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
14211 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
14212 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
14213 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
14214 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
14215 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
14216 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
14217 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
14218 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
14219 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
14220 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
14221 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
14222 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
14223 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
14224 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
14225 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
14226 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
14227 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
14228 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
14229 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
14230 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
14232 /* 245. GL_ATI_fragment_shader */
14233 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
14234 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
14236 /* 262. GL_NV_point_sprite */
14237 SET_PointParameteri(table
, save_PointParameteriNV
);
14238 SET_PointParameteriv(table
, save_PointParameterivNV
);
14240 /* 268. GL_EXT_stencil_two_side */
14241 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
14243 /* ???. GL_EXT_depth_bounds_test */
14244 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
14246 /* ARB 1. GL_ARB_multitexture */
14247 SET_ActiveTexture(table
, save_ActiveTextureARB
);
14249 /* ARB 3. GL_ARB_transpose_matrix */
14250 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
14251 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
14252 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
14253 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
14255 /* ARB 5. GL_ARB_multisample */
14256 SET_SampleCoverage(table
, save_SampleCoverageARB
);
14258 /* ARB 12. GL_ARB_texture_compression */
14259 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
14260 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
14261 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
14262 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
14263 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
14264 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
14266 /* ARB 14. GL_ARB_point_parameters */
14267 /* aliased with EXT_point_parameters functions */
14269 /* ARB 25. GL_ARB_window_pos */
14270 /* aliased with MESA_window_pos functions */
14272 /* ARB 26. GL_ARB_vertex_program */
14273 /* ARB 27. GL_ARB_fragment_program */
14274 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
14275 SET_ProgramStringARB(table
, save_ProgramStringARB
);
14276 SET_BindProgramARB(table
, save_BindProgramARB
);
14277 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
14278 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
14279 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
14280 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
14281 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
14282 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
14283 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
14284 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
14286 SET_BeginQuery(table
, save_BeginQueryARB
);
14287 SET_EndQuery(table
, save_EndQueryARB
);
14288 SET_QueryCounter(table
, save_QueryCounter
);
14290 SET_DrawBuffers(table
, save_DrawBuffersARB
);
14292 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
14294 SET_UseProgram(table
, save_UseProgram
);
14295 SET_Uniform1f(table
, save_Uniform1fARB
);
14296 SET_Uniform2f(table
, save_Uniform2fARB
);
14297 SET_Uniform3f(table
, save_Uniform3fARB
);
14298 SET_Uniform4f(table
, save_Uniform4fARB
);
14299 SET_Uniform1fv(table
, save_Uniform1fvARB
);
14300 SET_Uniform2fv(table
, save_Uniform2fvARB
);
14301 SET_Uniform3fv(table
, save_Uniform3fvARB
);
14302 SET_Uniform4fv(table
, save_Uniform4fvARB
);
14303 SET_Uniform1i(table
, save_Uniform1iARB
);
14304 SET_Uniform2i(table
, save_Uniform2iARB
);
14305 SET_Uniform3i(table
, save_Uniform3iARB
);
14306 SET_Uniform4i(table
, save_Uniform4iARB
);
14307 SET_Uniform1iv(table
, save_Uniform1ivARB
);
14308 SET_Uniform2iv(table
, save_Uniform2ivARB
);
14309 SET_Uniform3iv(table
, save_Uniform3ivARB
);
14310 SET_Uniform4iv(table
, save_Uniform4ivARB
);
14311 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
14312 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
14313 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
14314 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
14315 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
14316 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
14317 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
14318 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
14319 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
14321 /* 299. GL_EXT_blend_equation_separate */
14322 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
14324 /* GL_EXT_gpu_program_parameters */
14325 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
14326 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
14328 /* 364. GL_EXT_provoking_vertex */
14329 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
14331 /* GL_EXT_texture_integer */
14332 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
14333 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
14334 SET_TexParameterIiv(table
, save_TexParameterIiv
);
14335 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
14337 /* GL_ARB_clip_control */
14338 SET_ClipControl(table
, save_ClipControl
);
14340 /* GL_ARB_color_buffer_float */
14341 SET_ClampColor(table
, save_ClampColorARB
);
14344 SET_ClearBufferiv(table
, save_ClearBufferiv
);
14345 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
14346 SET_ClearBufferfv(table
, save_ClearBufferfv
);
14347 SET_ClearBufferfi(table
, save_ClearBufferfi
);
14348 SET_Uniform1ui(table
, save_Uniform1ui
);
14349 SET_Uniform2ui(table
, save_Uniform2ui
);
14350 SET_Uniform3ui(table
, save_Uniform3ui
);
14351 SET_Uniform4ui(table
, save_Uniform4ui
);
14352 SET_Uniform1uiv(table
, save_Uniform1uiv
);
14353 SET_Uniform2uiv(table
, save_Uniform2uiv
);
14354 SET_Uniform3uiv(table
, save_Uniform3uiv
);
14355 SET_Uniform4uiv(table
, save_Uniform4uiv
);
14357 /* GL_ARB_gpu_shader_fp64 */
14358 SET_Uniform1d(table
, save_Uniform1d
);
14359 SET_Uniform2d(table
, save_Uniform2d
);
14360 SET_Uniform3d(table
, save_Uniform3d
);
14361 SET_Uniform4d(table
, save_Uniform4d
);
14362 SET_Uniform1dv(table
, save_Uniform1dv
);
14363 SET_Uniform2dv(table
, save_Uniform2dv
);
14364 SET_Uniform3dv(table
, save_Uniform3dv
);
14365 SET_Uniform4dv(table
, save_Uniform4dv
);
14366 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
14367 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
14368 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
14369 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
14370 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
14371 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
14372 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
14373 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
14374 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
14376 /* GL_ARB_gpu_shader_int64 */
14377 SET_Uniform1i64ARB(table
, save_Uniform1i64ARB
);
14378 SET_Uniform2i64ARB(table
, save_Uniform2i64ARB
);
14379 SET_Uniform3i64ARB(table
, save_Uniform3i64ARB
);
14380 SET_Uniform4i64ARB(table
, save_Uniform4i64ARB
);
14381 SET_Uniform1i64vARB(table
, save_Uniform1i64vARB
);
14382 SET_Uniform2i64vARB(table
, save_Uniform2i64vARB
);
14383 SET_Uniform3i64vARB(table
, save_Uniform3i64vARB
);
14384 SET_Uniform4i64vARB(table
, save_Uniform4i64vARB
);
14385 SET_Uniform1ui64ARB(table
, save_Uniform1ui64ARB
);
14386 SET_Uniform2ui64ARB(table
, save_Uniform2ui64ARB
);
14387 SET_Uniform3ui64ARB(table
, save_Uniform3ui64ARB
);
14388 SET_Uniform4ui64ARB(table
, save_Uniform4ui64ARB
);
14389 SET_Uniform1ui64vARB(table
, save_Uniform1ui64vARB
);
14390 SET_Uniform2ui64vARB(table
, save_Uniform2ui64vARB
);
14391 SET_Uniform3ui64vARB(table
, save_Uniform3ui64vARB
);
14392 SET_Uniform4ui64vARB(table
, save_Uniform4ui64vARB
);
14394 SET_ProgramUniform1i64ARB(table
, save_ProgramUniform1i64ARB
);
14395 SET_ProgramUniform2i64ARB(table
, save_ProgramUniform2i64ARB
);
14396 SET_ProgramUniform3i64ARB(table
, save_ProgramUniform3i64ARB
);
14397 SET_ProgramUniform4i64ARB(table
, save_ProgramUniform4i64ARB
);
14398 SET_ProgramUniform1i64vARB(table
, save_ProgramUniform1i64vARB
);
14399 SET_ProgramUniform2i64vARB(table
, save_ProgramUniform2i64vARB
);
14400 SET_ProgramUniform3i64vARB(table
, save_ProgramUniform3i64vARB
);
14401 SET_ProgramUniform4i64vARB(table
, save_ProgramUniform4i64vARB
);
14402 SET_ProgramUniform1ui64ARB(table
, save_ProgramUniform1ui64ARB
);
14403 SET_ProgramUniform2ui64ARB(table
, save_ProgramUniform2ui64ARB
);
14404 SET_ProgramUniform3ui64ARB(table
, save_ProgramUniform3ui64ARB
);
14405 SET_ProgramUniform4ui64ARB(table
, save_ProgramUniform4ui64ARB
);
14406 SET_ProgramUniform1ui64vARB(table
, save_ProgramUniform1ui64vARB
);
14407 SET_ProgramUniform2ui64vARB(table
, save_ProgramUniform2ui64vARB
);
14408 SET_ProgramUniform3ui64vARB(table
, save_ProgramUniform3ui64vARB
);
14409 SET_ProgramUniform4ui64vARB(table
, save_ProgramUniform4ui64vARB
);
14412 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
14413 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
14414 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
14415 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
14416 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
14417 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
14418 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
14419 SET_DrawTransformFeedbackInstanced(table
,
14420 save_DrawTransformFeedbackInstanced
);
14421 SET_DrawTransformFeedbackStreamInstanced(table
,
14422 save_DrawTransformFeedbackStreamInstanced
);
14423 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
14424 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
14426 /* GL_ARB_instanced_arrays */
14427 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
14429 /* GL_NV_texture_barrier */
14430 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
14432 SET_BindSampler(table
, save_BindSampler
);
14433 SET_SamplerParameteri(table
, save_SamplerParameteri
);
14434 SET_SamplerParameterf(table
, save_SamplerParameterf
);
14435 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
14436 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
14437 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
14438 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
14440 /* GL_ARB_draw_buffer_blend */
14441 SET_BlendFunciARB(table
, save_BlendFunci
);
14442 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
14443 SET_BlendEquationiARB(table
, save_BlendEquationi
);
14444 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
14446 /* GL_NV_conditional_render */
14447 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
14448 SET_EndConditionalRender(table
, save_EndConditionalRender
);
14451 SET_WaitSync(table
, save_WaitSync
);
14453 /* GL_ARB_uniform_buffer_object */
14454 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
14456 /* GL_ARB_shader_subroutines */
14457 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
14459 /* GL_ARB_draw_instanced */
14460 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
14461 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
14463 /* GL_ARB_draw_elements_base_vertex */
14464 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
14466 /* GL_ARB_base_instance */
14467 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
14468 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
14469 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
14471 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
14472 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
14473 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
14474 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
14475 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
14477 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
14478 SET_UseProgramStages(table
, save_UseProgramStages
);
14479 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
14480 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
14481 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
14482 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
14483 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
14484 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
14485 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
14486 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
14487 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
14488 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
14489 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
14490 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
14491 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
14492 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
14493 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
14494 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
14495 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
14496 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
14497 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
14498 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
14499 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
14500 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
14501 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
14502 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
14503 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
14504 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
14505 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
14506 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
14507 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
14508 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
14509 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
14510 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
14511 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
14512 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
14513 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
14514 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
14515 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
14516 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
14517 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
14518 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
14519 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
14520 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
14521 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
14522 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
14523 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
14524 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
14525 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
14526 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
14527 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
14528 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
14530 /* GL_{ARB,EXT}_polygon_offset_clamp */
14531 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
14533 /* GL_EXT_window_rectangles */
14534 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
14536 /* GL_NV_conservative_raster */
14537 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
14539 /* GL_NV_conservative_raster_dilate */
14540 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
14542 /* GL_NV_conservative_raster_pre_snap_triangles */
14543 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
14545 /* GL_EXT_direct_state_access */
14546 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
14547 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
14548 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
14549 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
14550 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
14551 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
14552 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
14553 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
14554 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
14555 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
14556 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
14557 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
14558 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
14559 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
14560 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
14561 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
14562 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
14563 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
14564 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
14565 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
14566 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
14567 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
14568 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
14569 SET_TextureParameterIivEXT(table
, save_TextureParameterIivEXT
);
14570 SET_TextureParameterIuivEXT(table
, save_TextureParameterIuivEXT
);
14571 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
14572 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
14573 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
14574 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
14575 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
14576 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
14577 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
14578 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
14579 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
14580 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
14581 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
14582 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
14583 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
14584 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
14585 SET_MultiTexParameterIivEXT(table
, save_MultiTexParameterIivEXT
);
14586 SET_MultiTexParameterIuivEXT(table
, save_MultiTexParameterIuivEXT
);
14587 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
14588 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
14589 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
14590 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
14591 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
14592 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
14593 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
14594 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
14595 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
14596 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
14597 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
14598 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
14599 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
14600 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
14601 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
14602 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
14603 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
14604 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
14605 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
14606 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
14607 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
14608 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
14609 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
14610 SET_CompressedMultiTexImage1DEXT(table
, save_CompressedMultiTexImage1DEXT
);
14611 SET_CompressedMultiTexImage2DEXT(table
, save_CompressedMultiTexImage2DEXT
);
14612 SET_CompressedMultiTexImage3DEXT(table
, save_CompressedMultiTexImage3DEXT
);
14613 SET_CompressedMultiTexSubImage1DEXT(table
, save_CompressedMultiTexSubImage1DEXT
);
14614 SET_CompressedMultiTexSubImage2DEXT(table
, save_CompressedMultiTexSubImage2DEXT
);
14615 SET_CompressedMultiTexSubImage3DEXT(table
, save_CompressedMultiTexSubImage3DEXT
);
14616 SET_NamedProgramStringEXT(table
, save_NamedProgramStringEXT
);
14617 SET_NamedProgramLocalParameter4dEXT(table
, save_NamedProgramLocalParameter4dEXT
);
14618 SET_NamedProgramLocalParameter4dvEXT(table
, save_NamedProgramLocalParameter4dvEXT
);
14619 SET_NamedProgramLocalParameter4fEXT(table
, save_NamedProgramLocalParameter4fEXT
);
14620 SET_NamedProgramLocalParameter4fvEXT(table
, save_NamedProgramLocalParameter4fvEXT
);
14625 static const char *
14626 enum_string(GLenum k
)
14628 return _mesa_enum_to_string(k
);
14633 * Print the commands in a display list. For debugging only.
14634 * TODO: many commands aren't handled yet.
14635 * \param fname filename to write display list to. If null, use stdout.
14637 static void GLAPIENTRY
14638 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
14640 struct gl_display_list
*dlist
;
14646 f
= fopen(fname
, "w");
14651 if (!islist(ctx
, list
)) {
14652 fprintf(f
, "%u is not a display list ID\n", list
);
14656 dlist
= _mesa_lookup_list(ctx
, list
);
14663 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
14665 done
= n
? GL_FALSE
: GL_TRUE
;
14667 const OpCode opcode
= n
[0].opcode
;
14669 if (is_ext_opcode(opcode
)) {
14670 n
+= ext_opcode_print(ctx
, n
, f
);
14675 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
14677 case OPCODE_ACTIVE_TEXTURE
:
14678 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
14680 case OPCODE_BITMAP
:
14681 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
14682 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
14683 get_pointer(&n
[7]));
14685 case OPCODE_BLEND_COLOR
:
14686 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
14687 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14689 case OPCODE_BLEND_EQUATION
:
14690 fprintf(f
, "BlendEquation %s\n",
14691 enum_string(n
[1].e
));
14693 case OPCODE_BLEND_EQUATION_SEPARATE
:
14694 fprintf(f
, "BlendEquationSeparate %s, %s\n",
14695 enum_string(n
[1].e
),
14696 enum_string(n
[2].e
));
14698 case OPCODE_BLEND_FUNC_SEPARATE
:
14699 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
14700 enum_string(n
[1].e
),
14701 enum_string(n
[2].e
),
14702 enum_string(n
[3].e
),
14703 enum_string(n
[4].e
));
14705 case OPCODE_BLEND_EQUATION_I
:
14706 fprintf(f
, "BlendEquationi %u, %s\n",
14707 n
[1].ui
, enum_string(n
[2].e
));
14709 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
14710 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
14711 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14713 case OPCODE_BLEND_FUNC_I
:
14714 fprintf(f
, "BlendFunci %u, %s, %s\n",
14715 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14717 case OPCODE_BLEND_FUNC_SEPARATE_I
:
14718 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
14720 enum_string(n
[2].e
),
14721 enum_string(n
[3].e
),
14722 enum_string(n
[4].e
),
14723 enum_string(n
[5].e
));
14725 case OPCODE_CALL_LIST
:
14726 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
14728 case OPCODE_CALL_LISTS
:
14729 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
14731 case OPCODE_DISABLE
:
14732 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
14734 case OPCODE_ENABLE
:
14735 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
14737 case OPCODE_FRUSTUM
:
14738 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
14739 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14741 case OPCODE_LINE_STIPPLE
:
14742 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
14744 case OPCODE_LINE_WIDTH
:
14745 fprintf(f
, "LineWidth %f\n", n
[1].f
);
14747 case OPCODE_LOAD_IDENTITY
:
14748 fprintf(f
, "LoadIdentity\n");
14750 case OPCODE_LOAD_MATRIX
:
14751 fprintf(f
, "LoadMatrix\n");
14752 fprintf(f
, " %8f %8f %8f %8f\n",
14753 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14754 fprintf(f
, " %8f %8f %8f %8f\n",
14755 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14756 fprintf(f
, " %8f %8f %8f %8f\n",
14757 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14758 fprintf(f
, " %8f %8f %8f %8f\n",
14759 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14761 case OPCODE_MULT_MATRIX
:
14762 fprintf(f
, "MultMatrix (or Rotate)\n");
14763 fprintf(f
, " %8f %8f %8f %8f\n",
14764 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14765 fprintf(f
, " %8f %8f %8f %8f\n",
14766 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14767 fprintf(f
, " %8f %8f %8f %8f\n",
14768 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14769 fprintf(f
, " %8f %8f %8f %8f\n",
14770 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14773 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
14774 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14776 case OPCODE_POINT_SIZE
:
14777 fprintf(f
, "PointSize %f\n", n
[1].f
);
14779 case OPCODE_POP_ATTRIB
:
14780 fprintf(f
, "PopAttrib\n");
14782 case OPCODE_POP_MATRIX
:
14783 fprintf(f
, "PopMatrix\n");
14785 case OPCODE_POP_NAME
:
14786 fprintf(f
, "PopName\n");
14788 case OPCODE_PUSH_ATTRIB
:
14789 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
14791 case OPCODE_PUSH_MATRIX
:
14792 fprintf(f
, "PushMatrix\n");
14794 case OPCODE_PUSH_NAME
:
14795 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
14797 case OPCODE_RASTER_POS
:
14798 fprintf(f
, "RasterPos %g %g %g %g\n",
14799 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14801 case OPCODE_ROTATE
:
14802 fprintf(f
, "Rotate %g %g %g %g\n",
14803 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14806 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14808 case OPCODE_TRANSLATE
:
14809 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14811 case OPCODE_BIND_TEXTURE
:
14812 fprintf(f
, "BindTexture %s %d\n",
14813 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
14815 case OPCODE_SHADE_MODEL
:
14816 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
14819 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
14820 _mesa_enum_to_string(n
[1].ui
),
14821 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
14824 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
14825 _mesa_enum_to_string(n
[1].ui
),
14826 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
14827 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
14829 case OPCODE_MAPGRID1
:
14830 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
14832 case OPCODE_MAPGRID2
:
14833 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
14834 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
14836 case OPCODE_EVALMESH1
:
14837 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
14839 case OPCODE_EVALMESH2
:
14840 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
14841 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
14844 case OPCODE_ATTR_1F_NV
:
14845 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
14847 case OPCODE_ATTR_2F_NV
:
14848 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
14849 n
[1].i
, n
[2].f
, n
[3].f
);
14851 case OPCODE_ATTR_3F_NV
:
14852 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
14853 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14855 case OPCODE_ATTR_4F_NV
:
14856 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
14857 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14859 case OPCODE_ATTR_1F_ARB
:
14860 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
14862 case OPCODE_ATTR_2F_ARB
:
14863 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
14864 n
[1].i
, n
[2].f
, n
[3].f
);
14866 case OPCODE_ATTR_3F_ARB
:
14867 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
14868 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14870 case OPCODE_ATTR_4F_ARB
:
14871 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
14872 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14875 case OPCODE_MATERIAL
:
14876 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
14877 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14880 fprintf(f
, "BEGIN %x\n", n
[1].i
);
14883 fprintf(f
, "END\n");
14886 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
14889 case OPCODE_EVAL_C1
:
14890 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
14892 case OPCODE_EVAL_C2
:
14893 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
14895 case OPCODE_EVAL_P1
:
14896 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
14898 case OPCODE_EVAL_P2
:
14899 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
14902 case OPCODE_PROVOKING_VERTEX
:
14903 fprintf(f
, "ProvokingVertex %s\n",
14904 _mesa_enum_to_string(n
[1].ui
));
14908 * meta opcodes/commands
14911 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
14912 (const char *) get_pointer(&n
[2]));
14914 case OPCODE_CONTINUE
:
14915 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
14916 n
= (Node
*) get_pointer(&n
[1]);
14919 fprintf(f
, "NOP\n");
14921 case OPCODE_END_OF_LIST
:
14922 fprintf(f
, "END-LIST %u\n", list
);
14926 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
14928 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
14929 opcode
, (void *) n
);
14933 fprintf(f
, "command %d, %u operands\n", opcode
,
14937 /* increment n to point to next compiled command */
14938 if (opcode
!= OPCODE_CONTINUE
) {
14939 assert(InstSize
[opcode
] > 0);
14940 n
+= InstSize
[opcode
];
14954 * Clients may call this function to help debug display list problems.
14955 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14956 * changed, or break in the future without notice.
14959 mesa_print_display_list(GLuint list
)
14961 GET_CURRENT_CONTEXT(ctx
);
14962 print_list(ctx
, list
, NULL
);
14966 /**********************************************************************/
14967 /***** Initialization *****/
14968 /**********************************************************************/
14971 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
14972 const GLvertexformat
*vfmt
)
14974 SET_CallList(disp
, vfmt
->CallList
);
14975 SET_CallLists(disp
, vfmt
->CallLists
);
14980 * Initialize display list state for given context.
14983 _mesa_init_display_list(struct gl_context
*ctx
)
14985 static GLboolean tableInitialized
= GL_FALSE
;
14986 GLvertexformat
*vfmt
= &ctx
->ListState
.ListVtxfmt
;
14988 /* zero-out the instruction size table, just once */
14989 if (!tableInitialized
) {
14990 memset(InstSize
, 0, sizeof(InstSize
));
14991 tableInitialized
= GL_TRUE
;
14994 /* extension info */
14995 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
14998 ctx
->ListState
.CallDepth
= 0;
14999 ctx
->ExecuteFlag
= GL_TRUE
;
15000 ctx
->CompileFlag
= GL_FALSE
;
15001 ctx
->ListState
.CurrentBlock
= NULL
;
15002 ctx
->ListState
.CurrentPos
= 0;
15004 /* Display List group */
15005 ctx
->List
.ListBase
= 0;
15007 InstSize
[OPCODE_NOP
] = 1;
15009 #define NAME_AE(x) _ae_##x
15010 #define NAME_CALLLIST(x) save_##x
15011 #define NAME(x) save_##x
15012 #define NAME_ES(x) save_##x##ARB
15014 #include "vbo/vbo_init_tmp.h"
15019 _mesa_free_display_list_data(struct gl_context
*ctx
)
15021 free(ctx
->ListExt
);
15022 ctx
->ListExt
= NULL
;