2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* GL_ARB_gpu_shader_int64 */
401 OPCODE_UNIFORM_1I64V
,
402 OPCODE_UNIFORM_2I64V
,
403 OPCODE_UNIFORM_3I64V
,
404 OPCODE_UNIFORM_4I64V
,
405 OPCODE_UNIFORM_1UI64
,
406 OPCODE_UNIFORM_2UI64
,
407 OPCODE_UNIFORM_3UI64
,
408 OPCODE_UNIFORM_4UI64
,
409 OPCODE_UNIFORM_1UI64V
,
410 OPCODE_UNIFORM_2UI64V
,
411 OPCODE_UNIFORM_3UI64V
,
412 OPCODE_UNIFORM_4UI64V
,
413 OPCODE_PROGRAM_UNIFORM_1I64
,
414 OPCODE_PROGRAM_UNIFORM_2I64
,
415 OPCODE_PROGRAM_UNIFORM_3I64
,
416 OPCODE_PROGRAM_UNIFORM_4I64
,
417 OPCODE_PROGRAM_UNIFORM_1I64V
,
418 OPCODE_PROGRAM_UNIFORM_2I64V
,
419 OPCODE_PROGRAM_UNIFORM_3I64V
,
420 OPCODE_PROGRAM_UNIFORM_4I64V
,
421 OPCODE_PROGRAM_UNIFORM_1UI64
,
422 OPCODE_PROGRAM_UNIFORM_2UI64
,
423 OPCODE_PROGRAM_UNIFORM_3UI64
,
424 OPCODE_PROGRAM_UNIFORM_4UI64
,
425 OPCODE_PROGRAM_UNIFORM_1UI64V
,
426 OPCODE_PROGRAM_UNIFORM_2UI64V
,
427 OPCODE_PROGRAM_UNIFORM_3UI64V
,
428 OPCODE_PROGRAM_UNIFORM_4UI64V
,
430 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
431 OPCODE_PATCH_PARAMETER_I
,
432 OPCODE_PATCH_PARAMETER_FV_INNER
,
433 OPCODE_PATCH_PARAMETER_FV_OUTER
,
435 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
436 OPCODE_USE_PROGRAM_STAGES
,
437 OPCODE_PROGRAM_UNIFORM_1F
,
438 OPCODE_PROGRAM_UNIFORM_2F
,
439 OPCODE_PROGRAM_UNIFORM_3F
,
440 OPCODE_PROGRAM_UNIFORM_4F
,
441 OPCODE_PROGRAM_UNIFORM_1FV
,
442 OPCODE_PROGRAM_UNIFORM_2FV
,
443 OPCODE_PROGRAM_UNIFORM_3FV
,
444 OPCODE_PROGRAM_UNIFORM_4FV
,
445 OPCODE_PROGRAM_UNIFORM_1D
,
446 OPCODE_PROGRAM_UNIFORM_2D
,
447 OPCODE_PROGRAM_UNIFORM_3D
,
448 OPCODE_PROGRAM_UNIFORM_4D
,
449 OPCODE_PROGRAM_UNIFORM_1DV
,
450 OPCODE_PROGRAM_UNIFORM_2DV
,
451 OPCODE_PROGRAM_UNIFORM_3DV
,
452 OPCODE_PROGRAM_UNIFORM_4DV
,
453 OPCODE_PROGRAM_UNIFORM_1I
,
454 OPCODE_PROGRAM_UNIFORM_2I
,
455 OPCODE_PROGRAM_UNIFORM_3I
,
456 OPCODE_PROGRAM_UNIFORM_4I
,
457 OPCODE_PROGRAM_UNIFORM_1IV
,
458 OPCODE_PROGRAM_UNIFORM_2IV
,
459 OPCODE_PROGRAM_UNIFORM_3IV
,
460 OPCODE_PROGRAM_UNIFORM_4IV
,
461 OPCODE_PROGRAM_UNIFORM_1UI
,
462 OPCODE_PROGRAM_UNIFORM_2UI
,
463 OPCODE_PROGRAM_UNIFORM_3UI
,
464 OPCODE_PROGRAM_UNIFORM_4UI
,
465 OPCODE_PROGRAM_UNIFORM_1UIV
,
466 OPCODE_PROGRAM_UNIFORM_2UIV
,
467 OPCODE_PROGRAM_UNIFORM_3UIV
,
468 OPCODE_PROGRAM_UNIFORM_4UIV
,
469 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
470 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
471 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
472 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
473 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
474 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
475 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
476 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
477 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
478 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
479 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
480 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
481 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
482 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
483 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
484 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
485 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
486 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
488 /* GL_ARB_clip_control */
491 /* GL_ARB_color_buffer_float */
494 /* GL_EXT_framebuffer_blit */
495 OPCODE_BLIT_FRAMEBUFFER
,
497 /* Vertex attributes -- fallback for when optimized display
498 * list build isn't active.
521 /* GL_EXT_provoking_vertex */
522 OPCODE_PROVOKING_VERTEX
,
524 /* GL_EXT_transform_feedback */
525 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
526 OPCODE_END_TRANSFORM_FEEDBACK
,
527 OPCODE_BIND_TRANSFORM_FEEDBACK
,
528 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
529 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
530 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
532 /* GL_EXT_texture_integer */
534 OPCODE_CLEARCOLOR_UI
,
535 OPCODE_TEXPARAMETER_I
,
536 OPCODE_TEXPARAMETER_UI
,
538 /* GL_ARB_instanced_arrays */
539 OPCODE_VERTEX_ATTRIB_DIVISOR
,
541 /* GL_NV_texture_barrier */
542 OPCODE_TEXTURE_BARRIER_NV
,
544 /* GL_ARB_sampler_object */
546 OPCODE_SAMPLER_PARAMETERIV
,
547 OPCODE_SAMPLER_PARAMETERFV
,
548 OPCODE_SAMPLER_PARAMETERIIV
,
549 OPCODE_SAMPLER_PARAMETERUIV
,
551 /* ARB_compute_shader */
552 OPCODE_DISPATCH_COMPUTE
,
557 /* GL_NV_conditional_render */
558 OPCODE_BEGIN_CONDITIONAL_RENDER
,
559 OPCODE_END_CONDITIONAL_RENDER
,
561 /* ARB_timer_query */
562 OPCODE_QUERY_COUNTER
,
564 /* ARB_transform_feedback3 */
565 OPCODE_BEGIN_QUERY_INDEXED
,
566 OPCODE_END_QUERY_INDEXED
,
567 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
569 /* ARB_transform_feedback_instanced */
570 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
571 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
573 /* ARB_uniform_buffer_object */
574 OPCODE_UNIFORM_BLOCK_BINDING
,
576 /* ARB_shader_subroutines */
577 OPCODE_UNIFORM_SUBROUTINES
,
579 /* EXT_polygon_offset_clamp */
580 OPCODE_POLYGON_OFFSET_CLAMP
,
582 /* EXT_window_rectangles */
583 OPCODE_WINDOW_RECTANGLES
,
585 /* NV_conservative_raster */
586 OPCODE_SUBPIXEL_PRECISION_BIAS
,
588 /* NV_conservative_raster_dilate */
589 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
591 /* NV_conservative_raster_pre_snap_triangles */
592 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
594 /* EXT_direct_state_access */
597 OPCODE_MATRIX_ROTATE
,
599 OPCODE_MATRIX_TRANSLATE
,
600 OPCODE_MATRIX_LOAD_IDENTITY
,
602 OPCODE_MATRIX_FRUSTUM
,
605 OPCODE_TEXTUREPARAMETER_F
,
606 OPCODE_TEXTUREPARAMETER_I
,
607 OPCODE_TEXTUREPARAMETER_II
,
608 OPCODE_TEXTUREPARAMETER_IUI
,
609 OPCODE_TEXTURE_IMAGE1D
,
610 OPCODE_TEXTURE_IMAGE2D
,
611 OPCODE_TEXTURE_IMAGE3D
,
612 OPCODE_TEXTURE_SUB_IMAGE1D
,
613 OPCODE_TEXTURE_SUB_IMAGE2D
,
614 OPCODE_TEXTURE_SUB_IMAGE3D
,
615 OPCODE_COPY_TEXTURE_IMAGE1D
,
616 OPCODE_COPY_TEXTURE_IMAGE2D
,
617 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
618 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
619 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
620 OPCODE_BIND_MULTITEXTURE
,
621 OPCODE_MULTITEXPARAMETER_F
,
622 OPCODE_MULTITEXPARAMETER_I
,
623 OPCODE_MULTITEXPARAMETER_II
,
624 OPCODE_MULTITEXPARAMETER_IUI
,
625 OPCODE_MULTITEX_IMAGE1D
,
626 OPCODE_MULTITEX_IMAGE2D
,
627 OPCODE_MULTITEX_IMAGE3D
,
628 OPCODE_MULTITEX_SUB_IMAGE1D
,
629 OPCODE_MULTITEX_SUB_IMAGE2D
,
630 OPCODE_MULTITEX_SUB_IMAGE3D
,
631 OPCODE_COPY_MULTITEX_IMAGE1D
,
632 OPCODE_COPY_MULTITEX_IMAGE2D
,
633 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
634 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
635 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
637 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
638 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
639 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
640 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
641 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
642 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
643 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
644 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
645 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
646 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
647 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
648 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
649 OPCODE_NAMED_PROGRAM_STRING
,
650 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
,
652 /* The following three are meta instructions */
653 OPCODE_ERROR
, /* raise compiled-in error */
655 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
665 * Display list instructions are stored as sequences of "nodes". Nodes
666 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
667 * are linked together with a pointer.
669 * Each instruction in the display list is stored as a sequence of
670 * contiguous nodes in memory.
671 * Each node is the union of a variety of data types.
673 * Note, all of these members should be 4 bytes in size or less for the
674 * sake of compact display lists. We store 8-byte pointers in a pair of
675 * these nodes using the save/get_pointer() functions below.
693 typedef union gl_dlist_node Node
;
696 /** How many 4-byte dwords to store a pointer */
697 #define POINTER_DWORDS (sizeof(void *) / 4)
699 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
700 * space for display lists. The following types and functions are
701 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
706 GLuint dwords
[POINTER_DWORDS
];
711 * Save a 4 or 8-byte pointer at dest (and dest+1).
714 save_pointer(Node
*dest
, void *src
)
719 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
720 STATIC_ASSERT(sizeof(Node
) == 4);
724 for (i
= 0; i
< POINTER_DWORDS
; i
++)
725 dest
[i
].ui
= p
.dwords
[i
];
730 * Retrieve a 4 or 8-byte pointer from node (node+1).
733 get_pointer(const Node
*node
)
738 for (i
= 0; i
< POINTER_DWORDS
; i
++)
739 p
.dwords
[i
] = node
[i
].ui
;
746 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
768 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
770 union float64_pair tmp; \
772 n[idx].ui = tmp.uint32[0]; \
773 n[idx+1].ui = tmp.uint32[1]; \
776 #define ASSIGN_UINT64_TO_NODES(n, idx, value) \
778 union uint64_pair tmp; \
779 tmp.uint64 = value; \
780 n[idx].ui = tmp.uint32[0]; \
781 n[idx+1].ui = tmp.uint32[1]; \
784 #define ASSIGN_INT64_TO_NODES(n, idx, value) \
786 union int64_pair tmp; \
788 n[idx].i = tmp.int32[0]; \
789 n[idx+1].i = tmp.int32[1]; \
793 * How many nodes to allocate at a time. Note that bulk vertex data
794 * from glBegin/glVertex/glEnd primitives will typically wind up in
795 * a VBO, and not directly in the display list itself.
797 #define BLOCK_SIZE 256
802 * Number of nodes of storage needed for each instruction.
803 * Sizes for dynamically allocated opcodes are stored in the context struct.
805 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
808 void mesa_print_display_list(GLuint list
);
812 * Does the given display list only contain a single glBitmap call?
815 is_bitmap_list(const struct gl_display_list
*dlist
)
817 const Node
*n
= dlist
->Head
;
818 if (n
[0].opcode
== OPCODE_BITMAP
) {
819 n
+= InstSize
[OPCODE_BITMAP
];
820 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
828 * Is the given display list an empty list?
831 is_empty_list(const struct gl_display_list
*dlist
)
833 const Node
*n
= dlist
->Head
;
834 return n
[0].opcode
== OPCODE_END_OF_LIST
;
839 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
842 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
845 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
853 * Lookup a gl_bitmap_atlas by listBase ID.
855 static struct gl_bitmap_atlas
*
856 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
858 struct gl_bitmap_atlas
*atlas
;
860 assert(listBase
> 0);
861 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
867 * Create new bitmap atlas and insert into hash table.
869 static struct gl_bitmap_atlas
*
870 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
872 struct gl_bitmap_atlas
*atlas
;
874 assert(listBase
> 0);
875 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
877 atlas
= calloc(1, sizeof(*atlas
));
879 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
887 * Try to build a bitmap atlas. This involves examining a sequence of
888 * display lists which contain glBitmap commands and putting the bitmap
889 * images into a texture map (the atlas).
890 * If we succeed, gl_bitmap_atlas::complete will be set to true.
891 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
894 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
897 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
902 assert(!atlas
->complete
);
903 assert(atlas
->numBitmaps
> 0);
905 /* We use a rectangle texture (non-normalized coords) for the atlas */
906 assert(ctx
->Extensions
.NV_texture_rectangle
);
907 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
909 atlas
->texWidth
= 1024;
910 atlas
->texHeight
= 0; /* determined below */
912 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
913 if (!atlas
->glyphs
) {
915 atlas
->incomplete
= true;
919 /* Loop over the display lists. They should all contain a single glBitmap
920 * call. If not, bail out. Also, compute the position and sizes of each
921 * bitmap in the atlas to determine the texture atlas size.
923 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
924 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
926 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
927 unsigned bitmap_width
, bitmap_height
;
928 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
930 if (!list
|| is_empty_list(list
)) {
932 atlas
->numBitmaps
= i
;
936 if (!is_bitmap_list(list
)) {
937 /* This list does not contain exactly one glBitmap command. Give up. */
938 atlas
->incomplete
= true;
942 /* get bitmap info from the display list command */
944 assert(n
[0].opcode
== OPCODE_BITMAP
);
945 bitmap_width
= n
[1].i
;
946 bitmap_height
= n
[2].i
;
947 bitmap_xorig
= n
[3].f
;
948 bitmap_yorig
= n
[4].f
;
949 bitmap_xmove
= n
[5].f
;
950 bitmap_ymove
= n
[6].f
;
952 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
953 /* advance to the next row of the texture */
959 /* save the bitmap's position in the atlas */
963 g
->h
= bitmap_height
;
964 g
->xorig
= bitmap_xorig
;
965 g
->yorig
= bitmap_yorig
;
966 g
->xmove
= bitmap_xmove
;
967 g
->ymove
= bitmap_ymove
;
969 xpos
+= bitmap_width
;
971 /* keep track of tallest bitmap in the row */
972 row_height
= MAX2(row_height
, bitmap_height
);
975 /* Now we know the texture height */
976 atlas
->texHeight
= ypos
+ row_height
;
978 if (atlas
->texHeight
== 0) {
979 /* no glyphs found, give up */
982 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
983 /* too large, give up */
987 /* Create atlas texture (texture ID is irrelevant) */
988 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
989 if (!atlas
->texObj
) {
993 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
994 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
995 atlas
->texObj
->MaxLevel
= 0;
996 atlas
->texObj
->Immutable
= GL_TRUE
;
998 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
999 GL_TEXTURE_RECTANGLE
, 0);
1000 if (!atlas
->texImage
) {
1004 if (ctx
->Const
.BitmapUsesRed
)
1005 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1006 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1007 GL_RED
, MESA_FORMAT_R_UNORM8
);
1009 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
1010 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
1011 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
1013 /* alloc image storage */
1014 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
1018 /* map teximage, load with bitmap glyphs */
1019 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
1020 0, 0, atlas
->texWidth
, atlas
->texHeight
,
1021 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
1026 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
1027 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
1029 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
1030 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
1031 const Node
*n
= list
->Head
;
1033 assert(n
[0].opcode
== OPCODE_BITMAP
||
1034 n
[0].opcode
== OPCODE_END_OF_LIST
);
1036 if (n
[0].opcode
== OPCODE_BITMAP
) {
1037 unsigned bitmap_width
= n
[1].i
;
1038 unsigned bitmap_height
= n
[2].i
;
1039 unsigned xpos
= atlas
->glyphs
[i
].x
;
1040 unsigned ypos
= atlas
->glyphs
[i
].y
;
1041 const void *bitmap_image
= get_pointer(&n
[7]);
1043 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
1044 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
1046 /* put the bitmap image into the texture image */
1047 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
1048 &ctx
->DefaultPacking
, bitmap_image
,
1049 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
1054 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
1056 atlas
->complete
= true;
1061 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
1063 if (atlas
->texObj
) {
1064 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
1066 free(atlas
->glyphs
);
1067 atlas
->glyphs
= NULL
;
1068 atlas
->incomplete
= true;
1073 * Allocate a gl_display_list object with an initial block of storage.
1074 * \param count how many display list nodes/tokens to allocate
1076 static struct gl_display_list
*
1077 make_list(GLuint name
, GLuint count
)
1079 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1081 dlist
->Head
= malloc(sizeof(Node
) * count
);
1082 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1083 /* All InstSize[] entries must be non-zero */
1084 InstSize
[OPCODE_END_OF_LIST
] = 1;
1090 * Lookup function to just encapsulate casting.
1092 struct gl_display_list
*
1093 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1095 return (struct gl_display_list
*)
1096 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1100 /** Is the given opcode an extension code? */
1101 static inline GLboolean
1102 is_ext_opcode(OpCode opcode
)
1104 return (opcode
>= OPCODE_EXT_0
);
1108 /** Destroy an extended opcode instruction */
1110 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1112 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1114 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1115 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1120 /** Execute an extended opcode instruction */
1122 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1124 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1126 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1127 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1132 /** Print an extended opcode instruction */
1134 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1136 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1138 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1139 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1145 * Delete the named display list, but don't remove from hash table.
1146 * \param dlist - display list pointer
1149 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1154 n
= block
= dlist
->Head
;
1156 done
= block
? GL_FALSE
: GL_TRUE
;
1158 const OpCode opcode
= n
[0].opcode
;
1160 /* check for extension opcodes first */
1161 if (is_ext_opcode(opcode
)) {
1162 n
+= ext_opcode_destroy(ctx
, n
);
1166 /* for some commands, we need to free malloc'd memory */
1168 free(get_pointer(&n
[6]));
1171 free(get_pointer(&n
[10]));
1173 case OPCODE_CALL_LISTS
:
1174 free(get_pointer(&n
[3]));
1176 case OPCODE_DRAW_PIXELS
:
1177 free(get_pointer(&n
[5]));
1180 free(get_pointer(&n
[7]));
1182 case OPCODE_POLYGON_STIPPLE
:
1183 free(get_pointer(&n
[1]));
1185 case OPCODE_TEX_IMAGE1D
:
1186 free(get_pointer(&n
[8]));
1188 case OPCODE_TEX_IMAGE2D
:
1189 free(get_pointer(&n
[9]));
1191 case OPCODE_TEX_IMAGE3D
:
1192 free(get_pointer(&n
[10]));
1194 case OPCODE_TEX_SUB_IMAGE1D
:
1195 free(get_pointer(&n
[7]));
1197 case OPCODE_TEX_SUB_IMAGE2D
:
1198 free(get_pointer(&n
[9]));
1200 case OPCODE_TEX_SUB_IMAGE3D
:
1201 free(get_pointer(&n
[11]));
1203 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1204 free(get_pointer(&n
[7]));
1206 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1207 free(get_pointer(&n
[8]));
1209 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1210 free(get_pointer(&n
[9]));
1212 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1213 free(get_pointer(&n
[7]));
1215 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1216 free(get_pointer(&n
[9]));
1218 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1219 free(get_pointer(&n
[11]));
1221 case OPCODE_PROGRAM_STRING_ARB
:
1222 free(get_pointer(&n
[4])); /* program string */
1224 case OPCODE_UNIFORM_1FV
:
1225 case OPCODE_UNIFORM_2FV
:
1226 case OPCODE_UNIFORM_3FV
:
1227 case OPCODE_UNIFORM_4FV
:
1228 case OPCODE_UNIFORM_1DV
:
1229 case OPCODE_UNIFORM_2DV
:
1230 case OPCODE_UNIFORM_3DV
:
1231 case OPCODE_UNIFORM_4DV
:
1232 case OPCODE_UNIFORM_1IV
:
1233 case OPCODE_UNIFORM_2IV
:
1234 case OPCODE_UNIFORM_3IV
:
1235 case OPCODE_UNIFORM_4IV
:
1236 case OPCODE_UNIFORM_1UIV
:
1237 case OPCODE_UNIFORM_2UIV
:
1238 case OPCODE_UNIFORM_3UIV
:
1239 case OPCODE_UNIFORM_4UIV
:
1240 case OPCODE_UNIFORM_1I64V
:
1241 case OPCODE_UNIFORM_2I64V
:
1242 case OPCODE_UNIFORM_3I64V
:
1243 case OPCODE_UNIFORM_4I64V
:
1244 case OPCODE_UNIFORM_1UI64V
:
1245 case OPCODE_UNIFORM_2UI64V
:
1246 case OPCODE_UNIFORM_3UI64V
:
1247 case OPCODE_UNIFORM_4UI64V
:
1248 free(get_pointer(&n
[3]));
1250 case OPCODE_UNIFORM_MATRIX22
:
1251 case OPCODE_UNIFORM_MATRIX33
:
1252 case OPCODE_UNIFORM_MATRIX44
:
1253 case OPCODE_UNIFORM_MATRIX24
:
1254 case OPCODE_UNIFORM_MATRIX42
:
1255 case OPCODE_UNIFORM_MATRIX23
:
1256 case OPCODE_UNIFORM_MATRIX32
:
1257 case OPCODE_UNIFORM_MATRIX34
:
1258 case OPCODE_UNIFORM_MATRIX43
:
1259 case OPCODE_UNIFORM_MATRIX22D
:
1260 case OPCODE_UNIFORM_MATRIX33D
:
1261 case OPCODE_UNIFORM_MATRIX44D
:
1262 case OPCODE_UNIFORM_MATRIX24D
:
1263 case OPCODE_UNIFORM_MATRIX42D
:
1264 case OPCODE_UNIFORM_MATRIX23D
:
1265 case OPCODE_UNIFORM_MATRIX32D
:
1266 case OPCODE_UNIFORM_MATRIX34D
:
1267 case OPCODE_UNIFORM_MATRIX43D
:
1268 free(get_pointer(&n
[4]));
1270 case OPCODE_PROGRAM_UNIFORM_1FV
:
1271 case OPCODE_PROGRAM_UNIFORM_2FV
:
1272 case OPCODE_PROGRAM_UNIFORM_3FV
:
1273 case OPCODE_PROGRAM_UNIFORM_4FV
:
1274 case OPCODE_PROGRAM_UNIFORM_1DV
:
1275 case OPCODE_PROGRAM_UNIFORM_2DV
:
1276 case OPCODE_PROGRAM_UNIFORM_3DV
:
1277 case OPCODE_PROGRAM_UNIFORM_4DV
:
1278 case OPCODE_PROGRAM_UNIFORM_1IV
:
1279 case OPCODE_PROGRAM_UNIFORM_2IV
:
1280 case OPCODE_PROGRAM_UNIFORM_3IV
:
1281 case OPCODE_PROGRAM_UNIFORM_4IV
:
1282 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1283 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1284 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1285 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1286 case OPCODE_PROGRAM_UNIFORM_1I64V
:
1287 case OPCODE_PROGRAM_UNIFORM_2I64V
:
1288 case OPCODE_PROGRAM_UNIFORM_3I64V
:
1289 case OPCODE_PROGRAM_UNIFORM_4I64V
:
1290 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
1291 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
1292 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
1293 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
1294 free(get_pointer(&n
[4]));
1296 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1297 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1298 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1299 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1300 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1301 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1302 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1303 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1304 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1305 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1306 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1307 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1308 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1309 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1310 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1311 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1312 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1313 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1314 free(get_pointer(&n
[5]));
1316 case OPCODE_PIXEL_MAP
:
1317 free(get_pointer(&n
[3]));
1319 case OPCODE_VIEWPORT_ARRAY_V
:
1320 case OPCODE_SCISSOR_ARRAY_V
:
1321 case OPCODE_DEPTH_ARRAY_V
:
1322 case OPCODE_UNIFORM_SUBROUTINES
:
1323 case OPCODE_WINDOW_RECTANGLES
:
1324 free(get_pointer(&n
[3]));
1326 case OPCODE_TEXTURE_IMAGE1D
:
1327 case OPCODE_MULTITEX_IMAGE1D
:
1328 free(get_pointer(&n
[9]));
1330 case OPCODE_TEXTURE_IMAGE2D
:
1331 case OPCODE_MULTITEX_IMAGE2D
:
1332 free(get_pointer(&n
[10]));
1334 case OPCODE_TEXTURE_IMAGE3D
:
1335 case OPCODE_MULTITEX_IMAGE3D
:
1336 free(get_pointer(&n
[11]));
1338 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1339 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1340 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1341 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
1342 free(get_pointer(&n
[8]));
1344 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1345 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1346 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1347 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
1348 free(get_pointer(&n
[10]));
1350 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1351 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1352 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1353 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
1354 free(get_pointer(&n
[12]));
1356 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1357 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
1358 free(get_pointer(&n
[8]));
1360 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1361 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
1362 free(get_pointer(&n
[9]));
1364 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1365 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
1366 free(get_pointer(&n
[10]));
1368 case OPCODE_NAMED_PROGRAM_STRING
:
1369 free(get_pointer(&n
[5]));
1371 case OPCODE_CONTINUE
:
1372 n
= (Node
*) get_pointer(&n
[1]);
1376 case OPCODE_END_OF_LIST
:
1381 /* just increment 'n' pointer, below */
1385 if (opcode
!= OPCODE_CONTINUE
) {
1386 assert(InstSize
[opcode
] > 0);
1387 n
+= InstSize
[opcode
];
1398 * Called by _mesa_HashWalk() to check if a display list which is being
1399 * deleted belongs to a bitmap texture atlas.
1402 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1404 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1405 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1407 /* See if the list_id falls in the range contained in this texture atlas */
1408 if (atlas
->complete
&&
1409 list_id
>= atlas_id
&&
1410 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1411 /* Mark the atlas as incomplete so it doesn't get used. But don't
1412 * delete it yet since we don't want to try to recreate it in the next
1415 atlas
->complete
= false;
1416 atlas
->incomplete
= true;
1422 * Destroy a display list and remove from hash table.
1423 * \param list - display list number
1426 destroy_list(struct gl_context
*ctx
, GLuint list
)
1428 struct gl_display_list
*dlist
;
1433 dlist
= _mesa_lookup_list(ctx
, list
);
1437 if (is_bitmap_list(dlist
)) {
1438 /* If we're destroying a simple glBitmap display list, there's a
1439 * chance that we're destroying a bitmap image that's in a texture
1440 * atlas. Examine all atlases to see if that's the case. There's
1441 * usually few (if any) atlases so this isn't expensive.
1443 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1444 check_atlas_for_deleted_list
, &list
);
1447 _mesa_delete_list(ctx
, dlist
);
1448 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1453 * Translate the nth element of list from <type> to GLint.
1456 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1468 bptr
= (GLbyte
*) list
;
1469 return (GLint
) bptr
[n
];
1470 case GL_UNSIGNED_BYTE
:
1471 ubptr
= (GLubyte
*) list
;
1472 return (GLint
) ubptr
[n
];
1474 sptr
= (GLshort
*) list
;
1475 return (GLint
) sptr
[n
];
1476 case GL_UNSIGNED_SHORT
:
1477 usptr
= (GLushort
*) list
;
1478 return (GLint
) usptr
[n
];
1480 iptr
= (GLint
*) list
;
1482 case GL_UNSIGNED_INT
:
1483 uiptr
= (GLuint
*) list
;
1484 return (GLint
) uiptr
[n
];
1486 fptr
= (GLfloat
*) list
;
1487 return (GLint
) floorf(fptr
[n
]);
1489 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1490 return (GLint
) ubptr
[0] * 256
1493 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1494 return (GLint
) ubptr
[0] * 65536
1495 + (GLint
) ubptr
[1] * 256
1498 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1499 return (GLint
) ubptr
[0] * 16777216
1500 + (GLint
) ubptr
[1] * 65536
1501 + (GLint
) ubptr
[2] * 256
1510 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1511 * If width < 0 or height < 0 or format or type are invalid we'll just
1512 * return NULL. We will not generate an error since OpenGL command
1513 * arguments aren't error-checked until the command is actually executed
1514 * (not when they're compiled).
1515 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1518 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1519 GLsizei width
, GLsizei height
, GLsizei depth
,
1520 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1521 const struct gl_pixelstore_attrib
*unpack
)
1523 if (width
<= 0 || height
<= 0) {
1527 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1528 /* bad format and/or type */
1532 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1536 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1537 format
, type
, pixels
, unpack
);
1538 if (pixels
&& !image
) {
1539 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1543 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1544 depth
, format
, type
, INT_MAX
, pixels
)) {
1545 const GLubyte
*map
, *src
;
1549 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1550 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1553 /* unable to map src buffer! */
1554 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1558 src
= ADD_POINTERS(map
, pixels
);
1559 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1560 format
, type
, src
, unpack
);
1562 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1565 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1571 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1576 /** Return copy of memory */
1578 memdup(const void *src
, GLsizei bytes
)
1580 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1582 memcpy(b
, src
, bytes
);
1588 * Allocate space for a display list instruction (opcode + payload space).
1589 * \param opcode the instruction opcode (OPCODE_* value)
1590 * \param bytes instruction payload size (not counting opcode)
1591 * \param align8 does the payload need to be 8-byte aligned?
1592 * This is only relevant in 64-bit environments.
1593 * \return pointer to allocated memory (the payload will be at pointer+1)
1596 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1598 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1599 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1603 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1605 if (opcode
< OPCODE_EXT_0
) {
1606 if (InstSize
[opcode
] == 0) {
1607 /* save instruction size now */
1608 InstSize
[opcode
] = numNodes
;
1611 /* make sure instruction size agrees */
1612 assert(numNodes
== InstSize
[opcode
]);
1616 if (sizeof(void *) > sizeof(Node
) && align8
1617 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1618 /* The opcode would get placed at node[0] and the payload would start
1619 * at node[1]. But the payload needs to be at an even offset (8-byte
1628 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1630 /* This block is full. Allocate a new block and chain to it */
1632 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1633 n
[0].opcode
= OPCODE_CONTINUE
;
1634 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1636 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1640 /* a fresh block should be 8-byte aligned on 64-bit systems */
1641 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1643 save_pointer(&n
[1], newblock
);
1644 ctx
->ListState
.CurrentBlock
= newblock
;
1645 ctx
->ListState
.CurrentPos
= 0;
1647 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1648 * we have to insert a NOP so that the payload of the real opcode lands
1649 * on an even location:
1650 * node[0] = OPCODE_NOP
1651 * node[1] = OPCODE_x;
1652 * node[2] = start of payload
1654 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1657 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1659 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1660 n
[0].opcode
= OPCODE_NOP
;
1662 /* The "real" opcode will now be at an odd location and the payload
1663 * will be at an even location.
1666 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1668 n
[0].opcode
= opcode
;
1676 * Allocate space for a display list instruction. Used by callers outside
1677 * this file for things like VBO vertex data.
1679 * \param opcode the instruction opcode (OPCODE_* value)
1680 * \param bytes instruction size in bytes, not counting opcode.
1681 * \return pointer to the usable data area (not including the internal
1685 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1687 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1689 return n
+ 1; /* return pointer to payload area, after opcode */
1696 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1697 * aligned in 64-bit environments, 4-byte aligned otherwise.
1700 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1702 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1704 return n
+ 1; /* return pointer to payload area, after opcode */
1711 * This function allows modules and drivers to get their own opcodes
1712 * for extending display list functionality.
1713 * \param ctx the rendering context
1714 * \param size number of bytes for storing the new display list command
1715 * \param execute function to execute the new display list command
1716 * \param destroy function to destroy the new display list command
1717 * \param print function to print the new display list command
1718 * \return the new opcode number or -1 if error
1721 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1723 void (*execute
) (struct gl_context
*, void *),
1724 void (*destroy
) (struct gl_context
*, void *),
1725 void (*print
) (struct gl_context
*, void *, FILE *))
1727 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1728 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1729 ctx
->ListExt
->Opcode
[i
].Size
=
1730 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1731 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1732 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1733 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1734 return i
+ OPCODE_EXT_0
;
1741 * Allocate space for a display list instruction. The space is basically
1742 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1743 * function parameter, node[2] is the second parameter, etc.
1745 * \param opcode one of OPCODE_x
1746 * \param nparams number of function parameters
1747 * \return pointer to start of instruction space
1749 static inline Node
*
1750 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1752 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1757 * Called by EndList to try to reduce memory used for the list.
1760 trim_list(struct gl_context
*ctx
)
1762 /* If the list we're ending only has one allocated block of nodes/tokens
1763 * and its size isn't a full block size, realloc the block to use less
1764 * memory. This is important for apps that create many small display
1765 * lists and apps that use glXUseXFont (many lists each containing one
1767 * Note: we currently only trim display lists that allocated one block
1768 * of tokens. That hits the short list case which is what we're mainly
1769 * concerned with. Trimming longer lists would involve traversing the
1770 * linked list of blocks.
1772 struct gl_dlist_state
*list
= &ctx
->ListState
;
1774 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1775 (list
->CurrentPos
< BLOCK_SIZE
)) {
1776 /* There's only one block and it's not full, so realloc */
1777 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1778 list
->CurrentList
->Head
=
1779 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1780 if (!list
->CurrentBlock
) {
1781 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1789 * Display List compilation functions
1791 static void GLAPIENTRY
1792 save_Accum(GLenum op
, GLfloat value
)
1794 GET_CURRENT_CONTEXT(ctx
);
1796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1797 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1802 if (ctx
->ExecuteFlag
) {
1803 CALL_Accum(ctx
->Exec
, (op
, value
));
1808 static void GLAPIENTRY
1809 save_AlphaFunc(GLenum func
, GLclampf ref
)
1811 GET_CURRENT_CONTEXT(ctx
);
1813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1814 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1817 n
[2].f
= (GLfloat
) ref
;
1819 if (ctx
->ExecuteFlag
) {
1820 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1825 static void GLAPIENTRY
1826 save_BindTexture(GLenum target
, GLuint texture
)
1828 GET_CURRENT_CONTEXT(ctx
);
1830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1831 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1836 if (ctx
->ExecuteFlag
) {
1837 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1842 static void GLAPIENTRY
1843 save_Bitmap(GLsizei width
, GLsizei height
,
1844 GLfloat xorig
, GLfloat yorig
,
1845 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1852 n
[1].i
= (GLint
) width
;
1853 n
[2].i
= (GLint
) height
;
1859 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1860 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1862 if (ctx
->ExecuteFlag
) {
1863 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1864 xorig
, yorig
, xmove
, ymove
, pixels
));
1869 static void GLAPIENTRY
1870 save_BlendEquation(GLenum mode
)
1872 GET_CURRENT_CONTEXT(ctx
);
1874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1875 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1879 if (ctx
->ExecuteFlag
) {
1880 CALL_BlendEquation(ctx
->Exec
, (mode
));
1885 static void GLAPIENTRY
1886 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1888 GET_CURRENT_CONTEXT(ctx
);
1890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1891 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1896 if (ctx
->ExecuteFlag
) {
1897 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1902 static void GLAPIENTRY
1903 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1904 GLenum sfactorA
, GLenum dfactorA
)
1906 GET_CURRENT_CONTEXT(ctx
);
1908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1909 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1911 n
[1].e
= sfactorRGB
;
1912 n
[2].e
= dfactorRGB
;
1916 if (ctx
->ExecuteFlag
) {
1917 CALL_BlendFuncSeparate(ctx
->Exec
,
1918 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1923 static void GLAPIENTRY
1924 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1926 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1930 static void GLAPIENTRY
1931 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1933 GET_CURRENT_CONTEXT(ctx
);
1935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1936 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1943 if (ctx
->ExecuteFlag
) {
1944 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1948 /* GL_ARB_draw_buffers_blend */
1949 static void GLAPIENTRY
1950 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1951 GLenum sfactorA
, GLenum dfactorA
)
1953 GET_CURRENT_CONTEXT(ctx
);
1955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1956 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1959 n
[2].e
= sfactorRGB
;
1960 n
[3].e
= dfactorRGB
;
1964 if (ctx
->ExecuteFlag
) {
1965 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1966 sfactorA
, dfactorA
));
1970 /* GL_ARB_draw_buffers_blend */
1971 static void GLAPIENTRY
1972 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1974 GET_CURRENT_CONTEXT(ctx
);
1976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1977 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1983 if (ctx
->ExecuteFlag
) {
1984 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1988 /* GL_ARB_draw_buffers_blend */
1989 static void GLAPIENTRY
1990 save_BlendEquationi(GLuint buf
, GLenum mode
)
1992 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
2000 if (ctx
->ExecuteFlag
) {
2001 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
2005 /* GL_ARB_draw_buffers_blend */
2006 static void GLAPIENTRY
2007 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
2009 GET_CURRENT_CONTEXT(ctx
);
2011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2012 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
2018 if (ctx
->ExecuteFlag
) {
2019 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
2024 /* GL_ARB_draw_instanced. */
2025 static void GLAPIENTRY
2026 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
2028 UNUSED GLsizei count
,
2029 UNUSED GLsizei primcount
)
2031 GET_CURRENT_CONTEXT(ctx
);
2032 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2033 "glDrawArraysInstanced() during display list compile");
2036 static void GLAPIENTRY
2037 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
2038 UNUSED GLsizei count
,
2040 UNUSED
const GLvoid
*indices
,
2041 UNUSED GLsizei primcount
)
2043 GET_CURRENT_CONTEXT(ctx
);
2044 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2045 "glDrawElementsInstanced() during display list compile");
2048 static void GLAPIENTRY
2049 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
2050 UNUSED GLsizei count
,
2052 UNUSED
const GLvoid
*indices
,
2053 UNUSED GLsizei primcount
,
2054 UNUSED GLint basevertex
)
2056 GET_CURRENT_CONTEXT(ctx
);
2057 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2058 "glDrawElementsInstancedBaseVertex() during display list compile");
2061 /* GL_ARB_base_instance. */
2062 static void GLAPIENTRY
2063 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
2065 UNUSED GLsizei count
,
2066 UNUSED GLsizei primcount
,
2067 UNUSED GLuint baseinstance
)
2069 GET_CURRENT_CONTEXT(ctx
);
2070 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2071 "glDrawArraysInstancedBaseInstance() during display list compile");
2074 static void APIENTRY
2075 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
2076 UNUSED GLsizei count
,
2078 UNUSED
const void *indices
,
2079 UNUSED GLsizei primcount
,
2080 UNUSED GLuint baseinstance
)
2082 GET_CURRENT_CONTEXT(ctx
);
2083 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2084 "glDrawElementsInstancedBaseInstance() during display list compile");
2087 static void APIENTRY
2088 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
2089 UNUSED GLsizei count
,
2091 UNUSED
const void *indices
,
2092 UNUSED GLsizei primcount
,
2093 UNUSED GLint basevertex
,
2094 UNUSED GLuint baseinstance
)
2096 GET_CURRENT_CONTEXT(ctx
);
2097 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2098 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2101 static void APIENTRY
2102 save_DrawArraysIndirect(UNUSED GLenum mode
,
2103 UNUSED
const void *indirect
)
2105 GET_CURRENT_CONTEXT(ctx
);
2106 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2107 "glDrawArraysIndirect() during display list compile");
2110 static void APIENTRY
2111 save_DrawElementsIndirect(UNUSED GLenum mode
,
2113 UNUSED
const void *indirect
)
2115 GET_CURRENT_CONTEXT(ctx
);
2116 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2117 "glDrawElementsIndirect() during display list compile");
2120 static void APIENTRY
2121 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2122 UNUSED
const void *indirect
,
2123 UNUSED GLsizei primcount
,
2124 UNUSED GLsizei stride
)
2126 GET_CURRENT_CONTEXT(ctx
);
2127 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2128 "glMultiDrawArraysIndirect() during display list compile");
2131 static void APIENTRY
2132 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2134 UNUSED
const void *indirect
,
2135 UNUSED GLsizei primcount
,
2136 UNUSED GLsizei stride
)
2138 GET_CURRENT_CONTEXT(ctx
);
2139 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2140 "glMultiDrawElementsIndirect() during display list compile");
2144 * While building a display list we cache some OpenGL state.
2145 * Under some circumstances we need to invalidate that state (immediately
2146 * when we start compiling a list, or after glCallList(s)).
2149 invalidate_saved_current_state(struct gl_context
*ctx
)
2153 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2154 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2156 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2157 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2159 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2161 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2165 static void GLAPIENTRY
2166 save_CallList(GLuint list
)
2168 GET_CURRENT_CONTEXT(ctx
);
2170 SAVE_FLUSH_VERTICES(ctx
);
2172 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2177 /* After this, we don't know what state we're in. Invalidate all
2178 * cached information previously gathered:
2180 invalidate_saved_current_state( ctx
);
2182 if (ctx
->ExecuteFlag
) {
2183 _mesa_CallList(list
);
2188 static void GLAPIENTRY
2189 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2191 GET_CURRENT_CONTEXT(ctx
);
2196 SAVE_FLUSH_VERTICES(ctx
);
2200 case GL_UNSIGNED_BYTE
:
2204 case GL_UNSIGNED_SHORT
:
2212 case GL_UNSIGNED_INT
:
2221 if (num
> 0 && type_size
> 0) {
2222 /* create a copy of the array of list IDs to save in the display list */
2223 lists_copy
= memdup(lists
, num
* type_size
);
2228 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2232 save_pointer(&n
[3], lists_copy
);
2235 /* After this, we don't know what state we're in. Invalidate all
2236 * cached information previously gathered:
2238 invalidate_saved_current_state( ctx
);
2240 if (ctx
->ExecuteFlag
) {
2241 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2246 static void GLAPIENTRY
2247 save_Clear(GLbitfield mask
)
2249 GET_CURRENT_CONTEXT(ctx
);
2251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2252 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2256 if (ctx
->ExecuteFlag
) {
2257 CALL_Clear(ctx
->Exec
, (mask
));
2262 static void GLAPIENTRY
2263 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2265 GET_CURRENT_CONTEXT(ctx
);
2267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2268 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2271 n
[2].i
= drawbuffer
;
2273 if (buffer
== GL_COLOR
) {
2284 if (ctx
->ExecuteFlag
) {
2285 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2290 static void GLAPIENTRY
2291 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2293 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2299 n
[2].i
= drawbuffer
;
2301 if (buffer
== GL_COLOR
) {
2312 if (ctx
->ExecuteFlag
) {
2313 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2318 static void GLAPIENTRY
2319 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2321 GET_CURRENT_CONTEXT(ctx
);
2323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2324 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2327 n
[2].i
= drawbuffer
;
2329 if (buffer
== GL_COLOR
) {
2340 if (ctx
->ExecuteFlag
) {
2341 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2346 static void GLAPIENTRY
2347 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2348 GLfloat depth
, GLint stencil
)
2350 GET_CURRENT_CONTEXT(ctx
);
2352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2353 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2356 n
[2].i
= drawbuffer
;
2360 if (ctx
->ExecuteFlag
) {
2361 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2366 static void GLAPIENTRY
2367 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2369 GET_CURRENT_CONTEXT(ctx
);
2371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2372 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2379 if (ctx
->ExecuteFlag
) {
2380 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2385 static void GLAPIENTRY
2386 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2388 GET_CURRENT_CONTEXT(ctx
);
2390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2391 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2398 if (ctx
->ExecuteFlag
) {
2399 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2404 static void GLAPIENTRY
2405 save_ClearDepth(GLclampd depth
)
2407 GET_CURRENT_CONTEXT(ctx
);
2409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2410 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2412 n
[1].f
= (GLfloat
) depth
;
2414 if (ctx
->ExecuteFlag
) {
2415 CALL_ClearDepth(ctx
->Exec
, (depth
));
2420 static void GLAPIENTRY
2421 save_ClearIndex(GLfloat c
)
2423 GET_CURRENT_CONTEXT(ctx
);
2425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2426 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2430 if (ctx
->ExecuteFlag
) {
2431 CALL_ClearIndex(ctx
->Exec
, (c
));
2436 static void GLAPIENTRY
2437 save_ClearStencil(GLint s
)
2439 GET_CURRENT_CONTEXT(ctx
);
2441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2442 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2446 if (ctx
->ExecuteFlag
) {
2447 CALL_ClearStencil(ctx
->Exec
, (s
));
2452 static void GLAPIENTRY
2453 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2455 GET_CURRENT_CONTEXT(ctx
);
2457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2458 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2461 n
[2].f
= (GLfloat
) equ
[0];
2462 n
[3].f
= (GLfloat
) equ
[1];
2463 n
[4].f
= (GLfloat
) equ
[2];
2464 n
[5].f
= (GLfloat
) equ
[3];
2466 if (ctx
->ExecuteFlag
) {
2467 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2473 static void GLAPIENTRY
2474 save_ColorMask(GLboolean red
, GLboolean green
,
2475 GLboolean blue
, GLboolean alpha
)
2477 GET_CURRENT_CONTEXT(ctx
);
2479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2480 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2487 if (ctx
->ExecuteFlag
) {
2488 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2493 static void GLAPIENTRY
2494 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2495 GLboolean blue
, GLboolean alpha
)
2497 GET_CURRENT_CONTEXT(ctx
);
2499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2500 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2508 if (ctx
->ExecuteFlag
) {
2509 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2514 static void GLAPIENTRY
2515 save_ColorMaterial(GLenum face
, GLenum mode
)
2517 GET_CURRENT_CONTEXT(ctx
);
2519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2521 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2526 if (ctx
->ExecuteFlag
) {
2527 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2532 static void GLAPIENTRY
2533 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2535 GET_CURRENT_CONTEXT(ctx
);
2537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2538 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2542 n
[3].i
= (GLint
) width
;
2543 n
[4].i
= (GLint
) height
;
2546 if (ctx
->ExecuteFlag
) {
2547 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2553 static void GLAPIENTRY
2554 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2555 GLint x
, GLint y
, GLsizei width
, GLint border
)
2557 GET_CURRENT_CONTEXT(ctx
);
2559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2560 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2564 n
[3].e
= internalformat
;
2570 if (ctx
->ExecuteFlag
) {
2571 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2572 x
, y
, width
, border
));
2577 static void GLAPIENTRY
2578 save_CopyTexImage2D(GLenum target
, GLint level
,
2579 GLenum internalformat
,
2580 GLint x
, GLint y
, GLsizei width
,
2581 GLsizei height
, GLint border
)
2583 GET_CURRENT_CONTEXT(ctx
);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2586 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2590 n
[3].e
= internalformat
;
2597 if (ctx
->ExecuteFlag
) {
2598 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2599 x
, y
, width
, height
, border
));
2605 static void GLAPIENTRY
2606 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2607 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2609 GET_CURRENT_CONTEXT(ctx
);
2611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2612 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2621 if (ctx
->ExecuteFlag
) {
2622 CALL_CopyTexSubImage1D(ctx
->Exec
,
2623 (target
, level
, xoffset
, x
, y
, width
));
2628 static void GLAPIENTRY
2629 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2630 GLint xoffset
, GLint yoffset
,
2631 GLint x
, GLint y
, GLsizei width
, GLint height
)
2633 GET_CURRENT_CONTEXT(ctx
);
2635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2636 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2647 if (ctx
->ExecuteFlag
) {
2648 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2649 x
, y
, width
, height
));
2654 static void GLAPIENTRY
2655 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2656 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2657 GLint x
, GLint y
, GLsizei width
, GLint height
)
2659 GET_CURRENT_CONTEXT(ctx
);
2661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2662 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2674 if (ctx
->ExecuteFlag
) {
2675 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2676 xoffset
, yoffset
, zoffset
,
2677 x
, y
, width
, height
));
2682 static void GLAPIENTRY
2683 save_CullFace(GLenum mode
)
2685 GET_CURRENT_CONTEXT(ctx
);
2687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2688 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2692 if (ctx
->ExecuteFlag
) {
2693 CALL_CullFace(ctx
->Exec
, (mode
));
2698 static void GLAPIENTRY
2699 save_DepthFunc(GLenum func
)
2701 GET_CURRENT_CONTEXT(ctx
);
2703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2704 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2708 if (ctx
->ExecuteFlag
) {
2709 CALL_DepthFunc(ctx
->Exec
, (func
));
2714 static void GLAPIENTRY
2715 save_DepthMask(GLboolean mask
)
2717 GET_CURRENT_CONTEXT(ctx
);
2719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2720 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2724 if (ctx
->ExecuteFlag
) {
2725 CALL_DepthMask(ctx
->Exec
, (mask
));
2730 static void GLAPIENTRY
2731 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2733 GET_CURRENT_CONTEXT(ctx
);
2735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2736 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2738 n
[1].f
= (GLfloat
) nearval
;
2739 n
[2].f
= (GLfloat
) farval
;
2741 if (ctx
->ExecuteFlag
) {
2742 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2747 static void GLAPIENTRY
2748 save_Disable(GLenum cap
)
2750 GET_CURRENT_CONTEXT(ctx
);
2752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2753 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2757 if (ctx
->ExecuteFlag
) {
2758 CALL_Disable(ctx
->Exec
, (cap
));
2763 static void GLAPIENTRY
2764 save_DisableIndexed(GLuint index
, GLenum cap
)
2766 GET_CURRENT_CONTEXT(ctx
);
2768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2769 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2774 if (ctx
->ExecuteFlag
) {
2775 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2780 static void GLAPIENTRY
2781 save_DrawBuffer(GLenum mode
)
2783 GET_CURRENT_CONTEXT(ctx
);
2785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2786 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2790 if (ctx
->ExecuteFlag
) {
2791 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2796 static void GLAPIENTRY
2797 save_DrawPixels(GLsizei width
, GLsizei height
,
2798 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2800 GET_CURRENT_CONTEXT(ctx
);
2803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2805 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2812 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2813 pixels
, &ctx
->Unpack
));
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2822 static void GLAPIENTRY
2823 save_Enable(GLenum cap
)
2825 GET_CURRENT_CONTEXT(ctx
);
2827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2828 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2832 if (ctx
->ExecuteFlag
) {
2833 CALL_Enable(ctx
->Exec
, (cap
));
2839 static void GLAPIENTRY
2840 save_EnableIndexed(GLuint index
, GLenum cap
)
2842 GET_CURRENT_CONTEXT(ctx
);
2844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2845 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2850 if (ctx
->ExecuteFlag
) {
2851 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2857 static void GLAPIENTRY
2858 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2860 GET_CURRENT_CONTEXT(ctx
);
2862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2863 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2869 if (ctx
->ExecuteFlag
) {
2870 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2875 static void GLAPIENTRY
2876 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2878 GET_CURRENT_CONTEXT(ctx
);
2880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2881 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2889 if (ctx
->ExecuteFlag
) {
2890 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2897 static void GLAPIENTRY
2898 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2900 GET_CURRENT_CONTEXT(ctx
);
2902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2903 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2911 if (ctx
->ExecuteFlag
) {
2912 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2917 static void GLAPIENTRY
2918 save_Fogf(GLenum pname
, GLfloat param
)
2922 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2923 save_Fogfv(pname
, parray
);
2927 static void GLAPIENTRY
2928 save_Fogiv(GLenum pname
, const GLint
*params
)
2933 case GL_FOG_DENSITY
:
2937 case GL_FOG_COORDINATE_SOURCE
:
2938 p
[0] = (GLfloat
) *params
;
2944 p
[0] = INT_TO_FLOAT(params
[0]);
2945 p
[1] = INT_TO_FLOAT(params
[1]);
2946 p
[2] = INT_TO_FLOAT(params
[2]);
2947 p
[3] = INT_TO_FLOAT(params
[3]);
2950 /* Error will be caught later in gl_Fogfv */
2951 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2953 save_Fogfv(pname
, p
);
2957 static void GLAPIENTRY
2958 save_Fogi(GLenum pname
, GLint param
)
2962 parray
[1] = parray
[2] = parray
[3] = 0;
2963 save_Fogiv(pname
, parray
);
2967 static void GLAPIENTRY
2968 save_FrontFace(GLenum mode
)
2970 GET_CURRENT_CONTEXT(ctx
);
2972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2973 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2977 if (ctx
->ExecuteFlag
) {
2978 CALL_FrontFace(ctx
->Exec
, (mode
));
2983 static void GLAPIENTRY
2984 save_Frustum(GLdouble left
, GLdouble right
,
2985 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2987 GET_CURRENT_CONTEXT(ctx
);
2989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2990 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2992 n
[1].f
= (GLfloat
) left
;
2993 n
[2].f
= (GLfloat
) right
;
2994 n
[3].f
= (GLfloat
) bottom
;
2995 n
[4].f
= (GLfloat
) top
;
2996 n
[5].f
= (GLfloat
) nearval
;
2997 n
[6].f
= (GLfloat
) farval
;
2999 if (ctx
->ExecuteFlag
) {
3000 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3005 static void GLAPIENTRY
3006 save_Hint(GLenum target
, GLenum mode
)
3008 GET_CURRENT_CONTEXT(ctx
);
3010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3011 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
3016 if (ctx
->ExecuteFlag
) {
3017 CALL_Hint(ctx
->Exec
, (target
, mode
));
3022 static void GLAPIENTRY
3023 save_IndexMask(GLuint mask
)
3025 GET_CURRENT_CONTEXT(ctx
);
3027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3028 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
3032 if (ctx
->ExecuteFlag
) {
3033 CALL_IndexMask(ctx
->Exec
, (mask
));
3038 static void GLAPIENTRY
3039 save_InitNames(void)
3041 GET_CURRENT_CONTEXT(ctx
);
3042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3043 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
3044 if (ctx
->ExecuteFlag
) {
3045 CALL_InitNames(ctx
->Exec
, ());
3050 static void GLAPIENTRY
3051 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
3053 GET_CURRENT_CONTEXT(ctx
);
3055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3056 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
3074 case GL_SPOT_DIRECTION
:
3077 case GL_SPOT_EXPONENT
:
3080 case GL_SPOT_CUTOFF
:
3083 case GL_CONSTANT_ATTENUATION
:
3086 case GL_LINEAR_ATTENUATION
:
3089 case GL_QUADRATIC_ATTENUATION
:
3095 for (i
= 0; i
< nParams
; i
++) {
3096 n
[3 + i
].f
= params
[i
];
3099 if (ctx
->ExecuteFlag
) {
3100 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3105 static void GLAPIENTRY
3106 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3110 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3111 save_Lightfv(light
, pname
, parray
);
3115 static void GLAPIENTRY
3116 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3123 fparam
[0] = INT_TO_FLOAT(params
[0]);
3124 fparam
[1] = INT_TO_FLOAT(params
[1]);
3125 fparam
[2] = INT_TO_FLOAT(params
[2]);
3126 fparam
[3] = INT_TO_FLOAT(params
[3]);
3129 fparam
[0] = (GLfloat
) params
[0];
3130 fparam
[1] = (GLfloat
) params
[1];
3131 fparam
[2] = (GLfloat
) params
[2];
3132 fparam
[3] = (GLfloat
) params
[3];
3134 case GL_SPOT_DIRECTION
:
3135 fparam
[0] = (GLfloat
) params
[0];
3136 fparam
[1] = (GLfloat
) params
[1];
3137 fparam
[2] = (GLfloat
) params
[2];
3139 case GL_SPOT_EXPONENT
:
3140 case GL_SPOT_CUTOFF
:
3141 case GL_CONSTANT_ATTENUATION
:
3142 case GL_LINEAR_ATTENUATION
:
3143 case GL_QUADRATIC_ATTENUATION
:
3144 fparam
[0] = (GLfloat
) params
[0];
3147 /* error will be caught later in gl_Lightfv */
3150 save_Lightfv(light
, pname
, fparam
);
3154 static void GLAPIENTRY
3155 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3159 parray
[1] = parray
[2] = parray
[3] = 0;
3160 save_Lightiv(light
, pname
, parray
);
3164 static void GLAPIENTRY
3165 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3167 GET_CURRENT_CONTEXT(ctx
);
3169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3170 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3178 if (ctx
->ExecuteFlag
) {
3179 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3184 static void GLAPIENTRY
3185 save_LightModelf(GLenum pname
, GLfloat param
)
3189 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3190 save_LightModelfv(pname
, parray
);
3194 static void GLAPIENTRY
3195 save_LightModeliv(GLenum pname
, const GLint
*params
)
3199 case GL_LIGHT_MODEL_AMBIENT
:
3200 fparam
[0] = INT_TO_FLOAT(params
[0]);
3201 fparam
[1] = INT_TO_FLOAT(params
[1]);
3202 fparam
[2] = INT_TO_FLOAT(params
[2]);
3203 fparam
[3] = INT_TO_FLOAT(params
[3]);
3205 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3206 case GL_LIGHT_MODEL_TWO_SIDE
:
3207 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3208 fparam
[0] = (GLfloat
) params
[0];
3214 /* Error will be caught later in gl_LightModelfv */
3215 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3217 save_LightModelfv(pname
, fparam
);
3221 static void GLAPIENTRY
3222 save_LightModeli(GLenum pname
, GLint param
)
3226 parray
[1] = parray
[2] = parray
[3] = 0;
3227 save_LightModeliv(pname
, parray
);
3231 static void GLAPIENTRY
3232 save_LineStipple(GLint factor
, GLushort pattern
)
3234 GET_CURRENT_CONTEXT(ctx
);
3236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3237 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3242 if (ctx
->ExecuteFlag
) {
3243 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3248 static void GLAPIENTRY
3249 save_LineWidth(GLfloat width
)
3251 GET_CURRENT_CONTEXT(ctx
);
3253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3254 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_LineWidth(ctx
->Exec
, (width
));
3264 static void GLAPIENTRY
3265 save_ListBase(GLuint base
)
3267 GET_CURRENT_CONTEXT(ctx
);
3269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3270 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3274 if (ctx
->ExecuteFlag
) {
3275 CALL_ListBase(ctx
->Exec
, (base
));
3280 static void GLAPIENTRY
3281 save_LoadIdentity(void)
3283 GET_CURRENT_CONTEXT(ctx
);
3284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3285 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3286 if (ctx
->ExecuteFlag
) {
3287 CALL_LoadIdentity(ctx
->Exec
, ());
3292 static void GLAPIENTRY
3293 save_LoadMatrixf(const GLfloat
* m
)
3295 GET_CURRENT_CONTEXT(ctx
);
3297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3298 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3301 for (i
= 0; i
< 16; i
++) {
3305 if (ctx
->ExecuteFlag
) {
3306 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3311 static void GLAPIENTRY
3312 save_LoadMatrixd(const GLdouble
* m
)
3316 for (i
= 0; i
< 16; i
++) {
3317 f
[i
] = (GLfloat
) m
[i
];
3319 save_LoadMatrixf(f
);
3323 static void GLAPIENTRY
3324 save_LoadName(GLuint name
)
3326 GET_CURRENT_CONTEXT(ctx
);
3328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3329 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3333 if (ctx
->ExecuteFlag
) {
3334 CALL_LoadName(ctx
->Exec
, (name
));
3339 static void GLAPIENTRY
3340 save_LogicOp(GLenum opcode
)
3342 GET_CURRENT_CONTEXT(ctx
);
3344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3345 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3349 if (ctx
->ExecuteFlag
) {
3350 CALL_LogicOp(ctx
->Exec
, (opcode
));
3355 static void GLAPIENTRY
3356 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3357 GLint order
, const GLdouble
* points
)
3359 GET_CURRENT_CONTEXT(ctx
);
3361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3362 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3364 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3366 n
[2].f
= (GLfloat
) u1
;
3367 n
[3].f
= (GLfloat
) u2
;
3368 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3370 save_pointer(&n
[6], pnts
);
3372 if (ctx
->ExecuteFlag
) {
3373 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3377 static void GLAPIENTRY
3378 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3379 GLint order
, const GLfloat
* points
)
3381 GET_CURRENT_CONTEXT(ctx
);
3383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3384 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3386 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3390 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3392 save_pointer(&n
[6], pnts
);
3394 if (ctx
->ExecuteFlag
) {
3395 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3400 static void GLAPIENTRY
3401 save_Map2d(GLenum target
,
3402 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3403 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3404 const GLdouble
* points
)
3406 GET_CURRENT_CONTEXT(ctx
);
3408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3409 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3411 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3412 vstride
, vorder
, points
);
3414 n
[2].f
= (GLfloat
) u1
;
3415 n
[3].f
= (GLfloat
) u2
;
3416 n
[4].f
= (GLfloat
) v1
;
3417 n
[5].f
= (GLfloat
) v2
;
3418 /* XXX verify these strides are correct */
3419 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3420 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3423 save_pointer(&n
[10], pnts
);
3425 if (ctx
->ExecuteFlag
) {
3426 CALL_Map2d(ctx
->Exec
, (target
,
3427 u1
, u2
, ustride
, uorder
,
3428 v1
, v2
, vstride
, vorder
, points
));
3433 static void GLAPIENTRY
3434 save_Map2f(GLenum target
,
3435 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3436 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3437 const GLfloat
* points
)
3439 GET_CURRENT_CONTEXT(ctx
);
3441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3442 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3444 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3445 vstride
, vorder
, points
);
3451 /* XXX verify these strides are correct */
3452 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3453 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3456 save_pointer(&n
[10], pnts
);
3458 if (ctx
->ExecuteFlag
) {
3459 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3460 v1
, v2
, vstride
, vorder
, points
));
3465 static void GLAPIENTRY
3466 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3468 GET_CURRENT_CONTEXT(ctx
);
3470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3471 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3477 if (ctx
->ExecuteFlag
) {
3478 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3483 static void GLAPIENTRY
3484 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3486 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3490 static void GLAPIENTRY
3491 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3492 GLint vn
, GLfloat v1
, GLfloat v2
)
3494 GET_CURRENT_CONTEXT(ctx
);
3496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3497 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3506 if (ctx
->ExecuteFlag
) {
3507 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3513 static void GLAPIENTRY
3514 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3515 GLint vn
, GLdouble v1
, GLdouble v2
)
3517 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3518 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3522 static void GLAPIENTRY
3523 save_MatrixMode(GLenum mode
)
3525 GET_CURRENT_CONTEXT(ctx
);
3527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3528 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3532 if (ctx
->ExecuteFlag
) {
3533 CALL_MatrixMode(ctx
->Exec
, (mode
));
3538 static void GLAPIENTRY
3539 save_MultMatrixf(const GLfloat
* m
)
3541 GET_CURRENT_CONTEXT(ctx
);
3543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3544 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3547 for (i
= 0; i
< 16; i
++) {
3551 if (ctx
->ExecuteFlag
) {
3552 CALL_MultMatrixf(ctx
->Exec
, (m
));
3557 static void GLAPIENTRY
3558 save_MultMatrixd(const GLdouble
* m
)
3562 for (i
= 0; i
< 16; i
++) {
3563 f
[i
] = (GLfloat
) m
[i
];
3565 save_MultMatrixf(f
);
3569 static void GLAPIENTRY
3570 save_NewList(GLuint name
, GLenum mode
)
3572 GET_CURRENT_CONTEXT(ctx
);
3573 /* It's an error to call this function while building a display list */
3574 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3581 static void GLAPIENTRY
3582 save_Ortho(GLdouble left
, GLdouble right
,
3583 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3585 GET_CURRENT_CONTEXT(ctx
);
3587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3588 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3590 n
[1].f
= (GLfloat
) left
;
3591 n
[2].f
= (GLfloat
) right
;
3592 n
[3].f
= (GLfloat
) bottom
;
3593 n
[4].f
= (GLfloat
) top
;
3594 n
[5].f
= (GLfloat
) nearval
;
3595 n
[6].f
= (GLfloat
) farval
;
3597 if (ctx
->ExecuteFlag
) {
3598 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3603 static void GLAPIENTRY
3604 save_PatchParameteri(GLenum pname
, const GLint value
)
3606 GET_CURRENT_CONTEXT(ctx
);
3608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3609 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3614 if (ctx
->ExecuteFlag
) {
3615 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3620 static void GLAPIENTRY
3621 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3623 GET_CURRENT_CONTEXT(ctx
);
3625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3627 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3628 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3630 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3631 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3635 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3645 if (ctx
->ExecuteFlag
) {
3646 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3651 static void GLAPIENTRY
3652 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3654 GET_CURRENT_CONTEXT(ctx
);
3656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3657 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3661 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3663 if (ctx
->ExecuteFlag
) {
3664 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3669 static void GLAPIENTRY
3670 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3672 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3674 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3675 for (i
= 0; i
< mapsize
; i
++) {
3676 fvalues
[i
] = (GLfloat
) values
[i
];
3680 for (i
= 0; i
< mapsize
; i
++) {
3681 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3684 save_PixelMapfv(map
, mapsize
, fvalues
);
3688 static void GLAPIENTRY
3689 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3691 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3693 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3694 for (i
= 0; i
< mapsize
; i
++) {
3695 fvalues
[i
] = (GLfloat
) values
[i
];
3699 for (i
= 0; i
< mapsize
; i
++) {
3700 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3703 save_PixelMapfv(map
, mapsize
, fvalues
);
3707 static void GLAPIENTRY
3708 save_PixelTransferf(GLenum pname
, GLfloat param
)
3710 GET_CURRENT_CONTEXT(ctx
);
3712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3713 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3718 if (ctx
->ExecuteFlag
) {
3719 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3724 static void GLAPIENTRY
3725 save_PixelTransferi(GLenum pname
, GLint param
)
3727 save_PixelTransferf(pname
, (GLfloat
) param
);
3731 static void GLAPIENTRY
3732 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3734 GET_CURRENT_CONTEXT(ctx
);
3736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3737 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3742 if (ctx
->ExecuteFlag
) {
3743 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3748 static void GLAPIENTRY
3749 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3751 GET_CURRENT_CONTEXT(ctx
);
3753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3754 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3761 if (ctx
->ExecuteFlag
) {
3762 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3767 static void GLAPIENTRY
3768 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3772 parray
[1] = parray
[2] = 0.0F
;
3773 save_PointParameterfvEXT(pname
, parray
);
3776 static void GLAPIENTRY
3777 save_PointParameteriNV(GLenum pname
, GLint param
)
3780 parray
[0] = (GLfloat
) param
;
3781 parray
[1] = parray
[2] = 0.0F
;
3782 save_PointParameterfvEXT(pname
, parray
);
3785 static void GLAPIENTRY
3786 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3789 parray
[0] = (GLfloat
) param
[0];
3790 parray
[1] = parray
[2] = 0.0F
;
3791 save_PointParameterfvEXT(pname
, parray
);
3795 static void GLAPIENTRY
3796 save_PointSize(GLfloat size
)
3798 GET_CURRENT_CONTEXT(ctx
);
3800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3801 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3805 if (ctx
->ExecuteFlag
) {
3806 CALL_PointSize(ctx
->Exec
, (size
));
3811 static void GLAPIENTRY
3812 save_PolygonMode(GLenum face
, GLenum mode
)
3814 GET_CURRENT_CONTEXT(ctx
);
3816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3817 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3822 if (ctx
->ExecuteFlag
) {
3823 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3828 static void GLAPIENTRY
3829 save_PolygonStipple(const GLubyte
* pattern
)
3831 GET_CURRENT_CONTEXT(ctx
);
3834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3836 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3839 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3840 pattern
, &ctx
->Unpack
));
3842 if (ctx
->ExecuteFlag
) {
3843 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3848 static void GLAPIENTRY
3849 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3851 GET_CURRENT_CONTEXT(ctx
);
3853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3854 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3859 if (ctx
->ExecuteFlag
) {
3860 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3865 static void GLAPIENTRY
3866 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3868 GET_CURRENT_CONTEXT(ctx
);
3870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3871 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3877 if (ctx
->ExecuteFlag
) {
3878 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3882 static void GLAPIENTRY
3883 save_PopAttrib(void)
3885 GET_CURRENT_CONTEXT(ctx
);
3886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3887 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3888 if (ctx
->ExecuteFlag
) {
3889 CALL_PopAttrib(ctx
->Exec
, ());
3894 static void GLAPIENTRY
3895 save_PopMatrix(void)
3897 GET_CURRENT_CONTEXT(ctx
);
3898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3899 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3900 if (ctx
->ExecuteFlag
) {
3901 CALL_PopMatrix(ctx
->Exec
, ());
3906 static void GLAPIENTRY
3909 GET_CURRENT_CONTEXT(ctx
);
3910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3911 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3912 if (ctx
->ExecuteFlag
) {
3913 CALL_PopName(ctx
->Exec
, ());
3918 static void GLAPIENTRY
3919 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3920 const GLclampf
* priorities
)
3922 GET_CURRENT_CONTEXT(ctx
);
3924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3926 for (i
= 0; i
< num
; i
++) {
3928 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3930 n
[1].ui
= textures
[i
];
3931 n
[2].f
= priorities
[i
];
3934 if (ctx
->ExecuteFlag
) {
3935 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3940 static void GLAPIENTRY
3941 save_PushAttrib(GLbitfield mask
)
3943 GET_CURRENT_CONTEXT(ctx
);
3945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3946 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3950 if (ctx
->ExecuteFlag
) {
3951 CALL_PushAttrib(ctx
->Exec
, (mask
));
3956 static void GLAPIENTRY
3957 save_PushMatrix(void)
3959 GET_CURRENT_CONTEXT(ctx
);
3960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3961 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3962 if (ctx
->ExecuteFlag
) {
3963 CALL_PushMatrix(ctx
->Exec
, ());
3968 static void GLAPIENTRY
3969 save_PushName(GLuint name
)
3971 GET_CURRENT_CONTEXT(ctx
);
3973 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3974 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3978 if (ctx
->ExecuteFlag
) {
3979 CALL_PushName(ctx
->Exec
, (name
));
3984 static void GLAPIENTRY
3985 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3987 GET_CURRENT_CONTEXT(ctx
);
3989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3990 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3997 if (ctx
->ExecuteFlag
) {
3998 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
4002 static void GLAPIENTRY
4003 save_RasterPos2d(GLdouble x
, GLdouble y
)
4005 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4008 static void GLAPIENTRY
4009 save_RasterPos2f(GLfloat x
, GLfloat y
)
4011 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4014 static void GLAPIENTRY
4015 save_RasterPos2i(GLint x
, GLint y
)
4017 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4020 static void GLAPIENTRY
4021 save_RasterPos2s(GLshort x
, GLshort y
)
4023 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
4026 static void GLAPIENTRY
4027 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
4029 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4032 static void GLAPIENTRY
4033 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
4035 save_RasterPos4f(x
, y
, z
, 1.0F
);
4038 static void GLAPIENTRY
4039 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
4041 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4044 static void GLAPIENTRY
4045 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
4047 save_RasterPos4f(x
, y
, z
, 1.0F
);
4050 static void GLAPIENTRY
4051 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4053 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4056 static void GLAPIENTRY
4057 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
4059 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4062 static void GLAPIENTRY
4063 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4065 save_RasterPos4f(x
, y
, z
, w
);
4068 static void GLAPIENTRY
4069 save_RasterPos2dv(const GLdouble
* v
)
4071 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4074 static void GLAPIENTRY
4075 save_RasterPos2fv(const GLfloat
* v
)
4077 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4080 static void GLAPIENTRY
4081 save_RasterPos2iv(const GLint
* v
)
4083 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4086 static void GLAPIENTRY
4087 save_RasterPos2sv(const GLshort
* v
)
4089 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4092 static void GLAPIENTRY
4093 save_RasterPos3dv(const GLdouble
* v
)
4095 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4098 static void GLAPIENTRY
4099 save_RasterPos3fv(const GLfloat
* v
)
4101 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4104 static void GLAPIENTRY
4105 save_RasterPos3iv(const GLint
* v
)
4107 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4110 static void GLAPIENTRY
4111 save_RasterPos3sv(const GLshort
* v
)
4113 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4116 static void GLAPIENTRY
4117 save_RasterPos4dv(const GLdouble
* v
)
4119 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4120 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4123 static void GLAPIENTRY
4124 save_RasterPos4fv(const GLfloat
* v
)
4126 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4129 static void GLAPIENTRY
4130 save_RasterPos4iv(const GLint
* v
)
4132 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4133 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4136 static void GLAPIENTRY
4137 save_RasterPos4sv(const GLshort
* v
)
4139 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4143 static void GLAPIENTRY
4144 save_PassThrough(GLfloat token
)
4146 GET_CURRENT_CONTEXT(ctx
);
4148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4149 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4153 if (ctx
->ExecuteFlag
) {
4154 CALL_PassThrough(ctx
->Exec
, (token
));
4159 static void GLAPIENTRY
4160 save_ReadBuffer(GLenum mode
)
4162 GET_CURRENT_CONTEXT(ctx
);
4164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4165 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4169 if (ctx
->ExecuteFlag
) {
4170 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4175 static void GLAPIENTRY
4176 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4178 GET_CURRENT_CONTEXT(ctx
);
4180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4181 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4188 if (ctx
->ExecuteFlag
) {
4189 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4194 static void GLAPIENTRY
4195 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4197 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4201 static void GLAPIENTRY
4202 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4204 GET_CURRENT_CONTEXT(ctx
);
4206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4207 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4213 if (ctx
->ExecuteFlag
) {
4214 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4219 static void GLAPIENTRY
4220 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4222 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4226 static void GLAPIENTRY
4227 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4229 GET_CURRENT_CONTEXT(ctx
);
4231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4232 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4239 if (ctx
->ExecuteFlag
) {
4240 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4245 static void GLAPIENTRY
4246 save_ShadeModel(GLenum mode
)
4248 GET_CURRENT_CONTEXT(ctx
);
4250 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4252 if (ctx
->ExecuteFlag
) {
4253 CALL_ShadeModel(ctx
->Exec
, (mode
));
4256 /* Don't compile this call if it's a no-op.
4257 * By avoiding this state change we have a better chance of
4258 * coalescing subsequent drawing commands into one batch.
4260 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4263 SAVE_FLUSH_VERTICES(ctx
);
4265 ctx
->ListState
.Current
.ShadeModel
= mode
;
4267 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4274 static void GLAPIENTRY
4275 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4277 GET_CURRENT_CONTEXT(ctx
);
4279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4280 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4286 if (ctx
->ExecuteFlag
) {
4287 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4292 static void GLAPIENTRY
4293 save_StencilMask(GLuint mask
)
4295 GET_CURRENT_CONTEXT(ctx
);
4297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4298 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4302 if (ctx
->ExecuteFlag
) {
4303 CALL_StencilMask(ctx
->Exec
, (mask
));
4308 static void GLAPIENTRY
4309 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4311 GET_CURRENT_CONTEXT(ctx
);
4313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4314 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4320 if (ctx
->ExecuteFlag
) {
4321 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4326 static void GLAPIENTRY
4327 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4329 GET_CURRENT_CONTEXT(ctx
);
4331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4332 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4339 if (ctx
->ExecuteFlag
) {
4340 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4345 static void GLAPIENTRY
4346 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4349 GET_CURRENT_CONTEXT(ctx
);
4351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4353 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4361 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4368 if (ctx
->ExecuteFlag
) {
4369 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4370 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4375 static void GLAPIENTRY
4376 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4378 GET_CURRENT_CONTEXT(ctx
);
4380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4381 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4386 if (ctx
->ExecuteFlag
) {
4387 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4392 static void GLAPIENTRY
4393 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4395 GET_CURRENT_CONTEXT(ctx
);
4397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4398 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4405 if (ctx
->ExecuteFlag
) {
4406 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4411 static void GLAPIENTRY
4412 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4414 GET_CURRENT_CONTEXT(ctx
);
4416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4417 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4421 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4429 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4432 if (ctx
->ExecuteFlag
) {
4433 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4438 static void GLAPIENTRY
4439 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4442 parray
[0] = (GLfloat
) param
;
4443 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4444 save_TexEnvfv(target
, pname
, parray
);
4448 static void GLAPIENTRY
4449 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4452 p
[0] = (GLfloat
) param
;
4453 p
[1] = p
[2] = p
[3] = 0.0F
;
4454 save_TexEnvfv(target
, pname
, p
);
4458 static void GLAPIENTRY
4459 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4462 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4463 p
[0] = INT_TO_FLOAT(param
[0]);
4464 p
[1] = INT_TO_FLOAT(param
[1]);
4465 p
[2] = INT_TO_FLOAT(param
[2]);
4466 p
[3] = INT_TO_FLOAT(param
[3]);
4469 p
[0] = (GLfloat
) param
[0];
4470 p
[1] = p
[2] = p
[3] = 0.0F
;
4472 save_TexEnvfv(target
, pname
, p
);
4476 static void GLAPIENTRY
4477 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4479 GET_CURRENT_CONTEXT(ctx
);
4481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4482 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4491 if (ctx
->ExecuteFlag
) {
4492 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4497 static void GLAPIENTRY
4498 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4501 p
[0] = (GLfloat
) params
[0];
4502 p
[1] = (GLfloat
) params
[1];
4503 p
[2] = (GLfloat
) params
[2];
4504 p
[3] = (GLfloat
) params
[3];
4505 save_TexGenfv(coord
, pname
, p
);
4509 static void GLAPIENTRY
4510 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4513 parray
[0] = (GLfloat
) param
;
4514 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4515 save_TexGenfv(coord
, pname
, parray
);
4519 static void GLAPIENTRY
4520 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4523 p
[0] = (GLfloat
) params
[0];
4524 p
[1] = (GLfloat
) params
[1];
4525 p
[2] = (GLfloat
) params
[2];
4526 p
[3] = (GLfloat
) params
[3];
4527 save_TexGenfv(coord
, pname
, p
);
4531 static void GLAPIENTRY
4532 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4536 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4537 save_TexGenfv(coord
, pname
, parray
);
4541 static void GLAPIENTRY
4542 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4546 parray
[1] = parray
[2] = parray
[3] = 0;
4547 save_TexGeniv(coord
, pname
, parray
);
4551 static void GLAPIENTRY
4552 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4554 GET_CURRENT_CONTEXT(ctx
);
4556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4557 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4566 if (ctx
->ExecuteFlag
) {
4567 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4572 static void GLAPIENTRY
4573 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4577 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4578 save_TexParameterfv(target
, pname
, parray
);
4582 static void GLAPIENTRY
4583 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4586 fparam
[0] = (GLfloat
) param
;
4587 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4588 save_TexParameterfv(target
, pname
, fparam
);
4592 static void GLAPIENTRY
4593 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4596 fparam
[0] = (GLfloat
) params
[0];
4597 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4598 save_TexParameterfv(target
, pname
, fparam
);
4602 static void GLAPIENTRY
4603 save_TexImage1D(GLenum target
,
4604 GLint level
, GLint components
,
4605 GLsizei width
, GLint border
,
4606 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4608 GET_CURRENT_CONTEXT(ctx
);
4609 if (target
== GL_PROXY_TEXTURE_1D
) {
4610 /* don't compile, execute immediately */
4611 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4612 border
, format
, type
, pixels
));
4616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4617 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4621 n
[3].i
= components
;
4622 n
[4].i
= (GLint
) width
;
4627 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4628 pixels
, &ctx
->Unpack
));
4630 if (ctx
->ExecuteFlag
) {
4631 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4632 border
, format
, type
, pixels
));
4638 static void GLAPIENTRY
4639 save_TexImage2D(GLenum target
,
4640 GLint level
, GLint components
,
4641 GLsizei width
, GLsizei height
, GLint border
,
4642 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4644 GET_CURRENT_CONTEXT(ctx
);
4645 if (target
== GL_PROXY_TEXTURE_2D
) {
4646 /* don't compile, execute immediately */
4647 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4648 height
, border
, format
, type
, pixels
));
4652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4653 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4657 n
[3].i
= components
;
4658 n
[4].i
= (GLint
) width
;
4659 n
[5].i
= (GLint
) height
;
4664 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4665 pixels
, &ctx
->Unpack
));
4667 if (ctx
->ExecuteFlag
) {
4668 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4669 height
, border
, format
, type
, pixels
));
4675 static void GLAPIENTRY
4676 save_TexImage3D(GLenum target
,
4677 GLint level
, GLint internalFormat
,
4678 GLsizei width
, GLsizei height
, GLsizei depth
,
4680 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4682 GET_CURRENT_CONTEXT(ctx
);
4683 if (target
== GL_PROXY_TEXTURE_3D
) {
4684 /* don't compile, execute immediately */
4685 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4686 height
, depth
, border
, format
, type
,
4691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4692 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4696 n
[3].i
= (GLint
) internalFormat
;
4697 n
[4].i
= (GLint
) width
;
4698 n
[5].i
= (GLint
) height
;
4699 n
[6].i
= (GLint
) depth
;
4703 save_pointer(&n
[10],
4704 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4705 pixels
, &ctx
->Unpack
));
4707 if (ctx
->ExecuteFlag
) {
4708 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4709 height
, depth
, border
, format
, type
,
4716 static void GLAPIENTRY
4717 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4718 GLsizei width
, GLenum format
, GLenum type
,
4719 const GLvoid
* pixels
)
4721 GET_CURRENT_CONTEXT(ctx
);
4724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4726 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4731 n
[4].i
= (GLint
) width
;
4735 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4736 pixels
, &ctx
->Unpack
));
4738 if (ctx
->ExecuteFlag
) {
4739 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4740 format
, type
, pixels
));
4745 static void GLAPIENTRY
4746 save_TexSubImage2D(GLenum target
, GLint level
,
4747 GLint xoffset
, GLint yoffset
,
4748 GLsizei width
, GLsizei height
,
4749 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4751 GET_CURRENT_CONTEXT(ctx
);
4754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4756 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4762 n
[5].i
= (GLint
) width
;
4763 n
[6].i
= (GLint
) height
;
4767 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4768 pixels
, &ctx
->Unpack
));
4770 if (ctx
->ExecuteFlag
) {
4771 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4772 width
, height
, format
, type
, pixels
));
4777 static void GLAPIENTRY
4778 save_TexSubImage3D(GLenum target
, GLint level
,
4779 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4780 GLsizei width
, GLsizei height
, GLsizei depth
,
4781 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4783 GET_CURRENT_CONTEXT(ctx
);
4786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4788 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4795 n
[6].i
= (GLint
) width
;
4796 n
[7].i
= (GLint
) height
;
4797 n
[8].i
= (GLint
) depth
;
4800 save_pointer(&n
[11],
4801 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4802 pixels
, &ctx
->Unpack
));
4804 if (ctx
->ExecuteFlag
) {
4805 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4806 xoffset
, yoffset
, zoffset
,
4807 width
, height
, depth
, format
, type
,
4813 static void GLAPIENTRY
4814 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4816 GET_CURRENT_CONTEXT(ctx
);
4818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4819 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4825 if (ctx
->ExecuteFlag
) {
4826 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4831 static void GLAPIENTRY
4832 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4834 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4839 static void GLAPIENTRY
4840 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4842 GET_CURRENT_CONTEXT(ctx
);
4844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4845 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4849 n
[3].i
= (GLint
) width
;
4850 n
[4].i
= (GLint
) height
;
4852 if (ctx
->ExecuteFlag
) {
4853 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4857 static void GLAPIENTRY
4858 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4861 GET_CURRENT_CONTEXT(ctx
);
4863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4864 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4872 if (ctx
->ExecuteFlag
) {
4873 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4877 static void GLAPIENTRY
4878 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4880 GET_CURRENT_CONTEXT(ctx
);
4882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4883 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4891 if (ctx
->ExecuteFlag
) {
4892 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4896 static void GLAPIENTRY
4897 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4899 GET_CURRENT_CONTEXT(ctx
);
4901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4902 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4906 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4908 if (ctx
->ExecuteFlag
) {
4909 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4913 static void GLAPIENTRY
4914 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4917 GET_CURRENT_CONTEXT(ctx
);
4919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4920 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4928 if (ctx
->ExecuteFlag
) {
4929 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4933 static void GLAPIENTRY
4934 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4936 GET_CURRENT_CONTEXT(ctx
);
4938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4939 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4947 if (ctx
->ExecuteFlag
) {
4948 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4952 static void GLAPIENTRY
4953 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4955 GET_CURRENT_CONTEXT(ctx
);
4957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4958 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4962 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4964 if (ctx
->ExecuteFlag
) {
4965 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4969 static void GLAPIENTRY
4970 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4972 GET_CURRENT_CONTEXT(ctx
);
4974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4975 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4978 /* Mesa stores these as floats internally so we deliberately convert
4979 * them to a float here.
4984 if (ctx
->ExecuteFlag
) {
4985 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4989 static void GLAPIENTRY
4990 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4992 GET_CURRENT_CONTEXT(ctx
);
4994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4995 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4999 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
5001 if (ctx
->ExecuteFlag
) {
5002 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
5006 static void GLAPIENTRY
5007 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5009 GET_CURRENT_CONTEXT(ctx
);
5011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5012 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
5019 if (ctx
->ExecuteFlag
) {
5020 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
5024 static void GLAPIENTRY
5025 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
5027 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5030 static void GLAPIENTRY
5031 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
5033 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5036 static void GLAPIENTRY
5037 save_WindowPos2iMESA(GLint x
, GLint y
)
5039 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
5042 static void GLAPIENTRY
5043 save_WindowPos2sMESA(GLshort x
, GLshort y
)
5045 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
5048 static void GLAPIENTRY
5049 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
5051 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5054 static void GLAPIENTRY
5055 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
5057 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5060 static void GLAPIENTRY
5061 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
5063 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
5066 static void GLAPIENTRY
5067 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
5069 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5072 static void GLAPIENTRY
5073 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5075 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5078 static void GLAPIENTRY
5079 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
5081 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5084 static void GLAPIENTRY
5085 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
5087 save_WindowPos4fMESA(x
, y
, z
, w
);
5090 static void GLAPIENTRY
5091 save_WindowPos2dvMESA(const GLdouble
* v
)
5093 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5096 static void GLAPIENTRY
5097 save_WindowPos2fvMESA(const GLfloat
* v
)
5099 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5102 static void GLAPIENTRY
5103 save_WindowPos2ivMESA(const GLint
* v
)
5105 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5108 static void GLAPIENTRY
5109 save_WindowPos2svMESA(const GLshort
* v
)
5111 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5114 static void GLAPIENTRY
5115 save_WindowPos3dvMESA(const GLdouble
* v
)
5117 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5120 static void GLAPIENTRY
5121 save_WindowPos3fvMESA(const GLfloat
* v
)
5123 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5126 static void GLAPIENTRY
5127 save_WindowPos3ivMESA(const GLint
* v
)
5129 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5132 static void GLAPIENTRY
5133 save_WindowPos3svMESA(const GLshort
* v
)
5135 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5138 static void GLAPIENTRY
5139 save_WindowPos4dvMESA(const GLdouble
* v
)
5141 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5142 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5145 static void GLAPIENTRY
5146 save_WindowPos4fvMESA(const GLfloat
* v
)
5148 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5151 static void GLAPIENTRY
5152 save_WindowPos4ivMESA(const GLint
* v
)
5154 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5155 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5158 static void GLAPIENTRY
5159 save_WindowPos4svMESA(const GLshort
* v
)
5161 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5166 /* GL_ARB_multitexture */
5167 static void GLAPIENTRY
5168 save_ActiveTextureARB(GLenum target
)
5170 GET_CURRENT_CONTEXT(ctx
);
5172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5173 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5177 if (ctx
->ExecuteFlag
) {
5178 CALL_ActiveTexture(ctx
->Exec
, (target
));
5183 /* GL_ARB_transpose_matrix */
5185 static void GLAPIENTRY
5186 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5189 _math_transposefd(tm
, m
);
5190 save_LoadMatrixf(tm
);
5194 static void GLAPIENTRY
5195 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5198 _math_transposef(tm
, m
);
5199 save_LoadMatrixf(tm
);
5203 static void GLAPIENTRY
5204 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5207 _math_transposefd(tm
, m
);
5208 save_MultMatrixf(tm
);
5212 static void GLAPIENTRY
5213 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5216 _math_transposef(tm
, m
);
5217 save_MultMatrixf(tm
);
5220 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5222 GET_CURRENT_CONTEXT(ctx
);
5228 image
= malloc(size
);
5230 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5233 memcpy(image
, data
, size
);
5239 /* GL_ARB_texture_compression */
5240 static void GLAPIENTRY
5241 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5242 GLenum internalFormat
, GLsizei width
,
5243 GLint border
, GLsizei imageSize
,
5244 const GLvoid
* data
)
5246 GET_CURRENT_CONTEXT(ctx
);
5247 if (target
== GL_PROXY_TEXTURE_1D
) {
5248 /* don't compile, execute immediately */
5249 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5250 width
, border
, imageSize
,
5255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5257 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5258 6 + POINTER_DWORDS
);
5262 n
[3].e
= internalFormat
;
5263 n
[4].i
= (GLint
) width
;
5267 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5269 if (ctx
->ExecuteFlag
) {
5270 CALL_CompressedTexImage1D(ctx
->Exec
,
5271 (target
, level
, internalFormat
, width
,
5272 border
, imageSize
, data
));
5278 static void GLAPIENTRY
5279 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5280 GLenum internalFormat
, GLsizei width
,
5281 GLsizei height
, GLint border
, GLsizei imageSize
,
5282 const GLvoid
* data
)
5284 GET_CURRENT_CONTEXT(ctx
);
5285 if (target
== GL_PROXY_TEXTURE_2D
) {
5286 /* don't compile, execute immediately */
5287 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5288 width
, height
, border
,
5293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5295 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5296 7 + POINTER_DWORDS
);
5300 n
[3].e
= internalFormat
;
5301 n
[4].i
= (GLint
) width
;
5302 n
[5].i
= (GLint
) height
;
5306 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5308 if (ctx
->ExecuteFlag
) {
5309 CALL_CompressedTexImage2D(ctx
->Exec
,
5310 (target
, level
, internalFormat
, width
,
5311 height
, border
, imageSize
, data
));
5317 static void GLAPIENTRY
5318 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5319 GLenum internalFormat
, GLsizei width
,
5320 GLsizei height
, GLsizei depth
, GLint border
,
5321 GLsizei imageSize
, const GLvoid
* data
)
5323 GET_CURRENT_CONTEXT(ctx
);
5324 if (target
== GL_PROXY_TEXTURE_3D
) {
5325 /* don't compile, execute immediately */
5326 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5327 width
, height
, depth
, border
,
5332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5334 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5335 8 + POINTER_DWORDS
);
5339 n
[3].e
= internalFormat
;
5340 n
[4].i
= (GLint
) width
;
5341 n
[5].i
= (GLint
) height
;
5342 n
[6].i
= (GLint
) depth
;
5346 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5348 if (ctx
->ExecuteFlag
) {
5349 CALL_CompressedTexImage3D(ctx
->Exec
,
5350 (target
, level
, internalFormat
, width
,
5351 height
, depth
, border
, imageSize
,
5358 static void GLAPIENTRY
5359 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5360 GLsizei width
, GLenum format
,
5361 GLsizei imageSize
, const GLvoid
* data
)
5364 GET_CURRENT_CONTEXT(ctx
);
5365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5367 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5368 6 + POINTER_DWORDS
);
5373 n
[4].i
= (GLint
) width
;
5377 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5379 if (ctx
->ExecuteFlag
) {
5380 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5381 width
, format
, imageSize
,
5387 static void GLAPIENTRY
5388 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5389 GLint yoffset
, GLsizei width
, GLsizei height
,
5390 GLenum format
, GLsizei imageSize
,
5391 const GLvoid
* data
)
5394 GET_CURRENT_CONTEXT(ctx
);
5395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5397 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5398 8 + POINTER_DWORDS
);
5404 n
[5].i
= (GLint
) width
;
5405 n
[6].i
= (GLint
) height
;
5409 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5411 if (ctx
->ExecuteFlag
) {
5412 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5413 (target
, level
, xoffset
, yoffset
, width
,
5414 height
, format
, imageSize
, data
));
5419 static void GLAPIENTRY
5420 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5421 GLint yoffset
, GLint zoffset
, GLsizei width
,
5422 GLsizei height
, GLsizei depth
, GLenum format
,
5423 GLsizei imageSize
, const GLvoid
* data
)
5426 GET_CURRENT_CONTEXT(ctx
);
5427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5429 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5430 10 + POINTER_DWORDS
);
5437 n
[6].i
= (GLint
) width
;
5438 n
[7].i
= (GLint
) height
;
5439 n
[8].i
= (GLint
) depth
;
5441 n
[10].i
= imageSize
;
5442 save_pointer(&n
[11],
5443 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5445 if (ctx
->ExecuteFlag
) {
5446 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5447 (target
, level
, xoffset
, yoffset
,
5448 zoffset
, width
, height
, depth
, format
,
5454 /* GL_ARB_multisample */
5455 static void GLAPIENTRY
5456 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5458 GET_CURRENT_CONTEXT(ctx
);
5460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5461 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5466 if (ctx
->ExecuteFlag
) {
5467 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5473 * GL_ARB_vertex_program
5475 static void GLAPIENTRY
5476 save_BindProgramARB(GLenum target
, GLuint id
)
5478 GET_CURRENT_CONTEXT(ctx
);
5480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5481 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5486 if (ctx
->ExecuteFlag
) {
5487 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5491 static void GLAPIENTRY
5492 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5493 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5495 GET_CURRENT_CONTEXT(ctx
);
5497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5498 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5507 if (ctx
->ExecuteFlag
) {
5508 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5513 static void GLAPIENTRY
5514 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5515 const GLfloat
*params
)
5517 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5518 params
[2], params
[3]);
5522 static void GLAPIENTRY
5523 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5524 const GLfloat
* params
)
5526 GET_CURRENT_CONTEXT(ctx
);
5528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5532 const GLfloat
* p
= params
;
5534 for (i
= 0 ; i
< count
; i
++) {
5535 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5548 if (ctx
->ExecuteFlag
) {
5549 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5554 static void GLAPIENTRY
5555 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5556 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5558 save_ProgramEnvParameter4fARB(target
, index
,
5560 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5564 static void GLAPIENTRY
5565 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5566 const GLdouble
*params
)
5568 save_ProgramEnvParameter4fARB(target
, index
,
5569 (GLfloat
) params
[0],
5570 (GLfloat
) params
[1],
5571 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5575 static void GLAPIENTRY
5576 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5577 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5579 GET_CURRENT_CONTEXT(ctx
);
5581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5582 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5591 if (ctx
->ExecuteFlag
) {
5592 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5597 static void GLAPIENTRY
5598 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5599 const GLfloat
*params
)
5601 GET_CURRENT_CONTEXT(ctx
);
5603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5604 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5613 if (ctx
->ExecuteFlag
) {
5614 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5619 static void GLAPIENTRY
5620 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5621 const GLfloat
*params
)
5623 GET_CURRENT_CONTEXT(ctx
);
5625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5629 const GLfloat
* p
= params
;
5631 for (i
= 0 ; i
< count
; i
++) {
5632 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5645 if (ctx
->ExecuteFlag
) {
5646 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5651 static void GLAPIENTRY
5652 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5653 GLdouble x
, GLdouble y
,
5654 GLdouble z
, GLdouble w
)
5656 GET_CURRENT_CONTEXT(ctx
);
5658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5659 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5663 n
[3].f
= (GLfloat
) x
;
5664 n
[4].f
= (GLfloat
) y
;
5665 n
[5].f
= (GLfloat
) z
;
5666 n
[6].f
= (GLfloat
) w
;
5668 if (ctx
->ExecuteFlag
) {
5669 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5674 static void GLAPIENTRY
5675 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5676 const GLdouble
*params
)
5678 GET_CURRENT_CONTEXT(ctx
);
5680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5681 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5685 n
[3].f
= (GLfloat
) params
[0];
5686 n
[4].f
= (GLfloat
) params
[1];
5687 n
[5].f
= (GLfloat
) params
[2];
5688 n
[6].f
= (GLfloat
) params
[3];
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5696 /* GL_EXT_stencil_two_side */
5697 static void GLAPIENTRY
5698 save_ActiveStencilFaceEXT(GLenum face
)
5700 GET_CURRENT_CONTEXT(ctx
);
5702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5703 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5707 if (ctx
->ExecuteFlag
) {
5708 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5713 /* GL_EXT_depth_bounds_test */
5714 static void GLAPIENTRY
5715 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5717 GET_CURRENT_CONTEXT(ctx
);
5719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5720 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5722 n
[1].f
= (GLfloat
) zmin
;
5723 n
[2].f
= (GLfloat
) zmax
;
5725 if (ctx
->ExecuteFlag
) {
5726 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5732 static void GLAPIENTRY
5733 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5734 const GLvoid
* string
)
5736 GET_CURRENT_CONTEXT(ctx
);
5739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5741 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5743 GLubyte
*programCopy
= malloc(len
);
5745 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5748 memcpy(programCopy
, string
, len
);
5752 save_pointer(&n
[4], programCopy
);
5754 if (ctx
->ExecuteFlag
) {
5755 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5760 static void GLAPIENTRY
5761 save_BeginQueryARB(GLenum target
, GLuint id
)
5763 GET_CURRENT_CONTEXT(ctx
);
5765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5766 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5771 if (ctx
->ExecuteFlag
) {
5772 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5776 static void GLAPIENTRY
5777 save_EndQueryARB(GLenum target
)
5779 GET_CURRENT_CONTEXT(ctx
);
5781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5782 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5786 if (ctx
->ExecuteFlag
) {
5787 CALL_EndQuery(ctx
->Exec
, (target
));
5791 static void GLAPIENTRY
5792 save_QueryCounter(GLuint id
, GLenum target
)
5794 GET_CURRENT_CONTEXT(ctx
);
5796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5797 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5802 if (ctx
->ExecuteFlag
) {
5803 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5807 static void GLAPIENTRY
5808 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5810 GET_CURRENT_CONTEXT(ctx
);
5812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5813 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5819 if (ctx
->ExecuteFlag
) {
5820 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5824 static void GLAPIENTRY
5825 save_EndQueryIndexed(GLenum target
, GLuint index
)
5827 GET_CURRENT_CONTEXT(ctx
);
5829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5830 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5835 if (ctx
->ExecuteFlag
) {
5836 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5841 static void GLAPIENTRY
5842 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5844 GET_CURRENT_CONTEXT(ctx
);
5846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5847 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5851 if (count
> MAX_DRAW_BUFFERS
)
5852 count
= MAX_DRAW_BUFFERS
;
5853 for (i
= 0; i
< count
; i
++) {
5854 n
[2 + i
].e
= buffers
[i
];
5857 if (ctx
->ExecuteFlag
) {
5858 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5862 static void GLAPIENTRY
5863 save_BindFragmentShaderATI(GLuint id
)
5865 GET_CURRENT_CONTEXT(ctx
);
5868 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5872 if (ctx
->ExecuteFlag
) {
5873 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5877 static void GLAPIENTRY
5878 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5880 GET_CURRENT_CONTEXT(ctx
);
5883 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5891 if (ctx
->ExecuteFlag
) {
5892 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5896 static void GLAPIENTRY
5897 save_Attr1fNV(GLenum attr
, GLfloat x
)
5899 GET_CURRENT_CONTEXT(ctx
);
5901 SAVE_FLUSH_VERTICES(ctx
);
5902 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5908 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5909 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5910 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5912 if (ctx
->ExecuteFlag
) {
5913 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5917 static void GLAPIENTRY
5918 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5920 GET_CURRENT_CONTEXT(ctx
);
5922 SAVE_FLUSH_VERTICES(ctx
);
5923 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5930 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5931 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5932 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5934 if (ctx
->ExecuteFlag
) {
5935 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5939 static void GLAPIENTRY
5940 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5942 GET_CURRENT_CONTEXT(ctx
);
5944 SAVE_FLUSH_VERTICES(ctx
);
5945 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5953 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5954 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5955 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5957 if (ctx
->ExecuteFlag
) {
5958 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5962 static void GLAPIENTRY
5963 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5965 GET_CURRENT_CONTEXT(ctx
);
5967 SAVE_FLUSH_VERTICES(ctx
);
5968 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5977 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5978 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5979 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5981 if (ctx
->ExecuteFlag
) {
5982 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5987 static void GLAPIENTRY
5988 save_Attr1fARB(GLenum attr
, GLfloat x
)
5990 GET_CURRENT_CONTEXT(ctx
);
5992 SAVE_FLUSH_VERTICES(ctx
);
5993 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5999 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
6000 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
6001 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
6003 if (ctx
->ExecuteFlag
) {
6004 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
6008 static void GLAPIENTRY
6009 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
6011 GET_CURRENT_CONTEXT(ctx
);
6013 SAVE_FLUSH_VERTICES(ctx
);
6014 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
6021 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
6022 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
6023 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
6025 if (ctx
->ExecuteFlag
) {
6026 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
6030 static void GLAPIENTRY
6031 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
6033 GET_CURRENT_CONTEXT(ctx
);
6035 SAVE_FLUSH_VERTICES(ctx
);
6036 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
6044 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
6045 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
6046 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
6048 if (ctx
->ExecuteFlag
) {
6049 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
6053 static void GLAPIENTRY
6054 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6056 GET_CURRENT_CONTEXT(ctx
);
6058 SAVE_FLUSH_VERTICES(ctx
);
6059 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
6068 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
6069 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
6070 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
6072 if (ctx
->ExecuteFlag
) {
6073 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
6078 static void GLAPIENTRY
6079 save_EvalCoord1f(GLfloat x
)
6081 GET_CURRENT_CONTEXT(ctx
);
6083 SAVE_FLUSH_VERTICES(ctx
);
6084 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
6088 if (ctx
->ExecuteFlag
) {
6089 CALL_EvalCoord1f(ctx
->Exec
, (x
));
6093 static void GLAPIENTRY
6094 save_EvalCoord1fv(const GLfloat
* v
)
6096 save_EvalCoord1f(v
[0]);
6099 static void GLAPIENTRY
6100 save_EvalCoord2f(GLfloat x
, GLfloat y
)
6102 GET_CURRENT_CONTEXT(ctx
);
6104 SAVE_FLUSH_VERTICES(ctx
);
6105 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
6110 if (ctx
->ExecuteFlag
) {
6111 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
6115 static void GLAPIENTRY
6116 save_EvalCoord2fv(const GLfloat
* v
)
6118 save_EvalCoord2f(v
[0], v
[1]);
6122 static void GLAPIENTRY
6123 save_EvalPoint1(GLint x
)
6125 GET_CURRENT_CONTEXT(ctx
);
6127 SAVE_FLUSH_VERTICES(ctx
);
6128 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6132 if (ctx
->ExecuteFlag
) {
6133 CALL_EvalPoint1(ctx
->Exec
, (x
));
6137 static void GLAPIENTRY
6138 save_EvalPoint2(GLint x
, GLint y
)
6140 GET_CURRENT_CONTEXT(ctx
);
6142 SAVE_FLUSH_VERTICES(ctx
);
6143 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6148 if (ctx
->ExecuteFlag
) {
6149 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6153 static void GLAPIENTRY
6154 save_Indexf(GLfloat x
)
6156 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6159 static void GLAPIENTRY
6160 save_Indexfv(const GLfloat
* v
)
6162 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6165 static void GLAPIENTRY
6166 save_EdgeFlag(GLboolean x
)
6168 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6173 * Compare 'count' elements of vectors 'a' and 'b'.
6174 * \return GL_TRUE if equal, GL_FALSE if different.
6176 static inline GLboolean
6177 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6179 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6184 * This glMaterial function is used for glMaterial calls that are outside
6185 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6187 static void GLAPIENTRY
6188 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6190 GET_CURRENT_CONTEXT(ctx
);
6198 case GL_FRONT_AND_BACK
:
6201 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6210 case GL_AMBIENT_AND_DIFFUSE
:
6216 case GL_COLOR_INDEXES
:
6220 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6224 if (ctx
->ExecuteFlag
) {
6225 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6228 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6230 /* Try to eliminate redundant statechanges. Because it is legal to
6231 * call glMaterial even inside begin/end calls, don't need to worry
6232 * about ctx->Driver.CurrentSavePrimitive here.
6234 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6235 if (bitmask
& (1 << i
)) {
6236 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6237 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6238 /* no change in material value */
6239 bitmask
&= ~(1 << i
);
6242 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6243 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6248 /* If this call has no effect, return early */
6252 SAVE_FLUSH_VERTICES(ctx
);
6254 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6258 for (i
= 0; i
< args
; i
++)
6259 n
[3 + i
].f
= param
[i
];
6263 static void GLAPIENTRY
6264 save_Begin(GLenum mode
)
6266 GET_CURRENT_CONTEXT(ctx
);
6268 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6269 /* compile this error into the display list */
6270 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6272 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6273 /* compile this error into the display list */
6274 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6277 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6279 vbo_save_NotifyBegin(ctx
, mode
, false);
6283 static void GLAPIENTRY
6286 GET_CURRENT_CONTEXT(ctx
);
6287 SAVE_FLUSH_VERTICES(ctx
);
6288 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6289 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6290 if (ctx
->ExecuteFlag
) {
6291 CALL_End(ctx
->Exec
, ());
6295 static void GLAPIENTRY
6296 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6298 GET_CURRENT_CONTEXT(ctx
);
6300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6301 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6308 if (ctx
->ExecuteFlag
) {
6309 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6314 static void GLAPIENTRY
6315 save_Vertex2f(GLfloat x
, GLfloat y
)
6317 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6320 static void GLAPIENTRY
6321 save_Vertex2fv(const GLfloat
* v
)
6323 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6326 static void GLAPIENTRY
6327 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6329 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6332 static void GLAPIENTRY
6333 save_Vertex3fv(const GLfloat
* v
)
6335 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6338 static void GLAPIENTRY
6339 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6341 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6344 static void GLAPIENTRY
6345 save_Vertex4fv(const GLfloat
* v
)
6347 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6350 static void GLAPIENTRY
6351 save_TexCoord1f(GLfloat x
)
6353 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6356 static void GLAPIENTRY
6357 save_TexCoord1fv(const GLfloat
* v
)
6359 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6362 static void GLAPIENTRY
6363 save_TexCoord2f(GLfloat x
, GLfloat y
)
6365 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6368 static void GLAPIENTRY
6369 save_TexCoord2fv(const GLfloat
* v
)
6371 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6374 static void GLAPIENTRY
6375 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6377 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6380 static void GLAPIENTRY
6381 save_TexCoord3fv(const GLfloat
* v
)
6383 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6386 static void GLAPIENTRY
6387 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6389 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6392 static void GLAPIENTRY
6393 save_TexCoord4fv(const GLfloat
* v
)
6395 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6398 static void GLAPIENTRY
6399 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6401 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6404 static void GLAPIENTRY
6405 save_Normal3fv(const GLfloat
* v
)
6407 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6410 static void GLAPIENTRY
6411 save_FogCoordfEXT(GLfloat x
)
6413 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6416 static void GLAPIENTRY
6417 save_FogCoordfvEXT(const GLfloat
* v
)
6419 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6422 static void GLAPIENTRY
6423 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6425 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6428 static void GLAPIENTRY
6429 save_Color3fv(const GLfloat
* v
)
6431 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6434 static void GLAPIENTRY
6435 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6437 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6440 static void GLAPIENTRY
6441 save_Color4fv(const GLfloat
* v
)
6443 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6446 static void GLAPIENTRY
6447 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6449 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6452 static void GLAPIENTRY
6453 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6455 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6459 /* Just call the respective ATTR for texcoord
6461 static void GLAPIENTRY
6462 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6464 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6465 save_Attr1fNV(attr
, x
);
6468 static void GLAPIENTRY
6469 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6471 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6472 save_Attr1fNV(attr
, v
[0]);
6475 static void GLAPIENTRY
6476 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6478 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6479 save_Attr2fNV(attr
, x
, y
);
6482 static void GLAPIENTRY
6483 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6485 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6486 save_Attr2fNV(attr
, v
[0], v
[1]);
6489 static void GLAPIENTRY
6490 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6492 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6493 save_Attr3fNV(attr
, x
, y
, z
);
6496 static void GLAPIENTRY
6497 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6499 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6500 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6503 static void GLAPIENTRY
6504 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6505 GLfloat z
, GLfloat w
)
6507 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6508 save_Attr4fNV(attr
, x
, y
, z
, w
);
6511 static void GLAPIENTRY
6512 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6514 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6515 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6520 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6526 GET_CURRENT_CONTEXT(ctx
);
6527 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6532 static void GLAPIENTRY
6533 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6535 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6536 save_Attr1fARB(index
, x
);
6541 static void GLAPIENTRY
6542 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6544 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6545 save_Attr1fARB(index
, v
[0]);
6550 static void GLAPIENTRY
6551 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6553 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6554 save_Attr2fARB(index
, x
, y
);
6559 static void GLAPIENTRY
6560 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6562 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6563 save_Attr2fARB(index
, v
[0], v
[1]);
6568 static void GLAPIENTRY
6569 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6571 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6572 save_Attr3fARB(index
, x
, y
, z
);
6577 static void GLAPIENTRY
6578 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6580 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6581 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6586 static void GLAPIENTRY
6587 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6590 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6591 save_Attr4fARB(index
, x
, y
, z
, w
);
6596 static void GLAPIENTRY
6597 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6599 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6600 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6605 static void GLAPIENTRY
6606 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6608 GET_CURRENT_CONTEXT(ctx
);
6610 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6612 SAVE_FLUSH_VERTICES(ctx
);
6613 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6616 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6619 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6620 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6622 if (ctx
->ExecuteFlag
) {
6623 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6630 static void GLAPIENTRY
6631 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6633 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6634 save_VertexAttribL1d(index
, v
[0]);
6639 static void GLAPIENTRY
6640 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6642 GET_CURRENT_CONTEXT(ctx
);
6644 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6646 SAVE_FLUSH_VERTICES(ctx
);
6647 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6650 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6651 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6654 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6655 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6656 2 * sizeof(GLdouble
));
6658 if (ctx
->ExecuteFlag
) {
6659 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6666 static void GLAPIENTRY
6667 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6669 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6670 save_VertexAttribL2d(index
, v
[0], v
[1]);
6675 static void GLAPIENTRY
6676 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6678 GET_CURRENT_CONTEXT(ctx
);
6680 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6682 SAVE_FLUSH_VERTICES(ctx
);
6683 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6686 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6687 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6688 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6691 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6692 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6693 3 * sizeof(GLdouble
));
6695 if (ctx
->ExecuteFlag
) {
6696 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6703 static void GLAPIENTRY
6704 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6706 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6707 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6712 static void GLAPIENTRY
6713 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6716 GET_CURRENT_CONTEXT(ctx
);
6718 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6720 SAVE_FLUSH_VERTICES(ctx
);
6721 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6724 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6725 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6726 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6727 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6730 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6731 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6732 4 * sizeof(GLdouble
));
6734 if (ctx
->ExecuteFlag
) {
6735 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6742 static void GLAPIENTRY
6743 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6745 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6746 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6751 static void GLAPIENTRY
6752 save_PrimitiveRestartNV(void)
6754 /* Note: this is used when outside a glBegin/End pair in a display list */
6755 GET_CURRENT_CONTEXT(ctx
);
6756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6757 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6758 if (ctx
->ExecuteFlag
) {
6759 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6764 static void GLAPIENTRY
6765 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6766 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6767 GLbitfield mask
, GLenum filter
)
6769 GET_CURRENT_CONTEXT(ctx
);
6771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6772 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6785 if (ctx
->ExecuteFlag
) {
6786 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6787 dstX0
, dstY0
, dstX1
, dstY1
,
6793 /** GL_EXT_provoking_vertex */
6794 static void GLAPIENTRY
6795 save_ProvokingVertexEXT(GLenum mode
)
6797 GET_CURRENT_CONTEXT(ctx
);
6799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6800 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6804 if (ctx
->ExecuteFlag
) {
6805 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6806 _mesa_ProvokingVertex(mode
);
6811 /** GL_EXT_transform_feedback */
6812 static void GLAPIENTRY
6813 save_BeginTransformFeedback(GLenum mode
)
6815 GET_CURRENT_CONTEXT(ctx
);
6817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6818 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6822 if (ctx
->ExecuteFlag
) {
6823 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6828 /** GL_EXT_transform_feedback */
6829 static void GLAPIENTRY
6830 save_EndTransformFeedback(void)
6832 GET_CURRENT_CONTEXT(ctx
);
6833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6834 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6835 if (ctx
->ExecuteFlag
) {
6836 CALL_EndTransformFeedback(ctx
->Exec
, ());
6840 static void GLAPIENTRY
6841 save_BindTransformFeedback(GLenum target
, GLuint name
)
6843 GET_CURRENT_CONTEXT(ctx
);
6845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6846 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6851 if (ctx
->ExecuteFlag
) {
6852 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6856 static void GLAPIENTRY
6857 save_PauseTransformFeedback(void)
6859 GET_CURRENT_CONTEXT(ctx
);
6860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6861 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6862 if (ctx
->ExecuteFlag
) {
6863 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6867 static void GLAPIENTRY
6868 save_ResumeTransformFeedback(void)
6870 GET_CURRENT_CONTEXT(ctx
);
6871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6872 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6873 if (ctx
->ExecuteFlag
) {
6874 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6878 static void GLAPIENTRY
6879 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6881 GET_CURRENT_CONTEXT(ctx
);
6883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6884 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6889 if (ctx
->ExecuteFlag
) {
6890 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6894 static void GLAPIENTRY
6895 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6897 GET_CURRENT_CONTEXT(ctx
);
6899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6900 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6906 if (ctx
->ExecuteFlag
) {
6907 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6911 static void GLAPIENTRY
6912 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6915 GET_CURRENT_CONTEXT(ctx
);
6917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6918 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6922 n
[3].si
= primcount
;
6924 if (ctx
->ExecuteFlag
) {
6925 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6929 static void GLAPIENTRY
6930 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6931 GLuint stream
, GLsizei primcount
)
6933 GET_CURRENT_CONTEXT(ctx
);
6935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6936 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6941 n
[4].si
= primcount
;
6943 if (ctx
->ExecuteFlag
) {
6944 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6949 static void GLAPIENTRY
6950 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6951 GLuint num_groups_z
)
6953 GET_CURRENT_CONTEXT(ctx
);
6955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6956 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6958 n
[1].ui
= num_groups_x
;
6959 n
[2].ui
= num_groups_y
;
6960 n
[3].ui
= num_groups_z
;
6962 if (ctx
->ExecuteFlag
) {
6963 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6968 static void GLAPIENTRY
6969 save_DispatchComputeIndirect(GLintptr indirect
)
6971 GET_CURRENT_CONTEXT(ctx
);
6972 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6973 "glDispatchComputeIndirect() during display list compile");
6976 static void GLAPIENTRY
6977 save_UseProgram(GLuint program
)
6979 GET_CURRENT_CONTEXT(ctx
);
6981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6982 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6986 if (ctx
->ExecuteFlag
) {
6987 CALL_UseProgram(ctx
->Exec
, (program
));
6992 static void GLAPIENTRY
6993 save_Uniform1fARB(GLint location
, GLfloat x
)
6995 GET_CURRENT_CONTEXT(ctx
);
6997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6998 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
7003 if (ctx
->ExecuteFlag
) {
7004 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
7009 static void GLAPIENTRY
7010 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
7012 GET_CURRENT_CONTEXT(ctx
);
7014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7015 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
7021 if (ctx
->ExecuteFlag
) {
7022 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
7027 static void GLAPIENTRY
7028 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
7030 GET_CURRENT_CONTEXT(ctx
);
7032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7033 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
7040 if (ctx
->ExecuteFlag
) {
7041 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
7046 static void GLAPIENTRY
7047 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7049 GET_CURRENT_CONTEXT(ctx
);
7051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7052 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
7060 if (ctx
->ExecuteFlag
) {
7061 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
7066 static void GLAPIENTRY
7067 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7069 GET_CURRENT_CONTEXT(ctx
);
7071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7072 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
7076 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7078 if (ctx
->ExecuteFlag
) {
7079 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
7083 static void GLAPIENTRY
7084 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7086 GET_CURRENT_CONTEXT(ctx
);
7088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7089 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
7093 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7095 if (ctx
->ExecuteFlag
) {
7096 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
7100 static void GLAPIENTRY
7101 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7103 GET_CURRENT_CONTEXT(ctx
);
7105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7106 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
7110 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7112 if (ctx
->ExecuteFlag
) {
7113 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7117 static void GLAPIENTRY
7118 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7120 GET_CURRENT_CONTEXT(ctx
);
7122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7123 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7127 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7129 if (ctx
->ExecuteFlag
) {
7130 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7135 static void GLAPIENTRY
7136 save_Uniform1d(GLint location
, GLdouble x
)
7138 GET_CURRENT_CONTEXT(ctx
);
7140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7141 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7144 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7146 if (ctx
->ExecuteFlag
) {
7147 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7152 static void GLAPIENTRY
7153 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7155 GET_CURRENT_CONTEXT(ctx
);
7157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7158 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7161 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7162 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7164 if (ctx
->ExecuteFlag
) {
7165 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7170 static void GLAPIENTRY
7171 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7173 GET_CURRENT_CONTEXT(ctx
);
7175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7176 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7179 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7180 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7181 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7183 if (ctx
->ExecuteFlag
) {
7184 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7189 static void GLAPIENTRY
7190 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7192 GET_CURRENT_CONTEXT(ctx
);
7194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7195 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7198 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7199 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7200 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7201 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7203 if (ctx
->ExecuteFlag
) {
7204 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7209 static void GLAPIENTRY
7210 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7212 GET_CURRENT_CONTEXT(ctx
);
7214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7215 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7219 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7221 if (ctx
->ExecuteFlag
) {
7222 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7227 static void GLAPIENTRY
7228 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7230 GET_CURRENT_CONTEXT(ctx
);
7232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7233 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7237 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7239 if (ctx
->ExecuteFlag
) {
7240 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7245 static void GLAPIENTRY
7246 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7248 GET_CURRENT_CONTEXT(ctx
);
7250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7251 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7255 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7257 if (ctx
->ExecuteFlag
) {
7258 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7263 static void GLAPIENTRY
7264 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7266 GET_CURRENT_CONTEXT(ctx
);
7268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7269 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7273 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7275 if (ctx
->ExecuteFlag
) {
7276 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7281 static void GLAPIENTRY
7282 save_Uniform1iARB(GLint location
, GLint x
)
7284 GET_CURRENT_CONTEXT(ctx
);
7286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7287 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7292 if (ctx
->ExecuteFlag
) {
7293 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7297 static void GLAPIENTRY
7298 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7300 GET_CURRENT_CONTEXT(ctx
);
7302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7303 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7309 if (ctx
->ExecuteFlag
) {
7310 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7314 static void GLAPIENTRY
7315 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7317 GET_CURRENT_CONTEXT(ctx
);
7319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7320 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7327 if (ctx
->ExecuteFlag
) {
7328 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7332 static void GLAPIENTRY
7333 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7335 GET_CURRENT_CONTEXT(ctx
);
7337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7338 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7346 if (ctx
->ExecuteFlag
) {
7347 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7353 static void GLAPIENTRY
7354 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7356 GET_CURRENT_CONTEXT(ctx
);
7358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7359 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7363 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7365 if (ctx
->ExecuteFlag
) {
7366 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7370 static void GLAPIENTRY
7371 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7373 GET_CURRENT_CONTEXT(ctx
);
7375 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7376 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7380 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7382 if (ctx
->ExecuteFlag
) {
7383 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7387 static void GLAPIENTRY
7388 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7390 GET_CURRENT_CONTEXT(ctx
);
7392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7393 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7397 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7399 if (ctx
->ExecuteFlag
) {
7400 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7404 static void GLAPIENTRY
7405 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7407 GET_CURRENT_CONTEXT(ctx
);
7409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7410 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7414 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7416 if (ctx
->ExecuteFlag
) {
7417 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7423 static void GLAPIENTRY
7424 save_Uniform1ui(GLint location
, GLuint x
)
7426 GET_CURRENT_CONTEXT(ctx
);
7428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7429 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7434 if (ctx
->ExecuteFlag
) {
7435 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7439 static void GLAPIENTRY
7440 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7442 GET_CURRENT_CONTEXT(ctx
);
7444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7445 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7451 if (ctx
->ExecuteFlag
) {
7452 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7456 static void GLAPIENTRY
7457 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7459 GET_CURRENT_CONTEXT(ctx
);
7461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7462 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7469 if (ctx
->ExecuteFlag
) {
7470 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7474 static void GLAPIENTRY
7475 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7477 GET_CURRENT_CONTEXT(ctx
);
7479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7480 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7488 if (ctx
->ExecuteFlag
) {
7489 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7495 static void GLAPIENTRY
7496 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7498 GET_CURRENT_CONTEXT(ctx
);
7500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7501 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7505 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7507 if (ctx
->ExecuteFlag
) {
7508 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7512 static void GLAPIENTRY
7513 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7515 GET_CURRENT_CONTEXT(ctx
);
7517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7518 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7522 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7524 if (ctx
->ExecuteFlag
) {
7525 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7529 static void GLAPIENTRY
7530 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7532 GET_CURRENT_CONTEXT(ctx
);
7534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7535 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7539 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7541 if (ctx
->ExecuteFlag
) {
7542 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7546 static void GLAPIENTRY
7547 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7549 GET_CURRENT_CONTEXT(ctx
);
7551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7552 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7556 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7558 if (ctx
->ExecuteFlag
) {
7559 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7565 static void GLAPIENTRY
7566 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7569 GET_CURRENT_CONTEXT(ctx
);
7571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7572 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7577 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7579 if (ctx
->ExecuteFlag
) {
7580 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7584 static void GLAPIENTRY
7585 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7588 GET_CURRENT_CONTEXT(ctx
);
7590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7591 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7596 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7598 if (ctx
->ExecuteFlag
) {
7599 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7603 static void GLAPIENTRY
7604 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7607 GET_CURRENT_CONTEXT(ctx
);
7609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7610 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7615 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7617 if (ctx
->ExecuteFlag
) {
7618 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7623 static void GLAPIENTRY
7624 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7627 GET_CURRENT_CONTEXT(ctx
);
7629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7630 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7635 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7637 if (ctx
->ExecuteFlag
) {
7638 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7642 static void GLAPIENTRY
7643 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7646 GET_CURRENT_CONTEXT(ctx
);
7648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7649 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7654 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7656 if (ctx
->ExecuteFlag
) {
7657 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7662 static void GLAPIENTRY
7663 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7666 GET_CURRENT_CONTEXT(ctx
);
7668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7669 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7674 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7676 if (ctx
->ExecuteFlag
) {
7677 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7681 static void GLAPIENTRY
7682 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7685 GET_CURRENT_CONTEXT(ctx
);
7687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7688 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7693 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7695 if (ctx
->ExecuteFlag
) {
7696 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7701 static void GLAPIENTRY
7702 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7705 GET_CURRENT_CONTEXT(ctx
);
7707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7708 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7713 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7715 if (ctx
->ExecuteFlag
) {
7716 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7720 static void GLAPIENTRY
7721 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7724 GET_CURRENT_CONTEXT(ctx
);
7726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7727 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7732 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7734 if (ctx
->ExecuteFlag
) {
7735 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7740 static void GLAPIENTRY
7741 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7744 GET_CURRENT_CONTEXT(ctx
);
7746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7747 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7752 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7754 if (ctx
->ExecuteFlag
) {
7755 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7759 static void GLAPIENTRY
7760 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7763 GET_CURRENT_CONTEXT(ctx
);
7765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7766 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7771 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7773 if (ctx
->ExecuteFlag
) {
7774 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7778 static void GLAPIENTRY
7779 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7782 GET_CURRENT_CONTEXT(ctx
);
7784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7785 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7790 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7792 if (ctx
->ExecuteFlag
) {
7793 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7798 static void GLAPIENTRY
7799 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7802 GET_CURRENT_CONTEXT(ctx
);
7804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7805 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7810 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7812 if (ctx
->ExecuteFlag
) {
7813 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7818 static void GLAPIENTRY
7819 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7822 GET_CURRENT_CONTEXT(ctx
);
7824 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7825 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7830 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7832 if (ctx
->ExecuteFlag
) {
7833 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7838 static void GLAPIENTRY
7839 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7842 GET_CURRENT_CONTEXT(ctx
);
7844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7845 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7850 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7852 if (ctx
->ExecuteFlag
) {
7853 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7857 static void GLAPIENTRY
7858 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7861 GET_CURRENT_CONTEXT(ctx
);
7863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7864 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7869 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7871 if (ctx
->ExecuteFlag
) {
7872 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7877 static void GLAPIENTRY
7878 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7881 GET_CURRENT_CONTEXT(ctx
);
7883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7884 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7889 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7891 if (ctx
->ExecuteFlag
) {
7892 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7897 static void GLAPIENTRY
7898 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7901 GET_CURRENT_CONTEXT(ctx
);
7903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7904 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7909 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7911 if (ctx
->ExecuteFlag
) {
7912 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7916 static void GLAPIENTRY
7917 save_Uniform1i64ARB(GLint location
, GLint64 x
)
7919 GET_CURRENT_CONTEXT(ctx
);
7921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7922 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64
, 3);
7925 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7927 if (ctx
->ExecuteFlag
) {
7928 CALL_Uniform1i64ARB(ctx
->Exec
, (location
, x
));
7932 static void GLAPIENTRY
7933 save_Uniform2i64ARB(GLint location
, GLint64 x
, GLint64 y
)
7935 GET_CURRENT_CONTEXT(ctx
);
7937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7938 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64
, 5);
7941 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7942 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7944 if (ctx
->ExecuteFlag
) {
7945 CALL_Uniform2i64ARB(ctx
->Exec
, (location
, x
, y
));
7949 static void GLAPIENTRY
7950 save_Uniform3i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
)
7952 GET_CURRENT_CONTEXT(ctx
);
7954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7955 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64
, 7);
7958 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7959 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7960 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7962 if (ctx
->ExecuteFlag
) {
7963 CALL_Uniform3i64ARB(ctx
->Exec
, (location
, x
, y
, z
));
7967 static void GLAPIENTRY
7968 save_Uniform4i64ARB(GLint location
, GLint64 x
, GLint64 y
, GLint64 z
, GLint64 w
)
7970 GET_CURRENT_CONTEXT(ctx
);
7972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7973 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64
, 9);
7976 ASSIGN_INT64_TO_NODES(n
, 2, x
);
7977 ASSIGN_INT64_TO_NODES(n
, 4, y
);
7978 ASSIGN_INT64_TO_NODES(n
, 6, z
);
7979 ASSIGN_INT64_TO_NODES(n
, 8, w
);
7981 if (ctx
->ExecuteFlag
) {
7982 CALL_Uniform4i64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
7986 static void GLAPIENTRY
7987 save_Uniform1i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
7989 GET_CURRENT_CONTEXT(ctx
);
7991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7992 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I64V
, 2 + POINTER_DWORDS
);
7996 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint64
)));
7998 if (ctx
->ExecuteFlag
) {
7999 CALL_Uniform1i64vARB(ctx
->Exec
, (location
, count
, v
));
8003 static void GLAPIENTRY
8004 save_Uniform2i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
8006 GET_CURRENT_CONTEXT(ctx
);
8008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8009 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I64V
, 2 + POINTER_DWORDS
);
8013 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint64
)));
8015 if (ctx
->ExecuteFlag
) {
8016 CALL_Uniform2i64vARB(ctx
->Exec
, (location
, count
, v
));
8020 static void GLAPIENTRY
8021 save_Uniform3i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
8023 GET_CURRENT_CONTEXT(ctx
);
8025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8026 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I64V
, 2 + POINTER_DWORDS
);
8030 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint64
)));
8032 if (ctx
->ExecuteFlag
) {
8033 CALL_Uniform3i64vARB(ctx
->Exec
, (location
, count
, v
));
8037 static void GLAPIENTRY
8038 save_Uniform4i64vARB(GLint location
, GLsizei count
, const GLint64
*v
)
8040 GET_CURRENT_CONTEXT(ctx
);
8042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8043 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I64V
, 2 + POINTER_DWORDS
);
8047 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint64
)));
8049 if (ctx
->ExecuteFlag
) {
8050 CALL_Uniform4i64vARB(ctx
->Exec
, (location
, count
, v
));
8054 static void GLAPIENTRY
8055 save_Uniform1ui64ARB(GLint location
, GLuint64 x
)
8057 GET_CURRENT_CONTEXT(ctx
);
8059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8060 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64
, 3);
8063 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
8065 if (ctx
->ExecuteFlag
) {
8066 CALL_Uniform1ui64ARB(ctx
->Exec
, (location
, x
));
8070 static void GLAPIENTRY
8071 save_Uniform2ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
)
8073 GET_CURRENT_CONTEXT(ctx
);
8075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8076 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64
, 5);
8079 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
8080 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
8082 if (ctx
->ExecuteFlag
) {
8083 CALL_Uniform2ui64ARB(ctx
->Exec
, (location
, x
, y
));
8087 static void GLAPIENTRY
8088 save_Uniform3ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
)
8090 GET_CURRENT_CONTEXT(ctx
);
8092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8093 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64
, 7);
8096 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
8097 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
8098 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
8100 if (ctx
->ExecuteFlag
) {
8101 CALL_Uniform3ui64ARB(ctx
->Exec
, (location
, x
, y
, z
));
8105 static void GLAPIENTRY
8106 save_Uniform4ui64ARB(GLint location
, GLuint64 x
, GLuint64 y
, GLuint64 z
, GLuint64 w
)
8108 GET_CURRENT_CONTEXT(ctx
);
8110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8111 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64
, 9);
8114 ASSIGN_UINT64_TO_NODES(n
, 2, x
);
8115 ASSIGN_UINT64_TO_NODES(n
, 4, y
);
8116 ASSIGN_UINT64_TO_NODES(n
, 6, z
);
8117 ASSIGN_UINT64_TO_NODES(n
, 8, w
);
8119 if (ctx
->ExecuteFlag
) {
8120 CALL_Uniform4ui64ARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
8124 static void GLAPIENTRY
8125 save_Uniform1ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
8127 GET_CURRENT_CONTEXT(ctx
);
8129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8130 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI64V
, 2 + POINTER_DWORDS
);
8134 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8136 if (ctx
->ExecuteFlag
) {
8137 CALL_Uniform1ui64vARB(ctx
->Exec
, (location
, count
, v
));
8141 static void GLAPIENTRY
8142 save_Uniform2ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
8144 GET_CURRENT_CONTEXT(ctx
);
8146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8147 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI64V
, 2 + POINTER_DWORDS
);
8151 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLuint64
)));
8153 if (ctx
->ExecuteFlag
) {
8154 CALL_Uniform2ui64vARB(ctx
->Exec
, (location
, count
, v
));
8158 static void GLAPIENTRY
8159 save_Uniform3ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
8161 GET_CURRENT_CONTEXT(ctx
);
8163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8164 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI64V
, 2 + POINTER_DWORDS
);
8168 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLuint64
)));
8170 if (ctx
->ExecuteFlag
) {
8171 CALL_Uniform3ui64vARB(ctx
->Exec
, (location
, count
, v
));
8175 static void GLAPIENTRY
8176 save_Uniform4ui64vARB(GLint location
, GLsizei count
, const GLuint64
*v
)
8178 GET_CURRENT_CONTEXT(ctx
);
8180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8181 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI64V
, 2 + POINTER_DWORDS
);
8185 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLuint64
)));
8187 if (ctx
->ExecuteFlag
) {
8188 CALL_Uniform4ui64vARB(ctx
->Exec
, (location
, count
, v
));
8192 static void GLAPIENTRY
8193 save_ProgramUniform1i64ARB(GLuint program
, GLint location
, GLint64 x
)
8195 GET_CURRENT_CONTEXT(ctx
);
8197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8198 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64
, 4);
8202 ASSIGN_INT64_TO_NODES(n
, 3, x
);
8204 if (ctx
->ExecuteFlag
) {
8205 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (program
, location
, x
));
8209 static void GLAPIENTRY
8210 save_ProgramUniform2i64ARB(GLuint program
, GLint location
, GLint64 x
,
8213 GET_CURRENT_CONTEXT(ctx
);
8215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8216 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64
, 6);
8220 ASSIGN_INT64_TO_NODES(n
, 3, x
);
8221 ASSIGN_INT64_TO_NODES(n
, 5, y
);
8223 if (ctx
->ExecuteFlag
) {
8224 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (program
, location
, x
, y
));
8228 static void GLAPIENTRY
8229 save_ProgramUniform3i64ARB(GLuint program
, GLint location
, GLint64 x
,
8230 GLint64 y
, GLint64 z
)
8232 GET_CURRENT_CONTEXT(ctx
);
8234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8235 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64
, 8);
8239 ASSIGN_INT64_TO_NODES(n
, 3, x
);
8240 ASSIGN_INT64_TO_NODES(n
, 5, y
);
8241 ASSIGN_INT64_TO_NODES(n
, 7, z
);
8243 if (ctx
->ExecuteFlag
) {
8244 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
8248 static void GLAPIENTRY
8249 save_ProgramUniform4i64ARB(GLuint program
, GLint location
, GLint64 x
,
8250 GLint64 y
, GLint64 z
, GLint64 w
)
8252 GET_CURRENT_CONTEXT(ctx
);
8254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8255 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64
, 10);
8259 ASSIGN_INT64_TO_NODES(n
, 3, x
);
8260 ASSIGN_INT64_TO_NODES(n
, 5, y
);
8261 ASSIGN_INT64_TO_NODES(n
, 7, z
);
8262 ASSIGN_INT64_TO_NODES(n
, 9, w
);
8264 if (ctx
->ExecuteFlag
) {
8265 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8269 static void GLAPIENTRY
8270 save_ProgramUniform1i64vARB(GLuint program
, GLint location
, GLsizei count
,
8273 GET_CURRENT_CONTEXT(ctx
);
8275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8276 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I64V
, 3 + POINTER_DWORDS
);
8281 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
8283 if (ctx
->ExecuteFlag
) {
8284 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8288 static void GLAPIENTRY
8289 save_ProgramUniform2i64vARB(GLuint program
, GLint location
, GLsizei count
,
8292 GET_CURRENT_CONTEXT(ctx
);
8294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8295 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I64V
, 3 + POINTER_DWORDS
);
8300 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
8302 if (ctx
->ExecuteFlag
) {
8303 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8307 static void GLAPIENTRY
8308 save_ProgramUniform3i64vARB(GLuint program
, GLint location
, GLsizei count
,
8311 GET_CURRENT_CONTEXT(ctx
);
8313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8314 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I64V
, 3 + POINTER_DWORDS
);
8319 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
8321 if (ctx
->ExecuteFlag
) {
8322 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8326 static void GLAPIENTRY
8327 save_ProgramUniform4i64vARB(GLuint program
, GLint location
, GLsizei count
,
8330 GET_CURRENT_CONTEXT(ctx
);
8332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8333 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I64V
, 3 + POINTER_DWORDS
);
8338 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint64
)));
8340 if (ctx
->ExecuteFlag
) {
8341 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8345 static void GLAPIENTRY
8346 save_ProgramUniform1ui64ARB(GLuint program
, GLint location
, GLuint64 x
)
8348 GET_CURRENT_CONTEXT(ctx
);
8350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8351 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64
, 4);
8355 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
8357 if (ctx
->ExecuteFlag
) {
8358 CALL_ProgramUniform1ui64ARB(ctx
->Exec
, (program
, location
, x
));
8362 static void GLAPIENTRY
8363 save_ProgramUniform2ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
8366 GET_CURRENT_CONTEXT(ctx
);
8368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8369 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64
, 6);
8373 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
8374 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
8376 if (ctx
->ExecuteFlag
) {
8377 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (program
, location
, x
, y
));
8381 static void GLAPIENTRY
8382 save_ProgramUniform3ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
8383 GLuint64 y
, GLuint64 z
)
8385 GET_CURRENT_CONTEXT(ctx
);
8387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8388 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64
, 8);
8392 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
8393 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
8394 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
8396 if (ctx
->ExecuteFlag
) {
8397 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
));
8401 static void GLAPIENTRY
8402 save_ProgramUniform4ui64ARB(GLuint program
, GLint location
, GLuint64 x
,
8403 GLuint64 y
, GLuint64 z
, GLuint64 w
)
8405 GET_CURRENT_CONTEXT(ctx
);
8407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8408 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64
, 10);
8412 ASSIGN_UINT64_TO_NODES(n
, 3, x
);
8413 ASSIGN_UINT64_TO_NODES(n
, 5, y
);
8414 ASSIGN_UINT64_TO_NODES(n
, 7, z
);
8415 ASSIGN_UINT64_TO_NODES(n
, 9, w
);
8417 if (ctx
->ExecuteFlag
) {
8418 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8422 static void GLAPIENTRY
8423 save_ProgramUniform1ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8426 GET_CURRENT_CONTEXT(ctx
);
8428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8429 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI64V
,
8430 3 + POINTER_DWORDS
);
8435 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8437 if (ctx
->ExecuteFlag
) {
8438 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8442 static void GLAPIENTRY
8443 save_ProgramUniform2ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8446 GET_CURRENT_CONTEXT(ctx
);
8448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8449 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI64V
,
8450 3 + POINTER_DWORDS
);
8455 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8457 if (ctx
->ExecuteFlag
) {
8458 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8462 static void GLAPIENTRY
8463 save_ProgramUniform3ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8466 GET_CURRENT_CONTEXT(ctx
);
8468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8469 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI64V
,
8470 3 + POINTER_DWORDS
);
8475 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8477 if (ctx
->ExecuteFlag
) {
8478 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8482 static void GLAPIENTRY
8483 save_ProgramUniform4ui64vARB(GLuint program
, GLint location
, GLsizei count
,
8486 GET_CURRENT_CONTEXT(ctx
);
8488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8489 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI64V
,
8490 3 + POINTER_DWORDS
);
8495 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint64
)));
8497 if (ctx
->ExecuteFlag
) {
8498 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (program
, location
, count
, v
));
8503 static void GLAPIENTRY
8504 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
8506 GET_CURRENT_CONTEXT(ctx
);
8508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8509 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
8515 if (ctx
->ExecuteFlag
) {
8516 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
8520 static void GLAPIENTRY
8521 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
8523 GET_CURRENT_CONTEXT(ctx
);
8525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8526 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
8532 if (ctx
->ExecuteFlag
) {
8533 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
8537 static void GLAPIENTRY
8538 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
8540 GET_CURRENT_CONTEXT(ctx
);
8542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8543 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
8550 if (ctx
->ExecuteFlag
) {
8551 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
8555 static void GLAPIENTRY
8556 save_ProgramUniform3f(GLuint program
, GLint location
,
8557 GLfloat x
, GLfloat y
, GLfloat z
)
8559 GET_CURRENT_CONTEXT(ctx
);
8561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8562 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
8570 if (ctx
->ExecuteFlag
) {
8571 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
8575 static void GLAPIENTRY
8576 save_ProgramUniform4f(GLuint program
, GLint location
,
8577 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
8579 GET_CURRENT_CONTEXT(ctx
);
8581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8582 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
8591 if (ctx
->ExecuteFlag
) {
8592 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8596 static void GLAPIENTRY
8597 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
8600 GET_CURRENT_CONTEXT(ctx
);
8602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8603 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
8608 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
8610 if (ctx
->ExecuteFlag
) {
8611 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
8615 static void GLAPIENTRY
8616 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
8619 GET_CURRENT_CONTEXT(ctx
);
8621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8622 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
8627 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
8629 if (ctx
->ExecuteFlag
) {
8630 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
8634 static void GLAPIENTRY
8635 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
8638 GET_CURRENT_CONTEXT(ctx
);
8640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8641 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
8646 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
8648 if (ctx
->ExecuteFlag
) {
8649 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
8653 static void GLAPIENTRY
8654 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
8657 GET_CURRENT_CONTEXT(ctx
);
8659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8660 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
8665 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
8667 if (ctx
->ExecuteFlag
) {
8668 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
8672 static void GLAPIENTRY
8673 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
8675 GET_CURRENT_CONTEXT(ctx
);
8677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8678 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8682 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8684 if (ctx
->ExecuteFlag
) {
8685 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8689 static void GLAPIENTRY
8690 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8692 GET_CURRENT_CONTEXT(ctx
);
8694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8695 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8699 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8700 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8702 if (ctx
->ExecuteFlag
) {
8703 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8707 static void GLAPIENTRY
8708 save_ProgramUniform3d(GLuint program
, GLint location
,
8709 GLdouble x
, GLdouble y
, GLdouble z
)
8711 GET_CURRENT_CONTEXT(ctx
);
8713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8714 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8718 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8719 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8720 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8722 if (ctx
->ExecuteFlag
) {
8723 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8727 static void GLAPIENTRY
8728 save_ProgramUniform4d(GLuint program
, GLint location
,
8729 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8731 GET_CURRENT_CONTEXT(ctx
);
8733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8734 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8738 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8739 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8740 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8741 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8743 if (ctx
->ExecuteFlag
) {
8744 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8748 static void GLAPIENTRY
8749 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8752 GET_CURRENT_CONTEXT(ctx
);
8754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8755 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8760 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8762 if (ctx
->ExecuteFlag
) {
8763 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8767 static void GLAPIENTRY
8768 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8771 GET_CURRENT_CONTEXT(ctx
);
8773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8774 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8779 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8781 if (ctx
->ExecuteFlag
) {
8782 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8786 static void GLAPIENTRY
8787 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8790 GET_CURRENT_CONTEXT(ctx
);
8792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8793 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8798 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8800 if (ctx
->ExecuteFlag
) {
8801 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8805 static void GLAPIENTRY
8806 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8809 GET_CURRENT_CONTEXT(ctx
);
8811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8812 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8817 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8819 if (ctx
->ExecuteFlag
) {
8820 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8824 static void GLAPIENTRY
8825 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8827 GET_CURRENT_CONTEXT(ctx
);
8829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8830 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8836 if (ctx
->ExecuteFlag
) {
8837 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8841 static void GLAPIENTRY
8842 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8844 GET_CURRENT_CONTEXT(ctx
);
8846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8847 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8854 if (ctx
->ExecuteFlag
) {
8855 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8859 static void GLAPIENTRY
8860 save_ProgramUniform3i(GLuint program
, GLint location
,
8861 GLint x
, GLint y
, GLint z
)
8863 GET_CURRENT_CONTEXT(ctx
);
8865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8866 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8874 if (ctx
->ExecuteFlag
) {
8875 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8879 static void GLAPIENTRY
8880 save_ProgramUniform4i(GLuint program
, GLint location
,
8881 GLint x
, GLint y
, GLint z
, GLint w
)
8883 GET_CURRENT_CONTEXT(ctx
);
8885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8886 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8895 if (ctx
->ExecuteFlag
) {
8896 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8900 static void GLAPIENTRY
8901 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8904 GET_CURRENT_CONTEXT(ctx
);
8906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8907 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8912 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8914 if (ctx
->ExecuteFlag
) {
8915 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8919 static void GLAPIENTRY
8920 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8923 GET_CURRENT_CONTEXT(ctx
);
8925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8926 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8931 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8933 if (ctx
->ExecuteFlag
) {
8934 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8938 static void GLAPIENTRY
8939 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8942 GET_CURRENT_CONTEXT(ctx
);
8944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8945 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8950 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8952 if (ctx
->ExecuteFlag
) {
8953 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8957 static void GLAPIENTRY
8958 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8961 GET_CURRENT_CONTEXT(ctx
);
8963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8964 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8969 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8971 if (ctx
->ExecuteFlag
) {
8972 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8976 static void GLAPIENTRY
8977 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8979 GET_CURRENT_CONTEXT(ctx
);
8981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8982 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8988 if (ctx
->ExecuteFlag
) {
8989 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8993 static void GLAPIENTRY
8994 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8996 GET_CURRENT_CONTEXT(ctx
);
8998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8999 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
9006 if (ctx
->ExecuteFlag
) {
9007 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
9011 static void GLAPIENTRY
9012 save_ProgramUniform3ui(GLuint program
, GLint location
,
9013 GLuint x
, GLuint y
, GLuint z
)
9015 GET_CURRENT_CONTEXT(ctx
);
9017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9018 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
9026 if (ctx
->ExecuteFlag
) {
9027 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
9031 static void GLAPIENTRY
9032 save_ProgramUniform4ui(GLuint program
, GLint location
,
9033 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
9035 GET_CURRENT_CONTEXT(ctx
);
9037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9038 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
9047 if (ctx
->ExecuteFlag
) {
9048 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
9052 static void GLAPIENTRY
9053 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
9056 GET_CURRENT_CONTEXT(ctx
);
9058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9059 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
9064 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
9066 if (ctx
->ExecuteFlag
) {
9067 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
9071 static void GLAPIENTRY
9072 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
9075 GET_CURRENT_CONTEXT(ctx
);
9077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9078 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
9083 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
9085 if (ctx
->ExecuteFlag
) {
9086 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
9090 static void GLAPIENTRY
9091 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
9094 GET_CURRENT_CONTEXT(ctx
);
9096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9097 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
9102 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
9104 if (ctx
->ExecuteFlag
) {
9105 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
9109 static void GLAPIENTRY
9110 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
9113 GET_CURRENT_CONTEXT(ctx
);
9115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9116 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
9121 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
9123 if (ctx
->ExecuteFlag
) {
9124 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
9128 static void GLAPIENTRY
9129 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
9130 GLboolean transpose
, const GLfloat
*v
)
9132 GET_CURRENT_CONTEXT(ctx
);
9134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9135 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
9136 4 + POINTER_DWORDS
);
9142 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
9144 if (ctx
->ExecuteFlag
) {
9145 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
9146 (program
, location
, count
, transpose
, v
));
9150 static void GLAPIENTRY
9151 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
9152 GLboolean transpose
, const GLfloat
*v
)
9154 GET_CURRENT_CONTEXT(ctx
);
9156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9157 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
9158 4 + POINTER_DWORDS
);
9164 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
9166 if (ctx
->ExecuteFlag
) {
9167 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
9168 (program
, location
, count
, transpose
, v
));
9172 static void GLAPIENTRY
9173 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
9174 GLboolean transpose
, const GLfloat
*v
)
9176 GET_CURRENT_CONTEXT(ctx
);
9178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9179 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
9180 4 + POINTER_DWORDS
);
9186 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
9188 if (ctx
->ExecuteFlag
) {
9189 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
9190 (program
, location
, count
, transpose
, v
));
9194 static void GLAPIENTRY
9195 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
9196 GLboolean transpose
, const GLfloat
*v
)
9198 GET_CURRENT_CONTEXT(ctx
);
9200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9201 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
9202 4 + POINTER_DWORDS
);
9208 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
9210 if (ctx
->ExecuteFlag
) {
9211 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
9212 (program
, location
, count
, transpose
, v
));
9216 static void GLAPIENTRY
9217 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
9218 GLboolean transpose
, const GLfloat
*v
)
9220 GET_CURRENT_CONTEXT(ctx
);
9222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9223 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
9224 4 + POINTER_DWORDS
);
9230 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
9232 if (ctx
->ExecuteFlag
) {
9233 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
9234 (program
, location
, count
, transpose
, v
));
9238 static void GLAPIENTRY
9239 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
9240 GLboolean transpose
, const GLfloat
*v
)
9242 GET_CURRENT_CONTEXT(ctx
);
9244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9245 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
9246 4 + POINTER_DWORDS
);
9252 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
9254 if (ctx
->ExecuteFlag
) {
9255 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
9256 (program
, location
, count
, transpose
, v
));
9260 static void GLAPIENTRY
9261 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
9262 GLboolean transpose
, const GLfloat
*v
)
9264 GET_CURRENT_CONTEXT(ctx
);
9266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9267 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
9268 4 + POINTER_DWORDS
);
9274 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
9276 if (ctx
->ExecuteFlag
) {
9277 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
9278 (program
, location
, count
, transpose
, v
));
9282 static void GLAPIENTRY
9283 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
9284 GLboolean transpose
, const GLfloat
*v
)
9286 GET_CURRENT_CONTEXT(ctx
);
9288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9289 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
9290 4 + POINTER_DWORDS
);
9296 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
9298 if (ctx
->ExecuteFlag
) {
9299 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
9300 (program
, location
, count
, transpose
, v
));
9304 static void GLAPIENTRY
9305 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
9306 GLboolean transpose
, const GLfloat
*v
)
9308 GET_CURRENT_CONTEXT(ctx
);
9310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9311 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
9312 4 + POINTER_DWORDS
);
9318 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
9320 if (ctx
->ExecuteFlag
) {
9321 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
9322 (program
, location
, count
, transpose
, v
));
9326 static void GLAPIENTRY
9327 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
9328 GLboolean transpose
, const GLdouble
*v
)
9330 GET_CURRENT_CONTEXT(ctx
);
9332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9333 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
9334 4 + POINTER_DWORDS
);
9340 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
9342 if (ctx
->ExecuteFlag
) {
9343 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
9344 (program
, location
, count
, transpose
, v
));
9348 static void GLAPIENTRY
9349 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
9350 GLboolean transpose
, const GLdouble
*v
)
9352 GET_CURRENT_CONTEXT(ctx
);
9354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9355 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
9356 4 + POINTER_DWORDS
);
9362 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
9364 if (ctx
->ExecuteFlag
) {
9365 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
9366 (program
, location
, count
, transpose
, v
));
9370 static void GLAPIENTRY
9371 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
9372 GLboolean transpose
, const GLdouble
*v
)
9374 GET_CURRENT_CONTEXT(ctx
);
9376 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9377 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
9378 4 + POINTER_DWORDS
);
9384 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
9386 if (ctx
->ExecuteFlag
) {
9387 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
9388 (program
, location
, count
, transpose
, v
));
9392 static void GLAPIENTRY
9393 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
9394 GLboolean transpose
, const GLdouble
*v
)
9396 GET_CURRENT_CONTEXT(ctx
);
9398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9399 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
9400 4 + POINTER_DWORDS
);
9406 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
9408 if (ctx
->ExecuteFlag
) {
9409 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
9410 (program
, location
, count
, transpose
, v
));
9414 static void GLAPIENTRY
9415 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
9416 GLboolean transpose
, const GLdouble
*v
)
9418 GET_CURRENT_CONTEXT(ctx
);
9420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9421 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
9422 4 + POINTER_DWORDS
);
9428 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
9430 if (ctx
->ExecuteFlag
) {
9431 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
9432 (program
, location
, count
, transpose
, v
));
9436 static void GLAPIENTRY
9437 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
9438 GLboolean transpose
, const GLdouble
*v
)
9440 GET_CURRENT_CONTEXT(ctx
);
9442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9443 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
9444 4 + POINTER_DWORDS
);
9450 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
9452 if (ctx
->ExecuteFlag
) {
9453 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
9454 (program
, location
, count
, transpose
, v
));
9458 static void GLAPIENTRY
9459 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
9460 GLboolean transpose
, const GLdouble
*v
)
9462 GET_CURRENT_CONTEXT(ctx
);
9464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9465 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
9466 4 + POINTER_DWORDS
);
9472 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
9474 if (ctx
->ExecuteFlag
) {
9475 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
9476 (program
, location
, count
, transpose
, v
));
9480 static void GLAPIENTRY
9481 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
9482 GLboolean transpose
, const GLdouble
*v
)
9484 GET_CURRENT_CONTEXT(ctx
);
9486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9487 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
9488 4 + POINTER_DWORDS
);
9494 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
9496 if (ctx
->ExecuteFlag
) {
9497 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
9498 (program
, location
, count
, transpose
, v
));
9502 static void GLAPIENTRY
9503 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
9504 GLboolean transpose
, const GLdouble
*v
)
9506 GET_CURRENT_CONTEXT(ctx
);
9508 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9509 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
9510 4 + POINTER_DWORDS
);
9516 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
9518 if (ctx
->ExecuteFlag
) {
9519 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
9520 (program
, location
, count
, transpose
, v
));
9524 static void GLAPIENTRY
9525 save_ClipControl(GLenum origin
, GLenum depth
)
9527 GET_CURRENT_CONTEXT(ctx
);
9529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9530 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
9535 if (ctx
->ExecuteFlag
) {
9536 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
9540 static void GLAPIENTRY
9541 save_ClampColorARB(GLenum target
, GLenum clamp
)
9543 GET_CURRENT_CONTEXT(ctx
);
9545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9546 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
9551 if (ctx
->ExecuteFlag
) {
9552 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
9556 /** GL_EXT_texture_integer */
9557 static void GLAPIENTRY
9558 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
9560 GET_CURRENT_CONTEXT(ctx
);
9562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9563 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
9570 if (ctx
->ExecuteFlag
) {
9571 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9575 /** GL_EXT_texture_integer */
9576 static void GLAPIENTRY
9577 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
9579 GET_CURRENT_CONTEXT(ctx
);
9581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9582 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
9589 if (ctx
->ExecuteFlag
) {
9590 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
9594 /** GL_EXT_texture_integer */
9595 static void GLAPIENTRY
9596 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
9598 GET_CURRENT_CONTEXT(ctx
);
9600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9601 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
9610 if (ctx
->ExecuteFlag
) {
9611 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
9615 /** GL_EXT_texture_integer */
9616 static void GLAPIENTRY
9617 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
9619 GET_CURRENT_CONTEXT(ctx
);
9621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9622 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
9626 n
[3].ui
= params
[0];
9627 n
[4].ui
= params
[1];
9628 n
[5].ui
= params
[2];
9629 n
[6].ui
= params
[3];
9631 if (ctx
->ExecuteFlag
) {
9632 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
9636 /* GL_ARB_instanced_arrays */
9637 static void GLAPIENTRY
9638 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
9640 GET_CURRENT_CONTEXT(ctx
);
9642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9643 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
9648 if (ctx
->ExecuteFlag
) {
9649 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
9654 /* GL_NV_texture_barrier */
9655 static void GLAPIENTRY
9656 save_TextureBarrierNV(void)
9658 GET_CURRENT_CONTEXT(ctx
);
9659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9660 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
9661 if (ctx
->ExecuteFlag
) {
9662 CALL_TextureBarrierNV(ctx
->Exec
, ());
9667 /* GL_ARB_sampler_objects */
9668 static void GLAPIENTRY
9669 save_BindSampler(GLuint unit
, GLuint sampler
)
9672 GET_CURRENT_CONTEXT(ctx
);
9673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9674 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
9679 if (ctx
->ExecuteFlag
) {
9680 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9684 static void GLAPIENTRY
9685 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9688 GET_CURRENT_CONTEXT(ctx
);
9689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9690 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9695 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9701 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9704 if (ctx
->ExecuteFlag
) {
9705 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9709 static void GLAPIENTRY
9710 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9714 parray
[1] = parray
[2] = parray
[3] = 0;
9715 save_SamplerParameteriv(sampler
, pname
, parray
);
9718 static void GLAPIENTRY
9719 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9722 GET_CURRENT_CONTEXT(ctx
);
9723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9724 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9729 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9735 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9738 if (ctx
->ExecuteFlag
) {
9739 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9743 static void GLAPIENTRY
9744 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9748 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9749 save_SamplerParameterfv(sampler
, pname
, parray
);
9752 static void GLAPIENTRY
9753 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9756 GET_CURRENT_CONTEXT(ctx
);
9757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9758 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9763 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9769 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9772 if (ctx
->ExecuteFlag
) {
9773 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9777 static void GLAPIENTRY
9778 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9781 GET_CURRENT_CONTEXT(ctx
);
9782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9783 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9787 n
[3].ui
= params
[0];
9788 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9789 n
[4].ui
= params
[1];
9790 n
[5].ui
= params
[2];
9791 n
[6].ui
= params
[3];
9794 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9797 if (ctx
->ExecuteFlag
) {
9798 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9802 static void GLAPIENTRY
9803 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9806 GET_CURRENT_CONTEXT(ctx
);
9807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9808 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9810 union uint64_pair p
;
9813 n
[2].ui
= p
.uint32
[0];
9814 n
[3].ui
= p
.uint32
[1];
9815 save_pointer(&n
[4], sync
);
9817 if (ctx
->ExecuteFlag
) {
9818 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9823 /** GL_NV_conditional_render */
9824 static void GLAPIENTRY
9825 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9827 GET_CURRENT_CONTEXT(ctx
);
9829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9830 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9835 if (ctx
->ExecuteFlag
) {
9836 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9840 static void GLAPIENTRY
9841 save_EndConditionalRender(void)
9843 GET_CURRENT_CONTEXT(ctx
);
9844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9845 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9846 if (ctx
->ExecuteFlag
) {
9847 CALL_EndConditionalRender(ctx
->Exec
, ());
9851 static void GLAPIENTRY
9852 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9854 GET_CURRENT_CONTEXT(ctx
);
9856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9857 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9863 if (ctx
->ExecuteFlag
) {
9864 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9868 static void GLAPIENTRY
9869 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9870 const GLuint
*indices
)
9872 GET_CURRENT_CONTEXT(ctx
);
9874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9875 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9877 GLint
*indices_copy
= NULL
;
9880 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9881 n
[1].e
= shadertype
;
9883 save_pointer(&n
[3], indices_copy
);
9885 if (ctx
->ExecuteFlag
) {
9886 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9890 /** GL_EXT_window_rectangles */
9891 static void GLAPIENTRY
9892 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9894 GET_CURRENT_CONTEXT(ctx
);
9896 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9897 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9899 GLint
*box_copy
= NULL
;
9902 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9905 save_pointer(&n
[3], box_copy
);
9907 if (ctx
->ExecuteFlag
) {
9908 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9913 /** GL_NV_conservative_raster */
9914 static void GLAPIENTRY
9915 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9917 GET_CURRENT_CONTEXT(ctx
);
9919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9920 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9925 if (ctx
->ExecuteFlag
) {
9926 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9930 /** GL_NV_conservative_raster_dilate */
9931 static void GLAPIENTRY
9932 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9934 GET_CURRENT_CONTEXT(ctx
);
9936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9937 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9942 if (ctx
->ExecuteFlag
) {
9943 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9947 /** GL_NV_conservative_raster_pre_snap_triangles */
9948 static void GLAPIENTRY
9949 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9951 GET_CURRENT_CONTEXT(ctx
);
9953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9954 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9959 if (ctx
->ExecuteFlag
) {
9960 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9964 /** GL_EXT_direct_state_access */
9966 static void GLAPIENTRY
9967 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9969 GET_CURRENT_CONTEXT(ctx
);
9971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9972 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9974 n
[1].e
= matrixMode
;
9975 for (unsigned i
= 0; i
< 16; i
++) {
9979 if (ctx
->ExecuteFlag
) {
9980 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9984 static void GLAPIENTRY
9985 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9988 for (unsigned i
= 0; i
< 16; i
++) {
9989 f
[i
] = (GLfloat
) m
[i
];
9991 save_MatrixLoadfEXT(matrixMode
, f
);
9994 static void GLAPIENTRY
9995 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9997 GET_CURRENT_CONTEXT(ctx
);
9999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10000 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
10002 n
[1].e
= matrixMode
;
10003 for (unsigned i
= 0; i
< 16; i
++) {
10007 if (ctx
->ExecuteFlag
) {
10008 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
10012 static void GLAPIENTRY
10013 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
10016 for (unsigned i
= 0; i
< 16; i
++) {
10017 f
[i
] = (GLfloat
) m
[i
];
10019 save_MatrixMultfEXT(matrixMode
, f
);
10022 static void GLAPIENTRY
10023 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
10025 GET_CURRENT_CONTEXT(ctx
);
10027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10028 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
10030 n
[1].e
= matrixMode
;
10036 if (ctx
->ExecuteFlag
) {
10037 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
10041 static void GLAPIENTRY
10042 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
10044 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
10047 static void GLAPIENTRY
10048 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
10050 GET_CURRENT_CONTEXT(ctx
);
10052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10053 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
10055 n
[1].e
= matrixMode
;
10060 if (ctx
->ExecuteFlag
) {
10061 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
10065 static void GLAPIENTRY
10066 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
10068 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
10071 static void GLAPIENTRY
10072 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
10074 GET_CURRENT_CONTEXT(ctx
);
10076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10077 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
10079 n
[1].e
= matrixMode
;
10084 if (ctx
->ExecuteFlag
) {
10085 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
10089 static void GLAPIENTRY
10090 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
10092 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
10095 static void GLAPIENTRY
10096 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
10098 GET_CURRENT_CONTEXT(ctx
);
10100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10101 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
10103 n
[1].e
= matrixMode
;
10105 if (ctx
->ExecuteFlag
) {
10106 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
10110 static void GLAPIENTRY
10111 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
10112 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
10114 GET_CURRENT_CONTEXT(ctx
);
10116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10117 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
10119 n
[1].e
= matrixMode
;
10120 n
[2].f
= (GLfloat
) left
;
10121 n
[3].f
= (GLfloat
) right
;
10122 n
[4].f
= (GLfloat
) bottom
;
10123 n
[5].f
= (GLfloat
) top
;
10124 n
[6].f
= (GLfloat
) nearval
;
10125 n
[7].f
= (GLfloat
) farval
;
10127 if (ctx
->ExecuteFlag
) {
10128 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
10133 static void GLAPIENTRY
10134 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
10135 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
10137 GET_CURRENT_CONTEXT(ctx
);
10139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10140 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
10142 n
[1].e
= matrixMode
;
10143 n
[2].f
= (GLfloat
) left
;
10144 n
[3].f
= (GLfloat
) right
;
10145 n
[4].f
= (GLfloat
) bottom
;
10146 n
[5].f
= (GLfloat
) top
;
10147 n
[6].f
= (GLfloat
) nearval
;
10148 n
[7].f
= (GLfloat
) farval
;
10150 if (ctx
->ExecuteFlag
) {
10151 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
10155 static void GLAPIENTRY
10156 save_MatrixPushEXT(GLenum matrixMode
)
10158 GET_CURRENT_CONTEXT(ctx
);
10160 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10161 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
10163 n
[1].e
= matrixMode
;
10165 if (ctx
->ExecuteFlag
) {
10166 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
10170 static void GLAPIENTRY
10171 save_MatrixPopEXT(GLenum matrixMode
)
10173 GET_CURRENT_CONTEXT(ctx
);
10175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10176 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
10178 n
[1].e
= matrixMode
;
10180 if (ctx
->ExecuteFlag
) {
10181 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
10185 static void GLAPIENTRY
10186 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
10189 _math_transposef(tm
, m
);
10190 save_MatrixLoadfEXT(matrixMode
, tm
);
10193 static void GLAPIENTRY
10194 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
10197 _math_transposefd(tm
, m
);
10198 save_MatrixLoadfEXT(matrixMode
, tm
);
10201 static void GLAPIENTRY
10202 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
10205 _math_transposef(tm
, m
);
10206 save_MatrixMultfEXT(matrixMode
, tm
);
10209 static void GLAPIENTRY
10210 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
10213 _math_transposefd(tm
, m
);
10214 save_MatrixMultfEXT(matrixMode
, tm
);
10217 static void GLAPIENTRY
10218 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
10219 const GLfloat
*params
)
10221 GET_CURRENT_CONTEXT(ctx
);
10223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10224 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
10229 n
[4].f
= params
[0];
10230 n
[5].f
= params
[1];
10231 n
[6].f
= params
[2];
10232 n
[7].f
= params
[3];
10234 if (ctx
->ExecuteFlag
) {
10235 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
10240 static void GLAPIENTRY
10241 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
10245 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10246 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
10249 static void GLAPIENTRY
10250 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
10252 GET_CURRENT_CONTEXT(ctx
);
10254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10255 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
10260 n
[4].i
= params
[0];
10261 n
[5].i
= params
[1];
10262 n
[6].i
= params
[2];
10263 n
[7].i
= params
[3];
10265 if (ctx
->ExecuteFlag
) {
10266 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
10270 static void GLAPIENTRY
10271 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
10275 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10276 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
10279 static void GLAPIENTRY
10280 save_TextureParameterIivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
* params
)
10282 GET_CURRENT_CONTEXT(ctx
);
10284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10285 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_II
, 7);
10290 n
[4].i
= params
[0];
10291 n
[5].i
= params
[1];
10292 n
[6].i
= params
[2];
10293 n
[7].i
= params
[3];
10295 if (ctx
->ExecuteFlag
) {
10296 CALL_TextureParameterIivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
10300 static void GLAPIENTRY
10301 save_TextureParameterIuivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLuint
* params
)
10303 GET_CURRENT_CONTEXT(ctx
);
10305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10306 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_IUI
, 7);
10311 n
[4].ui
= params
[0];
10312 n
[5].ui
= params
[1];
10313 n
[6].ui
= params
[2];
10314 n
[7].ui
= params
[3];
10316 if (ctx
->ExecuteFlag
) {
10317 CALL_TextureParameterIuivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
10322 static void GLAPIENTRY
10323 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
10324 GLint level
, GLint components
,
10325 GLsizei width
, GLint border
,
10326 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10328 GET_CURRENT_CONTEXT(ctx
);
10329 if (target
== GL_PROXY_TEXTURE_1D
) {
10330 /* don't compile, execute immediately */
10331 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
10332 border
, format
, type
, pixels
));
10336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10337 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
10342 n
[4].i
= components
;
10343 n
[5].i
= (GLint
) width
;
10347 save_pointer(&n
[9],
10348 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10349 pixels
, &ctx
->Unpack
));
10351 if (ctx
->ExecuteFlag
) {
10352 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
10353 border
, format
, type
, pixels
));
10359 static void GLAPIENTRY
10360 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
10361 GLint level
, GLint components
,
10362 GLsizei width
, GLsizei height
, GLint border
,
10363 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10365 GET_CURRENT_CONTEXT(ctx
);
10366 if (target
== GL_PROXY_TEXTURE_2D
) {
10367 /* don't compile, execute immediately */
10368 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
10369 height
, border
, format
, type
, pixels
));
10373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10374 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
10379 n
[4].i
= components
;
10380 n
[5].i
= (GLint
) width
;
10381 n
[6].i
= (GLint
) height
;
10385 save_pointer(&n
[10],
10386 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10387 pixels
, &ctx
->Unpack
));
10389 if (ctx
->ExecuteFlag
) {
10390 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
10391 height
, border
, format
, type
, pixels
));
10397 static void GLAPIENTRY
10398 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
10399 GLint level
, GLint internalFormat
,
10400 GLsizei width
, GLsizei height
, GLsizei depth
,
10402 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10404 GET_CURRENT_CONTEXT(ctx
);
10405 if (target
== GL_PROXY_TEXTURE_3D
) {
10406 /* don't compile, execute immediately */
10407 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
10408 height
, depth
, border
, format
, type
,
10413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10414 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
10419 n
[4].i
= (GLint
) internalFormat
;
10420 n
[5].i
= (GLint
) width
;
10421 n
[6].i
= (GLint
) height
;
10422 n
[7].i
= (GLint
) depth
;
10426 save_pointer(&n
[11],
10427 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10428 pixels
, &ctx
->Unpack
));
10430 if (ctx
->ExecuteFlag
) {
10431 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
10432 width
, height
, depth
, border
, format
,
10439 static void GLAPIENTRY
10440 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10441 GLsizei width
, GLenum format
, GLenum type
,
10442 const GLvoid
* pixels
)
10444 GET_CURRENT_CONTEXT(ctx
);
10447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10449 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10455 n
[5].i
= (GLint
) width
;
10458 save_pointer(&n
[8],
10459 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10460 pixels
, &ctx
->Unpack
));
10462 if (ctx
->ExecuteFlag
) {
10463 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
10464 format
, type
, pixels
));
10469 static void GLAPIENTRY
10470 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10471 GLint xoffset
, GLint yoffset
,
10472 GLsizei width
, GLsizei height
,
10473 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10475 GET_CURRENT_CONTEXT(ctx
);
10478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10480 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10487 n
[6].i
= (GLint
) width
;
10488 n
[7].i
= (GLint
) height
;
10491 save_pointer(&n
[10],
10492 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10493 pixels
, &ctx
->Unpack
));
10495 if (ctx
->ExecuteFlag
) {
10496 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
10497 width
, height
, format
, type
, pixels
));
10502 static void GLAPIENTRY
10503 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10504 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10505 GLsizei width
, GLsizei height
, GLsizei depth
,
10506 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10508 GET_CURRENT_CONTEXT(ctx
);
10511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10513 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10521 n
[7].i
= (GLint
) width
;
10522 n
[8].i
= (GLint
) height
;
10523 n
[9].i
= (GLint
) depth
;
10526 save_pointer(&n
[12],
10527 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10528 pixels
, &ctx
->Unpack
));
10530 if (ctx
->ExecuteFlag
) {
10531 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10532 xoffset
, yoffset
, zoffset
,
10533 width
, height
, depth
, format
, type
,
10538 static void GLAPIENTRY
10539 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10540 GLenum internalformat
, GLint x
, GLint y
,
10541 GLsizei width
, GLint border
)
10543 GET_CURRENT_CONTEXT(ctx
);
10545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10546 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
10551 n
[4].e
= internalformat
;
10557 if (ctx
->ExecuteFlag
) {
10558 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10559 internalformat
, x
, y
,
10564 static void GLAPIENTRY
10565 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10566 GLenum internalformat
,
10567 GLint x
, GLint y
, GLsizei width
,
10568 GLsizei height
, GLint border
)
10570 GET_CURRENT_CONTEXT(ctx
);
10572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10573 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
10578 n
[4].e
= internalformat
;
10585 if (ctx
->ExecuteFlag
) {
10586 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10587 internalformat
, x
, y
,
10588 width
, height
, border
));
10592 static void GLAPIENTRY
10593 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10594 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10596 GET_CURRENT_CONTEXT(ctx
);
10598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10599 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
10609 if (ctx
->ExecuteFlag
) {
10610 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
10611 (texture
, target
, level
, xoffset
, x
, y
, width
));
10615 static void GLAPIENTRY
10616 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10617 GLint xoffset
, GLint yoffset
,
10618 GLint x
, GLint y
, GLsizei width
, GLint height
)
10620 GET_CURRENT_CONTEXT(ctx
);
10622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10623 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
10635 if (ctx
->ExecuteFlag
) {
10636 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10638 x
, y
, width
, height
));
10643 static void GLAPIENTRY
10644 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10645 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10646 GLint x
, GLint y
, GLsizei width
, GLint height
)
10648 GET_CURRENT_CONTEXT(ctx
);
10650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10651 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
10664 if (ctx
->ExecuteFlag
) {
10665 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10666 xoffset
, yoffset
, zoffset
,
10667 x
, y
, width
, height
));
10672 static void GLAPIENTRY
10673 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
10675 GET_CURRENT_CONTEXT(ctx
);
10677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10678 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
10684 if (ctx
->ExecuteFlag
) {
10685 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
10690 static void GLAPIENTRY
10691 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
10692 const GLfloat
*params
)
10694 GET_CURRENT_CONTEXT(ctx
);
10696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10697 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
10702 n
[4].f
= params
[0];
10703 n
[5].f
= params
[1];
10704 n
[6].f
= params
[2];
10705 n
[7].f
= params
[3];
10707 if (ctx
->ExecuteFlag
) {
10708 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10713 static void GLAPIENTRY
10714 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10718 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10719 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
10722 static void GLAPIENTRY
10723 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10725 GET_CURRENT_CONTEXT(ctx
);
10727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10728 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10733 n
[4].i
= params
[0];
10734 n
[5].i
= params
[1];
10735 n
[6].i
= params
[2];
10736 n
[7].i
= params
[3];
10738 if (ctx
->ExecuteFlag
) {
10739 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10743 static void GLAPIENTRY
10744 save_MultiTexParameterIivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10746 GET_CURRENT_CONTEXT(ctx
);
10748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10749 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_II
, 7);
10754 n
[4].i
= params
[0];
10755 n
[5].i
= params
[1];
10756 n
[6].i
= params
[2];
10757 n
[7].i
= params
[3];
10759 if (ctx
->ExecuteFlag
) {
10760 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10764 static void GLAPIENTRY
10765 save_MultiTexParameterIuivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLuint
*params
)
10767 GET_CURRENT_CONTEXT(ctx
);
10769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10770 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_IUI
, 7);
10775 n
[4].ui
= params
[0];
10776 n
[5].ui
= params
[1];
10777 n
[6].ui
= params
[2];
10778 n
[7].ui
= params
[3];
10780 if (ctx
->ExecuteFlag
) {
10781 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10785 static void GLAPIENTRY
10786 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10790 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10791 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10795 static void GLAPIENTRY
10796 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10797 GLint level
, GLint components
,
10798 GLsizei width
, GLint border
,
10799 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10801 GET_CURRENT_CONTEXT(ctx
);
10802 if (target
== GL_PROXY_TEXTURE_1D
) {
10803 /* don't compile, execute immediately */
10804 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10805 border
, format
, type
, pixels
));
10809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10810 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10815 n
[4].i
= components
;
10816 n
[5].i
= (GLint
) width
;
10820 save_pointer(&n
[9],
10821 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10822 pixels
, &ctx
->Unpack
));
10824 if (ctx
->ExecuteFlag
) {
10825 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10826 border
, format
, type
, pixels
));
10832 static void GLAPIENTRY
10833 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10834 GLint level
, GLint components
,
10835 GLsizei width
, GLsizei height
, GLint border
,
10836 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10838 GET_CURRENT_CONTEXT(ctx
);
10839 if (target
== GL_PROXY_TEXTURE_2D
) {
10840 /* don't compile, execute immediately */
10841 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10842 height
, border
, format
, type
, pixels
));
10846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10847 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10852 n
[4].i
= components
;
10853 n
[5].i
= (GLint
) width
;
10854 n
[6].i
= (GLint
) height
;
10858 save_pointer(&n
[10],
10859 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10860 pixels
, &ctx
->Unpack
));
10862 if (ctx
->ExecuteFlag
) {
10863 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10864 height
, border
, format
, type
, pixels
));
10870 static void GLAPIENTRY
10871 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10872 GLint level
, GLint internalFormat
,
10873 GLsizei width
, GLsizei height
, GLsizei depth
,
10875 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10877 GET_CURRENT_CONTEXT(ctx
);
10878 if (target
== GL_PROXY_TEXTURE_3D
) {
10879 /* don't compile, execute immediately */
10880 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10881 height
, depth
, border
, format
, type
,
10886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10887 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10892 n
[4].i
= (GLint
) internalFormat
;
10893 n
[5].i
= (GLint
) width
;
10894 n
[6].i
= (GLint
) height
;
10895 n
[7].i
= (GLint
) depth
;
10899 save_pointer(&n
[11],
10900 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10901 pixels
, &ctx
->Unpack
));
10903 if (ctx
->ExecuteFlag
) {
10904 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10905 width
, height
, depth
, border
, format
,
10912 static void GLAPIENTRY
10913 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10914 GLsizei width
, GLenum format
, GLenum type
,
10915 const GLvoid
* pixels
)
10917 GET_CURRENT_CONTEXT(ctx
);
10920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10922 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10928 n
[5].i
= (GLint
) width
;
10931 save_pointer(&n
[8],
10932 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10933 pixels
, &ctx
->Unpack
));
10935 if (ctx
->ExecuteFlag
) {
10936 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10937 format
, type
, pixels
));
10942 static void GLAPIENTRY
10943 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10944 GLint xoffset
, GLint yoffset
,
10945 GLsizei width
, GLsizei height
,
10946 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10948 GET_CURRENT_CONTEXT(ctx
);
10951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10953 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10960 n
[6].i
= (GLint
) width
;
10961 n
[7].i
= (GLint
) height
;
10964 save_pointer(&n
[10],
10965 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10966 pixels
, &ctx
->Unpack
));
10968 if (ctx
->ExecuteFlag
) {
10969 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10970 width
, height
, format
, type
, pixels
));
10975 static void GLAPIENTRY
10976 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10977 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10978 GLsizei width
, GLsizei height
, GLsizei depth
,
10979 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10981 GET_CURRENT_CONTEXT(ctx
);
10984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10986 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10994 n
[7].i
= (GLint
) width
;
10995 n
[8].i
= (GLint
) height
;
10996 n
[9].i
= (GLint
) depth
;
10999 save_pointer(&n
[12],
11000 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
11001 pixels
, &ctx
->Unpack
));
11003 if (ctx
->ExecuteFlag
) {
11004 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
11005 xoffset
, yoffset
, zoffset
,
11006 width
, height
, depth
, format
, type
,
11012 static void GLAPIENTRY
11013 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
11014 GLenum internalformat
, GLint x
, GLint y
,
11015 GLsizei width
, GLint border
)
11017 GET_CURRENT_CONTEXT(ctx
);
11019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11020 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
11025 n
[4].e
= internalformat
;
11031 if (ctx
->ExecuteFlag
) {
11032 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
11033 internalformat
, x
, y
,
11039 static void GLAPIENTRY
11040 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
11041 GLenum internalformat
,
11042 GLint x
, GLint y
, GLsizei width
,
11043 GLsizei height
, GLint border
)
11045 GET_CURRENT_CONTEXT(ctx
);
11047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11048 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
11053 n
[4].e
= internalformat
;
11060 if (ctx
->ExecuteFlag
) {
11061 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
11062 internalformat
, x
, y
,
11063 width
, height
, border
));
11068 static void GLAPIENTRY
11069 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
11070 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
11072 GET_CURRENT_CONTEXT(ctx
);
11074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11075 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
11085 if (ctx
->ExecuteFlag
) {
11086 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
11087 (texunit
, target
, level
, xoffset
, x
, y
, width
));
11092 static void GLAPIENTRY
11093 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
11094 GLint xoffset
, GLint yoffset
,
11095 GLint x
, GLint y
, GLsizei width
, GLint height
)
11097 GET_CURRENT_CONTEXT(ctx
);
11099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11100 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
11112 if (ctx
->ExecuteFlag
) {
11113 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
11115 x
, y
, width
, height
));
11120 static void GLAPIENTRY
11121 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
11122 GLint xoffset
, GLint yoffset
, GLint zoffset
,
11123 GLint x
, GLint y
, GLsizei width
, GLint height
)
11125 GET_CURRENT_CONTEXT(ctx
);
11127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11128 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
11141 if (ctx
->ExecuteFlag
) {
11142 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
11143 xoffset
, yoffset
, zoffset
,
11144 x
, y
, width
, height
));
11149 static void GLAPIENTRY
11150 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
11152 GET_CURRENT_CONTEXT(ctx
);
11154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11155 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
11160 if (pname
== GL_TEXTURE_ENV_COLOR
) {
11161 n
[4].f
= params
[0];
11162 n
[5].f
= params
[1];
11163 n
[6].f
= params
[2];
11164 n
[7].f
= params
[3];
11167 n
[4].f
= params
[0];
11168 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
11171 if (ctx
->ExecuteFlag
) {
11172 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
11177 static void GLAPIENTRY
11178 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
11181 parray
[0] = (GLfloat
) param
;
11182 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
11183 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
11187 static void GLAPIENTRY
11188 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
11191 p
[0] = (GLfloat
) param
;
11192 p
[1] = p
[2] = p
[3] = 0.0F
;
11193 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
11197 static void GLAPIENTRY
11198 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
11201 if (pname
== GL_TEXTURE_ENV_COLOR
) {
11202 p
[0] = INT_TO_FLOAT(param
[0]);
11203 p
[1] = INT_TO_FLOAT(param
[1]);
11204 p
[2] = INT_TO_FLOAT(param
[2]);
11205 p
[3] = INT_TO_FLOAT(param
[3]);
11208 p
[0] = (GLfloat
) param
[0];
11209 p
[1] = p
[2] = p
[3] = 0.0F
;
11211 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
11215 static void GLAPIENTRY
11216 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
11217 GLenum internalFormat
, GLsizei width
,
11218 GLint border
, GLsizei imageSize
,
11219 const GLvoid
* data
)
11221 GET_CURRENT_CONTEXT(ctx
);
11222 if (target
== GL_PROXY_TEXTURE_1D
) {
11223 /* don't compile, execute immediately */
11224 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
11225 internalFormat
, width
,
11231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11233 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
11234 7 + POINTER_DWORDS
);
11239 n
[4].e
= internalFormat
;
11240 n
[5].i
= (GLint
) width
;
11242 n
[7].i
= imageSize
;
11243 save_pointer(&n
[8],
11244 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
11246 if (ctx
->ExecuteFlag
) {
11247 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
11248 (texture
, target
, level
, internalFormat
,
11249 width
, border
, imageSize
, data
));
11255 static void GLAPIENTRY
11256 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
11257 GLenum internalFormat
, GLsizei width
,
11258 GLsizei height
, GLint border
, GLsizei imageSize
,
11259 const GLvoid
* data
)
11261 GET_CURRENT_CONTEXT(ctx
);
11262 if (target
== GL_PROXY_TEXTURE_2D
) {
11263 /* don't compile, execute immediately */
11264 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
11265 internalFormat
, width
, height
,
11266 border
, imageSize
, data
));
11270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11272 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
11273 8 + POINTER_DWORDS
);
11278 n
[4].e
= internalFormat
;
11279 n
[5].i
= (GLint
) width
;
11280 n
[6].i
= (GLint
) height
;
11282 n
[8].i
= imageSize
;
11283 save_pointer(&n
[9],
11284 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
11286 if (ctx
->ExecuteFlag
) {
11287 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
11288 (texture
, target
, level
, internalFormat
,
11289 width
, height
, border
, imageSize
, data
));
11295 static void GLAPIENTRY
11296 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
11297 GLenum internalFormat
, GLsizei width
,
11298 GLsizei height
, GLsizei depth
, GLint border
,
11299 GLsizei imageSize
, const GLvoid
* data
)
11301 GET_CURRENT_CONTEXT(ctx
);
11302 if (target
== GL_PROXY_TEXTURE_3D
) {
11303 /* don't compile, execute immediately */
11304 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
11305 internalFormat
, width
,
11306 height
, depth
, border
,
11311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11313 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
11314 9 + POINTER_DWORDS
);
11319 n
[4].e
= internalFormat
;
11320 n
[5].i
= (GLint
) width
;
11321 n
[6].i
= (GLint
) height
;
11322 n
[7].i
= (GLint
) depth
;
11324 n
[9].i
= imageSize
;
11325 save_pointer(&n
[10],
11326 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
11328 if (ctx
->ExecuteFlag
) {
11329 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
11330 (texture
, target
, level
, internalFormat
,
11331 width
, height
, depth
, border
, imageSize
,
11338 static void GLAPIENTRY
11339 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
11340 GLsizei width
, GLenum format
,
11341 GLsizei imageSize
, const GLvoid
* data
)
11344 GET_CURRENT_CONTEXT(ctx
);
11345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11347 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
11348 7 + POINTER_DWORDS
);
11354 n
[5].i
= (GLint
) width
;
11356 n
[7].i
= imageSize
;
11357 save_pointer(&n
[8],
11358 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
11360 if (ctx
->ExecuteFlag
) {
11361 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
11362 width
, format
, imageSize
, data
));
11367 static void GLAPIENTRY
11368 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
11369 GLint yoffset
, GLsizei width
, GLsizei height
,
11370 GLenum format
, GLsizei imageSize
,
11371 const GLvoid
* data
)
11374 GET_CURRENT_CONTEXT(ctx
);
11375 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11377 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
11378 9 + POINTER_DWORDS
);
11385 n
[6].i
= (GLint
) width
;
11386 n
[7].i
= (GLint
) height
;
11388 n
[9].i
= imageSize
;
11389 save_pointer(&n
[10],
11390 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
11392 if (ctx
->ExecuteFlag
) {
11393 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
11394 (texture
, target
, level
, xoffset
, yoffset
,
11395 width
, height
, format
, imageSize
, data
));
11400 static void GLAPIENTRY
11401 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
11402 GLint yoffset
, GLint zoffset
, GLsizei width
,
11403 GLsizei height
, GLsizei depth
, GLenum format
,
11404 GLsizei imageSize
, const GLvoid
* data
)
11407 GET_CURRENT_CONTEXT(ctx
);
11408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11410 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
11411 11 + POINTER_DWORDS
);
11419 n
[7].i
= (GLint
) width
;
11420 n
[8].i
= (GLint
) height
;
11421 n
[9].i
= (GLint
) depth
;
11423 n
[11].i
= imageSize
;
11424 save_pointer(&n
[12],
11425 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
11427 if (ctx
->ExecuteFlag
) {
11428 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
11429 (texture
, target
, level
, xoffset
, yoffset
,
11430 zoffset
, width
, height
, depth
, format
,
11436 static void GLAPIENTRY
11437 save_CompressedMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
11438 GLenum internalFormat
, GLsizei width
,
11439 GLint border
, GLsizei imageSize
,
11440 const GLvoid
* data
)
11442 GET_CURRENT_CONTEXT(ctx
);
11443 if (target
== GL_PROXY_TEXTURE_1D
) {
11444 /* don't compile, execute immediately */
11445 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
11446 internalFormat
, width
,
11452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11454 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
11455 7 + POINTER_DWORDS
);
11460 n
[4].e
= internalFormat
;
11461 n
[5].i
= (GLint
) width
;
11463 n
[7].i
= imageSize
;
11464 save_pointer(&n
[8],
11465 copy_data(data
, imageSize
, "glCompressedMultiTexImage1DEXT"));
11467 if (ctx
->ExecuteFlag
) {
11468 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
,
11469 (texunit
, target
, level
, internalFormat
,
11470 width
, border
, imageSize
, data
));
11476 static void GLAPIENTRY
11477 save_CompressedMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
11478 GLenum internalFormat
, GLsizei width
,
11479 GLsizei height
, GLint border
, GLsizei imageSize
,
11480 const GLvoid
* data
)
11482 GET_CURRENT_CONTEXT(ctx
);
11483 if (target
== GL_PROXY_TEXTURE_2D
) {
11484 /* don't compile, execute immediately */
11485 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
11486 internalFormat
, width
, height
,
11487 border
, imageSize
, data
));
11491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11493 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
11494 8 + POINTER_DWORDS
);
11499 n
[4].e
= internalFormat
;
11500 n
[5].i
= (GLint
) width
;
11501 n
[6].i
= (GLint
) height
;
11503 n
[8].i
= imageSize
;
11504 save_pointer(&n
[9],
11505 copy_data(data
, imageSize
, "glCompressedMultiTexImage2DEXT"));
11507 if (ctx
->ExecuteFlag
) {
11508 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
,
11509 (texunit
, target
, level
, internalFormat
,
11510 width
, height
, border
, imageSize
, data
));
11516 static void GLAPIENTRY
11517 save_CompressedMultiTexImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
11518 GLenum internalFormat
, GLsizei width
,
11519 GLsizei height
, GLsizei depth
, GLint border
,
11520 GLsizei imageSize
, const GLvoid
* data
)
11522 GET_CURRENT_CONTEXT(ctx
);
11523 if (target
== GL_PROXY_TEXTURE_3D
) {
11524 /* don't compile, execute immediately */
11525 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
11526 internalFormat
, width
,
11527 height
, depth
, border
,
11532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11534 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
11535 9 + POINTER_DWORDS
);
11540 n
[4].e
= internalFormat
;
11541 n
[5].i
= (GLint
) width
;
11542 n
[6].i
= (GLint
) height
;
11543 n
[7].i
= (GLint
) depth
;
11545 n
[9].i
= imageSize
;
11546 save_pointer(&n
[10],
11547 copy_data(data
, imageSize
, "glCompressedMultiTexImage3DEXT"));
11549 if (ctx
->ExecuteFlag
) {
11550 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
,
11551 (texunit
, target
, level
, internalFormat
,
11552 width
, height
, depth
, border
, imageSize
,
11559 static void GLAPIENTRY
11560 save_CompressedMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11561 GLsizei width
, GLenum format
,
11562 GLsizei imageSize
, const GLvoid
* data
)
11565 GET_CURRENT_CONTEXT(ctx
);
11566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11568 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
11569 7 + POINTER_DWORDS
);
11575 n
[5].i
= (GLint
) width
;
11577 n
[7].i
= imageSize
;
11578 save_pointer(&n
[8],
11579 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage1DEXT"));
11581 if (ctx
->ExecuteFlag
) {
11582 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
,
11583 width
, format
, imageSize
, data
));
11588 static void GLAPIENTRY
11589 save_CompressedMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11590 GLint yoffset
, GLsizei width
, GLsizei height
,
11591 GLenum format
, GLsizei imageSize
,
11592 const GLvoid
* data
)
11595 GET_CURRENT_CONTEXT(ctx
);
11596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11598 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
11599 9 + POINTER_DWORDS
);
11606 n
[6].i
= (GLint
) width
;
11607 n
[7].i
= (GLint
) height
;
11609 n
[9].i
= imageSize
;
11610 save_pointer(&n
[10],
11611 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage2DEXT"));
11613 if (ctx
->ExecuteFlag
) {
11614 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
11615 (texunit
, target
, level
, xoffset
, yoffset
,
11616 width
, height
, format
, imageSize
, data
));
11621 static void GLAPIENTRY
11622 save_CompressedMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
11623 GLint yoffset
, GLint zoffset
, GLsizei width
,
11624 GLsizei height
, GLsizei depth
, GLenum format
,
11625 GLsizei imageSize
, const GLvoid
* data
)
11628 GET_CURRENT_CONTEXT(ctx
);
11629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11631 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
11632 11 + POINTER_DWORDS
);
11640 n
[7].i
= (GLint
) width
;
11641 n
[8].i
= (GLint
) height
;
11642 n
[9].i
= (GLint
) depth
;
11644 n
[11].i
= imageSize
;
11645 save_pointer(&n
[12],
11646 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage3DEXT"));
11648 if (ctx
->ExecuteFlag
) {
11649 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
11650 (texunit
, target
, level
, xoffset
, yoffset
,
11651 zoffset
, width
, height
, depth
, format
,
11657 static void GLAPIENTRY
11658 save_NamedProgramStringEXT(GLuint program
, GLenum target
, GLenum format
, GLsizei len
,
11659 const GLvoid
* string
)
11661 GET_CURRENT_CONTEXT(ctx
);
11664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11666 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_STRING
, 4 + POINTER_DWORDS
);
11668 GLubyte
*programCopy
= malloc(len
);
11669 if (!programCopy
) {
11670 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glNamedProgramStringEXT");
11673 memcpy(programCopy
, string
, len
);
11678 save_pointer(&n
[5], programCopy
);
11680 if (ctx
->ExecuteFlag
) {
11681 CALL_NamedProgramStringEXT(ctx
->Exec
, (program
, target
, format
, len
, string
));
11686 static void GLAPIENTRY
11687 save_NamedProgramLocalParameter4fEXT(GLuint program
, GLenum target
, GLuint index
,
11688 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
11690 GET_CURRENT_CONTEXT(ctx
);
11692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11693 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
, 7);
11703 if (ctx
->ExecuteFlag
) {
11704 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
, (program
, target
, index
, x
, y
, z
, w
));
11709 static void GLAPIENTRY
11710 save_NamedProgramLocalParameter4fvEXT(GLuint program
, GLenum target
, GLuint index
,
11711 const GLfloat
*params
)
11713 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, params
[0],
11714 params
[1], params
[2], params
[3]);
11718 static void GLAPIENTRY
11719 save_NamedProgramLocalParameter4dEXT(GLuint program
, GLenum target
, GLuint index
,
11720 GLdouble x
, GLdouble y
,
11721 GLdouble z
, GLdouble w
)
11723 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) x
,
11724 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
11728 static void GLAPIENTRY
11729 save_NamedProgramLocalParameter4dvEXT(GLuint program
, GLenum target
, GLuint index
,
11730 const GLdouble
*params
)
11732 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) params
[0],
11733 (GLfloat
) params
[1], (GLfloat
) params
[2],
11734 (GLfloat
) params
[3]);
11739 * Save an error-generating command into display list.
11741 * KW: Will appear in the list before the vertex buffer containing the
11742 * command that provoked the error. I don't see this as a problem.
11745 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11748 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
11751 save_pointer(&n
[2], (void *) s
);
11752 /* note: the data/string here doesn't have to be freed in
11753 * _mesa_delete_list() since the string is never dynamically
11761 * Compile an error into current display list.
11764 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11766 if (ctx
->CompileFlag
)
11767 save_error(ctx
, error
, s
);
11768 if (ctx
->ExecuteFlag
)
11769 _mesa_error(ctx
, error
, "%s", s
);
11774 * Test if ID names a display list.
11777 islist(struct gl_context
*ctx
, GLuint list
)
11779 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
11789 /**********************************************************************/
11790 /* Display list execution */
11791 /**********************************************************************/
11795 * Execute a display list. Note that the ListBase offset must have already
11796 * been added before calling this function. I.e. the list argument is
11797 * the absolute list number, not relative to ListBase.
11798 * \param list - display list number
11801 execute_list(struct gl_context
*ctx
, GLuint list
)
11803 struct gl_display_list
*dlist
;
11807 if (list
== 0 || !islist(ctx
, list
))
11810 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
11811 /* raise an error? */
11815 dlist
= _mesa_lookup_list(ctx
, list
);
11819 ctx
->ListState
.CallDepth
++;
11821 vbo_save_BeginCallList(ctx
, dlist
);
11827 const OpCode opcode
= n
[0].opcode
;
11829 if (is_ext_opcode(opcode
)) {
11830 n
+= ext_opcode_execute(ctx
, n
);
11835 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
11838 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11840 case OPCODE_ALPHA_FUNC
:
11841 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11843 case OPCODE_BIND_TEXTURE
:
11844 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11846 case OPCODE_BITMAP
:
11848 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11849 ctx
->Unpack
= ctx
->DefaultPacking
;
11850 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
11851 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11852 get_pointer(&n
[7])));
11853 ctx
->Unpack
= save
; /* restore */
11856 case OPCODE_BLEND_COLOR
:
11857 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11859 case OPCODE_BLEND_EQUATION
:
11860 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
11862 case OPCODE_BLEND_EQUATION_SEPARATE
:
11863 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11865 case OPCODE_BLEND_FUNC_SEPARATE
:
11866 CALL_BlendFuncSeparate(ctx
->Exec
,
11867 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11870 case OPCODE_BLEND_FUNC_I
:
11871 /* GL_ARB_draw_buffers_blend */
11872 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
11874 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11875 /* GL_ARB_draw_buffers_blend */
11876 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
11879 case OPCODE_BLEND_EQUATION_I
:
11880 /* GL_ARB_draw_buffers_blend */
11881 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11883 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11884 /* GL_ARB_draw_buffers_blend */
11885 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
11886 (n
[1].ui
, n
[2].e
, n
[3].e
));
11889 case OPCODE_CALL_LIST
:
11890 /* Generated by glCallList(), don't add ListBase */
11891 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11892 execute_list(ctx
, n
[1].ui
);
11895 case OPCODE_CALL_LISTS
:
11896 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11897 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
11901 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
11903 case OPCODE_CLEAR_BUFFER_IV
:
11910 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11913 case OPCODE_CLEAR_BUFFER_UIV
:
11916 value
[0] = n
[3].ui
;
11917 value
[1] = n
[4].ui
;
11918 value
[2] = n
[5].ui
;
11919 value
[3] = n
[6].ui
;
11920 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11923 case OPCODE_CLEAR_BUFFER_FV
:
11930 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11933 case OPCODE_CLEAR_BUFFER_FI
:
11934 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
11936 case OPCODE_CLEAR_COLOR
:
11937 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11939 case OPCODE_CLEAR_ACCUM
:
11940 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11942 case OPCODE_CLEAR_DEPTH
:
11943 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
11945 case OPCODE_CLEAR_INDEX
:
11946 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
11948 case OPCODE_CLEAR_STENCIL
:
11949 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
11951 case OPCODE_CLIP_PLANE
:
11958 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
11961 case OPCODE_COLOR_MASK
:
11962 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
11964 case OPCODE_COLOR_MASK_INDEXED
:
11965 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
11968 case OPCODE_COLOR_MATERIAL
:
11969 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11971 case OPCODE_COPY_PIXELS
:
11972 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11973 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
11976 case OPCODE_COPY_TEX_IMAGE1D
:
11977 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11978 n
[5].i
, n
[6].i
, n
[7].i
));
11980 case OPCODE_COPY_TEX_IMAGE2D
:
11981 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11982 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
11984 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
11985 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11986 n
[4].i
, n
[5].i
, n
[6].i
));
11988 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
11989 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11990 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11993 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
11994 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11995 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11998 case OPCODE_CULL_FACE
:
11999 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
12001 case OPCODE_DEPTH_FUNC
:
12002 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
12004 case OPCODE_DEPTH_MASK
:
12005 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
12007 case OPCODE_DEPTH_RANGE
:
12008 CALL_DepthRange(ctx
->Exec
,
12009 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
12011 case OPCODE_DISABLE
:
12012 CALL_Disable(ctx
->Exec
, (n
[1].e
));
12014 case OPCODE_DISABLE_INDEXED
:
12015 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
12017 case OPCODE_DRAW_BUFFER
:
12018 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
12020 case OPCODE_DRAW_PIXELS
:
12022 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12023 ctx
->Unpack
= ctx
->DefaultPacking
;
12024 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
12025 get_pointer(&n
[5])));
12026 ctx
->Unpack
= save
; /* restore */
12029 case OPCODE_ENABLE
:
12030 CALL_Enable(ctx
->Exec
, (n
[1].e
));
12032 case OPCODE_ENABLE_INDEXED
:
12033 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
12035 case OPCODE_EVALMESH1
:
12036 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
12038 case OPCODE_EVALMESH2
:
12039 CALL_EvalMesh2(ctx
->Exec
,
12040 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12049 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
12052 case OPCODE_FRONT_FACE
:
12053 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
12055 case OPCODE_FRUSTUM
:
12056 CALL_Frustum(ctx
->Exec
,
12057 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12060 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12062 case OPCODE_INDEX_MASK
:
12063 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
12065 case OPCODE_INIT_NAMES
:
12066 CALL_InitNames(ctx
->Exec
, ());
12075 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
12078 case OPCODE_LIGHT_MODEL
:
12085 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
12088 case OPCODE_LINE_STIPPLE
:
12089 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
12091 case OPCODE_LINE_WIDTH
:
12092 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
12094 case OPCODE_LIST_BASE
:
12095 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
12097 case OPCODE_LOAD_IDENTITY
:
12098 CALL_LoadIdentity(ctx
->Exec
, ());
12100 case OPCODE_LOAD_MATRIX
:
12101 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
12102 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
12104 case OPCODE_LOAD_NAME
:
12105 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
12107 case OPCODE_LOGIC_OP
:
12108 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
12112 GLenum target
= n
[1].e
;
12113 GLint ustride
= _mesa_evaluator_components(target
);
12114 GLint uorder
= n
[5].i
;
12115 GLfloat u1
= n
[2].f
;
12116 GLfloat u2
= n
[3].f
;
12117 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
12118 (GLfloat
*) get_pointer(&n
[6])));
12123 GLenum target
= n
[1].e
;
12124 GLfloat u1
= n
[2].f
;
12125 GLfloat u2
= n
[3].f
;
12126 GLfloat v1
= n
[4].f
;
12127 GLfloat v2
= n
[5].f
;
12128 GLint ustride
= n
[6].i
;
12129 GLint vstride
= n
[7].i
;
12130 GLint uorder
= n
[8].i
;
12131 GLint vorder
= n
[9].i
;
12132 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
12133 v1
, v2
, vstride
, vorder
,
12134 (GLfloat
*) get_pointer(&n
[10])));
12137 case OPCODE_MAPGRID1
:
12138 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
12140 case OPCODE_MAPGRID2
:
12141 CALL_MapGrid2f(ctx
->Exec
,
12142 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
12144 case OPCODE_MATRIX_MODE
:
12145 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
12147 case OPCODE_MULT_MATRIX
:
12148 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
12151 CALL_Ortho(ctx
->Exec
,
12152 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12154 case OPCODE_PASSTHROUGH
:
12155 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
12157 case OPCODE_PATCH_PARAMETER_I
:
12158 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12160 case OPCODE_PATCH_PARAMETER_FV_INNER
:
12163 params
[0] = n
[2].f
;
12164 params
[1] = n
[3].f
;
12165 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
12168 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
12171 params
[0] = n
[2].f
;
12172 params
[1] = n
[3].f
;
12173 params
[2] = n
[4].f
;
12174 params
[3] = n
[5].f
;
12175 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
12178 case OPCODE_PIXEL_MAP
:
12179 CALL_PixelMapfv(ctx
->Exec
,
12180 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
12182 case OPCODE_PIXEL_TRANSFER
:
12183 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12185 case OPCODE_PIXEL_ZOOM
:
12186 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12188 case OPCODE_POINT_SIZE
:
12189 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
12191 case OPCODE_POINT_PARAMETERS
:
12194 params
[0] = n
[2].f
;
12195 params
[1] = n
[3].f
;
12196 params
[2] = n
[4].f
;
12197 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
12200 case OPCODE_POLYGON_MODE
:
12201 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12203 case OPCODE_POLYGON_STIPPLE
:
12205 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12206 ctx
->Unpack
= ctx
->DefaultPacking
;
12207 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
12208 ctx
->Unpack
= save
; /* restore */
12211 case OPCODE_POLYGON_OFFSET
:
12212 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12214 case OPCODE_POLYGON_OFFSET_CLAMP
:
12215 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12217 case OPCODE_POP_ATTRIB
:
12218 CALL_PopAttrib(ctx
->Exec
, ());
12220 case OPCODE_POP_MATRIX
:
12221 CALL_PopMatrix(ctx
->Exec
, ());
12223 case OPCODE_POP_NAME
:
12224 CALL_PopName(ctx
->Exec
, ());
12226 case OPCODE_PRIORITIZE_TEXTURE
:
12227 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
12229 case OPCODE_PUSH_ATTRIB
:
12230 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
12232 case OPCODE_PUSH_MATRIX
:
12233 CALL_PushMatrix(ctx
->Exec
, ());
12235 case OPCODE_PUSH_NAME
:
12236 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
12238 case OPCODE_RASTER_POS
:
12239 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12241 case OPCODE_READ_BUFFER
:
12242 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
12244 case OPCODE_ROTATE
:
12245 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12248 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12250 case OPCODE_SCISSOR
:
12251 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12253 case OPCODE_SHADE_MODEL
:
12254 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
12256 case OPCODE_PROVOKING_VERTEX
:
12257 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
12259 case OPCODE_STENCIL_FUNC
:
12260 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
12262 case OPCODE_STENCIL_MASK
:
12263 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
12265 case OPCODE_STENCIL_OP
:
12266 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
12268 case OPCODE_STENCIL_FUNC_SEPARATE
:
12269 CALL_StencilFuncSeparate(ctx
->Exec
,
12270 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
12272 case OPCODE_STENCIL_MASK_SEPARATE
:
12273 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12275 case OPCODE_STENCIL_OP_SEPARATE
:
12276 CALL_StencilOpSeparate(ctx
->Exec
,
12277 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
12279 case OPCODE_TEXENV
:
12282 params
[0] = n
[3].f
;
12283 params
[1] = n
[4].f
;
12284 params
[2] = n
[5].f
;
12285 params
[3] = n
[6].f
;
12286 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12289 case OPCODE_TEXGEN
:
12292 params
[0] = n
[3].f
;
12293 params
[1] = n
[4].f
;
12294 params
[2] = n
[5].f
;
12295 params
[3] = n
[6].f
;
12296 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12299 case OPCODE_TEXPARAMETER
:
12302 params
[0] = n
[3].f
;
12303 params
[1] = n
[4].f
;
12304 params
[2] = n
[5].f
;
12305 params
[3] = n
[6].f
;
12306 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12309 case OPCODE_TEX_IMAGE1D
:
12311 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12312 ctx
->Unpack
= ctx
->DefaultPacking
;
12313 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
12314 n
[2].i
, /* level */
12315 n
[3].i
, /* components */
12316 n
[4].i
, /* width */
12317 n
[5].e
, /* border */
12318 n
[6].e
, /* format */
12320 get_pointer(&n
[8])));
12321 ctx
->Unpack
= save
; /* restore */
12324 case OPCODE_TEX_IMAGE2D
:
12326 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12327 ctx
->Unpack
= ctx
->DefaultPacking
;
12328 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
12329 n
[2].i
, /* level */
12330 n
[3].i
, /* components */
12331 n
[4].i
, /* width */
12332 n
[5].i
, /* height */
12333 n
[6].e
, /* border */
12334 n
[7].e
, /* format */
12336 get_pointer(&n
[9])));
12337 ctx
->Unpack
= save
; /* restore */
12340 case OPCODE_TEX_IMAGE3D
:
12342 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12343 ctx
->Unpack
= ctx
->DefaultPacking
;
12344 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
12345 n
[2].i
, /* level */
12346 n
[3].i
, /* components */
12347 n
[4].i
, /* width */
12348 n
[5].i
, /* height */
12349 n
[6].i
, /* depth */
12350 n
[7].e
, /* border */
12351 n
[8].e
, /* format */
12353 get_pointer(&n
[10])));
12354 ctx
->Unpack
= save
; /* restore */
12357 case OPCODE_TEX_SUB_IMAGE1D
:
12359 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12360 ctx
->Unpack
= ctx
->DefaultPacking
;
12361 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
12363 n
[6].e
, get_pointer(&n
[7])));
12364 ctx
->Unpack
= save
; /* restore */
12367 case OPCODE_TEX_SUB_IMAGE2D
:
12369 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12370 ctx
->Unpack
= ctx
->DefaultPacking
;
12371 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
12373 n
[6].i
, n
[7].e
, n
[8].e
,
12374 get_pointer(&n
[9])));
12375 ctx
->Unpack
= save
; /* restore */
12378 case OPCODE_TEX_SUB_IMAGE3D
:
12380 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12381 ctx
->Unpack
= ctx
->DefaultPacking
;
12382 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
12383 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
12384 n
[8].i
, n
[9].e
, n
[10].e
,
12385 get_pointer(&n
[11])));
12386 ctx
->Unpack
= save
; /* restore */
12389 case OPCODE_TRANSLATE
:
12390 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12392 case OPCODE_VIEWPORT
:
12393 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12394 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
12396 case OPCODE_WINDOW_POS
:
12397 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12399 case OPCODE_VIEWPORT_ARRAY_V
:
12400 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
12401 get_pointer(&n
[3])));
12403 case OPCODE_VIEWPORT_INDEXED_F
:
12404 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
12407 case OPCODE_VIEWPORT_INDEXED_FV
: {
12413 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
12416 case OPCODE_SCISSOR_ARRAY_V
:
12417 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
12418 get_pointer(&n
[3])));
12420 case OPCODE_SCISSOR_INDEXED
:
12421 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
12424 case OPCODE_SCISSOR_INDEXED_V
: {
12430 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
12433 case OPCODE_DEPTH_ARRAY_V
:
12434 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
12435 get_pointer(&n
[3])));
12437 case OPCODE_DEPTH_INDEXED
:
12438 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
12440 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
12441 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
12443 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
12444 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
12445 n
[4].i
, n
[5].i
, n
[6].i
,
12446 get_pointer(&n
[7])));
12448 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
12449 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
12450 n
[4].i
, n
[5].i
, n
[6].i
,
12451 n
[7].i
, get_pointer(&n
[8])));
12453 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
12454 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
12455 n
[4].i
, n
[5].i
, n
[6].i
,
12457 get_pointer(&n
[9])));
12459 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
12460 CALL_CompressedTexSubImage1D(ctx
->Exec
,
12461 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12463 get_pointer(&n
[7])));
12465 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
12466 CALL_CompressedTexSubImage2D(ctx
->Exec
,
12467 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12468 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
12469 get_pointer(&n
[9])));
12471 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
12472 CALL_CompressedTexSubImage3D(ctx
->Exec
,
12473 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
12474 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12476 get_pointer(&n
[11])));
12478 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
12479 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
12481 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
12482 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
12484 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
12485 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12487 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
12488 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
12489 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
12492 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
12493 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
12495 case OPCODE_DEPTH_BOUNDS_EXT
:
12496 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12498 case OPCODE_PROGRAM_STRING_ARB
:
12499 CALL_ProgramStringARB(ctx
->Exec
,
12500 (n
[1].e
, n
[2].e
, n
[3].i
,
12501 get_pointer(&n
[4])));
12503 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
12504 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
12508 case OPCODE_BEGIN_QUERY_ARB
:
12509 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12511 case OPCODE_END_QUERY_ARB
:
12512 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
12514 case OPCODE_QUERY_COUNTER
:
12515 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
12517 case OPCODE_BEGIN_QUERY_INDEXED
:
12518 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
12520 case OPCODE_END_QUERY_INDEXED
:
12521 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12523 case OPCODE_DRAW_BUFFERS_ARB
:
12525 GLenum buffers
[MAX_DRAW_BUFFERS
];
12526 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
12527 for (i
= 0; i
< count
; i
++)
12528 buffers
[i
] = n
[2 + i
].e
;
12529 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
12532 case OPCODE_BLIT_FRAMEBUFFER
:
12533 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
12534 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12537 case OPCODE_PRIMITIVE_RESTART_NV
:
12538 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
12541 case OPCODE_USE_PROGRAM
:
12542 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
12544 case OPCODE_UNIFORM_1F
:
12545 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
12547 case OPCODE_UNIFORM_2F
:
12548 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
12550 case OPCODE_UNIFORM_3F
:
12551 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
12553 case OPCODE_UNIFORM_4F
:
12554 CALL_Uniform4f(ctx
->Exec
,
12555 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12557 case OPCODE_UNIFORM_1FV
:
12558 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12560 case OPCODE_UNIFORM_2FV
:
12561 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12563 case OPCODE_UNIFORM_3FV
:
12564 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12566 case OPCODE_UNIFORM_4FV
:
12567 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12569 case OPCODE_UNIFORM_1D
: {
12570 union float64_pair x
;
12572 x
.uint32
[0] = n
[2].ui
;
12573 x
.uint32
[1] = n
[3].ui
;
12575 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
12578 case OPCODE_UNIFORM_2D
: {
12579 union float64_pair x
;
12580 union float64_pair y
;
12582 x
.uint32
[0] = n
[2].ui
;
12583 x
.uint32
[1] = n
[3].ui
;
12584 y
.uint32
[0] = n
[4].ui
;
12585 y
.uint32
[1] = n
[5].ui
;
12587 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
12590 case OPCODE_UNIFORM_3D
: {
12591 union float64_pair x
;
12592 union float64_pair y
;
12593 union float64_pair z
;
12595 x
.uint32
[0] = n
[2].ui
;
12596 x
.uint32
[1] = n
[3].ui
;
12597 y
.uint32
[0] = n
[4].ui
;
12598 y
.uint32
[1] = n
[5].ui
;
12599 z
.uint32
[0] = n
[6].ui
;
12600 z
.uint32
[1] = n
[7].ui
;
12602 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
12605 case OPCODE_UNIFORM_4D
: {
12606 union float64_pair x
;
12607 union float64_pair y
;
12608 union float64_pair z
;
12609 union float64_pair w
;
12611 x
.uint32
[0] = n
[2].ui
;
12612 x
.uint32
[1] = n
[3].ui
;
12613 y
.uint32
[0] = n
[4].ui
;
12614 y
.uint32
[1] = n
[5].ui
;
12615 z
.uint32
[0] = n
[6].ui
;
12616 z
.uint32
[1] = n
[7].ui
;
12617 w
.uint32
[0] = n
[8].ui
;
12618 w
.uint32
[1] = n
[9].ui
;
12620 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
12623 case OPCODE_UNIFORM_1DV
:
12624 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12626 case OPCODE_UNIFORM_2DV
:
12627 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12629 case OPCODE_UNIFORM_3DV
:
12630 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12632 case OPCODE_UNIFORM_4DV
:
12633 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12635 case OPCODE_UNIFORM_1I
:
12636 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12638 case OPCODE_UNIFORM_2I
:
12639 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12641 case OPCODE_UNIFORM_3I
:
12642 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12644 case OPCODE_UNIFORM_4I
:
12645 CALL_Uniform4i(ctx
->Exec
,
12646 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12648 case OPCODE_UNIFORM_1IV
:
12649 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12651 case OPCODE_UNIFORM_2IV
:
12652 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12654 case OPCODE_UNIFORM_3IV
:
12655 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12657 case OPCODE_UNIFORM_4IV
:
12658 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12660 case OPCODE_UNIFORM_1UI
:
12661 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12663 case OPCODE_UNIFORM_2UI
:
12664 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12666 case OPCODE_UNIFORM_3UI
:
12667 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12669 case OPCODE_UNIFORM_4UI
:
12670 CALL_Uniform4ui(ctx
->Exec
,
12671 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12673 case OPCODE_UNIFORM_1UIV
:
12674 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12676 case OPCODE_UNIFORM_2UIV
:
12677 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12679 case OPCODE_UNIFORM_3UIV
:
12680 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12682 case OPCODE_UNIFORM_4UIV
:
12683 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12685 case OPCODE_UNIFORM_MATRIX22
:
12686 CALL_UniformMatrix2fv(ctx
->Exec
,
12687 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12689 case OPCODE_UNIFORM_MATRIX33
:
12690 CALL_UniformMatrix3fv(ctx
->Exec
,
12691 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12693 case OPCODE_UNIFORM_MATRIX44
:
12694 CALL_UniformMatrix4fv(ctx
->Exec
,
12695 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12697 case OPCODE_UNIFORM_MATRIX23
:
12698 CALL_UniformMatrix2x3fv(ctx
->Exec
,
12699 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12701 case OPCODE_UNIFORM_MATRIX32
:
12702 CALL_UniformMatrix3x2fv(ctx
->Exec
,
12703 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12705 case OPCODE_UNIFORM_MATRIX24
:
12706 CALL_UniformMatrix2x4fv(ctx
->Exec
,
12707 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12709 case OPCODE_UNIFORM_MATRIX42
:
12710 CALL_UniformMatrix4x2fv(ctx
->Exec
,
12711 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12713 case OPCODE_UNIFORM_MATRIX34
:
12714 CALL_UniformMatrix3x4fv(ctx
->Exec
,
12715 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12717 case OPCODE_UNIFORM_MATRIX43
:
12718 CALL_UniformMatrix4x3fv(ctx
->Exec
,
12719 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12721 case OPCODE_UNIFORM_MATRIX22D
:
12722 CALL_UniformMatrix2dv(ctx
->Exec
,
12723 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12725 case OPCODE_UNIFORM_MATRIX33D
:
12726 CALL_UniformMatrix3dv(ctx
->Exec
,
12727 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12729 case OPCODE_UNIFORM_MATRIX44D
:
12730 CALL_UniformMatrix4dv(ctx
->Exec
,
12731 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12733 case OPCODE_UNIFORM_MATRIX23D
:
12734 CALL_UniformMatrix2x3dv(ctx
->Exec
,
12735 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12737 case OPCODE_UNIFORM_MATRIX32D
:
12738 CALL_UniformMatrix3x2dv(ctx
->Exec
,
12739 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12741 case OPCODE_UNIFORM_MATRIX24D
:
12742 CALL_UniformMatrix2x4dv(ctx
->Exec
,
12743 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12745 case OPCODE_UNIFORM_MATRIX42D
:
12746 CALL_UniformMatrix4x2dv(ctx
->Exec
,
12747 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12749 case OPCODE_UNIFORM_MATRIX34D
:
12750 CALL_UniformMatrix3x4dv(ctx
->Exec
,
12751 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12753 case OPCODE_UNIFORM_MATRIX43D
:
12754 CALL_UniformMatrix4x3dv(ctx
->Exec
,
12755 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12758 case OPCODE_UNIFORM_1I64
: {
12759 union int64_pair x
;
12761 x
.int32
[0] = n
[2].i
;
12762 x
.int32
[1] = n
[3].i
;
12764 CALL_Uniform1i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
));
12767 case OPCODE_UNIFORM_2I64
: {
12768 union int64_pair x
;
12769 union int64_pair y
;
12771 x
.int32
[0] = n
[2].i
;
12772 x
.int32
[1] = n
[3].i
;
12773 y
.int32
[0] = n
[4].i
;
12774 y
.int32
[1] = n
[5].i
;
12776 CALL_Uniform2i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
));
12779 case OPCODE_UNIFORM_3I64
: {
12780 union int64_pair x
;
12781 union int64_pair y
;
12782 union int64_pair z
;
12784 x
.int32
[0] = n
[2].i
;
12785 x
.int32
[1] = n
[3].i
;
12786 y
.int32
[0] = n
[4].i
;
12787 y
.int32
[1] = n
[5].i
;
12788 z
.int32
[0] = n
[6].i
;
12789 z
.int32
[1] = n
[7].i
;
12792 CALL_Uniform3i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
));
12795 case OPCODE_UNIFORM_4I64
: {
12796 union int64_pair x
;
12797 union int64_pair y
;
12798 union int64_pair z
;
12799 union int64_pair w
;
12801 x
.int32
[0] = n
[2].i
;
12802 x
.int32
[1] = n
[3].i
;
12803 y
.int32
[0] = n
[4].i
;
12804 y
.int32
[1] = n
[5].i
;
12805 z
.int32
[0] = n
[6].i
;
12806 z
.int32
[1] = n
[7].i
;
12807 w
.int32
[0] = n
[8].i
;
12808 w
.int32
[1] = n
[9].i
;
12810 CALL_Uniform4i64ARB(ctx
->Exec
, (n
[1].i
, x
.int64
, y
.int64
, z
.int64
, w
.int64
));
12813 case OPCODE_UNIFORM_1I64V
:
12814 CALL_Uniform1i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12816 case OPCODE_UNIFORM_2I64V
:
12817 CALL_Uniform2i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12819 case OPCODE_UNIFORM_3I64V
:
12820 CALL_Uniform3i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12822 case OPCODE_UNIFORM_4I64V
:
12823 CALL_Uniform4i64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12825 case OPCODE_UNIFORM_1UI64
: {
12826 union uint64_pair x
;
12828 x
.uint32
[0] = n
[2].ui
;
12829 x
.uint32
[1] = n
[3].ui
;
12831 CALL_Uniform1ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
));
12834 case OPCODE_UNIFORM_2UI64
: {
12835 union uint64_pair x
;
12836 union uint64_pair y
;
12838 x
.uint32
[0] = n
[2].ui
;
12839 x
.uint32
[1] = n
[3].ui
;
12840 y
.uint32
[0] = n
[4].ui
;
12841 y
.uint32
[1] = n
[5].ui
;
12843 CALL_Uniform2ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
));
12846 case OPCODE_UNIFORM_3UI64
: {
12847 union uint64_pair x
;
12848 union uint64_pair y
;
12849 union uint64_pair z
;
12851 x
.uint32
[0] = n
[2].ui
;
12852 x
.uint32
[1] = n
[3].ui
;
12853 y
.uint32
[0] = n
[4].ui
;
12854 y
.uint32
[1] = n
[5].ui
;
12855 z
.uint32
[0] = n
[6].ui
;
12856 z
.uint32
[1] = n
[7].ui
;
12859 CALL_Uniform3ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12863 case OPCODE_UNIFORM_4UI64
: {
12864 union uint64_pair x
;
12865 union uint64_pair y
;
12866 union uint64_pair z
;
12867 union uint64_pair w
;
12869 x
.uint32
[0] = n
[2].ui
;
12870 x
.uint32
[1] = n
[3].ui
;
12871 y
.uint32
[0] = n
[4].ui
;
12872 y
.uint32
[1] = n
[5].ui
;
12873 z
.uint32
[0] = n
[6].ui
;
12874 z
.uint32
[1] = n
[7].ui
;
12875 w
.uint32
[0] = n
[8].ui
;
12876 w
.uint32
[1] = n
[9].ui
;
12878 CALL_Uniform4ui64ARB(ctx
->Exec
, (n
[1].i
, x
.uint64
, y
.uint64
,
12879 z
.uint64
, w
.uint64
));
12882 case OPCODE_UNIFORM_1UI64V
:
12883 CALL_Uniform1ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12884 get_pointer(&n
[3])));
12886 case OPCODE_UNIFORM_2UI64V
:
12887 CALL_Uniform2ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12888 get_pointer(&n
[3])));
12890 case OPCODE_UNIFORM_3UI64V
:
12891 CALL_Uniform3ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12892 get_pointer(&n
[3])));
12894 case OPCODE_UNIFORM_4UI64V
:
12895 CALL_Uniform4ui64vARB(ctx
->Exec
, (n
[1].i
, n
[2].i
,
12896 get_pointer(&n
[3])));
12899 case OPCODE_PROGRAM_UNIFORM_1I64
: {
12900 union int64_pair x
;
12902 x
.int32
[0] = n
[3].i
;
12903 x
.int32
[1] = n
[4].i
;
12905 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
));
12908 case OPCODE_PROGRAM_UNIFORM_2I64
: {
12909 union int64_pair x
;
12910 union int64_pair y
;
12912 x
.int32
[0] = n
[3].i
;
12913 x
.int32
[1] = n
[4].i
;
12914 y
.int32
[0] = n
[5].i
;
12915 y
.int32
[1] = n
[6].i
;
12917 CALL_ProgramUniform2i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12921 case OPCODE_PROGRAM_UNIFORM_3I64
: {
12922 union int64_pair x
;
12923 union int64_pair y
;
12924 union int64_pair z
;
12926 x
.int32
[0] = n
[3].i
;
12927 x
.int32
[1] = n
[4].i
;
12928 y
.int32
[0] = n
[5].i
;
12929 y
.int32
[1] = n
[6].i
;
12930 z
.int32
[0] = n
[7].i
;
12931 z
.int32
[1] = n
[8].i
;
12933 CALL_ProgramUniform3i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12934 y
.int64
, z
.int64
));
12937 case OPCODE_PROGRAM_UNIFORM_4I64
: {
12938 union int64_pair x
;
12939 union int64_pair y
;
12940 union int64_pair z
;
12941 union int64_pair w
;
12943 x
.int32
[0] = n
[3].i
;
12944 x
.int32
[1] = n
[4].i
;
12945 y
.int32
[0] = n
[5].i
;
12946 y
.int32
[1] = n
[6].i
;
12947 z
.int32
[0] = n
[7].i
;
12948 z
.int32
[1] = n
[8].i
;
12949 w
.int32
[0] = n
[9].i
;
12950 w
.int32
[1] = n
[10].i
;
12952 CALL_ProgramUniform4i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.int64
,
12953 y
.int64
, z
.int64
, w
.int64
));
12956 case OPCODE_PROGRAM_UNIFORM_1I64V
:
12957 CALL_ProgramUniform1i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12958 get_pointer(&n
[4])));
12960 case OPCODE_PROGRAM_UNIFORM_2I64V
:
12961 CALL_ProgramUniform2i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12962 get_pointer(&n
[4])));
12964 case OPCODE_PROGRAM_UNIFORM_3I64V
:
12965 CALL_ProgramUniform3i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12966 get_pointer(&n
[4])));
12968 case OPCODE_PROGRAM_UNIFORM_4I64V
:
12969 CALL_ProgramUniform4i64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12970 get_pointer(&n
[4])));
12972 case OPCODE_PROGRAM_UNIFORM_1UI64
: {
12973 union uint64_pair x
;
12975 x
.uint32
[0] = n
[3].ui
;
12976 x
.uint32
[1] = n
[4].ui
;
12978 CALL_ProgramUniform1i64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
));
12981 case OPCODE_PROGRAM_UNIFORM_2UI64
: {
12982 union uint64_pair x
;
12983 union uint64_pair y
;
12985 x
.uint32
[0] = n
[3].ui
;
12986 x
.uint32
[1] = n
[4].ui
;
12987 y
.uint32
[0] = n
[5].ui
;
12988 y
.uint32
[1] = n
[6].ui
;
12990 CALL_ProgramUniform2ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
12994 case OPCODE_PROGRAM_UNIFORM_3UI64
: {
12995 union uint64_pair x
;
12996 union uint64_pair y
;
12997 union uint64_pair z
;
12999 x
.uint32
[0] = n
[3].ui
;
13000 x
.uint32
[1] = n
[4].ui
;
13001 y
.uint32
[0] = n
[5].ui
;
13002 y
.uint32
[1] = n
[6].ui
;
13003 z
.uint32
[0] = n
[7].ui
;
13004 z
.uint32
[1] = n
[8].ui
;
13006 CALL_ProgramUniform3ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
13007 y
.uint64
, z
.uint64
));
13010 case OPCODE_PROGRAM_UNIFORM_4UI64
: {
13011 union uint64_pair x
;
13012 union uint64_pair y
;
13013 union uint64_pair z
;
13014 union uint64_pair w
;
13016 x
.uint32
[0] = n
[3].ui
;
13017 x
.uint32
[1] = n
[4].ui
;
13018 y
.uint32
[0] = n
[5].ui
;
13019 y
.uint32
[1] = n
[6].ui
;
13020 z
.uint32
[0] = n
[7].ui
;
13021 z
.uint32
[1] = n
[8].ui
;
13022 w
.uint32
[0] = n
[9].ui
;
13023 w
.uint32
[1] = n
[10].ui
;
13025 CALL_ProgramUniform4ui64ARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.uint64
,
13026 y
.uint64
, z
.uint64
, w
.uint64
));
13029 case OPCODE_PROGRAM_UNIFORM_1UI64V
:
13030 CALL_ProgramUniform1ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13031 get_pointer(&n
[4])));
13033 case OPCODE_PROGRAM_UNIFORM_2UI64V
:
13034 CALL_ProgramUniform2ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13035 get_pointer(&n
[4])));
13037 case OPCODE_PROGRAM_UNIFORM_3UI64V
:
13038 CALL_ProgramUniform3ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13039 get_pointer(&n
[4])));
13041 case OPCODE_PROGRAM_UNIFORM_4UI64V
:
13042 CALL_ProgramUniform4ui64vARB(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13043 get_pointer(&n
[4])));
13046 case OPCODE_USE_PROGRAM_STAGES
:
13047 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13049 case OPCODE_PROGRAM_UNIFORM_1F
:
13050 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
13052 case OPCODE_PROGRAM_UNIFORM_2F
:
13053 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
13055 case OPCODE_PROGRAM_UNIFORM_3F
:
13056 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13057 n
[3].f
, n
[4].f
, n
[5].f
));
13059 case OPCODE_PROGRAM_UNIFORM_4F
:
13060 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13061 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
13063 case OPCODE_PROGRAM_UNIFORM_1FV
:
13064 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13065 get_pointer(&n
[4])));
13067 case OPCODE_PROGRAM_UNIFORM_2FV
:
13068 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13069 get_pointer(&n
[4])));
13071 case OPCODE_PROGRAM_UNIFORM_3FV
:
13072 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13073 get_pointer(&n
[4])));
13075 case OPCODE_PROGRAM_UNIFORM_4FV
:
13076 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13077 get_pointer(&n
[4])));
13079 case OPCODE_PROGRAM_UNIFORM_1D
: {
13080 union float64_pair x
;
13082 x
.uint32
[0] = n
[3].ui
;
13083 x
.uint32
[1] = n
[4].ui
;
13085 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
13088 case OPCODE_PROGRAM_UNIFORM_2D
: {
13089 union float64_pair x
;
13090 union float64_pair y
;
13092 x
.uint32
[0] = n
[3].ui
;
13093 x
.uint32
[1] = n
[4].ui
;
13094 y
.uint32
[0] = n
[5].ui
;
13095 y
.uint32
[1] = n
[6].ui
;
13097 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
13100 case OPCODE_PROGRAM_UNIFORM_3D
: {
13101 union float64_pair x
;
13102 union float64_pair y
;
13103 union float64_pair z
;
13105 x
.uint32
[0] = n
[3].ui
;
13106 x
.uint32
[1] = n
[4].ui
;
13107 y
.uint32
[0] = n
[5].ui
;
13108 y
.uint32
[1] = n
[6].ui
;
13109 z
.uint32
[0] = n
[7].ui
;
13110 z
.uint32
[1] = n
[8].ui
;
13112 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13116 case OPCODE_PROGRAM_UNIFORM_4D
: {
13117 union float64_pair x
;
13118 union float64_pair y
;
13119 union float64_pair z
;
13120 union float64_pair w
;
13122 x
.uint32
[0] = n
[3].ui
;
13123 x
.uint32
[1] = n
[4].ui
;
13124 y
.uint32
[0] = n
[5].ui
;
13125 y
.uint32
[1] = n
[6].ui
;
13126 z
.uint32
[0] = n
[7].ui
;
13127 z
.uint32
[1] = n
[8].ui
;
13128 w
.uint32
[0] = n
[9].ui
;
13129 w
.uint32
[1] = n
[10].ui
;
13131 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13132 x
.d
, y
.d
, z
.d
, w
.d
));
13135 case OPCODE_PROGRAM_UNIFORM_1DV
:
13136 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13137 get_pointer(&n
[4])));
13139 case OPCODE_PROGRAM_UNIFORM_2DV
:
13140 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13141 get_pointer(&n
[4])));
13143 case OPCODE_PROGRAM_UNIFORM_3DV
:
13144 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13145 get_pointer(&n
[4])));
13147 case OPCODE_PROGRAM_UNIFORM_4DV
:
13148 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13149 get_pointer(&n
[4])));
13151 case OPCODE_PROGRAM_UNIFORM_1I
:
13152 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
13154 case OPCODE_PROGRAM_UNIFORM_2I
:
13155 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
13157 case OPCODE_PROGRAM_UNIFORM_3I
:
13158 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13159 n
[3].i
, n
[4].i
, n
[5].i
));
13161 case OPCODE_PROGRAM_UNIFORM_4I
:
13162 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13163 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
13165 case OPCODE_PROGRAM_UNIFORM_1IV
:
13166 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13167 get_pointer(&n
[4])));
13169 case OPCODE_PROGRAM_UNIFORM_2IV
:
13170 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13171 get_pointer(&n
[4])));
13173 case OPCODE_PROGRAM_UNIFORM_3IV
:
13174 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13175 get_pointer(&n
[4])));
13177 case OPCODE_PROGRAM_UNIFORM_4IV
:
13178 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13179 get_pointer(&n
[4])));
13181 case OPCODE_PROGRAM_UNIFORM_1UI
:
13182 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
13184 case OPCODE_PROGRAM_UNIFORM_2UI
:
13185 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13186 n
[3].ui
, n
[4].ui
));
13188 case OPCODE_PROGRAM_UNIFORM_3UI
:
13189 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13190 n
[3].ui
, n
[4].ui
, n
[5].ui
));
13192 case OPCODE_PROGRAM_UNIFORM_4UI
:
13193 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
13195 n
[4].ui
, n
[5].ui
, n
[6].ui
));
13197 case OPCODE_PROGRAM_UNIFORM_1UIV
:
13198 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13199 get_pointer(&n
[4])));
13201 case OPCODE_PROGRAM_UNIFORM_2UIV
:
13202 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13203 get_pointer(&n
[4])));
13205 case OPCODE_PROGRAM_UNIFORM_3UIV
:
13206 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13207 get_pointer(&n
[4])));
13209 case OPCODE_PROGRAM_UNIFORM_4UIV
:
13210 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
13211 get_pointer(&n
[4])));
13213 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
13214 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
13215 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13216 get_pointer(&n
[5])));
13218 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
13219 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
13220 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13221 get_pointer(&n
[5])));
13223 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
13224 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
13225 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13226 get_pointer(&n
[5])));
13228 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
13229 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
13230 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13231 get_pointer(&n
[5])));
13233 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
13234 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
13235 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13236 get_pointer(&n
[5])));
13238 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
13239 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
13240 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13241 get_pointer(&n
[5])));
13243 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
13244 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
13245 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13246 get_pointer(&n
[5])));
13248 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
13249 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
13250 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13251 get_pointer(&n
[5])));
13253 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
13254 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
13255 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13256 get_pointer(&n
[5])));
13258 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
13259 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
13260 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13261 get_pointer(&n
[5])));
13263 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
13264 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
13265 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13266 get_pointer(&n
[5])));
13268 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
13269 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
13270 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13271 get_pointer(&n
[5])));
13273 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
13274 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
13275 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13276 get_pointer(&n
[5])));
13278 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
13279 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
13280 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13281 get_pointer(&n
[5])));
13283 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
13284 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
13285 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13286 get_pointer(&n
[5])));
13288 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
13289 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
13290 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13291 get_pointer(&n
[5])));
13293 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
13294 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
13295 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13296 get_pointer(&n
[5])));
13298 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
13299 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
13300 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
13301 get_pointer(&n
[5])));
13304 case OPCODE_CLIP_CONTROL
:
13305 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
13308 case OPCODE_CLAMP_COLOR
:
13309 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
13312 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
13313 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
13315 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
13316 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
13318 case OPCODE_ATTR_1F_NV
:
13319 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
13321 case OPCODE_ATTR_2F_NV
:
13322 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13324 case OPCODE_ATTR_3F_NV
:
13325 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13327 case OPCODE_ATTR_4F_NV
:
13328 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13330 case OPCODE_ATTR_1F_ARB
:
13331 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
13333 case OPCODE_ATTR_2F_ARB
:
13334 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13336 case OPCODE_ATTR_3F_ARB
:
13337 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13339 case OPCODE_ATTR_4F_ARB
:
13340 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13342 case OPCODE_ATTR_1D
: {
13343 GLdouble
*d
= (GLdouble
*) &n
[2];
13344 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
13347 case OPCODE_ATTR_2D
: {
13348 GLdouble
*d
= (GLdouble
*) &n
[2];
13349 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
13352 case OPCODE_ATTR_3D
: {
13353 GLdouble
*d
= (GLdouble
*) &n
[2];
13354 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
13357 case OPCODE_ATTR_4D
: {
13358 GLdouble
*d
= (GLdouble
*) &n
[2];
13359 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
13362 case OPCODE_MATERIAL
:
13363 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
13366 CALL_Begin(ctx
->Exec
, (n
[1].e
));
13369 CALL_End(ctx
->Exec
, ());
13372 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
13374 case OPCODE_EVAL_C1
:
13375 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
13377 case OPCODE_EVAL_C2
:
13378 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
13380 case OPCODE_EVAL_P1
:
13381 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
13383 case OPCODE_EVAL_P2
:
13384 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
13387 /* GL_EXT_texture_integer */
13388 case OPCODE_CLEARCOLOR_I
:
13389 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
13391 case OPCODE_CLEARCOLOR_UI
:
13392 CALL_ClearColorIuiEXT(ctx
->Exec
,
13393 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
13395 case OPCODE_TEXPARAMETER_I
:
13398 params
[0] = n
[3].i
;
13399 params
[1] = n
[4].i
;
13400 params
[2] = n
[5].i
;
13401 params
[3] = n
[6].i
;
13402 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
13405 case OPCODE_TEXPARAMETER_UI
:
13408 params
[0] = n
[3].ui
;
13409 params
[1] = n
[4].ui
;
13410 params
[2] = n
[5].ui
;
13411 params
[3] = n
[6].ui
;
13412 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
13416 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
13417 /* GL_ARB_instanced_arrays */
13418 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13421 case OPCODE_TEXTURE_BARRIER_NV
:
13422 CALL_TextureBarrierNV(ctx
->Exec
, ());
13425 /* GL_EXT/ARB_transform_feedback */
13426 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
13427 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
13429 case OPCODE_END_TRANSFORM_FEEDBACK
:
13430 CALL_EndTransformFeedback(ctx
->Exec
, ());
13432 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
13433 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
13435 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
13436 CALL_PauseTransformFeedback(ctx
->Exec
, ());
13438 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
13439 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
13441 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
13442 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
13444 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
13445 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
13446 (n
[1].e
, n
[2].ui
, n
[3].ui
));
13448 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
13449 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
13450 (n
[1].e
, n
[2].ui
, n
[3].si
));
13452 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
13453 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
13454 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
13458 case OPCODE_BIND_SAMPLER
:
13459 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13461 case OPCODE_SAMPLER_PARAMETERIV
:
13464 params
[0] = n
[3].i
;
13465 params
[1] = n
[4].i
;
13466 params
[2] = n
[5].i
;
13467 params
[3] = n
[6].i
;
13468 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13471 case OPCODE_SAMPLER_PARAMETERFV
:
13474 params
[0] = n
[3].f
;
13475 params
[1] = n
[4].f
;
13476 params
[2] = n
[5].f
;
13477 params
[3] = n
[6].f
;
13478 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13481 case OPCODE_SAMPLER_PARAMETERIIV
:
13484 params
[0] = n
[3].i
;
13485 params
[1] = n
[4].i
;
13486 params
[2] = n
[5].i
;
13487 params
[3] = n
[6].i
;
13488 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13491 case OPCODE_SAMPLER_PARAMETERUIV
:
13494 params
[0] = n
[3].ui
;
13495 params
[1] = n
[4].ui
;
13496 params
[2] = n
[5].ui
;
13497 params
[3] = n
[6].ui
;
13498 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
13502 /* ARB_compute_shader */
13503 case OPCODE_DISPATCH_COMPUTE
:
13504 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13508 case OPCODE_WAIT_SYNC
:
13510 union uint64_pair p
;
13511 p
.uint32
[0] = n
[2].ui
;
13512 p
.uint32
[1] = n
[3].ui
;
13513 CALL_WaitSync(ctx
->Exec
,
13514 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
13518 /* GL_NV_conditional_render */
13519 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
13520 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
13522 case OPCODE_END_CONDITIONAL_RENDER
:
13523 CALL_EndConditionalRender(ctx
->Exec
, ());
13526 case OPCODE_UNIFORM_BLOCK_BINDING
:
13527 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
13530 case OPCODE_UNIFORM_SUBROUTINES
:
13531 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
13532 get_pointer(&n
[3])));
13535 /* GL_EXT_window_rectangles */
13536 case OPCODE_WINDOW_RECTANGLES
:
13537 CALL_WindowRectanglesEXT(
13538 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
13541 /* GL_NV_conservative_raster */
13542 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
13543 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
13546 /* GL_NV_conservative_raster_dilate */
13547 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
13548 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
13551 /* GL_NV_conservative_raster_pre_snap_triangles */
13552 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
13553 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
13556 /* GL_EXT_direct_state_access */
13557 case OPCODE_MATRIX_LOAD
:
13558 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13560 case OPCODE_MATRIX_MULT
:
13561 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
13563 case OPCODE_MATRIX_ROTATE
:
13564 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
13566 case OPCODE_MATRIX_SCALE
:
13567 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13569 case OPCODE_MATRIX_TRANSLATE
:
13570 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
13572 case OPCODE_MATRIX_LOAD_IDENTITY
:
13573 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
13575 case OPCODE_MATRIX_ORTHO
:
13576 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
13577 n
[2].f
, n
[3].f
, n
[4].f
,
13578 n
[5].f
, n
[6].f
, n
[7].f
));
13580 case OPCODE_MATRIX_FRUSTUM
:
13581 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
13582 n
[2].f
, n
[3].f
, n
[4].f
,
13583 n
[5].f
, n
[6].f
, n
[7].f
));
13585 case OPCODE_MATRIX_PUSH
:
13586 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
13588 case OPCODE_MATRIX_POP
:
13589 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
13591 case OPCODE_TEXTUREPARAMETER_F
:
13594 params
[0] = n
[4].f
;
13595 params
[1] = n
[5].f
;
13596 params
[2] = n
[6].f
;
13597 params
[3] = n
[7].f
;
13598 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13601 case OPCODE_TEXTUREPARAMETER_I
:
13604 params
[0] = n
[4].i
;
13605 params
[1] = n
[5].i
;
13606 params
[2] = n
[6].i
;
13607 params
[3] = n
[7].i
;
13608 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13611 case OPCODE_TEXTUREPARAMETER_II
:
13614 params
[0] = n
[4].i
;
13615 params
[1] = n
[5].i
;
13616 params
[2] = n
[6].i
;
13617 params
[3] = n
[7].i
;
13618 CALL_TextureParameterIivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13621 case OPCODE_TEXTUREPARAMETER_IUI
:
13624 params
[0] = n
[4].ui
;
13625 params
[1] = n
[5].ui
;
13626 params
[2] = n
[6].ui
;
13627 params
[3] = n
[7].ui
;
13628 CALL_TextureParameterIuivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
13631 case OPCODE_TEXTURE_IMAGE1D
:
13633 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13634 ctx
->Unpack
= ctx
->DefaultPacking
;
13635 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13636 n
[2].e
, /* target */
13637 n
[3].i
, /* level */
13638 n
[4].i
, /* components */
13639 n
[5].i
, /* width */
13640 n
[6].e
, /* border */
13641 n
[7].e
, /* format */
13643 get_pointer(&n
[9])));
13644 ctx
->Unpack
= save
; /* restore */
13647 case OPCODE_TEXTURE_IMAGE2D
:
13649 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13650 ctx
->Unpack
= ctx
->DefaultPacking
;
13651 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13652 n
[2].e
, /* target */
13653 n
[3].i
, /* level */
13654 n
[4].i
, /* components */
13655 n
[5].i
, /* width */
13656 n
[6].i
, /* height */
13657 n
[7].e
, /* border */
13658 n
[8].e
, /* format */
13660 get_pointer(&n
[10])));
13661 ctx
->Unpack
= save
; /* restore */
13664 case OPCODE_TEXTURE_IMAGE3D
:
13666 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13667 ctx
->Unpack
= ctx
->DefaultPacking
;
13668 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
13669 n
[2].e
, /* target */
13670 n
[3].i
, /* level */
13671 n
[4].i
, /* components */
13672 n
[5].i
, /* width */
13673 n
[6].i
, /* height */
13674 n
[7].i
, /* depth */
13675 n
[8].e
, /* border */
13676 n
[9].e
, /* format */
13677 n
[10].e
, /* type */
13678 get_pointer(&n
[11])));
13679 ctx
->Unpack
= save
; /* restore */
13682 case OPCODE_TEXTURE_SUB_IMAGE1D
:
13684 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13685 ctx
->Unpack
= ctx
->DefaultPacking
;
13686 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13687 n
[4].i
, n
[5].i
, n
[6].e
,
13688 n
[7].e
, get_pointer(&n
[8])));
13689 ctx
->Unpack
= save
; /* restore */
13692 case OPCODE_TEXTURE_SUB_IMAGE2D
:
13694 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13695 ctx
->Unpack
= ctx
->DefaultPacking
;
13696 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13697 n
[4].i
, n
[5].i
, n
[6].e
,
13698 n
[7].i
, n
[8].e
, n
[9].e
,
13699 get_pointer(&n
[10])));
13700 ctx
->Unpack
= save
;
13703 case OPCODE_TEXTURE_SUB_IMAGE3D
:
13705 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13706 ctx
->Unpack
= ctx
->DefaultPacking
;
13707 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13708 n
[4].i
, n
[5].i
, n
[6].i
,
13709 n
[7].i
, n
[8].i
, n
[9].i
,
13711 get_pointer(&n
[12])));
13712 ctx
->Unpack
= save
; /* restore */
13715 case OPCODE_COPY_TEXTURE_IMAGE1D
:
13716 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13717 n
[4].e
, n
[5].i
, n
[6].i
,
13720 case OPCODE_COPY_TEXTURE_IMAGE2D
:
13721 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13722 n
[4].e
, n
[5].i
, n
[6].i
,
13723 n
[7].i
, n
[8].i
, n
[9].i
));
13725 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
13726 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13727 n
[4].i
, n
[5].i
, n
[6].i
,
13730 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
13731 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13732 n
[4].i
, n
[5].i
, n
[6].i
,
13733 n
[7].i
, n
[8].i
, n
[9].i
));
13735 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
13736 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13737 n
[4].i
, n
[5].i
, n
[6].i
,
13738 n
[7].i
, n
[8].i
, n
[9].i
,
13741 case OPCODE_BIND_MULTITEXTURE
:
13742 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
13744 case OPCODE_MULTITEXPARAMETER_F
:
13747 params
[0] = n
[4].f
;
13748 params
[1] = n
[5].f
;
13749 params
[2] = n
[6].f
;
13750 params
[3] = n
[7].f
;
13751 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13754 case OPCODE_MULTITEXPARAMETER_I
:
13757 params
[0] = n
[4].i
;
13758 params
[1] = n
[5].i
;
13759 params
[2] = n
[6].i
;
13760 params
[3] = n
[7].i
;
13761 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13764 case OPCODE_MULTITEXPARAMETER_II
:
13767 params
[0] = n
[4].i
;
13768 params
[1] = n
[5].i
;
13769 params
[2] = n
[6].i
;
13770 params
[3] = n
[7].i
;
13771 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13774 case OPCODE_MULTITEXPARAMETER_IUI
:
13777 params
[0] = n
[4].ui
;
13778 params
[1] = n
[5].ui
;
13779 params
[2] = n
[6].ui
;
13780 params
[3] = n
[7].ui
;
13781 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13784 case OPCODE_MULTITEX_IMAGE1D
:
13786 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13787 ctx
->Unpack
= ctx
->DefaultPacking
;
13788 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13789 n
[2].e
, /* target */
13790 n
[3].i
, /* level */
13791 n
[4].i
, /* components */
13792 n
[5].i
, /* width */
13793 n
[6].e
, /* border */
13794 n
[7].e
, /* format */
13796 get_pointer(&n
[9])));
13797 ctx
->Unpack
= save
; /* restore */
13800 case OPCODE_MULTITEX_IMAGE2D
:
13802 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13803 ctx
->Unpack
= ctx
->DefaultPacking
;
13804 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13805 n
[2].e
, /* target */
13806 n
[3].i
, /* level */
13807 n
[4].i
, /* components */
13808 n
[5].i
, /* width */
13809 n
[6].i
, /* height */
13810 n
[7].e
, /* border */
13811 n
[8].e
, /* format */
13813 get_pointer(&n
[10])));
13814 ctx
->Unpack
= save
; /* restore */
13817 case OPCODE_MULTITEX_IMAGE3D
:
13819 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13820 ctx
->Unpack
= ctx
->DefaultPacking
;
13821 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
13822 n
[2].e
, /* target */
13823 n
[3].i
, /* level */
13824 n
[4].i
, /* components */
13825 n
[5].i
, /* width */
13826 n
[6].i
, /* height */
13827 n
[7].i
, /* depth */
13828 n
[8].e
, /* border */
13829 n
[9].e
, /* format */
13830 n
[10].e
, /* type */
13831 get_pointer(&n
[11])));
13832 ctx
->Unpack
= save
; /* restore */
13835 case OPCODE_MULTITEX_SUB_IMAGE1D
:
13837 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13838 ctx
->Unpack
= ctx
->DefaultPacking
;
13839 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13840 n
[4].i
, n
[5].i
, n
[6].e
,
13841 n
[7].e
, get_pointer(&n
[8])));
13842 ctx
->Unpack
= save
; /* restore */
13845 case OPCODE_MULTITEX_SUB_IMAGE2D
:
13847 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13848 ctx
->Unpack
= ctx
->DefaultPacking
;
13849 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13850 n
[4].i
, n
[5].i
, n
[6].e
,
13851 n
[7].i
, n
[8].e
, n
[9].e
,
13852 get_pointer(&n
[10])));
13853 ctx
->Unpack
= save
; /* restore */
13856 case OPCODE_MULTITEX_SUB_IMAGE3D
:
13858 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
13859 ctx
->Unpack
= ctx
->DefaultPacking
;
13860 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13861 n
[4].i
, n
[5].i
, n
[6].i
,
13862 n
[7].i
, n
[8].i
, n
[9].i
,
13864 get_pointer(&n
[12])));
13865 ctx
->Unpack
= save
; /* restore */
13868 case OPCODE_COPY_MULTITEX_IMAGE1D
:
13869 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13870 n
[4].e
, n
[5].i
, n
[6].i
,
13873 case OPCODE_COPY_MULTITEX_IMAGE2D
:
13874 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13875 n
[4].e
, n
[5].i
, n
[6].i
,
13876 n
[7].i
, n
[8].i
, n
[9].i
));
13878 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
13879 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13880 n
[4].i
, n
[5].i
, n
[6].i
,
13883 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
13884 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13885 n
[4].i
, n
[5].i
, n
[6].i
,
13886 n
[7].i
, n
[8].i
, n
[9].i
));
13888 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
13889 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13890 n
[4].i
, n
[5].i
, n
[6].i
,
13891 n
[7].i
, n
[8].i
, n
[9].i
,
13894 case OPCODE_MULTITEXENV
:
13897 params
[0] = n
[4].f
;
13898 params
[1] = n
[5].f
;
13899 params
[2] = n
[6].f
;
13900 params
[3] = n
[7].f
;
13901 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
13904 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
13905 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13906 n
[4].e
, n
[5].i
, n
[6].i
,
13907 n
[7].i
, get_pointer(&n
[8])));
13909 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
13910 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13911 n
[4].e
, n
[5].i
, n
[6].i
,
13913 get_pointer(&n
[9])));
13915 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
13916 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
13917 n
[4].e
, n
[5].i
, n
[6].i
,
13918 n
[7].i
, n
[8].i
, n
[9].i
,
13919 get_pointer(&n
[10])));
13921 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
13922 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
13923 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13924 n
[5].i
, n
[6].e
, n
[7].i
,
13925 get_pointer(&n
[8])));
13927 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
13928 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
13929 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13930 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13931 n
[9].i
, get_pointer(&n
[10])));
13933 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
13934 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
13935 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
13936 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13937 n
[9].i
, n
[10].e
, n
[11].i
,
13938 get_pointer(&n
[12])));
13940 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
13941 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13942 n
[4].e
, n
[5].i
, n
[6].i
,
13943 n
[7].i
, get_pointer(&n
[8])));
13945 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
13946 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13947 n
[4].e
, n
[5].i
, n
[6].i
,
13949 get_pointer(&n
[9])));
13951 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
13952 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13953 n
[4].e
, n
[5].i
, n
[6].i
,
13954 n
[7].i
, n
[8].i
, n
[9].i
,
13955 get_pointer(&n
[10])));
13957 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
13958 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
,
13959 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13960 n
[5].i
, n
[6].e
, n
[7].i
,
13961 get_pointer(&n
[8])));
13963 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
13964 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
13965 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13966 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13967 n
[9].i
, get_pointer(&n
[10])));
13969 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
13970 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
13971 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13972 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13973 n
[9].i
, n
[10].e
, n
[11].i
,
13974 get_pointer(&n
[12])));
13976 case OPCODE_NAMED_PROGRAM_STRING
:
13977 CALL_NamedProgramStringEXT(ctx
->Exec
,
13978 (n
[1].ui
, n
[2].e
, n
[3].e
, n
[4].i
,
13979 get_pointer(&n
[5])));
13981 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
:
13982 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
,
13983 (n
[1].ui
, n
[2].e
, n
[3].ui
, n
[4].f
,
13984 n
[5].f
, n
[6].f
, n
[7].f
));
13987 case OPCODE_CONTINUE
:
13988 n
= (Node
*) get_pointer(&n
[1]);
13993 case OPCODE_END_OF_LIST
:
13999 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
14001 _mesa_problem(ctx
, "%s", msg
);
14006 /* increment n to point to next compiled command */
14007 if (opcode
!= OPCODE_CONTINUE
) {
14008 assert(InstSize
[opcode
] > 0);
14009 n
+= InstSize
[opcode
];
14014 vbo_save_EndCallList(ctx
);
14016 ctx
->ListState
.CallDepth
--;
14021 /**********************************************************************/
14023 /**********************************************************************/
14026 * Test if a display list number is valid.
14028 GLboolean GLAPIENTRY
14029 _mesa_IsList(GLuint list
)
14031 GET_CURRENT_CONTEXT(ctx
);
14032 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
14033 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
14034 return islist(ctx
, list
);
14039 * Delete a sequence of consecutive display lists.
14042 _mesa_DeleteLists(GLuint list
, GLsizei range
)
14044 GET_CURRENT_CONTEXT(ctx
);
14046 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
14047 ASSERT_OUTSIDE_BEGIN_END(ctx
);
14050 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
14055 /* We may be deleting a set of bitmap lists. See if there's a
14056 * bitmap atlas to free.
14058 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
14060 _mesa_delete_bitmap_atlas(ctx
, atlas
);
14061 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
14065 for (i
= list
; i
< list
+ range
; i
++) {
14066 destroy_list(ctx
, i
);
14072 * Return a display list number, n, such that lists n through n+range-1
14076 _mesa_GenLists(GLsizei range
)
14078 GET_CURRENT_CONTEXT(ctx
);
14080 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
14081 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
14084 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
14092 * Make this an atomic operation
14094 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
14096 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
14098 /* reserve the list IDs by with empty/dummy lists */
14100 for (i
= 0; i
< range
; i
++) {
14101 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
14102 make_list(base
+ i
, 1));
14106 if (USE_BITMAP_ATLAS
&&
14108 ctx
->Driver
.DrawAtlasBitmaps
) {
14109 /* "range > 16" is a rough heuristic to guess when glGenLists might be
14110 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
14111 * Create the empty atlas now.
14113 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
14115 atlas
= alloc_bitmap_atlas(ctx
, base
);
14118 /* Atlas _should_ be new/empty now, but clobbering is OK */
14119 assert(atlas
->numBitmaps
== 0);
14120 atlas
->numBitmaps
= range
;
14124 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
14131 * Begin a new display list.
14134 _mesa_NewList(GLuint name
, GLenum mode
)
14136 GET_CURRENT_CONTEXT(ctx
);
14138 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
14139 ASSERT_OUTSIDE_BEGIN_END(ctx
);
14141 if (MESA_VERBOSE
& VERBOSE_API
)
14142 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
14143 _mesa_enum_to_string(mode
));
14146 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
14150 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
14151 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
14155 if (ctx
->ListState
.CurrentList
) {
14156 /* already compiling a display list */
14157 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
14161 ctx
->CompileFlag
= GL_TRUE
;
14162 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
14164 /* Reset accumulated list state */
14165 invalidate_saved_current_state( ctx
);
14167 /* Allocate new display list */
14168 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
14169 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
14170 ctx
->ListState
.CurrentPos
= 0;
14172 vbo_save_NewList(ctx
, name
, mode
);
14174 ctx
->CurrentServerDispatch
= ctx
->Save
;
14175 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
14176 if (ctx
->MarshalExec
== NULL
) {
14177 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
14183 * End definition of current display list.
14186 _mesa_EndList(void)
14188 GET_CURRENT_CONTEXT(ctx
);
14189 SAVE_FLUSH_VERTICES(ctx
);
14190 FLUSH_VERTICES(ctx
, 0);
14192 if (MESA_VERBOSE
& VERBOSE_API
)
14193 _mesa_debug(ctx
, "glEndList\n");
14195 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
14196 _mesa_error(ctx
, GL_INVALID_OPERATION
,
14197 "glEndList() called inside glBegin/End");
14200 /* Check that a list is under construction */
14201 if (!ctx
->ListState
.CurrentList
) {
14202 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
14206 /* Call before emitting END_OF_LIST, in case the driver wants to
14207 * emit opcodes itself.
14209 vbo_save_EndList(ctx
);
14211 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
14215 /* Destroy old list, if any */
14216 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
14218 /* Install the new list */
14219 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
14220 ctx
->ListState
.CurrentList
->Name
,
14221 ctx
->ListState
.CurrentList
);
14224 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
14225 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
14227 ctx
->ListState
.CurrentList
= NULL
;
14228 ctx
->ListState
.CurrentBlock
= NULL
;
14229 ctx
->ListState
.CurrentPos
= 0;
14230 ctx
->ExecuteFlag
= GL_TRUE
;
14231 ctx
->CompileFlag
= GL_FALSE
;
14233 ctx
->CurrentServerDispatch
= ctx
->Exec
;
14234 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
14235 if (ctx
->MarshalExec
== NULL
) {
14236 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
14242 _mesa_CallList(GLuint list
)
14244 GLboolean save_compile_flag
;
14245 GET_CURRENT_CONTEXT(ctx
);
14246 FLUSH_CURRENT(ctx
, 0);
14248 if (MESA_VERBOSE
& VERBOSE_API
)
14249 _mesa_debug(ctx
, "glCallList %d\n", list
);
14252 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
14257 mesa_print_display_list( list
);
14259 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
14260 * execute the display list, and restore the CompileFlag.
14262 save_compile_flag
= ctx
->CompileFlag
;
14263 if (save_compile_flag
) {
14264 ctx
->CompileFlag
= GL_FALSE
;
14267 execute_list(ctx
, list
);
14268 ctx
->CompileFlag
= save_compile_flag
;
14270 /* also restore API function pointers to point to "save" versions */
14271 if (save_compile_flag
) {
14272 ctx
->CurrentServerDispatch
= ctx
->Save
;
14273 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
14274 if (ctx
->MarshalExec
== NULL
) {
14275 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
14282 * Try to execute a glCallLists() command where the display lists contain
14283 * glBitmap commands with a texture atlas.
14284 * \return true for success, false otherwise
14287 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
14290 struct gl_bitmap_atlas
*atlas
;
14293 if (!USE_BITMAP_ATLAS
||
14294 !ctx
->Current
.RasterPosValid
||
14295 ctx
->List
.ListBase
== 0 ||
14296 type
!= GL_UNSIGNED_BYTE
||
14297 !ctx
->Driver
.DrawAtlasBitmaps
) {
14302 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
14305 /* Even if glGenLists wasn't called, we can still try to create
14308 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
14311 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
14312 /* Try to build the bitmap atlas now.
14313 * If the atlas was created in glGenLists, we'll have recorded the
14314 * number of lists (bitmaps). Otherwise, take a guess at 256.
14316 if (atlas
->numBitmaps
== 0)
14317 atlas
->numBitmaps
= 256;
14318 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
14321 if (!atlas
|| !atlas
->complete
) {
14325 /* check that all display list IDs are in the atlas */
14326 for (i
= 0; i
< n
; i
++) {
14327 const GLubyte
*ids
= (const GLubyte
*) lists
;
14329 if (ids
[i
] >= atlas
->numBitmaps
) {
14334 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
14341 * Execute glCallLists: call multiple display lists.
14344 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
14346 GET_CURRENT_CONTEXT(ctx
);
14348 GLboolean save_compile_flag
;
14350 if (MESA_VERBOSE
& VERBOSE_API
)
14351 _mesa_debug(ctx
, "glCallLists %d\n", n
);
14355 case GL_UNSIGNED_BYTE
:
14357 case GL_UNSIGNED_SHORT
:
14359 case GL_UNSIGNED_INT
:
14367 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
14372 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
14374 } else if (n
== 0 || lists
== NULL
) {
14375 /* nothing to do */
14379 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
14383 /* Save the CompileFlag status, turn it off, execute display list,
14384 * and restore the CompileFlag.
14386 save_compile_flag
= ctx
->CompileFlag
;
14387 ctx
->CompileFlag
= GL_FALSE
;
14389 for (i
= 0; i
< n
; i
++) {
14390 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
14391 execute_list(ctx
, list
);
14394 ctx
->CompileFlag
= save_compile_flag
;
14396 /* also restore API function pointers to point to "save" versions */
14397 if (save_compile_flag
) {
14398 ctx
->CurrentServerDispatch
= ctx
->Save
;
14399 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
14400 if (ctx
->MarshalExec
== NULL
) {
14401 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
14408 * Set the offset added to list numbers in glCallLists.
14411 _mesa_ListBase(GLuint base
)
14413 GET_CURRENT_CONTEXT(ctx
);
14414 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
14415 ASSERT_OUTSIDE_BEGIN_END(ctx
);
14416 ctx
->List
.ListBase
= base
;
14420 * Setup the given dispatch table to point to Mesa's display list
14421 * building functions.
14423 * This does not include any of the tnl functions - they are
14424 * initialized from _mesa_init_api_defaults and from the active vtxfmt
14428 _mesa_initialize_save_table(const struct gl_context
*ctx
)
14430 struct _glapi_table
*table
= ctx
->Save
;
14431 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
14433 /* Initially populate the dispatch table with the contents of the
14434 * normal-execution dispatch table. This lets us skip populating functions
14435 * that should be called directly instead of compiled into display lists.
14437 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
14439 _mesa_loopback_init_api_table(ctx
, table
);
14441 /* VBO functions */
14442 vbo_initialize_save_dispatch(ctx
, table
);
14445 SET_Accum(table
, save_Accum
);
14446 SET_AlphaFunc(table
, save_AlphaFunc
);
14447 SET_Bitmap(table
, save_Bitmap
);
14448 SET_BlendFunc(table
, save_BlendFunc
);
14449 SET_CallList(table
, save_CallList
);
14450 SET_CallLists(table
, save_CallLists
);
14451 SET_Clear(table
, save_Clear
);
14452 SET_ClearAccum(table
, save_ClearAccum
);
14453 SET_ClearColor(table
, save_ClearColor
);
14454 SET_ClearDepth(table
, save_ClearDepth
);
14455 SET_ClearIndex(table
, save_ClearIndex
);
14456 SET_ClearStencil(table
, save_ClearStencil
);
14457 SET_ClipPlane(table
, save_ClipPlane
);
14458 SET_ColorMask(table
, save_ColorMask
);
14459 SET_ColorMaski(table
, save_ColorMaskIndexed
);
14460 SET_ColorMaterial(table
, save_ColorMaterial
);
14461 SET_CopyPixels(table
, save_CopyPixels
);
14462 SET_CullFace(table
, save_CullFace
);
14463 SET_DepthFunc(table
, save_DepthFunc
);
14464 SET_DepthMask(table
, save_DepthMask
);
14465 SET_DepthRange(table
, save_DepthRange
);
14466 SET_Disable(table
, save_Disable
);
14467 SET_Disablei(table
, save_DisableIndexed
);
14468 SET_DrawBuffer(table
, save_DrawBuffer
);
14469 SET_DrawPixels(table
, save_DrawPixels
);
14470 SET_Enable(table
, save_Enable
);
14471 SET_Enablei(table
, save_EnableIndexed
);
14472 SET_EvalMesh1(table
, save_EvalMesh1
);
14473 SET_EvalMesh2(table
, save_EvalMesh2
);
14474 SET_Fogf(table
, save_Fogf
);
14475 SET_Fogfv(table
, save_Fogfv
);
14476 SET_Fogi(table
, save_Fogi
);
14477 SET_Fogiv(table
, save_Fogiv
);
14478 SET_FrontFace(table
, save_FrontFace
);
14479 SET_Frustum(table
, save_Frustum
);
14480 SET_Hint(table
, save_Hint
);
14481 SET_IndexMask(table
, save_IndexMask
);
14482 SET_InitNames(table
, save_InitNames
);
14483 SET_LightModelf(table
, save_LightModelf
);
14484 SET_LightModelfv(table
, save_LightModelfv
);
14485 SET_LightModeli(table
, save_LightModeli
);
14486 SET_LightModeliv(table
, save_LightModeliv
);
14487 SET_Lightf(table
, save_Lightf
);
14488 SET_Lightfv(table
, save_Lightfv
);
14489 SET_Lighti(table
, save_Lighti
);
14490 SET_Lightiv(table
, save_Lightiv
);
14491 SET_LineStipple(table
, save_LineStipple
);
14492 SET_LineWidth(table
, save_LineWidth
);
14493 SET_ListBase(table
, save_ListBase
);
14494 SET_LoadIdentity(table
, save_LoadIdentity
);
14495 SET_LoadMatrixd(table
, save_LoadMatrixd
);
14496 SET_LoadMatrixf(table
, save_LoadMatrixf
);
14497 SET_LoadName(table
, save_LoadName
);
14498 SET_LogicOp(table
, save_LogicOp
);
14499 SET_Map1d(table
, save_Map1d
);
14500 SET_Map1f(table
, save_Map1f
);
14501 SET_Map2d(table
, save_Map2d
);
14502 SET_Map2f(table
, save_Map2f
);
14503 SET_MapGrid1d(table
, save_MapGrid1d
);
14504 SET_MapGrid1f(table
, save_MapGrid1f
);
14505 SET_MapGrid2d(table
, save_MapGrid2d
);
14506 SET_MapGrid2f(table
, save_MapGrid2f
);
14507 SET_MatrixMode(table
, save_MatrixMode
);
14508 SET_MultMatrixd(table
, save_MultMatrixd
);
14509 SET_MultMatrixf(table
, save_MultMatrixf
);
14510 SET_NewList(table
, save_NewList
);
14511 SET_Ortho(table
, save_Ortho
);
14512 SET_PassThrough(table
, save_PassThrough
);
14513 SET_PixelMapfv(table
, save_PixelMapfv
);
14514 SET_PixelMapuiv(table
, save_PixelMapuiv
);
14515 SET_PixelMapusv(table
, save_PixelMapusv
);
14516 SET_PixelTransferf(table
, save_PixelTransferf
);
14517 SET_PixelTransferi(table
, save_PixelTransferi
);
14518 SET_PixelZoom(table
, save_PixelZoom
);
14519 SET_PointSize(table
, save_PointSize
);
14520 SET_PolygonMode(table
, save_PolygonMode
);
14521 SET_PolygonOffset(table
, save_PolygonOffset
);
14522 SET_PolygonStipple(table
, save_PolygonStipple
);
14523 SET_PopAttrib(table
, save_PopAttrib
);
14524 SET_PopMatrix(table
, save_PopMatrix
);
14525 SET_PopName(table
, save_PopName
);
14526 SET_PushAttrib(table
, save_PushAttrib
);
14527 SET_PushMatrix(table
, save_PushMatrix
);
14528 SET_PushName(table
, save_PushName
);
14529 SET_RasterPos2d(table
, save_RasterPos2d
);
14530 SET_RasterPos2dv(table
, save_RasterPos2dv
);
14531 SET_RasterPos2f(table
, save_RasterPos2f
);
14532 SET_RasterPos2fv(table
, save_RasterPos2fv
);
14533 SET_RasterPos2i(table
, save_RasterPos2i
);
14534 SET_RasterPos2iv(table
, save_RasterPos2iv
);
14535 SET_RasterPos2s(table
, save_RasterPos2s
);
14536 SET_RasterPos2sv(table
, save_RasterPos2sv
);
14537 SET_RasterPos3d(table
, save_RasterPos3d
);
14538 SET_RasterPos3dv(table
, save_RasterPos3dv
);
14539 SET_RasterPos3f(table
, save_RasterPos3f
);
14540 SET_RasterPos3fv(table
, save_RasterPos3fv
);
14541 SET_RasterPos3i(table
, save_RasterPos3i
);
14542 SET_RasterPos3iv(table
, save_RasterPos3iv
);
14543 SET_RasterPos3s(table
, save_RasterPos3s
);
14544 SET_RasterPos3sv(table
, save_RasterPos3sv
);
14545 SET_RasterPos4d(table
, save_RasterPos4d
);
14546 SET_RasterPos4dv(table
, save_RasterPos4dv
);
14547 SET_RasterPos4f(table
, save_RasterPos4f
);
14548 SET_RasterPos4fv(table
, save_RasterPos4fv
);
14549 SET_RasterPos4i(table
, save_RasterPos4i
);
14550 SET_RasterPos4iv(table
, save_RasterPos4iv
);
14551 SET_RasterPos4s(table
, save_RasterPos4s
);
14552 SET_RasterPos4sv(table
, save_RasterPos4sv
);
14553 SET_ReadBuffer(table
, save_ReadBuffer
);
14554 SET_Rectf(table
, save_Rectf
);
14555 SET_Rotated(table
, save_Rotated
);
14556 SET_Rotatef(table
, save_Rotatef
);
14557 SET_Scaled(table
, save_Scaled
);
14558 SET_Scalef(table
, save_Scalef
);
14559 SET_Scissor(table
, save_Scissor
);
14560 SET_ShadeModel(table
, save_ShadeModel
);
14561 SET_StencilFunc(table
, save_StencilFunc
);
14562 SET_StencilMask(table
, save_StencilMask
);
14563 SET_StencilOp(table
, save_StencilOp
);
14564 SET_TexEnvf(table
, save_TexEnvf
);
14565 SET_TexEnvfv(table
, save_TexEnvfv
);
14566 SET_TexEnvi(table
, save_TexEnvi
);
14567 SET_TexEnviv(table
, save_TexEnviv
);
14568 SET_TexGend(table
, save_TexGend
);
14569 SET_TexGendv(table
, save_TexGendv
);
14570 SET_TexGenf(table
, save_TexGenf
);
14571 SET_TexGenfv(table
, save_TexGenfv
);
14572 SET_TexGeni(table
, save_TexGeni
);
14573 SET_TexGeniv(table
, save_TexGeniv
);
14574 SET_TexImage1D(table
, save_TexImage1D
);
14575 SET_TexImage2D(table
, save_TexImage2D
);
14576 SET_TexParameterf(table
, save_TexParameterf
);
14577 SET_TexParameterfv(table
, save_TexParameterfv
);
14578 SET_TexParameteri(table
, save_TexParameteri
);
14579 SET_TexParameteriv(table
, save_TexParameteriv
);
14580 SET_Translated(table
, save_Translated
);
14581 SET_Translatef(table
, save_Translatef
);
14582 SET_Viewport(table
, save_Viewport
);
14585 SET_BindTexture(table
, save_BindTexture
);
14586 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
14587 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
14588 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
14589 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
14590 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
14591 SET_TexSubImage1D(table
, save_TexSubImage1D
);
14592 SET_TexSubImage2D(table
, save_TexSubImage2D
);
14595 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
14596 SET_TexImage3D(table
, save_TexImage3D
);
14597 SET_TexSubImage3D(table
, save_TexSubImage3D
);
14600 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
14601 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
14602 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
14604 /* ATI_separate_stencil */
14605 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
14607 /* GL_ARB_imaging */
14608 /* Not all are supported */
14609 SET_BlendColor(table
, save_BlendColor
);
14610 SET_BlendEquation(table
, save_BlendEquation
);
14612 /* 2. GL_EXT_blend_color */
14614 SET_BlendColorEXT(table
, save_BlendColorEXT
);
14617 /* 6. GL_EXT_texture3d */
14619 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
14620 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
14621 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
14624 /* 37. GL_EXT_blend_minmax */
14626 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
14629 /* 54. GL_EXT_point_parameters */
14630 SET_PointParameterf(table
, save_PointParameterfEXT
);
14631 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
14633 /* 91. GL_ARB_tessellation_shader */
14634 SET_PatchParameteri(table
, save_PatchParameteri
);
14635 SET_PatchParameterfv(table
, save_PatchParameterfv
);
14637 /* 100. ARB_viewport_array */
14638 SET_ViewportArrayv(table
, save_ViewportArrayv
);
14639 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
14640 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
14641 SET_ScissorArrayv(table
, save_ScissorArrayv
);
14642 SET_ScissorIndexed(table
, save_ScissorIndexed
);
14643 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
14644 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
14645 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
14647 /* 122. ARB_compute_shader */
14648 SET_DispatchCompute(table
, save_DispatchCompute
);
14649 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
14651 /* 173. GL_EXT_blend_func_separate */
14652 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
14654 /* 197. GL_MESA_window_pos */
14655 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
14656 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
14657 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
14658 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
14659 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
14660 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
14661 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
14662 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
14663 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
14664 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
14665 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
14666 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
14667 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
14668 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
14669 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
14670 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
14671 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
14672 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
14673 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
14674 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
14675 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
14676 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
14677 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
14678 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
14680 /* 245. GL_ATI_fragment_shader */
14681 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
14682 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
14684 /* 262. GL_NV_point_sprite */
14685 SET_PointParameteri(table
, save_PointParameteriNV
);
14686 SET_PointParameteriv(table
, save_PointParameterivNV
);
14688 /* 268. GL_EXT_stencil_two_side */
14689 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
14691 /* ???. GL_EXT_depth_bounds_test */
14692 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
14694 /* ARB 1. GL_ARB_multitexture */
14695 SET_ActiveTexture(table
, save_ActiveTextureARB
);
14697 /* ARB 3. GL_ARB_transpose_matrix */
14698 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
14699 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
14700 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
14701 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
14703 /* ARB 5. GL_ARB_multisample */
14704 SET_SampleCoverage(table
, save_SampleCoverageARB
);
14706 /* ARB 12. GL_ARB_texture_compression */
14707 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
14708 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
14709 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
14710 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
14711 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
14712 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
14714 /* ARB 14. GL_ARB_point_parameters */
14715 /* aliased with EXT_point_parameters functions */
14717 /* ARB 25. GL_ARB_window_pos */
14718 /* aliased with MESA_window_pos functions */
14720 /* ARB 26. GL_ARB_vertex_program */
14721 /* ARB 27. GL_ARB_fragment_program */
14722 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
14723 SET_ProgramStringARB(table
, save_ProgramStringARB
);
14724 SET_BindProgramARB(table
, save_BindProgramARB
);
14725 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
14726 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
14727 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
14728 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
14729 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
14730 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
14731 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
14732 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
14734 SET_BeginQuery(table
, save_BeginQueryARB
);
14735 SET_EndQuery(table
, save_EndQueryARB
);
14736 SET_QueryCounter(table
, save_QueryCounter
);
14738 SET_DrawBuffers(table
, save_DrawBuffersARB
);
14740 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
14742 SET_UseProgram(table
, save_UseProgram
);
14743 SET_Uniform1f(table
, save_Uniform1fARB
);
14744 SET_Uniform2f(table
, save_Uniform2fARB
);
14745 SET_Uniform3f(table
, save_Uniform3fARB
);
14746 SET_Uniform4f(table
, save_Uniform4fARB
);
14747 SET_Uniform1fv(table
, save_Uniform1fvARB
);
14748 SET_Uniform2fv(table
, save_Uniform2fvARB
);
14749 SET_Uniform3fv(table
, save_Uniform3fvARB
);
14750 SET_Uniform4fv(table
, save_Uniform4fvARB
);
14751 SET_Uniform1i(table
, save_Uniform1iARB
);
14752 SET_Uniform2i(table
, save_Uniform2iARB
);
14753 SET_Uniform3i(table
, save_Uniform3iARB
);
14754 SET_Uniform4i(table
, save_Uniform4iARB
);
14755 SET_Uniform1iv(table
, save_Uniform1ivARB
);
14756 SET_Uniform2iv(table
, save_Uniform2ivARB
);
14757 SET_Uniform3iv(table
, save_Uniform3ivARB
);
14758 SET_Uniform4iv(table
, save_Uniform4ivARB
);
14759 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
14760 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
14761 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
14762 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
14763 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
14764 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
14765 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
14766 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
14767 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
14769 /* 299. GL_EXT_blend_equation_separate */
14770 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
14772 /* GL_EXT_gpu_program_parameters */
14773 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
14774 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
14776 /* 364. GL_EXT_provoking_vertex */
14777 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
14779 /* GL_EXT_texture_integer */
14780 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
14781 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
14782 SET_TexParameterIiv(table
, save_TexParameterIiv
);
14783 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
14785 /* GL_ARB_clip_control */
14786 SET_ClipControl(table
, save_ClipControl
);
14788 /* GL_ARB_color_buffer_float */
14789 SET_ClampColor(table
, save_ClampColorARB
);
14792 SET_ClearBufferiv(table
, save_ClearBufferiv
);
14793 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
14794 SET_ClearBufferfv(table
, save_ClearBufferfv
);
14795 SET_ClearBufferfi(table
, save_ClearBufferfi
);
14796 SET_Uniform1ui(table
, save_Uniform1ui
);
14797 SET_Uniform2ui(table
, save_Uniform2ui
);
14798 SET_Uniform3ui(table
, save_Uniform3ui
);
14799 SET_Uniform4ui(table
, save_Uniform4ui
);
14800 SET_Uniform1uiv(table
, save_Uniform1uiv
);
14801 SET_Uniform2uiv(table
, save_Uniform2uiv
);
14802 SET_Uniform3uiv(table
, save_Uniform3uiv
);
14803 SET_Uniform4uiv(table
, save_Uniform4uiv
);
14805 /* GL_ARB_gpu_shader_fp64 */
14806 SET_Uniform1d(table
, save_Uniform1d
);
14807 SET_Uniform2d(table
, save_Uniform2d
);
14808 SET_Uniform3d(table
, save_Uniform3d
);
14809 SET_Uniform4d(table
, save_Uniform4d
);
14810 SET_Uniform1dv(table
, save_Uniform1dv
);
14811 SET_Uniform2dv(table
, save_Uniform2dv
);
14812 SET_Uniform3dv(table
, save_Uniform3dv
);
14813 SET_Uniform4dv(table
, save_Uniform4dv
);
14814 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
14815 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
14816 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
14817 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
14818 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
14819 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
14820 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
14821 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
14822 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
14824 /* GL_ARB_gpu_shader_int64 */
14825 SET_Uniform1i64ARB(table
, save_Uniform1i64ARB
);
14826 SET_Uniform2i64ARB(table
, save_Uniform2i64ARB
);
14827 SET_Uniform3i64ARB(table
, save_Uniform3i64ARB
);
14828 SET_Uniform4i64ARB(table
, save_Uniform4i64ARB
);
14829 SET_Uniform1i64vARB(table
, save_Uniform1i64vARB
);
14830 SET_Uniform2i64vARB(table
, save_Uniform2i64vARB
);
14831 SET_Uniform3i64vARB(table
, save_Uniform3i64vARB
);
14832 SET_Uniform4i64vARB(table
, save_Uniform4i64vARB
);
14833 SET_Uniform1ui64ARB(table
, save_Uniform1ui64ARB
);
14834 SET_Uniform2ui64ARB(table
, save_Uniform2ui64ARB
);
14835 SET_Uniform3ui64ARB(table
, save_Uniform3ui64ARB
);
14836 SET_Uniform4ui64ARB(table
, save_Uniform4ui64ARB
);
14837 SET_Uniform1ui64vARB(table
, save_Uniform1ui64vARB
);
14838 SET_Uniform2ui64vARB(table
, save_Uniform2ui64vARB
);
14839 SET_Uniform3ui64vARB(table
, save_Uniform3ui64vARB
);
14840 SET_Uniform4ui64vARB(table
, save_Uniform4ui64vARB
);
14842 SET_ProgramUniform1i64ARB(table
, save_ProgramUniform1i64ARB
);
14843 SET_ProgramUniform2i64ARB(table
, save_ProgramUniform2i64ARB
);
14844 SET_ProgramUniform3i64ARB(table
, save_ProgramUniform3i64ARB
);
14845 SET_ProgramUniform4i64ARB(table
, save_ProgramUniform4i64ARB
);
14846 SET_ProgramUniform1i64vARB(table
, save_ProgramUniform1i64vARB
);
14847 SET_ProgramUniform2i64vARB(table
, save_ProgramUniform2i64vARB
);
14848 SET_ProgramUniform3i64vARB(table
, save_ProgramUniform3i64vARB
);
14849 SET_ProgramUniform4i64vARB(table
, save_ProgramUniform4i64vARB
);
14850 SET_ProgramUniform1ui64ARB(table
, save_ProgramUniform1ui64ARB
);
14851 SET_ProgramUniform2ui64ARB(table
, save_ProgramUniform2ui64ARB
);
14852 SET_ProgramUniform3ui64ARB(table
, save_ProgramUniform3ui64ARB
);
14853 SET_ProgramUniform4ui64ARB(table
, save_ProgramUniform4ui64ARB
);
14854 SET_ProgramUniform1ui64vARB(table
, save_ProgramUniform1ui64vARB
);
14855 SET_ProgramUniform2ui64vARB(table
, save_ProgramUniform2ui64vARB
);
14856 SET_ProgramUniform3ui64vARB(table
, save_ProgramUniform3ui64vARB
);
14857 SET_ProgramUniform4ui64vARB(table
, save_ProgramUniform4ui64vARB
);
14860 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
14861 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
14862 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
14863 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
14864 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
14865 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
14866 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
14867 SET_DrawTransformFeedbackInstanced(table
,
14868 save_DrawTransformFeedbackInstanced
);
14869 SET_DrawTransformFeedbackStreamInstanced(table
,
14870 save_DrawTransformFeedbackStreamInstanced
);
14871 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
14872 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
14874 /* GL_ARB_instanced_arrays */
14875 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
14877 /* GL_NV_texture_barrier */
14878 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
14880 SET_BindSampler(table
, save_BindSampler
);
14881 SET_SamplerParameteri(table
, save_SamplerParameteri
);
14882 SET_SamplerParameterf(table
, save_SamplerParameterf
);
14883 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
14884 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
14885 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
14886 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
14888 /* GL_ARB_draw_buffer_blend */
14889 SET_BlendFunciARB(table
, save_BlendFunci
);
14890 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
14891 SET_BlendEquationiARB(table
, save_BlendEquationi
);
14892 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
14894 /* GL_NV_conditional_render */
14895 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
14896 SET_EndConditionalRender(table
, save_EndConditionalRender
);
14899 SET_WaitSync(table
, save_WaitSync
);
14901 /* GL_ARB_uniform_buffer_object */
14902 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
14904 /* GL_ARB_shader_subroutines */
14905 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
14907 /* GL_ARB_draw_instanced */
14908 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
14909 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
14911 /* GL_ARB_draw_elements_base_vertex */
14912 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
14914 /* GL_ARB_base_instance */
14915 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
14916 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
14917 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
14919 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
14920 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
14921 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
14922 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
14923 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
14925 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
14926 SET_UseProgramStages(table
, save_UseProgramStages
);
14927 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
14928 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
14929 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
14930 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
14931 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
14932 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
14933 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
14934 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
14935 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
14936 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
14937 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
14938 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
14939 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
14940 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
14941 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
14942 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
14943 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
14944 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
14945 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
14946 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
14947 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
14948 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
14949 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
14950 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
14951 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
14952 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
14953 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
14954 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
14955 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
14956 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
14957 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
14958 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
14959 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
14960 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
14961 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
14962 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
14963 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
14964 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
14965 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
14966 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
14967 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
14968 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
14969 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
14970 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
14971 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
14972 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
14973 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
14974 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
14975 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
14976 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
14978 /* GL_{ARB,EXT}_polygon_offset_clamp */
14979 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
14981 /* GL_EXT_window_rectangles */
14982 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
14984 /* GL_NV_conservative_raster */
14985 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
14987 /* GL_NV_conservative_raster_dilate */
14988 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
14990 /* GL_NV_conservative_raster_pre_snap_triangles */
14991 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
14993 /* GL_EXT_direct_state_access */
14994 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
14995 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
14996 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
14997 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
14998 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
14999 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
15000 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
15001 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
15002 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
15003 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
15004 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
15005 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
15006 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
15007 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
15008 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
15009 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
15010 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
15011 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
15012 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
15013 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
15014 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
15015 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
15016 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
15017 SET_TextureParameterIivEXT(table
, save_TextureParameterIivEXT
);
15018 SET_TextureParameterIuivEXT(table
, save_TextureParameterIuivEXT
);
15019 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
15020 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
15021 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
15022 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
15023 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
15024 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
15025 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
15026 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
15027 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
15028 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
15029 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
15030 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
15031 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
15032 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
15033 SET_MultiTexParameterIivEXT(table
, save_MultiTexParameterIivEXT
);
15034 SET_MultiTexParameterIuivEXT(table
, save_MultiTexParameterIuivEXT
);
15035 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
15036 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
15037 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
15038 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
15039 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
15040 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
15041 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
15042 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
15043 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
15044 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
15045 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
15046 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
15047 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
15048 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
15049 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
15050 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
15051 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
15052 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
15053 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
15054 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
15055 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
15056 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
15057 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
15058 SET_CompressedMultiTexImage1DEXT(table
, save_CompressedMultiTexImage1DEXT
);
15059 SET_CompressedMultiTexImage2DEXT(table
, save_CompressedMultiTexImage2DEXT
);
15060 SET_CompressedMultiTexImage3DEXT(table
, save_CompressedMultiTexImage3DEXT
);
15061 SET_CompressedMultiTexSubImage1DEXT(table
, save_CompressedMultiTexSubImage1DEXT
);
15062 SET_CompressedMultiTexSubImage2DEXT(table
, save_CompressedMultiTexSubImage2DEXT
);
15063 SET_CompressedMultiTexSubImage3DEXT(table
, save_CompressedMultiTexSubImage3DEXT
);
15064 SET_NamedProgramStringEXT(table
, save_NamedProgramStringEXT
);
15065 SET_NamedProgramLocalParameter4dEXT(table
, save_NamedProgramLocalParameter4dEXT
);
15066 SET_NamedProgramLocalParameter4dvEXT(table
, save_NamedProgramLocalParameter4dvEXT
);
15067 SET_NamedProgramLocalParameter4fEXT(table
, save_NamedProgramLocalParameter4fEXT
);
15068 SET_NamedProgramLocalParameter4fvEXT(table
, save_NamedProgramLocalParameter4fvEXT
);
15073 static const char *
15074 enum_string(GLenum k
)
15076 return _mesa_enum_to_string(k
);
15081 * Print the commands in a display list. For debugging only.
15082 * TODO: many commands aren't handled yet.
15083 * \param fname filename to write display list to. If null, use stdout.
15085 static void GLAPIENTRY
15086 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
15088 struct gl_display_list
*dlist
;
15094 f
= fopen(fname
, "w");
15099 if (!islist(ctx
, list
)) {
15100 fprintf(f
, "%u is not a display list ID\n", list
);
15104 dlist
= _mesa_lookup_list(ctx
, list
);
15111 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
15113 done
= n
? GL_FALSE
: GL_TRUE
;
15115 const OpCode opcode
= n
[0].opcode
;
15117 if (is_ext_opcode(opcode
)) {
15118 n
+= ext_opcode_print(ctx
, n
, f
);
15123 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
15125 case OPCODE_ACTIVE_TEXTURE
:
15126 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
15128 case OPCODE_BITMAP
:
15129 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
15130 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
15131 get_pointer(&n
[7]));
15133 case OPCODE_BLEND_COLOR
:
15134 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
15135 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
15137 case OPCODE_BLEND_EQUATION
:
15138 fprintf(f
, "BlendEquation %s\n",
15139 enum_string(n
[1].e
));
15141 case OPCODE_BLEND_EQUATION_SEPARATE
:
15142 fprintf(f
, "BlendEquationSeparate %s, %s\n",
15143 enum_string(n
[1].e
),
15144 enum_string(n
[2].e
));
15146 case OPCODE_BLEND_FUNC_SEPARATE
:
15147 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
15148 enum_string(n
[1].e
),
15149 enum_string(n
[2].e
),
15150 enum_string(n
[3].e
),
15151 enum_string(n
[4].e
));
15153 case OPCODE_BLEND_EQUATION_I
:
15154 fprintf(f
, "BlendEquationi %u, %s\n",
15155 n
[1].ui
, enum_string(n
[2].e
));
15157 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
15158 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
15159 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
15161 case OPCODE_BLEND_FUNC_I
:
15162 fprintf(f
, "BlendFunci %u, %s, %s\n",
15163 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
15165 case OPCODE_BLEND_FUNC_SEPARATE_I
:
15166 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
15168 enum_string(n
[2].e
),
15169 enum_string(n
[3].e
),
15170 enum_string(n
[4].e
),
15171 enum_string(n
[5].e
));
15173 case OPCODE_CALL_LIST
:
15174 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
15176 case OPCODE_CALL_LISTS
:
15177 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
15179 case OPCODE_DISABLE
:
15180 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
15182 case OPCODE_ENABLE
:
15183 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
15185 case OPCODE_FRUSTUM
:
15186 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
15187 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
15189 case OPCODE_LINE_STIPPLE
:
15190 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
15192 case OPCODE_LINE_WIDTH
:
15193 fprintf(f
, "LineWidth %f\n", n
[1].f
);
15195 case OPCODE_LOAD_IDENTITY
:
15196 fprintf(f
, "LoadIdentity\n");
15198 case OPCODE_LOAD_MATRIX
:
15199 fprintf(f
, "LoadMatrix\n");
15200 fprintf(f
, " %8f %8f %8f %8f\n",
15201 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
15202 fprintf(f
, " %8f %8f %8f %8f\n",
15203 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
15204 fprintf(f
, " %8f %8f %8f %8f\n",
15205 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
15206 fprintf(f
, " %8f %8f %8f %8f\n",
15207 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
15209 case OPCODE_MULT_MATRIX
:
15210 fprintf(f
, "MultMatrix (or Rotate)\n");
15211 fprintf(f
, " %8f %8f %8f %8f\n",
15212 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
15213 fprintf(f
, " %8f %8f %8f %8f\n",
15214 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
15215 fprintf(f
, " %8f %8f %8f %8f\n",
15216 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
15217 fprintf(f
, " %8f %8f %8f %8f\n",
15218 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
15221 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
15222 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
15224 case OPCODE_POINT_SIZE
:
15225 fprintf(f
, "PointSize %f\n", n
[1].f
);
15227 case OPCODE_POP_ATTRIB
:
15228 fprintf(f
, "PopAttrib\n");
15230 case OPCODE_POP_MATRIX
:
15231 fprintf(f
, "PopMatrix\n");
15233 case OPCODE_POP_NAME
:
15234 fprintf(f
, "PopName\n");
15236 case OPCODE_PUSH_ATTRIB
:
15237 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
15239 case OPCODE_PUSH_MATRIX
:
15240 fprintf(f
, "PushMatrix\n");
15242 case OPCODE_PUSH_NAME
:
15243 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
15245 case OPCODE_RASTER_POS
:
15246 fprintf(f
, "RasterPos %g %g %g %g\n",
15247 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
15249 case OPCODE_ROTATE
:
15250 fprintf(f
, "Rotate %g %g %g %g\n",
15251 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
15254 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
15256 case OPCODE_TRANSLATE
:
15257 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
15259 case OPCODE_BIND_TEXTURE
:
15260 fprintf(f
, "BindTexture %s %d\n",
15261 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
15263 case OPCODE_SHADE_MODEL
:
15264 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
15267 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
15268 _mesa_enum_to_string(n
[1].ui
),
15269 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
15272 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
15273 _mesa_enum_to_string(n
[1].ui
),
15274 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
15275 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
15277 case OPCODE_MAPGRID1
:
15278 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
15280 case OPCODE_MAPGRID2
:
15281 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
15282 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
15284 case OPCODE_EVALMESH1
:
15285 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
15287 case OPCODE_EVALMESH2
:
15288 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
15289 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
15292 case OPCODE_ATTR_1F_NV
:
15293 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
15295 case OPCODE_ATTR_2F_NV
:
15296 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
15297 n
[1].i
, n
[2].f
, n
[3].f
);
15299 case OPCODE_ATTR_3F_NV
:
15300 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
15301 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
15303 case OPCODE_ATTR_4F_NV
:
15304 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
15305 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
15307 case OPCODE_ATTR_1F_ARB
:
15308 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
15310 case OPCODE_ATTR_2F_ARB
:
15311 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
15312 n
[1].i
, n
[2].f
, n
[3].f
);
15314 case OPCODE_ATTR_3F_ARB
:
15315 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
15316 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
15318 case OPCODE_ATTR_4F_ARB
:
15319 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
15320 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
15323 case OPCODE_MATERIAL
:
15324 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
15325 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
15328 fprintf(f
, "BEGIN %x\n", n
[1].i
);
15331 fprintf(f
, "END\n");
15334 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
15337 case OPCODE_EVAL_C1
:
15338 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
15340 case OPCODE_EVAL_C2
:
15341 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
15343 case OPCODE_EVAL_P1
:
15344 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
15346 case OPCODE_EVAL_P2
:
15347 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
15350 case OPCODE_PROVOKING_VERTEX
:
15351 fprintf(f
, "ProvokingVertex %s\n",
15352 _mesa_enum_to_string(n
[1].ui
));
15356 * meta opcodes/commands
15359 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
15360 (const char *) get_pointer(&n
[2]));
15362 case OPCODE_CONTINUE
:
15363 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
15364 n
= (Node
*) get_pointer(&n
[1]);
15367 fprintf(f
, "NOP\n");
15369 case OPCODE_END_OF_LIST
:
15370 fprintf(f
, "END-LIST %u\n", list
);
15374 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
15376 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
15377 opcode
, (void *) n
);
15381 fprintf(f
, "command %d, %u operands\n", opcode
,
15385 /* increment n to point to next compiled command */
15386 if (opcode
!= OPCODE_CONTINUE
) {
15387 assert(InstSize
[opcode
] > 0);
15388 n
+= InstSize
[opcode
];
15402 * Clients may call this function to help debug display list problems.
15403 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
15404 * changed, or break in the future without notice.
15407 mesa_print_display_list(GLuint list
)
15409 GET_CURRENT_CONTEXT(ctx
);
15410 print_list(ctx
, list
, NULL
);
15414 /**********************************************************************/
15415 /***** Initialization *****/
15416 /**********************************************************************/
15419 save_vtxfmt_init(GLvertexformat
* vfmt
)
15421 vfmt
->ArrayElement
= _ae_ArrayElement
;
15423 vfmt
->Begin
= save_Begin
;
15425 vfmt
->CallList
= save_CallList
;
15426 vfmt
->CallLists
= save_CallLists
;
15428 vfmt
->Color3f
= save_Color3f
;
15429 vfmt
->Color3fv
= save_Color3fv
;
15430 vfmt
->Color4f
= save_Color4f
;
15431 vfmt
->Color4fv
= save_Color4fv
;
15432 vfmt
->EdgeFlag
= save_EdgeFlag
;
15433 vfmt
->End
= save_End
;
15435 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
15436 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
15437 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
15438 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
15439 vfmt
->EvalPoint1
= save_EvalPoint1
;
15440 vfmt
->EvalPoint2
= save_EvalPoint2
;
15442 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
15443 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
15444 vfmt
->Indexf
= save_Indexf
;
15445 vfmt
->Indexfv
= save_Indexfv
;
15446 vfmt
->Materialfv
= save_Materialfv
;
15447 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
15448 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
15449 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
15450 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
15451 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
15452 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
15453 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
15454 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
15455 vfmt
->Normal3f
= save_Normal3f
;
15456 vfmt
->Normal3fv
= save_Normal3fv
;
15457 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
15458 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
15459 vfmt
->TexCoord1f
= save_TexCoord1f
;
15460 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
15461 vfmt
->TexCoord2f
= save_TexCoord2f
;
15462 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
15463 vfmt
->TexCoord3f
= save_TexCoord3f
;
15464 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
15465 vfmt
->TexCoord4f
= save_TexCoord4f
;
15466 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
15467 vfmt
->Vertex2f
= save_Vertex2f
;
15468 vfmt
->Vertex2fv
= save_Vertex2fv
;
15469 vfmt
->Vertex3f
= save_Vertex3f
;
15470 vfmt
->Vertex3fv
= save_Vertex3fv
;
15471 vfmt
->Vertex4f
= save_Vertex4f
;
15472 vfmt
->Vertex4fv
= save_Vertex4fv
;
15473 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
15474 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
15475 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
15476 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
15477 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
15478 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
15479 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
15480 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
15481 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
15482 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
15483 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
15484 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
15485 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
15486 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
15487 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
15488 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
15490 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
15495 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
15496 const GLvertexformat
*vfmt
)
15498 SET_CallList(disp
, vfmt
->CallList
);
15499 SET_CallLists(disp
, vfmt
->CallLists
);
15504 * Initialize display list state for given context.
15507 _mesa_init_display_list(struct gl_context
*ctx
)
15509 static GLboolean tableInitialized
= GL_FALSE
;
15511 /* zero-out the instruction size table, just once */
15512 if (!tableInitialized
) {
15513 memset(InstSize
, 0, sizeof(InstSize
));
15514 tableInitialized
= GL_TRUE
;
15517 /* extension info */
15518 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
15521 ctx
->ListState
.CallDepth
= 0;
15522 ctx
->ExecuteFlag
= GL_TRUE
;
15523 ctx
->CompileFlag
= GL_FALSE
;
15524 ctx
->ListState
.CurrentBlock
= NULL
;
15525 ctx
->ListState
.CurrentPos
= 0;
15527 /* Display List group */
15528 ctx
->List
.ListBase
= 0;
15530 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
15532 InstSize
[OPCODE_NOP
] = 1;
15537 _mesa_free_display_list_data(struct gl_context
*ctx
)
15539 free(ctx
->ListExt
);
15540 ctx
->ListExt
= NULL
;