2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_BIND_MULTITEXTURE
,
585 OPCODE_MULTITEXPARAMETER_F
,
586 OPCODE_MULTITEXPARAMETER_I
,
587 OPCODE_MULTITEX_IMAGE1D
,
588 OPCODE_MULTITEX_IMAGE2D
,
589 OPCODE_MULTITEX_IMAGE3D
,
590 OPCODE_MULTITEX_SUB_IMAGE1D
,
591 OPCODE_MULTITEX_SUB_IMAGE2D
,
592 OPCODE_MULTITEX_SUB_IMAGE3D
,
593 OPCODE_COPY_MULTITEX_IMAGE1D
,
594 OPCODE_COPY_MULTITEX_IMAGE2D
,
595 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
596 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
597 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
599 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
600 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
601 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
602 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
603 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
604 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
605 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
606 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
607 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
608 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
609 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
610 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
611 OPCODE_NAMED_PROGRAM_STRING
,
612 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
,
614 /* The following three are meta instructions */
615 OPCODE_ERROR
, /* raise compiled-in error */
617 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
627 * Display list instructions are stored as sequences of "nodes". Nodes
628 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
629 * are linked together with a pointer.
631 * Each instruction in the display list is stored as a sequence of
632 * contiguous nodes in memory.
633 * Each node is the union of a variety of data types.
635 * Note, all of these members should be 4 bytes in size or less for the
636 * sake of compact display lists. We store 8-byte pointers in a pair of
637 * these nodes using the save/get_pointer() functions below.
655 typedef union gl_dlist_node Node
;
658 /** How many 4-byte dwords to store a pointer */
659 #define POINTER_DWORDS (sizeof(void *) / 4)
661 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
662 * space for display lists. The following types and functions are
663 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
668 GLuint dwords
[POINTER_DWORDS
];
673 * Save a 4 or 8-byte pointer at dest (and dest+1).
676 save_pointer(Node
*dest
, void *src
)
681 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
682 STATIC_ASSERT(sizeof(Node
) == 4);
686 for (i
= 0; i
< POINTER_DWORDS
; i
++)
687 dest
[i
].ui
= p
.dwords
[i
];
692 * Retrieve a 4 or 8-byte pointer from node (node+1).
695 get_pointer(const Node
*node
)
700 for (i
= 0; i
< POINTER_DWORDS
; i
++)
701 p
.dwords
[i
] = node
[i
].ui
;
708 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
725 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
727 union float64_pair tmp; \
729 n[idx].ui = tmp.uint32[0]; \
730 n[idx+1].ui = tmp.uint32[1]; \
735 * How many nodes to allocate at a time. Note that bulk vertex data
736 * from glBegin/glVertex/glEnd primitives will typically wind up in
737 * a VBO, and not directly in the display list itself.
739 #define BLOCK_SIZE 256
744 * Number of nodes of storage needed for each instruction.
745 * Sizes for dynamically allocated opcodes are stored in the context struct.
747 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
750 void mesa_print_display_list(GLuint list
);
754 * Does the given display list only contain a single glBitmap call?
757 is_bitmap_list(const struct gl_display_list
*dlist
)
759 const Node
*n
= dlist
->Head
;
760 if (n
[0].opcode
== OPCODE_BITMAP
) {
761 n
+= InstSize
[OPCODE_BITMAP
];
762 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
770 * Is the given display list an empty list?
773 is_empty_list(const struct gl_display_list
*dlist
)
775 const Node
*n
= dlist
->Head
;
776 return n
[0].opcode
== OPCODE_END_OF_LIST
;
781 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
784 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
787 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
795 * Lookup a gl_bitmap_atlas by listBase ID.
797 static struct gl_bitmap_atlas
*
798 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
800 struct gl_bitmap_atlas
*atlas
;
802 assert(listBase
> 0);
803 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
809 * Create new bitmap atlas and insert into hash table.
811 static struct gl_bitmap_atlas
*
812 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
814 struct gl_bitmap_atlas
*atlas
;
816 assert(listBase
> 0);
817 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
819 atlas
= calloc(1, sizeof(*atlas
));
821 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
829 * Try to build a bitmap atlas. This involves examining a sequence of
830 * display lists which contain glBitmap commands and putting the bitmap
831 * images into a texture map (the atlas).
832 * If we succeed, gl_bitmap_atlas::complete will be set to true.
833 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
836 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
839 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
844 assert(!atlas
->complete
);
845 assert(atlas
->numBitmaps
> 0);
847 /* We use a rectangle texture (non-normalized coords) for the atlas */
848 assert(ctx
->Extensions
.NV_texture_rectangle
);
849 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
851 atlas
->texWidth
= 1024;
852 atlas
->texHeight
= 0; /* determined below */
854 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
855 if (!atlas
->glyphs
) {
857 atlas
->incomplete
= true;
861 /* Loop over the display lists. They should all contain a single glBitmap
862 * call. If not, bail out. Also, compute the position and sizes of each
863 * bitmap in the atlas to determine the texture atlas size.
865 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
866 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
868 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
869 unsigned bitmap_width
, bitmap_height
;
870 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
872 if (!list
|| is_empty_list(list
)) {
874 atlas
->numBitmaps
= i
;
878 if (!is_bitmap_list(list
)) {
879 /* This list does not contain exactly one glBitmap command. Give up. */
880 atlas
->incomplete
= true;
884 /* get bitmap info from the display list command */
886 assert(n
[0].opcode
== OPCODE_BITMAP
);
887 bitmap_width
= n
[1].i
;
888 bitmap_height
= n
[2].i
;
889 bitmap_xorig
= n
[3].f
;
890 bitmap_yorig
= n
[4].f
;
891 bitmap_xmove
= n
[5].f
;
892 bitmap_ymove
= n
[6].f
;
894 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
895 /* advance to the next row of the texture */
901 /* save the bitmap's position in the atlas */
905 g
->h
= bitmap_height
;
906 g
->xorig
= bitmap_xorig
;
907 g
->yorig
= bitmap_yorig
;
908 g
->xmove
= bitmap_xmove
;
909 g
->ymove
= bitmap_ymove
;
911 xpos
+= bitmap_width
;
913 /* keep track of tallest bitmap in the row */
914 row_height
= MAX2(row_height
, bitmap_height
);
917 /* Now we know the texture height */
918 atlas
->texHeight
= ypos
+ row_height
;
920 if (atlas
->texHeight
== 0) {
921 /* no glyphs found, give up */
924 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
925 /* too large, give up */
929 /* Create atlas texture (texture ID is irrelevant) */
930 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
931 if (!atlas
->texObj
) {
935 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
936 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
937 atlas
->texObj
->MaxLevel
= 0;
938 atlas
->texObj
->Immutable
= GL_TRUE
;
940 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
941 GL_TEXTURE_RECTANGLE
, 0);
942 if (!atlas
->texImage
) {
946 if (ctx
->Const
.BitmapUsesRed
)
947 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
948 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
949 GL_RED
, MESA_FORMAT_R_UNORM8
);
951 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
952 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
953 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
955 /* alloc image storage */
956 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
960 /* map teximage, load with bitmap glyphs */
961 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
962 0, 0, atlas
->texWidth
, atlas
->texHeight
,
963 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
968 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
969 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
971 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
972 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
973 const Node
*n
= list
->Head
;
975 assert(n
[0].opcode
== OPCODE_BITMAP
||
976 n
[0].opcode
== OPCODE_END_OF_LIST
);
978 if (n
[0].opcode
== OPCODE_BITMAP
) {
979 unsigned bitmap_width
= n
[1].i
;
980 unsigned bitmap_height
= n
[2].i
;
981 unsigned xpos
= atlas
->glyphs
[i
].x
;
982 unsigned ypos
= atlas
->glyphs
[i
].y
;
983 const void *bitmap_image
= get_pointer(&n
[7]);
985 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
986 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
988 /* put the bitmap image into the texture image */
989 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
990 &ctx
->DefaultPacking
, bitmap_image
,
991 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
996 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
998 atlas
->complete
= true;
1003 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
1005 if (atlas
->texObj
) {
1006 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
1008 free(atlas
->glyphs
);
1009 atlas
->glyphs
= NULL
;
1010 atlas
->incomplete
= true;
1015 * Allocate a gl_display_list object with an initial block of storage.
1016 * \param count how many display list nodes/tokens to allocate
1018 static struct gl_display_list
*
1019 make_list(GLuint name
, GLuint count
)
1021 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1023 dlist
->Head
= malloc(sizeof(Node
) * count
);
1024 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1025 /* All InstSize[] entries must be non-zero */
1026 InstSize
[OPCODE_END_OF_LIST
] = 1;
1032 * Lookup function to just encapsulate casting.
1034 struct gl_display_list
*
1035 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1037 return (struct gl_display_list
*)
1038 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1042 /** Is the given opcode an extension code? */
1043 static inline GLboolean
1044 is_ext_opcode(OpCode opcode
)
1046 return (opcode
>= OPCODE_EXT_0
);
1050 /** Destroy an extended opcode instruction */
1052 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1054 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1056 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1057 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1062 /** Execute an extended opcode instruction */
1064 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1066 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1068 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1069 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1074 /** Print an extended opcode instruction */
1076 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1078 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1080 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1081 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1087 * Delete the named display list, but don't remove from hash table.
1088 * \param dlist - display list pointer
1091 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1096 n
= block
= dlist
->Head
;
1098 done
= block
? GL_FALSE
: GL_TRUE
;
1100 const OpCode opcode
= n
[0].opcode
;
1102 /* check for extension opcodes first */
1103 if (is_ext_opcode(opcode
)) {
1104 n
+= ext_opcode_destroy(ctx
, n
);
1108 /* for some commands, we need to free malloc'd memory */
1110 free(get_pointer(&n
[6]));
1113 free(get_pointer(&n
[10]));
1115 case OPCODE_CALL_LISTS
:
1116 free(get_pointer(&n
[3]));
1118 case OPCODE_DRAW_PIXELS
:
1119 free(get_pointer(&n
[5]));
1122 free(get_pointer(&n
[7]));
1124 case OPCODE_POLYGON_STIPPLE
:
1125 free(get_pointer(&n
[1]));
1127 case OPCODE_TEX_IMAGE1D
:
1128 free(get_pointer(&n
[8]));
1130 case OPCODE_TEX_IMAGE2D
:
1131 free(get_pointer(&n
[9]));
1133 case OPCODE_TEX_IMAGE3D
:
1134 free(get_pointer(&n
[10]));
1136 case OPCODE_TEX_SUB_IMAGE1D
:
1137 free(get_pointer(&n
[7]));
1139 case OPCODE_TEX_SUB_IMAGE2D
:
1140 free(get_pointer(&n
[9]));
1142 case OPCODE_TEX_SUB_IMAGE3D
:
1143 free(get_pointer(&n
[11]));
1145 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1146 free(get_pointer(&n
[7]));
1148 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1149 free(get_pointer(&n
[8]));
1151 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1152 free(get_pointer(&n
[9]));
1154 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1155 free(get_pointer(&n
[7]));
1157 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1158 free(get_pointer(&n
[9]));
1160 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1161 free(get_pointer(&n
[11]));
1163 case OPCODE_PROGRAM_STRING_ARB
:
1164 free(get_pointer(&n
[4])); /* program string */
1166 case OPCODE_UNIFORM_1FV
:
1167 case OPCODE_UNIFORM_2FV
:
1168 case OPCODE_UNIFORM_3FV
:
1169 case OPCODE_UNIFORM_4FV
:
1170 case OPCODE_UNIFORM_1DV
:
1171 case OPCODE_UNIFORM_2DV
:
1172 case OPCODE_UNIFORM_3DV
:
1173 case OPCODE_UNIFORM_4DV
:
1174 case OPCODE_UNIFORM_1IV
:
1175 case OPCODE_UNIFORM_2IV
:
1176 case OPCODE_UNIFORM_3IV
:
1177 case OPCODE_UNIFORM_4IV
:
1178 case OPCODE_UNIFORM_1UIV
:
1179 case OPCODE_UNIFORM_2UIV
:
1180 case OPCODE_UNIFORM_3UIV
:
1181 case OPCODE_UNIFORM_4UIV
:
1182 free(get_pointer(&n
[3]));
1184 case OPCODE_UNIFORM_MATRIX22
:
1185 case OPCODE_UNIFORM_MATRIX33
:
1186 case OPCODE_UNIFORM_MATRIX44
:
1187 case OPCODE_UNIFORM_MATRIX24
:
1188 case OPCODE_UNIFORM_MATRIX42
:
1189 case OPCODE_UNIFORM_MATRIX23
:
1190 case OPCODE_UNIFORM_MATRIX32
:
1191 case OPCODE_UNIFORM_MATRIX34
:
1192 case OPCODE_UNIFORM_MATRIX43
:
1193 case OPCODE_UNIFORM_MATRIX22D
:
1194 case OPCODE_UNIFORM_MATRIX33D
:
1195 case OPCODE_UNIFORM_MATRIX44D
:
1196 case OPCODE_UNIFORM_MATRIX24D
:
1197 case OPCODE_UNIFORM_MATRIX42D
:
1198 case OPCODE_UNIFORM_MATRIX23D
:
1199 case OPCODE_UNIFORM_MATRIX32D
:
1200 case OPCODE_UNIFORM_MATRIX34D
:
1201 case OPCODE_UNIFORM_MATRIX43D
:
1202 free(get_pointer(&n
[4]));
1204 case OPCODE_PROGRAM_UNIFORM_1FV
:
1205 case OPCODE_PROGRAM_UNIFORM_2FV
:
1206 case OPCODE_PROGRAM_UNIFORM_3FV
:
1207 case OPCODE_PROGRAM_UNIFORM_4FV
:
1208 case OPCODE_PROGRAM_UNIFORM_1DV
:
1209 case OPCODE_PROGRAM_UNIFORM_2DV
:
1210 case OPCODE_PROGRAM_UNIFORM_3DV
:
1211 case OPCODE_PROGRAM_UNIFORM_4DV
:
1212 case OPCODE_PROGRAM_UNIFORM_1IV
:
1213 case OPCODE_PROGRAM_UNIFORM_2IV
:
1214 case OPCODE_PROGRAM_UNIFORM_3IV
:
1215 case OPCODE_PROGRAM_UNIFORM_4IV
:
1216 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1217 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1218 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1219 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1220 free(get_pointer(&n
[4]));
1222 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1223 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1224 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1225 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1226 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1227 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1228 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1229 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1230 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1231 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1232 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1233 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1234 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1235 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1236 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1237 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1238 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1239 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1240 free(get_pointer(&n
[5]));
1242 case OPCODE_PIXEL_MAP
:
1243 free(get_pointer(&n
[3]));
1245 case OPCODE_VIEWPORT_ARRAY_V
:
1246 case OPCODE_SCISSOR_ARRAY_V
:
1247 case OPCODE_DEPTH_ARRAY_V
:
1248 case OPCODE_UNIFORM_SUBROUTINES
:
1249 case OPCODE_WINDOW_RECTANGLES
:
1250 free(get_pointer(&n
[3]));
1252 case OPCODE_TEXTURE_IMAGE1D
:
1253 case OPCODE_MULTITEX_IMAGE1D
:
1254 free(get_pointer(&n
[9]));
1256 case OPCODE_TEXTURE_IMAGE2D
:
1257 case OPCODE_MULTITEX_IMAGE2D
:
1258 free(get_pointer(&n
[10]));
1260 case OPCODE_TEXTURE_IMAGE3D
:
1261 case OPCODE_MULTITEX_IMAGE3D
:
1262 free(get_pointer(&n
[11]));
1264 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1265 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1266 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1267 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
1268 free(get_pointer(&n
[8]));
1270 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1271 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1272 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1273 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
1274 free(get_pointer(&n
[10]));
1276 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1277 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1278 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1279 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
1280 free(get_pointer(&n
[12]));
1282 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1283 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
1284 free(get_pointer(&n
[8]));
1286 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1287 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
1288 free(get_pointer(&n
[9]));
1290 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1291 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
1292 free(get_pointer(&n
[10]));
1294 case OPCODE_NAMED_PROGRAM_STRING
:
1295 free(get_pointer(&n
[5]));
1297 case OPCODE_CONTINUE
:
1298 n
= (Node
*) get_pointer(&n
[1]);
1302 case OPCODE_END_OF_LIST
:
1307 /* just increment 'n' pointer, below */
1311 if (opcode
!= OPCODE_CONTINUE
) {
1312 assert(InstSize
[opcode
] > 0);
1313 n
+= InstSize
[opcode
];
1324 * Called by _mesa_HashWalk() to check if a display list which is being
1325 * deleted belongs to a bitmap texture atlas.
1328 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1330 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1331 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1333 /* See if the list_id falls in the range contained in this texture atlas */
1334 if (atlas
->complete
&&
1335 list_id
>= atlas_id
&&
1336 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1337 /* Mark the atlas as incomplete so it doesn't get used. But don't
1338 * delete it yet since we don't want to try to recreate it in the next
1341 atlas
->complete
= false;
1342 atlas
->incomplete
= true;
1348 * Destroy a display list and remove from hash table.
1349 * \param list - display list number
1352 destroy_list(struct gl_context
*ctx
, GLuint list
)
1354 struct gl_display_list
*dlist
;
1359 dlist
= _mesa_lookup_list(ctx
, list
);
1363 if (is_bitmap_list(dlist
)) {
1364 /* If we're destroying a simple glBitmap display list, there's a
1365 * chance that we're destroying a bitmap image that's in a texture
1366 * atlas. Examine all atlases to see if that's the case. There's
1367 * usually few (if any) atlases so this isn't expensive.
1369 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1370 check_atlas_for_deleted_list
, &list
);
1373 _mesa_delete_list(ctx
, dlist
);
1374 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1379 * Translate the nth element of list from <type> to GLint.
1382 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1394 bptr
= (GLbyte
*) list
;
1395 return (GLint
) bptr
[n
];
1396 case GL_UNSIGNED_BYTE
:
1397 ubptr
= (GLubyte
*) list
;
1398 return (GLint
) ubptr
[n
];
1400 sptr
= (GLshort
*) list
;
1401 return (GLint
) sptr
[n
];
1402 case GL_UNSIGNED_SHORT
:
1403 usptr
= (GLushort
*) list
;
1404 return (GLint
) usptr
[n
];
1406 iptr
= (GLint
*) list
;
1408 case GL_UNSIGNED_INT
:
1409 uiptr
= (GLuint
*) list
;
1410 return (GLint
) uiptr
[n
];
1412 fptr
= (GLfloat
*) list
;
1413 return (GLint
) floorf(fptr
[n
]);
1415 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1416 return (GLint
) ubptr
[0] * 256
1419 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1420 return (GLint
) ubptr
[0] * 65536
1421 + (GLint
) ubptr
[1] * 256
1424 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1425 return (GLint
) ubptr
[0] * 16777216
1426 + (GLint
) ubptr
[1] * 65536
1427 + (GLint
) ubptr
[2] * 256
1436 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1437 * If width < 0 or height < 0 or format or type are invalid we'll just
1438 * return NULL. We will not generate an error since OpenGL command
1439 * arguments aren't error-checked until the command is actually executed
1440 * (not when they're compiled).
1441 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1444 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1445 GLsizei width
, GLsizei height
, GLsizei depth
,
1446 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1447 const struct gl_pixelstore_attrib
*unpack
)
1449 if (width
<= 0 || height
<= 0) {
1453 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1454 /* bad format and/or type */
1458 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1462 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1463 format
, type
, pixels
, unpack
);
1464 if (pixels
&& !image
) {
1465 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1469 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1470 depth
, format
, type
, INT_MAX
, pixels
)) {
1471 const GLubyte
*map
, *src
;
1475 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1476 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1479 /* unable to map src buffer! */
1480 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1484 src
= ADD_POINTERS(map
, pixels
);
1485 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1486 format
, type
, src
, unpack
);
1488 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1491 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1497 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1502 /** Return copy of memory */
1504 memdup(const void *src
, GLsizei bytes
)
1506 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1508 memcpy(b
, src
, bytes
);
1514 * Allocate space for a display list instruction (opcode + payload space).
1515 * \param opcode the instruction opcode (OPCODE_* value)
1516 * \param bytes instruction payload size (not counting opcode)
1517 * \param align8 does the payload need to be 8-byte aligned?
1518 * This is only relevant in 64-bit environments.
1519 * \return pointer to allocated memory (the payload will be at pointer+1)
1522 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1524 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1525 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1529 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1531 if (opcode
< OPCODE_EXT_0
) {
1532 if (InstSize
[opcode
] == 0) {
1533 /* save instruction size now */
1534 InstSize
[opcode
] = numNodes
;
1537 /* make sure instruction size agrees */
1538 assert(numNodes
== InstSize
[opcode
]);
1542 if (sizeof(void *) > sizeof(Node
) && align8
1543 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1544 /* The opcode would get placed at node[0] and the payload would start
1545 * at node[1]. But the payload needs to be at an even offset (8-byte
1554 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1556 /* This block is full. Allocate a new block and chain to it */
1558 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1559 n
[0].opcode
= OPCODE_CONTINUE
;
1560 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1562 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1566 /* a fresh block should be 8-byte aligned on 64-bit systems */
1567 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1569 save_pointer(&n
[1], newblock
);
1570 ctx
->ListState
.CurrentBlock
= newblock
;
1571 ctx
->ListState
.CurrentPos
= 0;
1573 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1574 * we have to insert a NOP so that the payload of the real opcode lands
1575 * on an even location:
1576 * node[0] = OPCODE_NOP
1577 * node[1] = OPCODE_x;
1578 * node[2] = start of payload
1580 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1583 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1585 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1586 n
[0].opcode
= OPCODE_NOP
;
1588 /* The "real" opcode will now be at an odd location and the payload
1589 * will be at an even location.
1592 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1594 n
[0].opcode
= opcode
;
1602 * Allocate space for a display list instruction. Used by callers outside
1603 * this file for things like VBO vertex data.
1605 * \param opcode the instruction opcode (OPCODE_* value)
1606 * \param bytes instruction size in bytes, not counting opcode.
1607 * \return pointer to the usable data area (not including the internal
1611 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1613 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1615 return n
+ 1; /* return pointer to payload area, after opcode */
1622 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1623 * aligned in 64-bit environments, 4-byte aligned otherwise.
1626 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1628 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1630 return n
+ 1; /* return pointer to payload area, after opcode */
1637 * This function allows modules and drivers to get their own opcodes
1638 * for extending display list functionality.
1639 * \param ctx the rendering context
1640 * \param size number of bytes for storing the new display list command
1641 * \param execute function to execute the new display list command
1642 * \param destroy function to destroy the new display list command
1643 * \param print function to print the new display list command
1644 * \return the new opcode number or -1 if error
1647 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1649 void (*execute
) (struct gl_context
*, void *),
1650 void (*destroy
) (struct gl_context
*, void *),
1651 void (*print
) (struct gl_context
*, void *, FILE *))
1653 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1654 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1655 ctx
->ListExt
->Opcode
[i
].Size
=
1656 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1657 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1658 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1659 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1660 return i
+ OPCODE_EXT_0
;
1667 * Allocate space for a display list instruction. The space is basically
1668 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1669 * function parameter, node[2] is the second parameter, etc.
1671 * \param opcode one of OPCODE_x
1672 * \param nparams number of function parameters
1673 * \return pointer to start of instruction space
1675 static inline Node
*
1676 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1678 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1683 * Called by EndList to try to reduce memory used for the list.
1686 trim_list(struct gl_context
*ctx
)
1688 /* If the list we're ending only has one allocated block of nodes/tokens
1689 * and its size isn't a full block size, realloc the block to use less
1690 * memory. This is important for apps that create many small display
1691 * lists and apps that use glXUseXFont (many lists each containing one
1693 * Note: we currently only trim display lists that allocated one block
1694 * of tokens. That hits the short list case which is what we're mainly
1695 * concerned with. Trimming longer lists would involve traversing the
1696 * linked list of blocks.
1698 struct gl_dlist_state
*list
= &ctx
->ListState
;
1700 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1701 (list
->CurrentPos
< BLOCK_SIZE
)) {
1702 /* There's only one block and it's not full, so realloc */
1703 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1704 list
->CurrentList
->Head
=
1705 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1706 if (!list
->CurrentBlock
) {
1707 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1715 * Display List compilation functions
1717 static void GLAPIENTRY
1718 save_Accum(GLenum op
, GLfloat value
)
1720 GET_CURRENT_CONTEXT(ctx
);
1722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1723 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1728 if (ctx
->ExecuteFlag
) {
1729 CALL_Accum(ctx
->Exec
, (op
, value
));
1734 static void GLAPIENTRY
1735 save_AlphaFunc(GLenum func
, GLclampf ref
)
1737 GET_CURRENT_CONTEXT(ctx
);
1739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1740 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1743 n
[2].f
= (GLfloat
) ref
;
1745 if (ctx
->ExecuteFlag
) {
1746 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1751 static void GLAPIENTRY
1752 save_BindTexture(GLenum target
, GLuint texture
)
1754 GET_CURRENT_CONTEXT(ctx
);
1756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1757 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1768 static void GLAPIENTRY
1769 save_Bitmap(GLsizei width
, GLsizei height
,
1770 GLfloat xorig
, GLfloat yorig
,
1771 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1773 GET_CURRENT_CONTEXT(ctx
);
1775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1776 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1778 n
[1].i
= (GLint
) width
;
1779 n
[2].i
= (GLint
) height
;
1785 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1786 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1788 if (ctx
->ExecuteFlag
) {
1789 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1790 xorig
, yorig
, xmove
, ymove
, pixels
));
1795 static void GLAPIENTRY
1796 save_BlendEquation(GLenum mode
)
1798 GET_CURRENT_CONTEXT(ctx
);
1800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1801 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1805 if (ctx
->ExecuteFlag
) {
1806 CALL_BlendEquation(ctx
->Exec
, (mode
));
1811 static void GLAPIENTRY
1812 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1814 GET_CURRENT_CONTEXT(ctx
);
1816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1817 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1822 if (ctx
->ExecuteFlag
) {
1823 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1828 static void GLAPIENTRY
1829 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1830 GLenum sfactorA
, GLenum dfactorA
)
1832 GET_CURRENT_CONTEXT(ctx
);
1834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1835 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1837 n
[1].e
= sfactorRGB
;
1838 n
[2].e
= dfactorRGB
;
1842 if (ctx
->ExecuteFlag
) {
1843 CALL_BlendFuncSeparate(ctx
->Exec
,
1844 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1849 static void GLAPIENTRY
1850 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1852 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1856 static void GLAPIENTRY
1857 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1859 GET_CURRENT_CONTEXT(ctx
);
1861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1862 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1869 if (ctx
->ExecuteFlag
) {
1870 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1874 /* GL_ARB_draw_buffers_blend */
1875 static void GLAPIENTRY
1876 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1877 GLenum sfactorA
, GLenum dfactorA
)
1879 GET_CURRENT_CONTEXT(ctx
);
1881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1882 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1885 n
[2].e
= sfactorRGB
;
1886 n
[3].e
= dfactorRGB
;
1890 if (ctx
->ExecuteFlag
) {
1891 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1892 sfactorA
, dfactorA
));
1896 /* GL_ARB_draw_buffers_blend */
1897 static void GLAPIENTRY
1898 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1900 GET_CURRENT_CONTEXT(ctx
);
1902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1903 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1909 if (ctx
->ExecuteFlag
) {
1910 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1914 /* GL_ARB_draw_buffers_blend */
1915 static void GLAPIENTRY
1916 save_BlendEquationi(GLuint buf
, GLenum mode
)
1918 GET_CURRENT_CONTEXT(ctx
);
1920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1921 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1926 if (ctx
->ExecuteFlag
) {
1927 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1931 /* GL_ARB_draw_buffers_blend */
1932 static void GLAPIENTRY
1933 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1935 GET_CURRENT_CONTEXT(ctx
);
1937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1938 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1944 if (ctx
->ExecuteFlag
) {
1945 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1950 /* GL_ARB_draw_instanced. */
1951 static void GLAPIENTRY
1952 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1954 UNUSED GLsizei count
,
1955 UNUSED GLsizei primcount
)
1957 GET_CURRENT_CONTEXT(ctx
);
1958 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1959 "glDrawArraysInstanced() during display list compile");
1962 static void GLAPIENTRY
1963 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1964 UNUSED GLsizei count
,
1966 UNUSED
const GLvoid
*indices
,
1967 UNUSED GLsizei primcount
)
1969 GET_CURRENT_CONTEXT(ctx
);
1970 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1971 "glDrawElementsInstanced() during display list compile");
1974 static void GLAPIENTRY
1975 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1976 UNUSED GLsizei count
,
1978 UNUSED
const GLvoid
*indices
,
1979 UNUSED GLsizei primcount
,
1980 UNUSED GLint basevertex
)
1982 GET_CURRENT_CONTEXT(ctx
);
1983 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1984 "glDrawElementsInstancedBaseVertex() during display list compile");
1987 /* GL_ARB_base_instance. */
1988 static void GLAPIENTRY
1989 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1991 UNUSED GLsizei count
,
1992 UNUSED GLsizei primcount
,
1993 UNUSED GLuint baseinstance
)
1995 GET_CURRENT_CONTEXT(ctx
);
1996 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1997 "glDrawArraysInstancedBaseInstance() during display list compile");
2000 static void APIENTRY
2001 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
2002 UNUSED GLsizei count
,
2004 UNUSED
const void *indices
,
2005 UNUSED GLsizei primcount
,
2006 UNUSED GLuint baseinstance
)
2008 GET_CURRENT_CONTEXT(ctx
);
2009 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2010 "glDrawElementsInstancedBaseInstance() during display list compile");
2013 static void APIENTRY
2014 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
2015 UNUSED GLsizei count
,
2017 UNUSED
const void *indices
,
2018 UNUSED GLsizei primcount
,
2019 UNUSED GLint basevertex
,
2020 UNUSED GLuint baseinstance
)
2022 GET_CURRENT_CONTEXT(ctx
);
2023 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2024 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2027 static void APIENTRY
2028 save_DrawArraysIndirect(UNUSED GLenum mode
,
2029 UNUSED
const void *indirect
)
2031 GET_CURRENT_CONTEXT(ctx
);
2032 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2033 "glDrawArraysIndirect() during display list compile");
2036 static void APIENTRY
2037 save_DrawElementsIndirect(UNUSED GLenum mode
,
2039 UNUSED
const void *indirect
)
2041 GET_CURRENT_CONTEXT(ctx
);
2042 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2043 "glDrawElementsIndirect() during display list compile");
2046 static void APIENTRY
2047 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2048 UNUSED
const void *indirect
,
2049 UNUSED GLsizei primcount
,
2050 UNUSED GLsizei stride
)
2052 GET_CURRENT_CONTEXT(ctx
);
2053 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2054 "glMultiDrawArraysIndirect() during display list compile");
2057 static void APIENTRY
2058 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2060 UNUSED
const void *indirect
,
2061 UNUSED GLsizei primcount
,
2062 UNUSED GLsizei stride
)
2064 GET_CURRENT_CONTEXT(ctx
);
2065 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2066 "glMultiDrawElementsIndirect() during display list compile");
2070 * While building a display list we cache some OpenGL state.
2071 * Under some circumstances we need to invalidate that state (immediately
2072 * when we start compiling a list, or after glCallList(s)).
2075 invalidate_saved_current_state(struct gl_context
*ctx
)
2079 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2080 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2082 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2083 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2085 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2087 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2091 static void GLAPIENTRY
2092 save_CallList(GLuint list
)
2094 GET_CURRENT_CONTEXT(ctx
);
2096 SAVE_FLUSH_VERTICES(ctx
);
2098 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2103 /* After this, we don't know what state we're in. Invalidate all
2104 * cached information previously gathered:
2106 invalidate_saved_current_state( ctx
);
2108 if (ctx
->ExecuteFlag
) {
2109 _mesa_CallList(list
);
2114 static void GLAPIENTRY
2115 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2117 GET_CURRENT_CONTEXT(ctx
);
2122 SAVE_FLUSH_VERTICES(ctx
);
2126 case GL_UNSIGNED_BYTE
:
2130 case GL_UNSIGNED_SHORT
:
2138 case GL_UNSIGNED_INT
:
2147 if (num
> 0 && type_size
> 0) {
2148 /* create a copy of the array of list IDs to save in the display list */
2149 lists_copy
= memdup(lists
, num
* type_size
);
2154 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2158 save_pointer(&n
[3], lists_copy
);
2161 /* After this, we don't know what state we're in. Invalidate all
2162 * cached information previously gathered:
2164 invalidate_saved_current_state( ctx
);
2166 if (ctx
->ExecuteFlag
) {
2167 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2172 static void GLAPIENTRY
2173 save_Clear(GLbitfield mask
)
2175 GET_CURRENT_CONTEXT(ctx
);
2177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2178 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2182 if (ctx
->ExecuteFlag
) {
2183 CALL_Clear(ctx
->Exec
, (mask
));
2188 static void GLAPIENTRY
2189 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2191 GET_CURRENT_CONTEXT(ctx
);
2193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2194 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2197 n
[2].i
= drawbuffer
;
2199 if (buffer
== GL_COLOR
) {
2210 if (ctx
->ExecuteFlag
) {
2211 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2216 static void GLAPIENTRY
2217 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2219 GET_CURRENT_CONTEXT(ctx
);
2221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2222 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2225 n
[2].i
= drawbuffer
;
2227 if (buffer
== GL_COLOR
) {
2238 if (ctx
->ExecuteFlag
) {
2239 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2244 static void GLAPIENTRY
2245 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2247 GET_CURRENT_CONTEXT(ctx
);
2249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2250 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2253 n
[2].i
= drawbuffer
;
2255 if (buffer
== GL_COLOR
) {
2266 if (ctx
->ExecuteFlag
) {
2267 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2272 static void GLAPIENTRY
2273 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2274 GLfloat depth
, GLint stencil
)
2276 GET_CURRENT_CONTEXT(ctx
);
2278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2279 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2282 n
[2].i
= drawbuffer
;
2286 if (ctx
->ExecuteFlag
) {
2287 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2292 static void GLAPIENTRY
2293 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2295 GET_CURRENT_CONTEXT(ctx
);
2297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2298 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2305 if (ctx
->ExecuteFlag
) {
2306 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2311 static void GLAPIENTRY
2312 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2314 GET_CURRENT_CONTEXT(ctx
);
2316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2317 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2324 if (ctx
->ExecuteFlag
) {
2325 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2330 static void GLAPIENTRY
2331 save_ClearDepth(GLclampd depth
)
2333 GET_CURRENT_CONTEXT(ctx
);
2335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2336 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2338 n
[1].f
= (GLfloat
) depth
;
2340 if (ctx
->ExecuteFlag
) {
2341 CALL_ClearDepth(ctx
->Exec
, (depth
));
2346 static void GLAPIENTRY
2347 save_ClearIndex(GLfloat c
)
2349 GET_CURRENT_CONTEXT(ctx
);
2351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2352 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2356 if (ctx
->ExecuteFlag
) {
2357 CALL_ClearIndex(ctx
->Exec
, (c
));
2362 static void GLAPIENTRY
2363 save_ClearStencil(GLint s
)
2365 GET_CURRENT_CONTEXT(ctx
);
2367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2368 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2372 if (ctx
->ExecuteFlag
) {
2373 CALL_ClearStencil(ctx
->Exec
, (s
));
2378 static void GLAPIENTRY
2379 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2381 GET_CURRENT_CONTEXT(ctx
);
2383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2384 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2387 n
[2].f
= (GLfloat
) equ
[0];
2388 n
[3].f
= (GLfloat
) equ
[1];
2389 n
[4].f
= (GLfloat
) equ
[2];
2390 n
[5].f
= (GLfloat
) equ
[3];
2392 if (ctx
->ExecuteFlag
) {
2393 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2399 static void GLAPIENTRY
2400 save_ColorMask(GLboolean red
, GLboolean green
,
2401 GLboolean blue
, GLboolean alpha
)
2403 GET_CURRENT_CONTEXT(ctx
);
2405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2406 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2413 if (ctx
->ExecuteFlag
) {
2414 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2419 static void GLAPIENTRY
2420 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2421 GLboolean blue
, GLboolean alpha
)
2423 GET_CURRENT_CONTEXT(ctx
);
2425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2426 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2434 if (ctx
->ExecuteFlag
) {
2435 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2440 static void GLAPIENTRY
2441 save_ColorMaterial(GLenum face
, GLenum mode
)
2443 GET_CURRENT_CONTEXT(ctx
);
2445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2447 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2452 if (ctx
->ExecuteFlag
) {
2453 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2458 static void GLAPIENTRY
2459 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2461 GET_CURRENT_CONTEXT(ctx
);
2463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2464 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2468 n
[3].i
= (GLint
) width
;
2469 n
[4].i
= (GLint
) height
;
2472 if (ctx
->ExecuteFlag
) {
2473 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2479 static void GLAPIENTRY
2480 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2481 GLint x
, GLint y
, GLsizei width
, GLint border
)
2483 GET_CURRENT_CONTEXT(ctx
);
2485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2486 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2490 n
[3].e
= internalformat
;
2496 if (ctx
->ExecuteFlag
) {
2497 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2498 x
, y
, width
, border
));
2503 static void GLAPIENTRY
2504 save_CopyTexImage2D(GLenum target
, GLint level
,
2505 GLenum internalformat
,
2506 GLint x
, GLint y
, GLsizei width
,
2507 GLsizei height
, GLint border
)
2509 GET_CURRENT_CONTEXT(ctx
);
2511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2512 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2516 n
[3].e
= internalformat
;
2523 if (ctx
->ExecuteFlag
) {
2524 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2525 x
, y
, width
, height
, border
));
2531 static void GLAPIENTRY
2532 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2533 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2535 GET_CURRENT_CONTEXT(ctx
);
2537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2538 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2547 if (ctx
->ExecuteFlag
) {
2548 CALL_CopyTexSubImage1D(ctx
->Exec
,
2549 (target
, level
, xoffset
, x
, y
, width
));
2554 static void GLAPIENTRY
2555 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2556 GLint xoffset
, GLint yoffset
,
2557 GLint x
, GLint y
, GLsizei width
, GLint height
)
2559 GET_CURRENT_CONTEXT(ctx
);
2561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2562 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2573 if (ctx
->ExecuteFlag
) {
2574 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2575 x
, y
, width
, height
));
2580 static void GLAPIENTRY
2581 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2582 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2583 GLint x
, GLint y
, GLsizei width
, GLint height
)
2585 GET_CURRENT_CONTEXT(ctx
);
2587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2588 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2600 if (ctx
->ExecuteFlag
) {
2601 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2602 xoffset
, yoffset
, zoffset
,
2603 x
, y
, width
, height
));
2608 static void GLAPIENTRY
2609 save_CullFace(GLenum mode
)
2611 GET_CURRENT_CONTEXT(ctx
);
2613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2614 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2618 if (ctx
->ExecuteFlag
) {
2619 CALL_CullFace(ctx
->Exec
, (mode
));
2624 static void GLAPIENTRY
2625 save_DepthFunc(GLenum func
)
2627 GET_CURRENT_CONTEXT(ctx
);
2629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2630 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2634 if (ctx
->ExecuteFlag
) {
2635 CALL_DepthFunc(ctx
->Exec
, (func
));
2640 static void GLAPIENTRY
2641 save_DepthMask(GLboolean mask
)
2643 GET_CURRENT_CONTEXT(ctx
);
2645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2646 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2650 if (ctx
->ExecuteFlag
) {
2651 CALL_DepthMask(ctx
->Exec
, (mask
));
2656 static void GLAPIENTRY
2657 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2659 GET_CURRENT_CONTEXT(ctx
);
2661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2662 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2664 n
[1].f
= (GLfloat
) nearval
;
2665 n
[2].f
= (GLfloat
) farval
;
2667 if (ctx
->ExecuteFlag
) {
2668 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2673 static void GLAPIENTRY
2674 save_Disable(GLenum cap
)
2676 GET_CURRENT_CONTEXT(ctx
);
2678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2679 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2683 if (ctx
->ExecuteFlag
) {
2684 CALL_Disable(ctx
->Exec
, (cap
));
2689 static void GLAPIENTRY
2690 save_DisableIndexed(GLuint index
, GLenum cap
)
2692 GET_CURRENT_CONTEXT(ctx
);
2694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2695 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2700 if (ctx
->ExecuteFlag
) {
2701 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2706 static void GLAPIENTRY
2707 save_DrawBuffer(GLenum mode
)
2709 GET_CURRENT_CONTEXT(ctx
);
2711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2712 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2716 if (ctx
->ExecuteFlag
) {
2717 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2722 static void GLAPIENTRY
2723 save_DrawPixels(GLsizei width
, GLsizei height
,
2724 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2726 GET_CURRENT_CONTEXT(ctx
);
2729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2731 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2738 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2739 pixels
, &ctx
->Unpack
));
2741 if (ctx
->ExecuteFlag
) {
2742 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2748 static void GLAPIENTRY
2749 save_Enable(GLenum cap
)
2751 GET_CURRENT_CONTEXT(ctx
);
2753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2754 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2758 if (ctx
->ExecuteFlag
) {
2759 CALL_Enable(ctx
->Exec
, (cap
));
2765 static void GLAPIENTRY
2766 save_EnableIndexed(GLuint index
, GLenum cap
)
2768 GET_CURRENT_CONTEXT(ctx
);
2770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2771 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2776 if (ctx
->ExecuteFlag
) {
2777 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2783 static void GLAPIENTRY
2784 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2786 GET_CURRENT_CONTEXT(ctx
);
2788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2789 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2795 if (ctx
->ExecuteFlag
) {
2796 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2801 static void GLAPIENTRY
2802 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2804 GET_CURRENT_CONTEXT(ctx
);
2806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2807 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2823 static void GLAPIENTRY
2824 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2826 GET_CURRENT_CONTEXT(ctx
);
2828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2829 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2837 if (ctx
->ExecuteFlag
) {
2838 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2843 static void GLAPIENTRY
2844 save_Fogf(GLenum pname
, GLfloat param
)
2848 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2849 save_Fogfv(pname
, parray
);
2853 static void GLAPIENTRY
2854 save_Fogiv(GLenum pname
, const GLint
*params
)
2859 case GL_FOG_DENSITY
:
2863 case GL_FOG_COORDINATE_SOURCE
:
2864 p
[0] = (GLfloat
) *params
;
2870 p
[0] = INT_TO_FLOAT(params
[0]);
2871 p
[1] = INT_TO_FLOAT(params
[1]);
2872 p
[2] = INT_TO_FLOAT(params
[2]);
2873 p
[3] = INT_TO_FLOAT(params
[3]);
2876 /* Error will be caught later in gl_Fogfv */
2877 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2879 save_Fogfv(pname
, p
);
2883 static void GLAPIENTRY
2884 save_Fogi(GLenum pname
, GLint param
)
2888 parray
[1] = parray
[2] = parray
[3] = 0;
2889 save_Fogiv(pname
, parray
);
2893 static void GLAPIENTRY
2894 save_FrontFace(GLenum mode
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2899 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2903 if (ctx
->ExecuteFlag
) {
2904 CALL_FrontFace(ctx
->Exec
, (mode
));
2909 static void GLAPIENTRY
2910 save_Frustum(GLdouble left
, GLdouble right
,
2911 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2913 GET_CURRENT_CONTEXT(ctx
);
2915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2916 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2918 n
[1].f
= (GLfloat
) left
;
2919 n
[2].f
= (GLfloat
) right
;
2920 n
[3].f
= (GLfloat
) bottom
;
2921 n
[4].f
= (GLfloat
) top
;
2922 n
[5].f
= (GLfloat
) nearval
;
2923 n
[6].f
= (GLfloat
) farval
;
2925 if (ctx
->ExecuteFlag
) {
2926 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2931 static void GLAPIENTRY
2932 save_Hint(GLenum target
, GLenum mode
)
2934 GET_CURRENT_CONTEXT(ctx
);
2936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2937 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2942 if (ctx
->ExecuteFlag
) {
2943 CALL_Hint(ctx
->Exec
, (target
, mode
));
2948 static void GLAPIENTRY
2949 save_IndexMask(GLuint mask
)
2951 GET_CURRENT_CONTEXT(ctx
);
2953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2954 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2958 if (ctx
->ExecuteFlag
) {
2959 CALL_IndexMask(ctx
->Exec
, (mask
));
2964 static void GLAPIENTRY
2965 save_InitNames(void)
2967 GET_CURRENT_CONTEXT(ctx
);
2968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2969 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2970 if (ctx
->ExecuteFlag
) {
2971 CALL_InitNames(ctx
->Exec
, ());
2976 static void GLAPIENTRY
2977 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2979 GET_CURRENT_CONTEXT(ctx
);
2981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2982 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
3000 case GL_SPOT_DIRECTION
:
3003 case GL_SPOT_EXPONENT
:
3006 case GL_SPOT_CUTOFF
:
3009 case GL_CONSTANT_ATTENUATION
:
3012 case GL_LINEAR_ATTENUATION
:
3015 case GL_QUADRATIC_ATTENUATION
:
3021 for (i
= 0; i
< nParams
; i
++) {
3022 n
[3 + i
].f
= params
[i
];
3025 if (ctx
->ExecuteFlag
) {
3026 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3031 static void GLAPIENTRY
3032 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3036 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3037 save_Lightfv(light
, pname
, parray
);
3041 static void GLAPIENTRY
3042 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3049 fparam
[0] = INT_TO_FLOAT(params
[0]);
3050 fparam
[1] = INT_TO_FLOAT(params
[1]);
3051 fparam
[2] = INT_TO_FLOAT(params
[2]);
3052 fparam
[3] = INT_TO_FLOAT(params
[3]);
3055 fparam
[0] = (GLfloat
) params
[0];
3056 fparam
[1] = (GLfloat
) params
[1];
3057 fparam
[2] = (GLfloat
) params
[2];
3058 fparam
[3] = (GLfloat
) params
[3];
3060 case GL_SPOT_DIRECTION
:
3061 fparam
[0] = (GLfloat
) params
[0];
3062 fparam
[1] = (GLfloat
) params
[1];
3063 fparam
[2] = (GLfloat
) params
[2];
3065 case GL_SPOT_EXPONENT
:
3066 case GL_SPOT_CUTOFF
:
3067 case GL_CONSTANT_ATTENUATION
:
3068 case GL_LINEAR_ATTENUATION
:
3069 case GL_QUADRATIC_ATTENUATION
:
3070 fparam
[0] = (GLfloat
) params
[0];
3073 /* error will be caught later in gl_Lightfv */
3076 save_Lightfv(light
, pname
, fparam
);
3080 static void GLAPIENTRY
3081 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3085 parray
[1] = parray
[2] = parray
[3] = 0;
3086 save_Lightiv(light
, pname
, parray
);
3090 static void GLAPIENTRY
3091 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3093 GET_CURRENT_CONTEXT(ctx
);
3095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3096 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3104 if (ctx
->ExecuteFlag
) {
3105 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3110 static void GLAPIENTRY
3111 save_LightModelf(GLenum pname
, GLfloat param
)
3115 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3116 save_LightModelfv(pname
, parray
);
3120 static void GLAPIENTRY
3121 save_LightModeliv(GLenum pname
, const GLint
*params
)
3125 case GL_LIGHT_MODEL_AMBIENT
:
3126 fparam
[0] = INT_TO_FLOAT(params
[0]);
3127 fparam
[1] = INT_TO_FLOAT(params
[1]);
3128 fparam
[2] = INT_TO_FLOAT(params
[2]);
3129 fparam
[3] = INT_TO_FLOAT(params
[3]);
3131 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3132 case GL_LIGHT_MODEL_TWO_SIDE
:
3133 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3134 fparam
[0] = (GLfloat
) params
[0];
3140 /* Error will be caught later in gl_LightModelfv */
3141 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3143 save_LightModelfv(pname
, fparam
);
3147 static void GLAPIENTRY
3148 save_LightModeli(GLenum pname
, GLint param
)
3152 parray
[1] = parray
[2] = parray
[3] = 0;
3153 save_LightModeliv(pname
, parray
);
3157 static void GLAPIENTRY
3158 save_LineStipple(GLint factor
, GLushort pattern
)
3160 GET_CURRENT_CONTEXT(ctx
);
3162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3163 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3168 if (ctx
->ExecuteFlag
) {
3169 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3174 static void GLAPIENTRY
3175 save_LineWidth(GLfloat width
)
3177 GET_CURRENT_CONTEXT(ctx
);
3179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3180 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3184 if (ctx
->ExecuteFlag
) {
3185 CALL_LineWidth(ctx
->Exec
, (width
));
3190 static void GLAPIENTRY
3191 save_ListBase(GLuint base
)
3193 GET_CURRENT_CONTEXT(ctx
);
3195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3196 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3200 if (ctx
->ExecuteFlag
) {
3201 CALL_ListBase(ctx
->Exec
, (base
));
3206 static void GLAPIENTRY
3207 save_LoadIdentity(void)
3209 GET_CURRENT_CONTEXT(ctx
);
3210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3211 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3212 if (ctx
->ExecuteFlag
) {
3213 CALL_LoadIdentity(ctx
->Exec
, ());
3218 static void GLAPIENTRY
3219 save_LoadMatrixf(const GLfloat
* m
)
3221 GET_CURRENT_CONTEXT(ctx
);
3223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3224 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3227 for (i
= 0; i
< 16; i
++) {
3231 if (ctx
->ExecuteFlag
) {
3232 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3237 static void GLAPIENTRY
3238 save_LoadMatrixd(const GLdouble
* m
)
3242 for (i
= 0; i
< 16; i
++) {
3243 f
[i
] = (GLfloat
) m
[i
];
3245 save_LoadMatrixf(f
);
3249 static void GLAPIENTRY
3250 save_LoadName(GLuint name
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3259 if (ctx
->ExecuteFlag
) {
3260 CALL_LoadName(ctx
->Exec
, (name
));
3265 static void GLAPIENTRY
3266 save_LogicOp(GLenum opcode
)
3268 GET_CURRENT_CONTEXT(ctx
);
3270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3271 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3275 if (ctx
->ExecuteFlag
) {
3276 CALL_LogicOp(ctx
->Exec
, (opcode
));
3281 static void GLAPIENTRY
3282 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3283 GLint order
, const GLdouble
* points
)
3285 GET_CURRENT_CONTEXT(ctx
);
3287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3288 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3290 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3292 n
[2].f
= (GLfloat
) u1
;
3293 n
[3].f
= (GLfloat
) u2
;
3294 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3296 save_pointer(&n
[6], pnts
);
3298 if (ctx
->ExecuteFlag
) {
3299 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3303 static void GLAPIENTRY
3304 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3305 GLint order
, const GLfloat
* points
)
3307 GET_CURRENT_CONTEXT(ctx
);
3309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3310 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3312 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3316 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3318 save_pointer(&n
[6], pnts
);
3320 if (ctx
->ExecuteFlag
) {
3321 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3326 static void GLAPIENTRY
3327 save_Map2d(GLenum target
,
3328 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3329 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3330 const GLdouble
* points
)
3332 GET_CURRENT_CONTEXT(ctx
);
3334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3335 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3337 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3338 vstride
, vorder
, points
);
3340 n
[2].f
= (GLfloat
) u1
;
3341 n
[3].f
= (GLfloat
) u2
;
3342 n
[4].f
= (GLfloat
) v1
;
3343 n
[5].f
= (GLfloat
) v2
;
3344 /* XXX verify these strides are correct */
3345 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3346 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3349 save_pointer(&n
[10], pnts
);
3351 if (ctx
->ExecuteFlag
) {
3352 CALL_Map2d(ctx
->Exec
, (target
,
3353 u1
, u2
, ustride
, uorder
,
3354 v1
, v2
, vstride
, vorder
, points
));
3359 static void GLAPIENTRY
3360 save_Map2f(GLenum target
,
3361 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3362 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3363 const GLfloat
* points
)
3365 GET_CURRENT_CONTEXT(ctx
);
3367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3368 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3370 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3371 vstride
, vorder
, points
);
3377 /* XXX verify these strides are correct */
3378 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3379 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3382 save_pointer(&n
[10], pnts
);
3384 if (ctx
->ExecuteFlag
) {
3385 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3386 v1
, v2
, vstride
, vorder
, points
));
3391 static void GLAPIENTRY
3392 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3394 GET_CURRENT_CONTEXT(ctx
);
3396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3397 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3403 if (ctx
->ExecuteFlag
) {
3404 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3409 static void GLAPIENTRY
3410 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3412 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3416 static void GLAPIENTRY
3417 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3418 GLint vn
, GLfloat v1
, GLfloat v2
)
3420 GET_CURRENT_CONTEXT(ctx
);
3422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3423 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3432 if (ctx
->ExecuteFlag
) {
3433 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3439 static void GLAPIENTRY
3440 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3441 GLint vn
, GLdouble v1
, GLdouble v2
)
3443 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3444 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3448 static void GLAPIENTRY
3449 save_MatrixMode(GLenum mode
)
3451 GET_CURRENT_CONTEXT(ctx
);
3453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3454 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3458 if (ctx
->ExecuteFlag
) {
3459 CALL_MatrixMode(ctx
->Exec
, (mode
));
3464 static void GLAPIENTRY
3465 save_MultMatrixf(const GLfloat
* m
)
3467 GET_CURRENT_CONTEXT(ctx
);
3469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3470 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3473 for (i
= 0; i
< 16; i
++) {
3477 if (ctx
->ExecuteFlag
) {
3478 CALL_MultMatrixf(ctx
->Exec
, (m
));
3483 static void GLAPIENTRY
3484 save_MultMatrixd(const GLdouble
* m
)
3488 for (i
= 0; i
< 16; i
++) {
3489 f
[i
] = (GLfloat
) m
[i
];
3491 save_MultMatrixf(f
);
3495 static void GLAPIENTRY
3496 save_NewList(GLuint name
, GLenum mode
)
3498 GET_CURRENT_CONTEXT(ctx
);
3499 /* It's an error to call this function while building a display list */
3500 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3507 static void GLAPIENTRY
3508 save_Ortho(GLdouble left
, GLdouble right
,
3509 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3511 GET_CURRENT_CONTEXT(ctx
);
3513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3514 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3516 n
[1].f
= (GLfloat
) left
;
3517 n
[2].f
= (GLfloat
) right
;
3518 n
[3].f
= (GLfloat
) bottom
;
3519 n
[4].f
= (GLfloat
) top
;
3520 n
[5].f
= (GLfloat
) nearval
;
3521 n
[6].f
= (GLfloat
) farval
;
3523 if (ctx
->ExecuteFlag
) {
3524 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3529 static void GLAPIENTRY
3530 save_PatchParameteri(GLenum pname
, const GLint value
)
3532 GET_CURRENT_CONTEXT(ctx
);
3534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3535 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3540 if (ctx
->ExecuteFlag
) {
3541 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3546 static void GLAPIENTRY
3547 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3549 GET_CURRENT_CONTEXT(ctx
);
3551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3553 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3554 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3556 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3557 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3561 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3571 if (ctx
->ExecuteFlag
) {
3572 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3577 static void GLAPIENTRY
3578 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3580 GET_CURRENT_CONTEXT(ctx
);
3582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3583 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3587 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3589 if (ctx
->ExecuteFlag
) {
3590 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3595 static void GLAPIENTRY
3596 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3598 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3600 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3601 for (i
= 0; i
< mapsize
; i
++) {
3602 fvalues
[i
] = (GLfloat
) values
[i
];
3606 for (i
= 0; i
< mapsize
; i
++) {
3607 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3610 save_PixelMapfv(map
, mapsize
, fvalues
);
3614 static void GLAPIENTRY
3615 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3617 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3619 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3620 for (i
= 0; i
< mapsize
; i
++) {
3621 fvalues
[i
] = (GLfloat
) values
[i
];
3625 for (i
= 0; i
< mapsize
; i
++) {
3626 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3629 save_PixelMapfv(map
, mapsize
, fvalues
);
3633 static void GLAPIENTRY
3634 save_PixelTransferf(GLenum pname
, GLfloat param
)
3636 GET_CURRENT_CONTEXT(ctx
);
3638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3639 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3644 if (ctx
->ExecuteFlag
) {
3645 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3650 static void GLAPIENTRY
3651 save_PixelTransferi(GLenum pname
, GLint param
)
3653 save_PixelTransferf(pname
, (GLfloat
) param
);
3657 static void GLAPIENTRY
3658 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3660 GET_CURRENT_CONTEXT(ctx
);
3662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3663 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3668 if (ctx
->ExecuteFlag
) {
3669 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3674 static void GLAPIENTRY
3675 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3677 GET_CURRENT_CONTEXT(ctx
);
3679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3680 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3687 if (ctx
->ExecuteFlag
) {
3688 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3693 static void GLAPIENTRY
3694 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3698 parray
[1] = parray
[2] = 0.0F
;
3699 save_PointParameterfvEXT(pname
, parray
);
3702 static void GLAPIENTRY
3703 save_PointParameteriNV(GLenum pname
, GLint param
)
3706 parray
[0] = (GLfloat
) param
;
3707 parray
[1] = parray
[2] = 0.0F
;
3708 save_PointParameterfvEXT(pname
, parray
);
3711 static void GLAPIENTRY
3712 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3715 parray
[0] = (GLfloat
) param
[0];
3716 parray
[1] = parray
[2] = 0.0F
;
3717 save_PointParameterfvEXT(pname
, parray
);
3721 static void GLAPIENTRY
3722 save_PointSize(GLfloat size
)
3724 GET_CURRENT_CONTEXT(ctx
);
3726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3727 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3731 if (ctx
->ExecuteFlag
) {
3732 CALL_PointSize(ctx
->Exec
, (size
));
3737 static void GLAPIENTRY
3738 save_PolygonMode(GLenum face
, GLenum mode
)
3740 GET_CURRENT_CONTEXT(ctx
);
3742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3743 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3748 if (ctx
->ExecuteFlag
) {
3749 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3754 static void GLAPIENTRY
3755 save_PolygonStipple(const GLubyte
* pattern
)
3757 GET_CURRENT_CONTEXT(ctx
);
3760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3762 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3765 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3766 pattern
, &ctx
->Unpack
));
3768 if (ctx
->ExecuteFlag
) {
3769 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3774 static void GLAPIENTRY
3775 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3777 GET_CURRENT_CONTEXT(ctx
);
3779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3780 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3785 if (ctx
->ExecuteFlag
) {
3786 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3791 static void GLAPIENTRY
3792 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3794 GET_CURRENT_CONTEXT(ctx
);
3796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3797 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3803 if (ctx
->ExecuteFlag
) {
3804 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3808 static void GLAPIENTRY
3809 save_PopAttrib(void)
3811 GET_CURRENT_CONTEXT(ctx
);
3812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3813 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3814 if (ctx
->ExecuteFlag
) {
3815 CALL_PopAttrib(ctx
->Exec
, ());
3820 static void GLAPIENTRY
3821 save_PopMatrix(void)
3823 GET_CURRENT_CONTEXT(ctx
);
3824 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3825 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3826 if (ctx
->ExecuteFlag
) {
3827 CALL_PopMatrix(ctx
->Exec
, ());
3832 static void GLAPIENTRY
3835 GET_CURRENT_CONTEXT(ctx
);
3836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3837 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3838 if (ctx
->ExecuteFlag
) {
3839 CALL_PopName(ctx
->Exec
, ());
3844 static void GLAPIENTRY
3845 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3846 const GLclampf
* priorities
)
3848 GET_CURRENT_CONTEXT(ctx
);
3850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3852 for (i
= 0; i
< num
; i
++) {
3854 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3856 n
[1].ui
= textures
[i
];
3857 n
[2].f
= priorities
[i
];
3860 if (ctx
->ExecuteFlag
) {
3861 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3866 static void GLAPIENTRY
3867 save_PushAttrib(GLbitfield mask
)
3869 GET_CURRENT_CONTEXT(ctx
);
3871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3872 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3876 if (ctx
->ExecuteFlag
) {
3877 CALL_PushAttrib(ctx
->Exec
, (mask
));
3882 static void GLAPIENTRY
3883 save_PushMatrix(void)
3885 GET_CURRENT_CONTEXT(ctx
);
3886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3887 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3888 if (ctx
->ExecuteFlag
) {
3889 CALL_PushMatrix(ctx
->Exec
, ());
3894 static void GLAPIENTRY
3895 save_PushName(GLuint name
)
3897 GET_CURRENT_CONTEXT(ctx
);
3899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3900 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3904 if (ctx
->ExecuteFlag
) {
3905 CALL_PushName(ctx
->Exec
, (name
));
3910 static void GLAPIENTRY
3911 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3913 GET_CURRENT_CONTEXT(ctx
);
3915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3916 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3923 if (ctx
->ExecuteFlag
) {
3924 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3928 static void GLAPIENTRY
3929 save_RasterPos2d(GLdouble x
, GLdouble y
)
3931 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3934 static void GLAPIENTRY
3935 save_RasterPos2f(GLfloat x
, GLfloat y
)
3937 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3940 static void GLAPIENTRY
3941 save_RasterPos2i(GLint x
, GLint y
)
3943 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3946 static void GLAPIENTRY
3947 save_RasterPos2s(GLshort x
, GLshort y
)
3949 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3952 static void GLAPIENTRY
3953 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3955 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3958 static void GLAPIENTRY
3959 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3961 save_RasterPos4f(x
, y
, z
, 1.0F
);
3964 static void GLAPIENTRY
3965 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3967 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3970 static void GLAPIENTRY
3971 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3973 save_RasterPos4f(x
, y
, z
, 1.0F
);
3976 static void GLAPIENTRY
3977 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3979 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3982 static void GLAPIENTRY
3983 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3985 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3988 static void GLAPIENTRY
3989 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3991 save_RasterPos4f(x
, y
, z
, w
);
3994 static void GLAPIENTRY
3995 save_RasterPos2dv(const GLdouble
* v
)
3997 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4000 static void GLAPIENTRY
4001 save_RasterPos2fv(const GLfloat
* v
)
4003 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4006 static void GLAPIENTRY
4007 save_RasterPos2iv(const GLint
* v
)
4009 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4012 static void GLAPIENTRY
4013 save_RasterPos2sv(const GLshort
* v
)
4015 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4018 static void GLAPIENTRY
4019 save_RasterPos3dv(const GLdouble
* v
)
4021 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4024 static void GLAPIENTRY
4025 save_RasterPos3fv(const GLfloat
* v
)
4027 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4030 static void GLAPIENTRY
4031 save_RasterPos3iv(const GLint
* v
)
4033 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4036 static void GLAPIENTRY
4037 save_RasterPos3sv(const GLshort
* v
)
4039 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4042 static void GLAPIENTRY
4043 save_RasterPos4dv(const GLdouble
* v
)
4045 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4046 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4049 static void GLAPIENTRY
4050 save_RasterPos4fv(const GLfloat
* v
)
4052 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4055 static void GLAPIENTRY
4056 save_RasterPos4iv(const GLint
* v
)
4058 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4059 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4062 static void GLAPIENTRY
4063 save_RasterPos4sv(const GLshort
* v
)
4065 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4069 static void GLAPIENTRY
4070 save_PassThrough(GLfloat token
)
4072 GET_CURRENT_CONTEXT(ctx
);
4074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4075 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4079 if (ctx
->ExecuteFlag
) {
4080 CALL_PassThrough(ctx
->Exec
, (token
));
4085 static void GLAPIENTRY
4086 save_ReadBuffer(GLenum mode
)
4088 GET_CURRENT_CONTEXT(ctx
);
4090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4091 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4095 if (ctx
->ExecuteFlag
) {
4096 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4101 static void GLAPIENTRY
4102 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4104 GET_CURRENT_CONTEXT(ctx
);
4106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4107 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4114 if (ctx
->ExecuteFlag
) {
4115 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4120 static void GLAPIENTRY
4121 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4123 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4127 static void GLAPIENTRY
4128 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4130 GET_CURRENT_CONTEXT(ctx
);
4132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4133 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4139 if (ctx
->ExecuteFlag
) {
4140 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4145 static void GLAPIENTRY
4146 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4148 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4152 static void GLAPIENTRY
4153 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4155 GET_CURRENT_CONTEXT(ctx
);
4157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4158 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4165 if (ctx
->ExecuteFlag
) {
4166 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4171 static void GLAPIENTRY
4172 save_ShadeModel(GLenum mode
)
4174 GET_CURRENT_CONTEXT(ctx
);
4176 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4178 if (ctx
->ExecuteFlag
) {
4179 CALL_ShadeModel(ctx
->Exec
, (mode
));
4182 /* Don't compile this call if it's a no-op.
4183 * By avoiding this state change we have a better chance of
4184 * coalescing subsequent drawing commands into one batch.
4186 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4189 SAVE_FLUSH_VERTICES(ctx
);
4191 ctx
->ListState
.Current
.ShadeModel
= mode
;
4193 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4200 static void GLAPIENTRY
4201 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4203 GET_CURRENT_CONTEXT(ctx
);
4205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4206 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4212 if (ctx
->ExecuteFlag
) {
4213 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4218 static void GLAPIENTRY
4219 save_StencilMask(GLuint mask
)
4221 GET_CURRENT_CONTEXT(ctx
);
4223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4224 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4228 if (ctx
->ExecuteFlag
) {
4229 CALL_StencilMask(ctx
->Exec
, (mask
));
4234 static void GLAPIENTRY
4235 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4237 GET_CURRENT_CONTEXT(ctx
);
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4240 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4246 if (ctx
->ExecuteFlag
) {
4247 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4252 static void GLAPIENTRY
4253 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4255 GET_CURRENT_CONTEXT(ctx
);
4257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4258 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4265 if (ctx
->ExecuteFlag
) {
4266 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4271 static void GLAPIENTRY
4272 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4275 GET_CURRENT_CONTEXT(ctx
);
4277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4279 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4287 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4294 if (ctx
->ExecuteFlag
) {
4295 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4296 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4301 static void GLAPIENTRY
4302 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4304 GET_CURRENT_CONTEXT(ctx
);
4306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4307 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4312 if (ctx
->ExecuteFlag
) {
4313 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4318 static void GLAPIENTRY
4319 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4321 GET_CURRENT_CONTEXT(ctx
);
4323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4324 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4331 if (ctx
->ExecuteFlag
) {
4332 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4337 static void GLAPIENTRY
4338 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4340 GET_CURRENT_CONTEXT(ctx
);
4342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4343 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4347 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4355 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4358 if (ctx
->ExecuteFlag
) {
4359 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4364 static void GLAPIENTRY
4365 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4368 parray
[0] = (GLfloat
) param
;
4369 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4370 save_TexEnvfv(target
, pname
, parray
);
4374 static void GLAPIENTRY
4375 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4378 p
[0] = (GLfloat
) param
;
4379 p
[1] = p
[2] = p
[3] = 0.0F
;
4380 save_TexEnvfv(target
, pname
, p
);
4384 static void GLAPIENTRY
4385 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4388 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4389 p
[0] = INT_TO_FLOAT(param
[0]);
4390 p
[1] = INT_TO_FLOAT(param
[1]);
4391 p
[2] = INT_TO_FLOAT(param
[2]);
4392 p
[3] = INT_TO_FLOAT(param
[3]);
4395 p
[0] = (GLfloat
) param
[0];
4396 p
[1] = p
[2] = p
[3] = 0.0F
;
4398 save_TexEnvfv(target
, pname
, p
);
4402 static void GLAPIENTRY
4403 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4405 GET_CURRENT_CONTEXT(ctx
);
4407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4408 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4417 if (ctx
->ExecuteFlag
) {
4418 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4423 static void GLAPIENTRY
4424 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4427 p
[0] = (GLfloat
) params
[0];
4428 p
[1] = (GLfloat
) params
[1];
4429 p
[2] = (GLfloat
) params
[2];
4430 p
[3] = (GLfloat
) params
[3];
4431 save_TexGenfv(coord
, pname
, p
);
4435 static void GLAPIENTRY
4436 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4439 parray
[0] = (GLfloat
) param
;
4440 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4441 save_TexGenfv(coord
, pname
, parray
);
4445 static void GLAPIENTRY
4446 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4449 p
[0] = (GLfloat
) params
[0];
4450 p
[1] = (GLfloat
) params
[1];
4451 p
[2] = (GLfloat
) params
[2];
4452 p
[3] = (GLfloat
) params
[3];
4453 save_TexGenfv(coord
, pname
, p
);
4457 static void GLAPIENTRY
4458 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4462 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4463 save_TexGenfv(coord
, pname
, parray
);
4467 static void GLAPIENTRY
4468 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4472 parray
[1] = parray
[2] = parray
[3] = 0;
4473 save_TexGeniv(coord
, pname
, parray
);
4477 static void GLAPIENTRY
4478 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4480 GET_CURRENT_CONTEXT(ctx
);
4482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4483 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4492 if (ctx
->ExecuteFlag
) {
4493 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4498 static void GLAPIENTRY
4499 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4503 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4504 save_TexParameterfv(target
, pname
, parray
);
4508 static void GLAPIENTRY
4509 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4512 fparam
[0] = (GLfloat
) param
;
4513 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4514 save_TexParameterfv(target
, pname
, fparam
);
4518 static void GLAPIENTRY
4519 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4522 fparam
[0] = (GLfloat
) params
[0];
4523 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4524 save_TexParameterfv(target
, pname
, fparam
);
4528 static void GLAPIENTRY
4529 save_TexImage1D(GLenum target
,
4530 GLint level
, GLint components
,
4531 GLsizei width
, GLint border
,
4532 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4534 GET_CURRENT_CONTEXT(ctx
);
4535 if (target
== GL_PROXY_TEXTURE_1D
) {
4536 /* don't compile, execute immediately */
4537 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4538 border
, format
, type
, pixels
));
4542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4543 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4547 n
[3].i
= components
;
4548 n
[4].i
= (GLint
) width
;
4553 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4554 pixels
, &ctx
->Unpack
));
4556 if (ctx
->ExecuteFlag
) {
4557 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4558 border
, format
, type
, pixels
));
4564 static void GLAPIENTRY
4565 save_TexImage2D(GLenum target
,
4566 GLint level
, GLint components
,
4567 GLsizei width
, GLsizei height
, GLint border
,
4568 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4570 GET_CURRENT_CONTEXT(ctx
);
4571 if (target
== GL_PROXY_TEXTURE_2D
) {
4572 /* don't compile, execute immediately */
4573 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4574 height
, border
, format
, type
, pixels
));
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4579 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4583 n
[3].i
= components
;
4584 n
[4].i
= (GLint
) width
;
4585 n
[5].i
= (GLint
) height
;
4590 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4591 pixels
, &ctx
->Unpack
));
4593 if (ctx
->ExecuteFlag
) {
4594 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4595 height
, border
, format
, type
, pixels
));
4601 static void GLAPIENTRY
4602 save_TexImage3D(GLenum target
,
4603 GLint level
, GLint internalFormat
,
4604 GLsizei width
, GLsizei height
, GLsizei depth
,
4606 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4608 GET_CURRENT_CONTEXT(ctx
);
4609 if (target
== GL_PROXY_TEXTURE_3D
) {
4610 /* don't compile, execute immediately */
4611 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4612 height
, depth
, border
, format
, type
,
4617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4618 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4622 n
[3].i
= (GLint
) internalFormat
;
4623 n
[4].i
= (GLint
) width
;
4624 n
[5].i
= (GLint
) height
;
4625 n
[6].i
= (GLint
) depth
;
4629 save_pointer(&n
[10],
4630 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4631 pixels
, &ctx
->Unpack
));
4633 if (ctx
->ExecuteFlag
) {
4634 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4635 height
, depth
, border
, format
, type
,
4642 static void GLAPIENTRY
4643 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4644 GLsizei width
, GLenum format
, GLenum type
,
4645 const GLvoid
* pixels
)
4647 GET_CURRENT_CONTEXT(ctx
);
4650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4652 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4657 n
[4].i
= (GLint
) width
;
4661 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4662 pixels
, &ctx
->Unpack
));
4664 if (ctx
->ExecuteFlag
) {
4665 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4666 format
, type
, pixels
));
4671 static void GLAPIENTRY
4672 save_TexSubImage2D(GLenum target
, GLint level
,
4673 GLint xoffset
, GLint yoffset
,
4674 GLsizei width
, GLsizei height
,
4675 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4677 GET_CURRENT_CONTEXT(ctx
);
4680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4682 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4688 n
[5].i
= (GLint
) width
;
4689 n
[6].i
= (GLint
) height
;
4693 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4694 pixels
, &ctx
->Unpack
));
4696 if (ctx
->ExecuteFlag
) {
4697 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4698 width
, height
, format
, type
, pixels
));
4703 static void GLAPIENTRY
4704 save_TexSubImage3D(GLenum target
, GLint level
,
4705 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4706 GLsizei width
, GLsizei height
, GLsizei depth
,
4707 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4709 GET_CURRENT_CONTEXT(ctx
);
4712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4714 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4721 n
[6].i
= (GLint
) width
;
4722 n
[7].i
= (GLint
) height
;
4723 n
[8].i
= (GLint
) depth
;
4726 save_pointer(&n
[11],
4727 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4728 pixels
, &ctx
->Unpack
));
4730 if (ctx
->ExecuteFlag
) {
4731 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4732 xoffset
, yoffset
, zoffset
,
4733 width
, height
, depth
, format
, type
,
4739 static void GLAPIENTRY
4740 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4742 GET_CURRENT_CONTEXT(ctx
);
4744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4745 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4751 if (ctx
->ExecuteFlag
) {
4752 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4757 static void GLAPIENTRY
4758 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4760 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4765 static void GLAPIENTRY
4766 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4768 GET_CURRENT_CONTEXT(ctx
);
4770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4771 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4775 n
[3].i
= (GLint
) width
;
4776 n
[4].i
= (GLint
) height
;
4778 if (ctx
->ExecuteFlag
) {
4779 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4783 static void GLAPIENTRY
4784 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4787 GET_CURRENT_CONTEXT(ctx
);
4789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4790 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4798 if (ctx
->ExecuteFlag
) {
4799 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4803 static void GLAPIENTRY
4804 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4806 GET_CURRENT_CONTEXT(ctx
);
4808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4809 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4817 if (ctx
->ExecuteFlag
) {
4818 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4822 static void GLAPIENTRY
4823 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4825 GET_CURRENT_CONTEXT(ctx
);
4827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4828 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4832 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4834 if (ctx
->ExecuteFlag
) {
4835 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4839 static void GLAPIENTRY
4840 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4843 GET_CURRENT_CONTEXT(ctx
);
4845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4846 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4854 if (ctx
->ExecuteFlag
) {
4855 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4859 static void GLAPIENTRY
4860 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4862 GET_CURRENT_CONTEXT(ctx
);
4864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4865 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4873 if (ctx
->ExecuteFlag
) {
4874 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4878 static void GLAPIENTRY
4879 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4881 GET_CURRENT_CONTEXT(ctx
);
4883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4884 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4888 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4890 if (ctx
->ExecuteFlag
) {
4891 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4895 static void GLAPIENTRY
4896 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4898 GET_CURRENT_CONTEXT(ctx
);
4900 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4901 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4904 /* Mesa stores these as floats internally so we deliberately convert
4905 * them to a float here.
4910 if (ctx
->ExecuteFlag
) {
4911 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4915 static void GLAPIENTRY
4916 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4918 GET_CURRENT_CONTEXT(ctx
);
4920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4921 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4925 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4927 if (ctx
->ExecuteFlag
) {
4928 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4932 static void GLAPIENTRY
4933 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4935 GET_CURRENT_CONTEXT(ctx
);
4937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4938 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4945 if (ctx
->ExecuteFlag
) {
4946 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4950 static void GLAPIENTRY
4951 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4953 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4956 static void GLAPIENTRY
4957 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4959 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4962 static void GLAPIENTRY
4963 save_WindowPos2iMESA(GLint x
, GLint y
)
4965 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4968 static void GLAPIENTRY
4969 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4971 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4974 static void GLAPIENTRY
4975 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4977 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4980 static void GLAPIENTRY
4981 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4983 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4986 static void GLAPIENTRY
4987 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4989 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4992 static void GLAPIENTRY
4993 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4995 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4998 static void GLAPIENTRY
4999 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5001 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5004 static void GLAPIENTRY
5005 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
5007 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5010 static void GLAPIENTRY
5011 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
5013 save_WindowPos4fMESA(x
, y
, z
, w
);
5016 static void GLAPIENTRY
5017 save_WindowPos2dvMESA(const GLdouble
* v
)
5019 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5022 static void GLAPIENTRY
5023 save_WindowPos2fvMESA(const GLfloat
* v
)
5025 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5028 static void GLAPIENTRY
5029 save_WindowPos2ivMESA(const GLint
* v
)
5031 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5034 static void GLAPIENTRY
5035 save_WindowPos2svMESA(const GLshort
* v
)
5037 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5040 static void GLAPIENTRY
5041 save_WindowPos3dvMESA(const GLdouble
* v
)
5043 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5046 static void GLAPIENTRY
5047 save_WindowPos3fvMESA(const GLfloat
* v
)
5049 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5052 static void GLAPIENTRY
5053 save_WindowPos3ivMESA(const GLint
* v
)
5055 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5058 static void GLAPIENTRY
5059 save_WindowPos3svMESA(const GLshort
* v
)
5061 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5064 static void GLAPIENTRY
5065 save_WindowPos4dvMESA(const GLdouble
* v
)
5067 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5068 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5071 static void GLAPIENTRY
5072 save_WindowPos4fvMESA(const GLfloat
* v
)
5074 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5077 static void GLAPIENTRY
5078 save_WindowPos4ivMESA(const GLint
* v
)
5080 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5081 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5084 static void GLAPIENTRY
5085 save_WindowPos4svMESA(const GLshort
* v
)
5087 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5092 /* GL_ARB_multitexture */
5093 static void GLAPIENTRY
5094 save_ActiveTextureARB(GLenum target
)
5096 GET_CURRENT_CONTEXT(ctx
);
5098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5099 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5103 if (ctx
->ExecuteFlag
) {
5104 CALL_ActiveTexture(ctx
->Exec
, (target
));
5109 /* GL_ARB_transpose_matrix */
5111 static void GLAPIENTRY
5112 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5115 _math_transposefd(tm
, m
);
5116 save_LoadMatrixf(tm
);
5120 static void GLAPIENTRY
5121 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5124 _math_transposef(tm
, m
);
5125 save_LoadMatrixf(tm
);
5129 static void GLAPIENTRY
5130 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5133 _math_transposefd(tm
, m
);
5134 save_MultMatrixf(tm
);
5138 static void GLAPIENTRY
5139 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5142 _math_transposef(tm
, m
);
5143 save_MultMatrixf(tm
);
5146 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5148 GET_CURRENT_CONTEXT(ctx
);
5154 image
= malloc(size
);
5156 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5159 memcpy(image
, data
, size
);
5165 /* GL_ARB_texture_compression */
5166 static void GLAPIENTRY
5167 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5168 GLenum internalFormat
, GLsizei width
,
5169 GLint border
, GLsizei imageSize
,
5170 const GLvoid
* data
)
5172 GET_CURRENT_CONTEXT(ctx
);
5173 if (target
== GL_PROXY_TEXTURE_1D
) {
5174 /* don't compile, execute immediately */
5175 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5176 width
, border
, imageSize
,
5181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5183 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5184 6 + POINTER_DWORDS
);
5188 n
[3].e
= internalFormat
;
5189 n
[4].i
= (GLint
) width
;
5193 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5195 if (ctx
->ExecuteFlag
) {
5196 CALL_CompressedTexImage1D(ctx
->Exec
,
5197 (target
, level
, internalFormat
, width
,
5198 border
, imageSize
, data
));
5204 static void GLAPIENTRY
5205 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5206 GLenum internalFormat
, GLsizei width
,
5207 GLsizei height
, GLint border
, GLsizei imageSize
,
5208 const GLvoid
* data
)
5210 GET_CURRENT_CONTEXT(ctx
);
5211 if (target
== GL_PROXY_TEXTURE_2D
) {
5212 /* don't compile, execute immediately */
5213 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5214 width
, height
, border
,
5219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5221 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5222 7 + POINTER_DWORDS
);
5226 n
[3].e
= internalFormat
;
5227 n
[4].i
= (GLint
) width
;
5228 n
[5].i
= (GLint
) height
;
5232 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5234 if (ctx
->ExecuteFlag
) {
5235 CALL_CompressedTexImage2D(ctx
->Exec
,
5236 (target
, level
, internalFormat
, width
,
5237 height
, border
, imageSize
, data
));
5243 static void GLAPIENTRY
5244 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5245 GLenum internalFormat
, GLsizei width
,
5246 GLsizei height
, GLsizei depth
, GLint border
,
5247 GLsizei imageSize
, const GLvoid
* data
)
5249 GET_CURRENT_CONTEXT(ctx
);
5250 if (target
== GL_PROXY_TEXTURE_3D
) {
5251 /* don't compile, execute immediately */
5252 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5253 width
, height
, depth
, border
,
5258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5260 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5261 8 + POINTER_DWORDS
);
5265 n
[3].e
= internalFormat
;
5266 n
[4].i
= (GLint
) width
;
5267 n
[5].i
= (GLint
) height
;
5268 n
[6].i
= (GLint
) depth
;
5272 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5274 if (ctx
->ExecuteFlag
) {
5275 CALL_CompressedTexImage3D(ctx
->Exec
,
5276 (target
, level
, internalFormat
, width
,
5277 height
, depth
, border
, imageSize
,
5284 static void GLAPIENTRY
5285 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5286 GLsizei width
, GLenum format
,
5287 GLsizei imageSize
, const GLvoid
* data
)
5290 GET_CURRENT_CONTEXT(ctx
);
5291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5293 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5294 6 + POINTER_DWORDS
);
5299 n
[4].i
= (GLint
) width
;
5303 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5305 if (ctx
->ExecuteFlag
) {
5306 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5307 width
, format
, imageSize
,
5313 static void GLAPIENTRY
5314 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5315 GLint yoffset
, GLsizei width
, GLsizei height
,
5316 GLenum format
, GLsizei imageSize
,
5317 const GLvoid
* data
)
5320 GET_CURRENT_CONTEXT(ctx
);
5321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5323 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5324 8 + POINTER_DWORDS
);
5330 n
[5].i
= (GLint
) width
;
5331 n
[6].i
= (GLint
) height
;
5335 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5337 if (ctx
->ExecuteFlag
) {
5338 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5339 (target
, level
, xoffset
, yoffset
, width
,
5340 height
, format
, imageSize
, data
));
5345 static void GLAPIENTRY
5346 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5347 GLint yoffset
, GLint zoffset
, GLsizei width
,
5348 GLsizei height
, GLsizei depth
, GLenum format
,
5349 GLsizei imageSize
, const GLvoid
* data
)
5352 GET_CURRENT_CONTEXT(ctx
);
5353 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5355 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5356 10 + POINTER_DWORDS
);
5363 n
[6].i
= (GLint
) width
;
5364 n
[7].i
= (GLint
) height
;
5365 n
[8].i
= (GLint
) depth
;
5367 n
[10].i
= imageSize
;
5368 save_pointer(&n
[11],
5369 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5371 if (ctx
->ExecuteFlag
) {
5372 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5373 (target
, level
, xoffset
, yoffset
,
5374 zoffset
, width
, height
, depth
, format
,
5380 /* GL_ARB_multisample */
5381 static void GLAPIENTRY
5382 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5384 GET_CURRENT_CONTEXT(ctx
);
5386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5387 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5392 if (ctx
->ExecuteFlag
) {
5393 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5399 * GL_ARB_vertex_program
5401 static void GLAPIENTRY
5402 save_BindProgramARB(GLenum target
, GLuint id
)
5404 GET_CURRENT_CONTEXT(ctx
);
5406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5407 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5412 if (ctx
->ExecuteFlag
) {
5413 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5417 static void GLAPIENTRY
5418 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5419 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5421 GET_CURRENT_CONTEXT(ctx
);
5423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5424 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5433 if (ctx
->ExecuteFlag
) {
5434 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5439 static void GLAPIENTRY
5440 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5441 const GLfloat
*params
)
5443 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5444 params
[2], params
[3]);
5448 static void GLAPIENTRY
5449 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5450 const GLfloat
* params
)
5452 GET_CURRENT_CONTEXT(ctx
);
5454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5458 const GLfloat
* p
= params
;
5460 for (i
= 0 ; i
< count
; i
++) {
5461 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5474 if (ctx
->ExecuteFlag
) {
5475 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5480 static void GLAPIENTRY
5481 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5482 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5484 save_ProgramEnvParameter4fARB(target
, index
,
5486 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5490 static void GLAPIENTRY
5491 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5492 const GLdouble
*params
)
5494 save_ProgramEnvParameter4fARB(target
, index
,
5495 (GLfloat
) params
[0],
5496 (GLfloat
) params
[1],
5497 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5501 static void GLAPIENTRY
5502 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5503 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5505 GET_CURRENT_CONTEXT(ctx
);
5507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5508 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5517 if (ctx
->ExecuteFlag
) {
5518 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5523 static void GLAPIENTRY
5524 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5525 const GLfloat
*params
)
5527 GET_CURRENT_CONTEXT(ctx
);
5529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5530 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5539 if (ctx
->ExecuteFlag
) {
5540 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5545 static void GLAPIENTRY
5546 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5547 const GLfloat
*params
)
5549 GET_CURRENT_CONTEXT(ctx
);
5551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5555 const GLfloat
* p
= params
;
5557 for (i
= 0 ; i
< count
; i
++) {
5558 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5571 if (ctx
->ExecuteFlag
) {
5572 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5577 static void GLAPIENTRY
5578 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5579 GLdouble x
, GLdouble y
,
5580 GLdouble z
, GLdouble w
)
5582 GET_CURRENT_CONTEXT(ctx
);
5584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5585 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5589 n
[3].f
= (GLfloat
) x
;
5590 n
[4].f
= (GLfloat
) y
;
5591 n
[5].f
= (GLfloat
) z
;
5592 n
[6].f
= (GLfloat
) w
;
5594 if (ctx
->ExecuteFlag
) {
5595 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5600 static void GLAPIENTRY
5601 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5602 const GLdouble
*params
)
5604 GET_CURRENT_CONTEXT(ctx
);
5606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5607 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5611 n
[3].f
= (GLfloat
) params
[0];
5612 n
[4].f
= (GLfloat
) params
[1];
5613 n
[5].f
= (GLfloat
) params
[2];
5614 n
[6].f
= (GLfloat
) params
[3];
5616 if (ctx
->ExecuteFlag
) {
5617 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5622 /* GL_EXT_stencil_two_side */
5623 static void GLAPIENTRY
5624 save_ActiveStencilFaceEXT(GLenum face
)
5626 GET_CURRENT_CONTEXT(ctx
);
5628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5629 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5633 if (ctx
->ExecuteFlag
) {
5634 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5639 /* GL_EXT_depth_bounds_test */
5640 static void GLAPIENTRY
5641 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5643 GET_CURRENT_CONTEXT(ctx
);
5645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5646 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5648 n
[1].f
= (GLfloat
) zmin
;
5649 n
[2].f
= (GLfloat
) zmax
;
5651 if (ctx
->ExecuteFlag
) {
5652 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5658 static void GLAPIENTRY
5659 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5660 const GLvoid
* string
)
5662 GET_CURRENT_CONTEXT(ctx
);
5665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5667 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5669 GLubyte
*programCopy
= malloc(len
);
5671 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5674 memcpy(programCopy
, string
, len
);
5678 save_pointer(&n
[4], programCopy
);
5680 if (ctx
->ExecuteFlag
) {
5681 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5686 static void GLAPIENTRY
5687 save_BeginQueryARB(GLenum target
, GLuint id
)
5689 GET_CURRENT_CONTEXT(ctx
);
5691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5692 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5697 if (ctx
->ExecuteFlag
) {
5698 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5702 static void GLAPIENTRY
5703 save_EndQueryARB(GLenum target
)
5705 GET_CURRENT_CONTEXT(ctx
);
5707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5708 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5712 if (ctx
->ExecuteFlag
) {
5713 CALL_EndQuery(ctx
->Exec
, (target
));
5717 static void GLAPIENTRY
5718 save_QueryCounter(GLuint id
, GLenum target
)
5720 GET_CURRENT_CONTEXT(ctx
);
5722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5723 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5728 if (ctx
->ExecuteFlag
) {
5729 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5733 static void GLAPIENTRY
5734 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5736 GET_CURRENT_CONTEXT(ctx
);
5738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5739 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5745 if (ctx
->ExecuteFlag
) {
5746 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5750 static void GLAPIENTRY
5751 save_EndQueryIndexed(GLenum target
, GLuint index
)
5753 GET_CURRENT_CONTEXT(ctx
);
5755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5756 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5761 if (ctx
->ExecuteFlag
) {
5762 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5767 static void GLAPIENTRY
5768 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5770 GET_CURRENT_CONTEXT(ctx
);
5772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5773 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5777 if (count
> MAX_DRAW_BUFFERS
)
5778 count
= MAX_DRAW_BUFFERS
;
5779 for (i
= 0; i
< count
; i
++) {
5780 n
[2 + i
].e
= buffers
[i
];
5783 if (ctx
->ExecuteFlag
) {
5784 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5788 static void GLAPIENTRY
5789 save_BindFragmentShaderATI(GLuint id
)
5791 GET_CURRENT_CONTEXT(ctx
);
5794 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5798 if (ctx
->ExecuteFlag
) {
5799 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5803 static void GLAPIENTRY
5804 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5806 GET_CURRENT_CONTEXT(ctx
);
5809 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5817 if (ctx
->ExecuteFlag
) {
5818 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5822 static void GLAPIENTRY
5823 save_Attr1fNV(GLenum attr
, GLfloat x
)
5825 GET_CURRENT_CONTEXT(ctx
);
5827 SAVE_FLUSH_VERTICES(ctx
);
5828 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5834 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5835 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5836 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5838 if (ctx
->ExecuteFlag
) {
5839 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5843 static void GLAPIENTRY
5844 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5846 GET_CURRENT_CONTEXT(ctx
);
5848 SAVE_FLUSH_VERTICES(ctx
);
5849 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5856 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5857 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5858 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5860 if (ctx
->ExecuteFlag
) {
5861 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5865 static void GLAPIENTRY
5866 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5868 GET_CURRENT_CONTEXT(ctx
);
5870 SAVE_FLUSH_VERTICES(ctx
);
5871 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5879 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5880 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5881 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5883 if (ctx
->ExecuteFlag
) {
5884 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5888 static void GLAPIENTRY
5889 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5891 GET_CURRENT_CONTEXT(ctx
);
5893 SAVE_FLUSH_VERTICES(ctx
);
5894 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5903 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5904 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5905 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5907 if (ctx
->ExecuteFlag
) {
5908 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5913 static void GLAPIENTRY
5914 save_Attr1fARB(GLenum attr
, GLfloat x
)
5916 GET_CURRENT_CONTEXT(ctx
);
5918 SAVE_FLUSH_VERTICES(ctx
);
5919 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5925 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5926 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5927 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5929 if (ctx
->ExecuteFlag
) {
5930 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5934 static void GLAPIENTRY
5935 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5937 GET_CURRENT_CONTEXT(ctx
);
5939 SAVE_FLUSH_VERTICES(ctx
);
5940 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5947 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5948 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5949 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5951 if (ctx
->ExecuteFlag
) {
5952 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5956 static void GLAPIENTRY
5957 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5959 GET_CURRENT_CONTEXT(ctx
);
5961 SAVE_FLUSH_VERTICES(ctx
);
5962 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5970 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5971 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5972 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5974 if (ctx
->ExecuteFlag
) {
5975 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5979 static void GLAPIENTRY
5980 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5982 GET_CURRENT_CONTEXT(ctx
);
5984 SAVE_FLUSH_VERTICES(ctx
);
5985 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5994 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5995 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5996 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5998 if (ctx
->ExecuteFlag
) {
5999 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
6004 static void GLAPIENTRY
6005 save_EvalCoord1f(GLfloat x
)
6007 GET_CURRENT_CONTEXT(ctx
);
6009 SAVE_FLUSH_VERTICES(ctx
);
6010 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
6014 if (ctx
->ExecuteFlag
) {
6015 CALL_EvalCoord1f(ctx
->Exec
, (x
));
6019 static void GLAPIENTRY
6020 save_EvalCoord1fv(const GLfloat
* v
)
6022 save_EvalCoord1f(v
[0]);
6025 static void GLAPIENTRY
6026 save_EvalCoord2f(GLfloat x
, GLfloat y
)
6028 GET_CURRENT_CONTEXT(ctx
);
6030 SAVE_FLUSH_VERTICES(ctx
);
6031 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
6036 if (ctx
->ExecuteFlag
) {
6037 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
6041 static void GLAPIENTRY
6042 save_EvalCoord2fv(const GLfloat
* v
)
6044 save_EvalCoord2f(v
[0], v
[1]);
6048 static void GLAPIENTRY
6049 save_EvalPoint1(GLint x
)
6051 GET_CURRENT_CONTEXT(ctx
);
6053 SAVE_FLUSH_VERTICES(ctx
);
6054 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6058 if (ctx
->ExecuteFlag
) {
6059 CALL_EvalPoint1(ctx
->Exec
, (x
));
6063 static void GLAPIENTRY
6064 save_EvalPoint2(GLint x
, GLint y
)
6066 GET_CURRENT_CONTEXT(ctx
);
6068 SAVE_FLUSH_VERTICES(ctx
);
6069 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6074 if (ctx
->ExecuteFlag
) {
6075 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6079 static void GLAPIENTRY
6080 save_Indexf(GLfloat x
)
6082 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6085 static void GLAPIENTRY
6086 save_Indexfv(const GLfloat
* v
)
6088 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6091 static void GLAPIENTRY
6092 save_EdgeFlag(GLboolean x
)
6094 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6099 * Compare 'count' elements of vectors 'a' and 'b'.
6100 * \return GL_TRUE if equal, GL_FALSE if different.
6102 static inline GLboolean
6103 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6105 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6110 * This glMaterial function is used for glMaterial calls that are outside
6111 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6113 static void GLAPIENTRY
6114 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6116 GET_CURRENT_CONTEXT(ctx
);
6124 case GL_FRONT_AND_BACK
:
6127 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6136 case GL_AMBIENT_AND_DIFFUSE
:
6142 case GL_COLOR_INDEXES
:
6146 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6150 if (ctx
->ExecuteFlag
) {
6151 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6154 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6156 /* Try to eliminate redundant statechanges. Because it is legal to
6157 * call glMaterial even inside begin/end calls, don't need to worry
6158 * about ctx->Driver.CurrentSavePrimitive here.
6160 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6161 if (bitmask
& (1 << i
)) {
6162 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6163 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6164 /* no change in material value */
6165 bitmask
&= ~(1 << i
);
6168 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6169 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6174 /* If this call has no effect, return early */
6178 SAVE_FLUSH_VERTICES(ctx
);
6180 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6184 for (i
= 0; i
< args
; i
++)
6185 n
[3 + i
].f
= param
[i
];
6189 static void GLAPIENTRY
6190 save_Begin(GLenum mode
)
6192 GET_CURRENT_CONTEXT(ctx
);
6194 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6195 /* compile this error into the display list */
6196 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6198 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6199 /* compile this error into the display list */
6200 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6203 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6205 vbo_save_NotifyBegin(ctx
, mode
, false);
6209 static void GLAPIENTRY
6212 GET_CURRENT_CONTEXT(ctx
);
6213 SAVE_FLUSH_VERTICES(ctx
);
6214 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6215 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6216 if (ctx
->ExecuteFlag
) {
6217 CALL_End(ctx
->Exec
, ());
6221 static void GLAPIENTRY
6222 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6224 GET_CURRENT_CONTEXT(ctx
);
6226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6227 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6234 if (ctx
->ExecuteFlag
) {
6235 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6240 static void GLAPIENTRY
6241 save_Vertex2f(GLfloat x
, GLfloat y
)
6243 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6246 static void GLAPIENTRY
6247 save_Vertex2fv(const GLfloat
* v
)
6249 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6252 static void GLAPIENTRY
6253 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6255 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6258 static void GLAPIENTRY
6259 save_Vertex3fv(const GLfloat
* v
)
6261 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6264 static void GLAPIENTRY
6265 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6267 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6270 static void GLAPIENTRY
6271 save_Vertex4fv(const GLfloat
* v
)
6273 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6276 static void GLAPIENTRY
6277 save_TexCoord1f(GLfloat x
)
6279 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6282 static void GLAPIENTRY
6283 save_TexCoord1fv(const GLfloat
* v
)
6285 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6288 static void GLAPIENTRY
6289 save_TexCoord2f(GLfloat x
, GLfloat y
)
6291 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6294 static void GLAPIENTRY
6295 save_TexCoord2fv(const GLfloat
* v
)
6297 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6300 static void GLAPIENTRY
6301 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6303 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6306 static void GLAPIENTRY
6307 save_TexCoord3fv(const GLfloat
* v
)
6309 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6312 static void GLAPIENTRY
6313 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6315 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6318 static void GLAPIENTRY
6319 save_TexCoord4fv(const GLfloat
* v
)
6321 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6324 static void GLAPIENTRY
6325 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6327 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6330 static void GLAPIENTRY
6331 save_Normal3fv(const GLfloat
* v
)
6333 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6336 static void GLAPIENTRY
6337 save_FogCoordfEXT(GLfloat x
)
6339 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6342 static void GLAPIENTRY
6343 save_FogCoordfvEXT(const GLfloat
* v
)
6345 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6348 static void GLAPIENTRY
6349 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6351 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6354 static void GLAPIENTRY
6355 save_Color3fv(const GLfloat
* v
)
6357 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6360 static void GLAPIENTRY
6361 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6363 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6366 static void GLAPIENTRY
6367 save_Color4fv(const GLfloat
* v
)
6369 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6372 static void GLAPIENTRY
6373 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6375 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6378 static void GLAPIENTRY
6379 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6381 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6385 /* Just call the respective ATTR for texcoord
6387 static void GLAPIENTRY
6388 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6390 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6391 save_Attr1fNV(attr
, x
);
6394 static void GLAPIENTRY
6395 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6397 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6398 save_Attr1fNV(attr
, v
[0]);
6401 static void GLAPIENTRY
6402 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6404 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6405 save_Attr2fNV(attr
, x
, y
);
6408 static void GLAPIENTRY
6409 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6411 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6412 save_Attr2fNV(attr
, v
[0], v
[1]);
6415 static void GLAPIENTRY
6416 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6418 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6419 save_Attr3fNV(attr
, x
, y
, z
);
6422 static void GLAPIENTRY
6423 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6425 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6426 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6429 static void GLAPIENTRY
6430 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6431 GLfloat z
, GLfloat w
)
6433 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6434 save_Attr4fNV(attr
, x
, y
, z
, w
);
6437 static void GLAPIENTRY
6438 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6440 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6441 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6446 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6452 GET_CURRENT_CONTEXT(ctx
);
6453 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6458 static void GLAPIENTRY
6459 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6461 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6462 save_Attr1fARB(index
, x
);
6467 static void GLAPIENTRY
6468 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6470 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6471 save_Attr1fARB(index
, v
[0]);
6476 static void GLAPIENTRY
6477 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6479 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6480 save_Attr2fARB(index
, x
, y
);
6485 static void GLAPIENTRY
6486 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6488 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6489 save_Attr2fARB(index
, v
[0], v
[1]);
6494 static void GLAPIENTRY
6495 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6497 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6498 save_Attr3fARB(index
, x
, y
, z
);
6503 static void GLAPIENTRY
6504 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6506 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6507 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6512 static void GLAPIENTRY
6513 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6516 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6517 save_Attr4fARB(index
, x
, y
, z
, w
);
6522 static void GLAPIENTRY
6523 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6525 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6526 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6531 static void GLAPIENTRY
6532 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6534 GET_CURRENT_CONTEXT(ctx
);
6536 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6538 SAVE_FLUSH_VERTICES(ctx
);
6539 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6542 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6545 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6546 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6548 if (ctx
->ExecuteFlag
) {
6549 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6556 static void GLAPIENTRY
6557 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6559 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6560 save_VertexAttribL1d(index
, v
[0]);
6565 static void GLAPIENTRY
6566 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6568 GET_CURRENT_CONTEXT(ctx
);
6570 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6572 SAVE_FLUSH_VERTICES(ctx
);
6573 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6576 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6577 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6580 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6581 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6582 2 * sizeof(GLdouble
));
6584 if (ctx
->ExecuteFlag
) {
6585 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6592 static void GLAPIENTRY
6593 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6595 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6596 save_VertexAttribL2d(index
, v
[0], v
[1]);
6601 static void GLAPIENTRY
6602 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6604 GET_CURRENT_CONTEXT(ctx
);
6606 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6608 SAVE_FLUSH_VERTICES(ctx
);
6609 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6612 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6613 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6614 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6617 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6618 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6619 3 * sizeof(GLdouble
));
6621 if (ctx
->ExecuteFlag
) {
6622 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6629 static void GLAPIENTRY
6630 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6632 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6633 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6638 static void GLAPIENTRY
6639 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6642 GET_CURRENT_CONTEXT(ctx
);
6644 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6646 SAVE_FLUSH_VERTICES(ctx
);
6647 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6650 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6651 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6652 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6653 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6656 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6657 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6658 4 * sizeof(GLdouble
));
6660 if (ctx
->ExecuteFlag
) {
6661 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6668 static void GLAPIENTRY
6669 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6671 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6672 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6677 static void GLAPIENTRY
6678 save_PrimitiveRestartNV(void)
6680 /* Note: this is used when outside a glBegin/End pair in a display list */
6681 GET_CURRENT_CONTEXT(ctx
);
6682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6683 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6684 if (ctx
->ExecuteFlag
) {
6685 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6690 static void GLAPIENTRY
6691 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6692 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6693 GLbitfield mask
, GLenum filter
)
6695 GET_CURRENT_CONTEXT(ctx
);
6697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6698 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6711 if (ctx
->ExecuteFlag
) {
6712 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6713 dstX0
, dstY0
, dstX1
, dstY1
,
6719 /** GL_EXT_provoking_vertex */
6720 static void GLAPIENTRY
6721 save_ProvokingVertexEXT(GLenum mode
)
6723 GET_CURRENT_CONTEXT(ctx
);
6725 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6726 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6730 if (ctx
->ExecuteFlag
) {
6731 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6732 _mesa_ProvokingVertex(mode
);
6737 /** GL_EXT_transform_feedback */
6738 static void GLAPIENTRY
6739 save_BeginTransformFeedback(GLenum mode
)
6741 GET_CURRENT_CONTEXT(ctx
);
6743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6744 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6748 if (ctx
->ExecuteFlag
) {
6749 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6754 /** GL_EXT_transform_feedback */
6755 static void GLAPIENTRY
6756 save_EndTransformFeedback(void)
6758 GET_CURRENT_CONTEXT(ctx
);
6759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6760 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6761 if (ctx
->ExecuteFlag
) {
6762 CALL_EndTransformFeedback(ctx
->Exec
, ());
6766 static void GLAPIENTRY
6767 save_BindTransformFeedback(GLenum target
, GLuint name
)
6769 GET_CURRENT_CONTEXT(ctx
);
6771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6772 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6777 if (ctx
->ExecuteFlag
) {
6778 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6782 static void GLAPIENTRY
6783 save_PauseTransformFeedback(void)
6785 GET_CURRENT_CONTEXT(ctx
);
6786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6787 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6788 if (ctx
->ExecuteFlag
) {
6789 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6793 static void GLAPIENTRY
6794 save_ResumeTransformFeedback(void)
6796 GET_CURRENT_CONTEXT(ctx
);
6797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6798 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6799 if (ctx
->ExecuteFlag
) {
6800 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6804 static void GLAPIENTRY
6805 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6807 GET_CURRENT_CONTEXT(ctx
);
6809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6810 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6815 if (ctx
->ExecuteFlag
) {
6816 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6820 static void GLAPIENTRY
6821 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6823 GET_CURRENT_CONTEXT(ctx
);
6825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6826 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6832 if (ctx
->ExecuteFlag
) {
6833 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6837 static void GLAPIENTRY
6838 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6841 GET_CURRENT_CONTEXT(ctx
);
6843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6844 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6848 n
[3].si
= primcount
;
6850 if (ctx
->ExecuteFlag
) {
6851 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6855 static void GLAPIENTRY
6856 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6857 GLuint stream
, GLsizei primcount
)
6859 GET_CURRENT_CONTEXT(ctx
);
6861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6862 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6867 n
[4].si
= primcount
;
6869 if (ctx
->ExecuteFlag
) {
6870 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6875 static void GLAPIENTRY
6876 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6877 GLuint num_groups_z
)
6879 GET_CURRENT_CONTEXT(ctx
);
6881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6882 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6884 n
[1].ui
= num_groups_x
;
6885 n
[2].ui
= num_groups_y
;
6886 n
[3].ui
= num_groups_z
;
6888 if (ctx
->ExecuteFlag
) {
6889 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6894 static void GLAPIENTRY
6895 save_DispatchComputeIndirect(GLintptr indirect
)
6897 GET_CURRENT_CONTEXT(ctx
);
6898 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6899 "glDispatchComputeIndirect() during display list compile");
6902 static void GLAPIENTRY
6903 save_UseProgram(GLuint program
)
6905 GET_CURRENT_CONTEXT(ctx
);
6907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6908 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6912 if (ctx
->ExecuteFlag
) {
6913 CALL_UseProgram(ctx
->Exec
, (program
));
6918 static void GLAPIENTRY
6919 save_Uniform1fARB(GLint location
, GLfloat x
)
6921 GET_CURRENT_CONTEXT(ctx
);
6923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6924 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6929 if (ctx
->ExecuteFlag
) {
6930 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6935 static void GLAPIENTRY
6936 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6938 GET_CURRENT_CONTEXT(ctx
);
6940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6941 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6947 if (ctx
->ExecuteFlag
) {
6948 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6953 static void GLAPIENTRY
6954 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6956 GET_CURRENT_CONTEXT(ctx
);
6958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6959 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6966 if (ctx
->ExecuteFlag
) {
6967 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6972 static void GLAPIENTRY
6973 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6975 GET_CURRENT_CONTEXT(ctx
);
6977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6978 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6986 if (ctx
->ExecuteFlag
) {
6987 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6992 static void GLAPIENTRY
6993 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6995 GET_CURRENT_CONTEXT(ctx
);
6997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6998 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
7002 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7004 if (ctx
->ExecuteFlag
) {
7005 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
7009 static void GLAPIENTRY
7010 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7012 GET_CURRENT_CONTEXT(ctx
);
7014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7015 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
7019 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7021 if (ctx
->ExecuteFlag
) {
7022 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
7026 static void GLAPIENTRY
7027 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7029 GET_CURRENT_CONTEXT(ctx
);
7031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7032 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
7036 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7038 if (ctx
->ExecuteFlag
) {
7039 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7043 static void GLAPIENTRY
7044 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7046 GET_CURRENT_CONTEXT(ctx
);
7048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7049 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7053 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7055 if (ctx
->ExecuteFlag
) {
7056 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7061 static void GLAPIENTRY
7062 save_Uniform1d(GLint location
, GLdouble x
)
7064 GET_CURRENT_CONTEXT(ctx
);
7066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7067 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7070 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7072 if (ctx
->ExecuteFlag
) {
7073 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7078 static void GLAPIENTRY
7079 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7081 GET_CURRENT_CONTEXT(ctx
);
7083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7084 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7087 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7088 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7090 if (ctx
->ExecuteFlag
) {
7091 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7096 static void GLAPIENTRY
7097 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7099 GET_CURRENT_CONTEXT(ctx
);
7101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7102 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7105 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7106 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7107 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7109 if (ctx
->ExecuteFlag
) {
7110 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7115 static void GLAPIENTRY
7116 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7118 GET_CURRENT_CONTEXT(ctx
);
7120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7121 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7124 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7125 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7126 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7127 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7129 if (ctx
->ExecuteFlag
) {
7130 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7135 static void GLAPIENTRY
7136 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7138 GET_CURRENT_CONTEXT(ctx
);
7140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7141 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7145 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7147 if (ctx
->ExecuteFlag
) {
7148 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7153 static void GLAPIENTRY
7154 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7156 GET_CURRENT_CONTEXT(ctx
);
7158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7159 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7163 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7165 if (ctx
->ExecuteFlag
) {
7166 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7171 static void GLAPIENTRY
7172 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7174 GET_CURRENT_CONTEXT(ctx
);
7176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7177 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7181 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7183 if (ctx
->ExecuteFlag
) {
7184 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7189 static void GLAPIENTRY
7190 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7192 GET_CURRENT_CONTEXT(ctx
);
7194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7195 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7199 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7201 if (ctx
->ExecuteFlag
) {
7202 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7207 static void GLAPIENTRY
7208 save_Uniform1iARB(GLint location
, GLint x
)
7210 GET_CURRENT_CONTEXT(ctx
);
7212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7213 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7218 if (ctx
->ExecuteFlag
) {
7219 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7223 static void GLAPIENTRY
7224 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7226 GET_CURRENT_CONTEXT(ctx
);
7228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7229 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7235 if (ctx
->ExecuteFlag
) {
7236 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7240 static void GLAPIENTRY
7241 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7243 GET_CURRENT_CONTEXT(ctx
);
7245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7246 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7253 if (ctx
->ExecuteFlag
) {
7254 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7258 static void GLAPIENTRY
7259 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7261 GET_CURRENT_CONTEXT(ctx
);
7263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7264 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7272 if (ctx
->ExecuteFlag
) {
7273 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7279 static void GLAPIENTRY
7280 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7282 GET_CURRENT_CONTEXT(ctx
);
7284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7285 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7289 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7291 if (ctx
->ExecuteFlag
) {
7292 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7296 static void GLAPIENTRY
7297 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7299 GET_CURRENT_CONTEXT(ctx
);
7301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7302 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7306 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7308 if (ctx
->ExecuteFlag
) {
7309 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7313 static void GLAPIENTRY
7314 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7316 GET_CURRENT_CONTEXT(ctx
);
7318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7319 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7323 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7325 if (ctx
->ExecuteFlag
) {
7326 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7330 static void GLAPIENTRY
7331 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7333 GET_CURRENT_CONTEXT(ctx
);
7335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7336 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7340 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7342 if (ctx
->ExecuteFlag
) {
7343 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7349 static void GLAPIENTRY
7350 save_Uniform1ui(GLint location
, GLuint x
)
7352 GET_CURRENT_CONTEXT(ctx
);
7354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7355 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7360 if (ctx
->ExecuteFlag
) {
7361 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7365 static void GLAPIENTRY
7366 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7368 GET_CURRENT_CONTEXT(ctx
);
7370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7371 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7377 if (ctx
->ExecuteFlag
) {
7378 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7382 static void GLAPIENTRY
7383 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7385 GET_CURRENT_CONTEXT(ctx
);
7387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7388 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7395 if (ctx
->ExecuteFlag
) {
7396 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7400 static void GLAPIENTRY
7401 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7403 GET_CURRENT_CONTEXT(ctx
);
7405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7406 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7414 if (ctx
->ExecuteFlag
) {
7415 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7421 static void GLAPIENTRY
7422 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7424 GET_CURRENT_CONTEXT(ctx
);
7426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7427 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7431 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7433 if (ctx
->ExecuteFlag
) {
7434 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7438 static void GLAPIENTRY
7439 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7441 GET_CURRENT_CONTEXT(ctx
);
7443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7444 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7448 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7450 if (ctx
->ExecuteFlag
) {
7451 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7455 static void GLAPIENTRY
7456 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7458 GET_CURRENT_CONTEXT(ctx
);
7460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7461 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7465 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7467 if (ctx
->ExecuteFlag
) {
7468 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7472 static void GLAPIENTRY
7473 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7475 GET_CURRENT_CONTEXT(ctx
);
7477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7478 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7482 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7484 if (ctx
->ExecuteFlag
) {
7485 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7491 static void GLAPIENTRY
7492 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7495 GET_CURRENT_CONTEXT(ctx
);
7497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7498 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7503 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7505 if (ctx
->ExecuteFlag
) {
7506 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7510 static void GLAPIENTRY
7511 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7514 GET_CURRENT_CONTEXT(ctx
);
7516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7517 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7522 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7524 if (ctx
->ExecuteFlag
) {
7525 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7529 static void GLAPIENTRY
7530 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7533 GET_CURRENT_CONTEXT(ctx
);
7535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7536 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7541 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7543 if (ctx
->ExecuteFlag
) {
7544 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7549 static void GLAPIENTRY
7550 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7553 GET_CURRENT_CONTEXT(ctx
);
7555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7556 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7561 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7563 if (ctx
->ExecuteFlag
) {
7564 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7568 static void GLAPIENTRY
7569 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7572 GET_CURRENT_CONTEXT(ctx
);
7574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7575 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7580 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7582 if (ctx
->ExecuteFlag
) {
7583 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7588 static void GLAPIENTRY
7589 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7592 GET_CURRENT_CONTEXT(ctx
);
7594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7595 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7600 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7602 if (ctx
->ExecuteFlag
) {
7603 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7607 static void GLAPIENTRY
7608 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7611 GET_CURRENT_CONTEXT(ctx
);
7613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7614 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7619 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7621 if (ctx
->ExecuteFlag
) {
7622 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7627 static void GLAPIENTRY
7628 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7631 GET_CURRENT_CONTEXT(ctx
);
7633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7634 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7639 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7641 if (ctx
->ExecuteFlag
) {
7642 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7646 static void GLAPIENTRY
7647 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7650 GET_CURRENT_CONTEXT(ctx
);
7652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7653 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7658 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7660 if (ctx
->ExecuteFlag
) {
7661 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7666 static void GLAPIENTRY
7667 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7670 GET_CURRENT_CONTEXT(ctx
);
7672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7673 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7678 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7680 if (ctx
->ExecuteFlag
) {
7681 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7685 static void GLAPIENTRY
7686 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7689 GET_CURRENT_CONTEXT(ctx
);
7691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7692 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7697 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7699 if (ctx
->ExecuteFlag
) {
7700 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7704 static void GLAPIENTRY
7705 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7708 GET_CURRENT_CONTEXT(ctx
);
7710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7711 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7716 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7718 if (ctx
->ExecuteFlag
) {
7719 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7724 static void GLAPIENTRY
7725 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7728 GET_CURRENT_CONTEXT(ctx
);
7730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7731 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7736 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7738 if (ctx
->ExecuteFlag
) {
7739 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7744 static void GLAPIENTRY
7745 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7748 GET_CURRENT_CONTEXT(ctx
);
7750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7751 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7756 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7758 if (ctx
->ExecuteFlag
) {
7759 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7764 static void GLAPIENTRY
7765 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7768 GET_CURRENT_CONTEXT(ctx
);
7770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7771 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7776 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7778 if (ctx
->ExecuteFlag
) {
7779 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7783 static void GLAPIENTRY
7784 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7787 GET_CURRENT_CONTEXT(ctx
);
7789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7790 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7795 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7797 if (ctx
->ExecuteFlag
) {
7798 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7803 static void GLAPIENTRY
7804 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7807 GET_CURRENT_CONTEXT(ctx
);
7809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7810 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7815 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7817 if (ctx
->ExecuteFlag
) {
7818 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7823 static void GLAPIENTRY
7824 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7827 GET_CURRENT_CONTEXT(ctx
);
7829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7830 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7835 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7837 if (ctx
->ExecuteFlag
) {
7838 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7843 static void GLAPIENTRY
7844 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7846 GET_CURRENT_CONTEXT(ctx
);
7848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7849 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7855 if (ctx
->ExecuteFlag
) {
7856 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7860 static void GLAPIENTRY
7861 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7863 GET_CURRENT_CONTEXT(ctx
);
7865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7866 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7872 if (ctx
->ExecuteFlag
) {
7873 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7877 static void GLAPIENTRY
7878 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7880 GET_CURRENT_CONTEXT(ctx
);
7882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7883 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7890 if (ctx
->ExecuteFlag
) {
7891 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7895 static void GLAPIENTRY
7896 save_ProgramUniform3f(GLuint program
, GLint location
,
7897 GLfloat x
, GLfloat y
, GLfloat z
)
7899 GET_CURRENT_CONTEXT(ctx
);
7901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7902 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7910 if (ctx
->ExecuteFlag
) {
7911 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7915 static void GLAPIENTRY
7916 save_ProgramUniform4f(GLuint program
, GLint location
,
7917 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7919 GET_CURRENT_CONTEXT(ctx
);
7921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7922 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7931 if (ctx
->ExecuteFlag
) {
7932 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7936 static void GLAPIENTRY
7937 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7940 GET_CURRENT_CONTEXT(ctx
);
7942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7943 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7948 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7950 if (ctx
->ExecuteFlag
) {
7951 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7955 static void GLAPIENTRY
7956 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7959 GET_CURRENT_CONTEXT(ctx
);
7961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7962 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7967 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7969 if (ctx
->ExecuteFlag
) {
7970 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7974 static void GLAPIENTRY
7975 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7978 GET_CURRENT_CONTEXT(ctx
);
7980 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7981 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7986 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7988 if (ctx
->ExecuteFlag
) {
7989 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7993 static void GLAPIENTRY
7994 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7997 GET_CURRENT_CONTEXT(ctx
);
7999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8000 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
8005 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
8007 if (ctx
->ExecuteFlag
) {
8008 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
8012 static void GLAPIENTRY
8013 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
8015 GET_CURRENT_CONTEXT(ctx
);
8017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8018 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8022 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8024 if (ctx
->ExecuteFlag
) {
8025 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8029 static void GLAPIENTRY
8030 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8032 GET_CURRENT_CONTEXT(ctx
);
8034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8035 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8039 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8040 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8042 if (ctx
->ExecuteFlag
) {
8043 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8047 static void GLAPIENTRY
8048 save_ProgramUniform3d(GLuint program
, GLint location
,
8049 GLdouble x
, GLdouble y
, GLdouble z
)
8051 GET_CURRENT_CONTEXT(ctx
);
8053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8054 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8058 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8059 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8060 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8062 if (ctx
->ExecuteFlag
) {
8063 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8067 static void GLAPIENTRY
8068 save_ProgramUniform4d(GLuint program
, GLint location
,
8069 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8071 GET_CURRENT_CONTEXT(ctx
);
8073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8074 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8078 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8079 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8080 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8081 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8083 if (ctx
->ExecuteFlag
) {
8084 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8088 static void GLAPIENTRY
8089 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8092 GET_CURRENT_CONTEXT(ctx
);
8094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8095 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8100 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8102 if (ctx
->ExecuteFlag
) {
8103 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8107 static void GLAPIENTRY
8108 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8111 GET_CURRENT_CONTEXT(ctx
);
8113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8114 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8119 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8121 if (ctx
->ExecuteFlag
) {
8122 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8126 static void GLAPIENTRY
8127 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8130 GET_CURRENT_CONTEXT(ctx
);
8132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8133 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8138 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8140 if (ctx
->ExecuteFlag
) {
8141 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8145 static void GLAPIENTRY
8146 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8149 GET_CURRENT_CONTEXT(ctx
);
8151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8152 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8157 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8159 if (ctx
->ExecuteFlag
) {
8160 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8164 static void GLAPIENTRY
8165 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8167 GET_CURRENT_CONTEXT(ctx
);
8169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8170 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8176 if (ctx
->ExecuteFlag
) {
8177 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8181 static void GLAPIENTRY
8182 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8184 GET_CURRENT_CONTEXT(ctx
);
8186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8187 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8194 if (ctx
->ExecuteFlag
) {
8195 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8199 static void GLAPIENTRY
8200 save_ProgramUniform3i(GLuint program
, GLint location
,
8201 GLint x
, GLint y
, GLint z
)
8203 GET_CURRENT_CONTEXT(ctx
);
8205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8206 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8214 if (ctx
->ExecuteFlag
) {
8215 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8219 static void GLAPIENTRY
8220 save_ProgramUniform4i(GLuint program
, GLint location
,
8221 GLint x
, GLint y
, GLint z
, GLint w
)
8223 GET_CURRENT_CONTEXT(ctx
);
8225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8226 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8235 if (ctx
->ExecuteFlag
) {
8236 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8240 static void GLAPIENTRY
8241 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8244 GET_CURRENT_CONTEXT(ctx
);
8246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8247 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8252 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8254 if (ctx
->ExecuteFlag
) {
8255 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8259 static void GLAPIENTRY
8260 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8263 GET_CURRENT_CONTEXT(ctx
);
8265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8266 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8271 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8273 if (ctx
->ExecuteFlag
) {
8274 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8278 static void GLAPIENTRY
8279 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8282 GET_CURRENT_CONTEXT(ctx
);
8284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8285 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8290 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8292 if (ctx
->ExecuteFlag
) {
8293 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8297 static void GLAPIENTRY
8298 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8301 GET_CURRENT_CONTEXT(ctx
);
8303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8304 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8309 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8311 if (ctx
->ExecuteFlag
) {
8312 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8316 static void GLAPIENTRY
8317 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8319 GET_CURRENT_CONTEXT(ctx
);
8321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8322 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8328 if (ctx
->ExecuteFlag
) {
8329 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8333 static void GLAPIENTRY
8334 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8336 GET_CURRENT_CONTEXT(ctx
);
8338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8339 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8346 if (ctx
->ExecuteFlag
) {
8347 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8351 static void GLAPIENTRY
8352 save_ProgramUniform3ui(GLuint program
, GLint location
,
8353 GLuint x
, GLuint y
, GLuint z
)
8355 GET_CURRENT_CONTEXT(ctx
);
8357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8358 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8366 if (ctx
->ExecuteFlag
) {
8367 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8371 static void GLAPIENTRY
8372 save_ProgramUniform4ui(GLuint program
, GLint location
,
8373 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8375 GET_CURRENT_CONTEXT(ctx
);
8377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8378 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8387 if (ctx
->ExecuteFlag
) {
8388 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8392 static void GLAPIENTRY
8393 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8396 GET_CURRENT_CONTEXT(ctx
);
8398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8399 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8404 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8406 if (ctx
->ExecuteFlag
) {
8407 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8411 static void GLAPIENTRY
8412 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8415 GET_CURRENT_CONTEXT(ctx
);
8417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8418 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8423 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8425 if (ctx
->ExecuteFlag
) {
8426 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8430 static void GLAPIENTRY
8431 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8434 GET_CURRENT_CONTEXT(ctx
);
8436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8437 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8442 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8444 if (ctx
->ExecuteFlag
) {
8445 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8449 static void GLAPIENTRY
8450 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8453 GET_CURRENT_CONTEXT(ctx
);
8455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8456 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8461 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8463 if (ctx
->ExecuteFlag
) {
8464 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8468 static void GLAPIENTRY
8469 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8470 GLboolean transpose
, const GLfloat
*v
)
8472 GET_CURRENT_CONTEXT(ctx
);
8474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8475 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8476 4 + POINTER_DWORDS
);
8482 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8484 if (ctx
->ExecuteFlag
) {
8485 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8486 (program
, location
, count
, transpose
, v
));
8490 static void GLAPIENTRY
8491 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8492 GLboolean transpose
, const GLfloat
*v
)
8494 GET_CURRENT_CONTEXT(ctx
);
8496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8497 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8498 4 + POINTER_DWORDS
);
8504 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8506 if (ctx
->ExecuteFlag
) {
8507 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8508 (program
, location
, count
, transpose
, v
));
8512 static void GLAPIENTRY
8513 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8514 GLboolean transpose
, const GLfloat
*v
)
8516 GET_CURRENT_CONTEXT(ctx
);
8518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8519 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8520 4 + POINTER_DWORDS
);
8526 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8528 if (ctx
->ExecuteFlag
) {
8529 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8530 (program
, location
, count
, transpose
, v
));
8534 static void GLAPIENTRY
8535 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8536 GLboolean transpose
, const GLfloat
*v
)
8538 GET_CURRENT_CONTEXT(ctx
);
8540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8541 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8542 4 + POINTER_DWORDS
);
8548 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8550 if (ctx
->ExecuteFlag
) {
8551 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8552 (program
, location
, count
, transpose
, v
));
8556 static void GLAPIENTRY
8557 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8558 GLboolean transpose
, const GLfloat
*v
)
8560 GET_CURRENT_CONTEXT(ctx
);
8562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8563 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8564 4 + POINTER_DWORDS
);
8570 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8572 if (ctx
->ExecuteFlag
) {
8573 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8574 (program
, location
, count
, transpose
, v
));
8578 static void GLAPIENTRY
8579 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8580 GLboolean transpose
, const GLfloat
*v
)
8582 GET_CURRENT_CONTEXT(ctx
);
8584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8585 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8586 4 + POINTER_DWORDS
);
8592 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8594 if (ctx
->ExecuteFlag
) {
8595 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8596 (program
, location
, count
, transpose
, v
));
8600 static void GLAPIENTRY
8601 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8602 GLboolean transpose
, const GLfloat
*v
)
8604 GET_CURRENT_CONTEXT(ctx
);
8606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8607 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8608 4 + POINTER_DWORDS
);
8614 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8616 if (ctx
->ExecuteFlag
) {
8617 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8618 (program
, location
, count
, transpose
, v
));
8622 static void GLAPIENTRY
8623 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8624 GLboolean transpose
, const GLfloat
*v
)
8626 GET_CURRENT_CONTEXT(ctx
);
8628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8629 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8630 4 + POINTER_DWORDS
);
8636 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8638 if (ctx
->ExecuteFlag
) {
8639 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8640 (program
, location
, count
, transpose
, v
));
8644 static void GLAPIENTRY
8645 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8646 GLboolean transpose
, const GLfloat
*v
)
8648 GET_CURRENT_CONTEXT(ctx
);
8650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8651 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8652 4 + POINTER_DWORDS
);
8658 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8660 if (ctx
->ExecuteFlag
) {
8661 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8662 (program
, location
, count
, transpose
, v
));
8666 static void GLAPIENTRY
8667 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8668 GLboolean transpose
, const GLdouble
*v
)
8670 GET_CURRENT_CONTEXT(ctx
);
8672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8673 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8674 4 + POINTER_DWORDS
);
8680 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8682 if (ctx
->ExecuteFlag
) {
8683 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8684 (program
, location
, count
, transpose
, v
));
8688 static void GLAPIENTRY
8689 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8690 GLboolean transpose
, const GLdouble
*v
)
8692 GET_CURRENT_CONTEXT(ctx
);
8694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8695 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8696 4 + POINTER_DWORDS
);
8702 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8704 if (ctx
->ExecuteFlag
) {
8705 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8706 (program
, location
, count
, transpose
, v
));
8710 static void GLAPIENTRY
8711 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8712 GLboolean transpose
, const GLdouble
*v
)
8714 GET_CURRENT_CONTEXT(ctx
);
8716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8717 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8718 4 + POINTER_DWORDS
);
8724 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8726 if (ctx
->ExecuteFlag
) {
8727 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8728 (program
, location
, count
, transpose
, v
));
8732 static void GLAPIENTRY
8733 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8734 GLboolean transpose
, const GLdouble
*v
)
8736 GET_CURRENT_CONTEXT(ctx
);
8738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8739 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8740 4 + POINTER_DWORDS
);
8746 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8748 if (ctx
->ExecuteFlag
) {
8749 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8750 (program
, location
, count
, transpose
, v
));
8754 static void GLAPIENTRY
8755 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8756 GLboolean transpose
, const GLdouble
*v
)
8758 GET_CURRENT_CONTEXT(ctx
);
8760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8761 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8762 4 + POINTER_DWORDS
);
8768 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8770 if (ctx
->ExecuteFlag
) {
8771 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8772 (program
, location
, count
, transpose
, v
));
8776 static void GLAPIENTRY
8777 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8778 GLboolean transpose
, const GLdouble
*v
)
8780 GET_CURRENT_CONTEXT(ctx
);
8782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8783 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8784 4 + POINTER_DWORDS
);
8790 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8792 if (ctx
->ExecuteFlag
) {
8793 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8794 (program
, location
, count
, transpose
, v
));
8798 static void GLAPIENTRY
8799 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8800 GLboolean transpose
, const GLdouble
*v
)
8802 GET_CURRENT_CONTEXT(ctx
);
8804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8805 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8806 4 + POINTER_DWORDS
);
8812 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8814 if (ctx
->ExecuteFlag
) {
8815 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8816 (program
, location
, count
, transpose
, v
));
8820 static void GLAPIENTRY
8821 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8822 GLboolean transpose
, const GLdouble
*v
)
8824 GET_CURRENT_CONTEXT(ctx
);
8826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8827 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8828 4 + POINTER_DWORDS
);
8834 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8836 if (ctx
->ExecuteFlag
) {
8837 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8838 (program
, location
, count
, transpose
, v
));
8842 static void GLAPIENTRY
8843 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8844 GLboolean transpose
, const GLdouble
*v
)
8846 GET_CURRENT_CONTEXT(ctx
);
8848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8849 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8850 4 + POINTER_DWORDS
);
8856 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8858 if (ctx
->ExecuteFlag
) {
8859 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8860 (program
, location
, count
, transpose
, v
));
8864 static void GLAPIENTRY
8865 save_ClipControl(GLenum origin
, GLenum depth
)
8867 GET_CURRENT_CONTEXT(ctx
);
8869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8870 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8875 if (ctx
->ExecuteFlag
) {
8876 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8880 static void GLAPIENTRY
8881 save_ClampColorARB(GLenum target
, GLenum clamp
)
8883 GET_CURRENT_CONTEXT(ctx
);
8885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8886 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8891 if (ctx
->ExecuteFlag
) {
8892 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8896 /** GL_EXT_texture_integer */
8897 static void GLAPIENTRY
8898 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8900 GET_CURRENT_CONTEXT(ctx
);
8902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8903 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8910 if (ctx
->ExecuteFlag
) {
8911 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8915 /** GL_EXT_texture_integer */
8916 static void GLAPIENTRY
8917 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8919 GET_CURRENT_CONTEXT(ctx
);
8921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8922 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8929 if (ctx
->ExecuteFlag
) {
8930 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8934 /** GL_EXT_texture_integer */
8935 static void GLAPIENTRY
8936 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8938 GET_CURRENT_CONTEXT(ctx
);
8940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8941 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8950 if (ctx
->ExecuteFlag
) {
8951 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8955 /** GL_EXT_texture_integer */
8956 static void GLAPIENTRY
8957 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8959 GET_CURRENT_CONTEXT(ctx
);
8961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8962 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8966 n
[3].ui
= params
[0];
8967 n
[4].ui
= params
[1];
8968 n
[5].ui
= params
[2];
8969 n
[6].ui
= params
[3];
8971 if (ctx
->ExecuteFlag
) {
8972 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8976 /* GL_ARB_instanced_arrays */
8977 static void GLAPIENTRY
8978 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8980 GET_CURRENT_CONTEXT(ctx
);
8982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8983 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8988 if (ctx
->ExecuteFlag
) {
8989 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8994 /* GL_NV_texture_barrier */
8995 static void GLAPIENTRY
8996 save_TextureBarrierNV(void)
8998 GET_CURRENT_CONTEXT(ctx
);
8999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9000 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
9001 if (ctx
->ExecuteFlag
) {
9002 CALL_TextureBarrierNV(ctx
->Exec
, ());
9007 /* GL_ARB_sampler_objects */
9008 static void GLAPIENTRY
9009 save_BindSampler(GLuint unit
, GLuint sampler
)
9012 GET_CURRENT_CONTEXT(ctx
);
9013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9014 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
9019 if (ctx
->ExecuteFlag
) {
9020 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9024 static void GLAPIENTRY
9025 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9028 GET_CURRENT_CONTEXT(ctx
);
9029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9030 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9035 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9041 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9044 if (ctx
->ExecuteFlag
) {
9045 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9049 static void GLAPIENTRY
9050 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9054 parray
[1] = parray
[2] = parray
[3] = 0;
9055 save_SamplerParameteriv(sampler
, pname
, parray
);
9058 static void GLAPIENTRY
9059 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9062 GET_CURRENT_CONTEXT(ctx
);
9063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9064 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9069 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9075 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9078 if (ctx
->ExecuteFlag
) {
9079 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9083 static void GLAPIENTRY
9084 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9088 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9089 save_SamplerParameterfv(sampler
, pname
, parray
);
9092 static void GLAPIENTRY
9093 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9096 GET_CURRENT_CONTEXT(ctx
);
9097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9098 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9103 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9109 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9112 if (ctx
->ExecuteFlag
) {
9113 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9117 static void GLAPIENTRY
9118 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9121 GET_CURRENT_CONTEXT(ctx
);
9122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9123 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9127 n
[3].ui
= params
[0];
9128 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9129 n
[4].ui
= params
[1];
9130 n
[5].ui
= params
[2];
9131 n
[6].ui
= params
[3];
9134 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9137 if (ctx
->ExecuteFlag
) {
9138 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9142 static void GLAPIENTRY
9143 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9146 GET_CURRENT_CONTEXT(ctx
);
9147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9148 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9150 union uint64_pair p
;
9153 n
[2].ui
= p
.uint32
[0];
9154 n
[3].ui
= p
.uint32
[1];
9155 save_pointer(&n
[4], sync
);
9157 if (ctx
->ExecuteFlag
) {
9158 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9163 /** GL_NV_conditional_render */
9164 static void GLAPIENTRY
9165 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9167 GET_CURRENT_CONTEXT(ctx
);
9169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9170 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9175 if (ctx
->ExecuteFlag
) {
9176 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9180 static void GLAPIENTRY
9181 save_EndConditionalRender(void)
9183 GET_CURRENT_CONTEXT(ctx
);
9184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9185 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9186 if (ctx
->ExecuteFlag
) {
9187 CALL_EndConditionalRender(ctx
->Exec
, ());
9191 static void GLAPIENTRY
9192 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9194 GET_CURRENT_CONTEXT(ctx
);
9196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9197 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9203 if (ctx
->ExecuteFlag
) {
9204 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9208 static void GLAPIENTRY
9209 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9210 const GLuint
*indices
)
9212 GET_CURRENT_CONTEXT(ctx
);
9214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9215 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9217 GLint
*indices_copy
= NULL
;
9220 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9221 n
[1].e
= shadertype
;
9223 save_pointer(&n
[3], indices_copy
);
9225 if (ctx
->ExecuteFlag
) {
9226 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9230 /** GL_EXT_window_rectangles */
9231 static void GLAPIENTRY
9232 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9234 GET_CURRENT_CONTEXT(ctx
);
9236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9237 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9239 GLint
*box_copy
= NULL
;
9242 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9245 save_pointer(&n
[3], box_copy
);
9247 if (ctx
->ExecuteFlag
) {
9248 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9253 /** GL_NV_conservative_raster */
9254 static void GLAPIENTRY
9255 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9257 GET_CURRENT_CONTEXT(ctx
);
9259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9260 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9265 if (ctx
->ExecuteFlag
) {
9266 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9270 /** GL_NV_conservative_raster_dilate */
9271 static void GLAPIENTRY
9272 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9274 GET_CURRENT_CONTEXT(ctx
);
9276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9277 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9282 if (ctx
->ExecuteFlag
) {
9283 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9287 /** GL_NV_conservative_raster_pre_snap_triangles */
9288 static void GLAPIENTRY
9289 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9291 GET_CURRENT_CONTEXT(ctx
);
9293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9294 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9299 if (ctx
->ExecuteFlag
) {
9300 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9304 /** GL_EXT_direct_state_access */
9306 static void GLAPIENTRY
9307 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9309 GET_CURRENT_CONTEXT(ctx
);
9311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9312 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9314 n
[1].e
= matrixMode
;
9315 for (unsigned i
= 0; i
< 16; i
++) {
9319 if (ctx
->ExecuteFlag
) {
9320 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9324 static void GLAPIENTRY
9325 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9328 for (unsigned i
= 0; i
< 16; i
++) {
9329 f
[i
] = (GLfloat
) m
[i
];
9331 save_MatrixLoadfEXT(matrixMode
, f
);
9334 static void GLAPIENTRY
9335 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9337 GET_CURRENT_CONTEXT(ctx
);
9339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9340 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9342 n
[1].e
= matrixMode
;
9343 for (unsigned i
= 0; i
< 16; i
++) {
9347 if (ctx
->ExecuteFlag
) {
9348 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9352 static void GLAPIENTRY
9353 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9356 for (unsigned i
= 0; i
< 16; i
++) {
9357 f
[i
] = (GLfloat
) m
[i
];
9359 save_MatrixMultfEXT(matrixMode
, f
);
9362 static void GLAPIENTRY
9363 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9365 GET_CURRENT_CONTEXT(ctx
);
9367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9368 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9370 n
[1].e
= matrixMode
;
9376 if (ctx
->ExecuteFlag
) {
9377 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9381 static void GLAPIENTRY
9382 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9384 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9387 static void GLAPIENTRY
9388 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9390 GET_CURRENT_CONTEXT(ctx
);
9392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9393 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9395 n
[1].e
= matrixMode
;
9400 if (ctx
->ExecuteFlag
) {
9401 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9405 static void GLAPIENTRY
9406 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9408 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9411 static void GLAPIENTRY
9412 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9414 GET_CURRENT_CONTEXT(ctx
);
9416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9417 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9419 n
[1].e
= matrixMode
;
9424 if (ctx
->ExecuteFlag
) {
9425 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9429 static void GLAPIENTRY
9430 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9432 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9435 static void GLAPIENTRY
9436 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9438 GET_CURRENT_CONTEXT(ctx
);
9440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9441 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9443 n
[1].e
= matrixMode
;
9445 if (ctx
->ExecuteFlag
) {
9446 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9450 static void GLAPIENTRY
9451 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9452 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9454 GET_CURRENT_CONTEXT(ctx
);
9456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9457 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9459 n
[1].e
= matrixMode
;
9460 n
[2].f
= (GLfloat
) left
;
9461 n
[3].f
= (GLfloat
) right
;
9462 n
[4].f
= (GLfloat
) bottom
;
9463 n
[5].f
= (GLfloat
) top
;
9464 n
[6].f
= (GLfloat
) nearval
;
9465 n
[7].f
= (GLfloat
) farval
;
9467 if (ctx
->ExecuteFlag
) {
9468 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9473 static void GLAPIENTRY
9474 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9475 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9477 GET_CURRENT_CONTEXT(ctx
);
9479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9480 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9482 n
[1].e
= matrixMode
;
9483 n
[2].f
= (GLfloat
) left
;
9484 n
[3].f
= (GLfloat
) right
;
9485 n
[4].f
= (GLfloat
) bottom
;
9486 n
[5].f
= (GLfloat
) top
;
9487 n
[6].f
= (GLfloat
) nearval
;
9488 n
[7].f
= (GLfloat
) farval
;
9490 if (ctx
->ExecuteFlag
) {
9491 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9495 static void GLAPIENTRY
9496 save_MatrixPushEXT(GLenum matrixMode
)
9498 GET_CURRENT_CONTEXT(ctx
);
9500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9501 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9503 n
[1].e
= matrixMode
;
9505 if (ctx
->ExecuteFlag
) {
9506 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9510 static void GLAPIENTRY
9511 save_MatrixPopEXT(GLenum matrixMode
)
9513 GET_CURRENT_CONTEXT(ctx
);
9515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9516 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9518 n
[1].e
= matrixMode
;
9520 if (ctx
->ExecuteFlag
) {
9521 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9525 static void GLAPIENTRY
9526 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9529 _math_transposef(tm
, m
);
9530 save_MatrixLoadfEXT(matrixMode
, tm
);
9533 static void GLAPIENTRY
9534 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9537 _math_transposefd(tm
, m
);
9538 save_MatrixLoadfEXT(matrixMode
, tm
);
9541 static void GLAPIENTRY
9542 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9545 _math_transposef(tm
, m
);
9546 save_MatrixMultfEXT(matrixMode
, tm
);
9549 static void GLAPIENTRY
9550 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9553 _math_transposefd(tm
, m
);
9554 save_MatrixMultfEXT(matrixMode
, tm
);
9557 static void GLAPIENTRY
9558 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9559 const GLfloat
*params
)
9561 GET_CURRENT_CONTEXT(ctx
);
9563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9564 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9574 if (ctx
->ExecuteFlag
) {
9575 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9580 static void GLAPIENTRY
9581 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9585 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9586 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9589 static void GLAPIENTRY
9590 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9592 GET_CURRENT_CONTEXT(ctx
);
9594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9595 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9605 if (ctx
->ExecuteFlag
) {
9606 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9610 static void GLAPIENTRY
9611 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9615 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9616 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9619 static void GLAPIENTRY
9620 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9621 GLint level
, GLint components
,
9622 GLsizei width
, GLint border
,
9623 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9625 GET_CURRENT_CONTEXT(ctx
);
9626 if (target
== GL_PROXY_TEXTURE_1D
) {
9627 /* don't compile, execute immediately */
9628 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9629 border
, format
, type
, pixels
));
9633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9634 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9639 n
[4].i
= components
;
9640 n
[5].i
= (GLint
) width
;
9645 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9646 pixels
, &ctx
->Unpack
));
9648 if (ctx
->ExecuteFlag
) {
9649 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9650 border
, format
, type
, pixels
));
9656 static void GLAPIENTRY
9657 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9658 GLint level
, GLint components
,
9659 GLsizei width
, GLsizei height
, GLint border
,
9660 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9662 GET_CURRENT_CONTEXT(ctx
);
9663 if (target
== GL_PROXY_TEXTURE_2D
) {
9664 /* don't compile, execute immediately */
9665 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9666 height
, border
, format
, type
, pixels
));
9670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9671 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9676 n
[4].i
= components
;
9677 n
[5].i
= (GLint
) width
;
9678 n
[6].i
= (GLint
) height
;
9682 save_pointer(&n
[10],
9683 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9684 pixels
, &ctx
->Unpack
));
9686 if (ctx
->ExecuteFlag
) {
9687 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9688 height
, border
, format
, type
, pixels
));
9694 static void GLAPIENTRY
9695 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9696 GLint level
, GLint internalFormat
,
9697 GLsizei width
, GLsizei height
, GLsizei depth
,
9699 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9701 GET_CURRENT_CONTEXT(ctx
);
9702 if (target
== GL_PROXY_TEXTURE_3D
) {
9703 /* don't compile, execute immediately */
9704 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9705 height
, depth
, border
, format
, type
,
9710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9711 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9716 n
[4].i
= (GLint
) internalFormat
;
9717 n
[5].i
= (GLint
) width
;
9718 n
[6].i
= (GLint
) height
;
9719 n
[7].i
= (GLint
) depth
;
9723 save_pointer(&n
[11],
9724 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9725 pixels
, &ctx
->Unpack
));
9727 if (ctx
->ExecuteFlag
) {
9728 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9729 width
, height
, depth
, border
, format
,
9736 static void GLAPIENTRY
9737 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9738 GLsizei width
, GLenum format
, GLenum type
,
9739 const GLvoid
* pixels
)
9741 GET_CURRENT_CONTEXT(ctx
);
9744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9746 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9752 n
[5].i
= (GLint
) width
;
9756 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9757 pixels
, &ctx
->Unpack
));
9759 if (ctx
->ExecuteFlag
) {
9760 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9761 format
, type
, pixels
));
9766 static void GLAPIENTRY
9767 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9768 GLint xoffset
, GLint yoffset
,
9769 GLsizei width
, GLsizei height
,
9770 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9772 GET_CURRENT_CONTEXT(ctx
);
9775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9777 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9784 n
[6].i
= (GLint
) width
;
9785 n
[7].i
= (GLint
) height
;
9788 save_pointer(&n
[10],
9789 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9790 pixels
, &ctx
->Unpack
));
9792 if (ctx
->ExecuteFlag
) {
9793 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9794 width
, height
, format
, type
, pixels
));
9799 static void GLAPIENTRY
9800 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9801 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9802 GLsizei width
, GLsizei height
, GLsizei depth
,
9803 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9805 GET_CURRENT_CONTEXT(ctx
);
9808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9810 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9818 n
[7].i
= (GLint
) width
;
9819 n
[8].i
= (GLint
) height
;
9820 n
[9].i
= (GLint
) depth
;
9823 save_pointer(&n
[12],
9824 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9825 pixels
, &ctx
->Unpack
));
9827 if (ctx
->ExecuteFlag
) {
9828 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9829 xoffset
, yoffset
, zoffset
,
9830 width
, height
, depth
, format
, type
,
9835 static void GLAPIENTRY
9836 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9837 GLenum internalformat
, GLint x
, GLint y
,
9838 GLsizei width
, GLint border
)
9840 GET_CURRENT_CONTEXT(ctx
);
9842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9843 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9848 n
[4].e
= internalformat
;
9854 if (ctx
->ExecuteFlag
) {
9855 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9856 internalformat
, x
, y
,
9861 static void GLAPIENTRY
9862 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9863 GLenum internalformat
,
9864 GLint x
, GLint y
, GLsizei width
,
9865 GLsizei height
, GLint border
)
9867 GET_CURRENT_CONTEXT(ctx
);
9869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9870 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9875 n
[4].e
= internalformat
;
9882 if (ctx
->ExecuteFlag
) {
9883 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9884 internalformat
, x
, y
,
9885 width
, height
, border
));
9889 static void GLAPIENTRY
9890 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9891 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9893 GET_CURRENT_CONTEXT(ctx
);
9895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9896 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9906 if (ctx
->ExecuteFlag
) {
9907 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9908 (texture
, target
, level
, xoffset
, x
, y
, width
));
9912 static void GLAPIENTRY
9913 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9914 GLint xoffset
, GLint yoffset
,
9915 GLint x
, GLint y
, GLsizei width
, GLint height
)
9917 GET_CURRENT_CONTEXT(ctx
);
9919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9920 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9932 if (ctx
->ExecuteFlag
) {
9933 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9935 x
, y
, width
, height
));
9940 static void GLAPIENTRY
9941 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9942 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9943 GLint x
, GLint y
, GLsizei width
, GLint height
)
9945 GET_CURRENT_CONTEXT(ctx
);
9947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9948 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9961 if (ctx
->ExecuteFlag
) {
9962 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9963 xoffset
, yoffset
, zoffset
,
9964 x
, y
, width
, height
));
9969 static void GLAPIENTRY
9970 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9972 GET_CURRENT_CONTEXT(ctx
);
9974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9975 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9981 if (ctx
->ExecuteFlag
) {
9982 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9987 static void GLAPIENTRY
9988 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9989 const GLfloat
*params
)
9991 GET_CURRENT_CONTEXT(ctx
);
9993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9994 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
10000 n
[5].f
= params
[1];
10001 n
[6].f
= params
[2];
10002 n
[7].f
= params
[3];
10004 if (ctx
->ExecuteFlag
) {
10005 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10010 static void GLAPIENTRY
10011 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10015 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10016 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
10019 static void GLAPIENTRY
10020 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10022 GET_CURRENT_CONTEXT(ctx
);
10024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10025 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10030 n
[4].i
= params
[0];
10031 n
[5].i
= params
[1];
10032 n
[6].i
= params
[2];
10033 n
[7].i
= params
[3];
10035 if (ctx
->ExecuteFlag
) {
10036 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10040 static void GLAPIENTRY
10041 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10045 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10046 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10050 static void GLAPIENTRY
10051 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10052 GLint level
, GLint components
,
10053 GLsizei width
, GLint border
,
10054 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10056 GET_CURRENT_CONTEXT(ctx
);
10057 if (target
== GL_PROXY_TEXTURE_1D
) {
10058 /* don't compile, execute immediately */
10059 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10060 border
, format
, type
, pixels
));
10064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10065 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10070 n
[4].i
= components
;
10071 n
[5].i
= (GLint
) width
;
10075 save_pointer(&n
[9],
10076 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10077 pixels
, &ctx
->Unpack
));
10079 if (ctx
->ExecuteFlag
) {
10080 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10081 border
, format
, type
, pixels
));
10087 static void GLAPIENTRY
10088 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10089 GLint level
, GLint components
,
10090 GLsizei width
, GLsizei height
, GLint border
,
10091 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10093 GET_CURRENT_CONTEXT(ctx
);
10094 if (target
== GL_PROXY_TEXTURE_2D
) {
10095 /* don't compile, execute immediately */
10096 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10097 height
, border
, format
, type
, pixels
));
10101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10102 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10107 n
[4].i
= components
;
10108 n
[5].i
= (GLint
) width
;
10109 n
[6].i
= (GLint
) height
;
10113 save_pointer(&n
[10],
10114 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10115 pixels
, &ctx
->Unpack
));
10117 if (ctx
->ExecuteFlag
) {
10118 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10119 height
, border
, format
, type
, pixels
));
10125 static void GLAPIENTRY
10126 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10127 GLint level
, GLint internalFormat
,
10128 GLsizei width
, GLsizei height
, GLsizei depth
,
10130 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10132 GET_CURRENT_CONTEXT(ctx
);
10133 if (target
== GL_PROXY_TEXTURE_3D
) {
10134 /* don't compile, execute immediately */
10135 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10136 height
, depth
, border
, format
, type
,
10141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10142 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10147 n
[4].i
= (GLint
) internalFormat
;
10148 n
[5].i
= (GLint
) width
;
10149 n
[6].i
= (GLint
) height
;
10150 n
[7].i
= (GLint
) depth
;
10154 save_pointer(&n
[11],
10155 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10156 pixels
, &ctx
->Unpack
));
10158 if (ctx
->ExecuteFlag
) {
10159 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10160 width
, height
, depth
, border
, format
,
10167 static void GLAPIENTRY
10168 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10169 GLsizei width
, GLenum format
, GLenum type
,
10170 const GLvoid
* pixels
)
10172 GET_CURRENT_CONTEXT(ctx
);
10175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10177 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10183 n
[5].i
= (GLint
) width
;
10186 save_pointer(&n
[8],
10187 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10188 pixels
, &ctx
->Unpack
));
10190 if (ctx
->ExecuteFlag
) {
10191 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10192 format
, type
, pixels
));
10197 static void GLAPIENTRY
10198 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10199 GLint xoffset
, GLint yoffset
,
10200 GLsizei width
, GLsizei height
,
10201 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10203 GET_CURRENT_CONTEXT(ctx
);
10206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10208 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10215 n
[6].i
= (GLint
) width
;
10216 n
[7].i
= (GLint
) height
;
10219 save_pointer(&n
[10],
10220 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10221 pixels
, &ctx
->Unpack
));
10223 if (ctx
->ExecuteFlag
) {
10224 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10225 width
, height
, format
, type
, pixels
));
10230 static void GLAPIENTRY
10231 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10232 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10233 GLsizei width
, GLsizei height
, GLsizei depth
,
10234 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10236 GET_CURRENT_CONTEXT(ctx
);
10239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10241 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10249 n
[7].i
= (GLint
) width
;
10250 n
[8].i
= (GLint
) height
;
10251 n
[9].i
= (GLint
) depth
;
10254 save_pointer(&n
[12],
10255 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10256 pixels
, &ctx
->Unpack
));
10258 if (ctx
->ExecuteFlag
) {
10259 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10260 xoffset
, yoffset
, zoffset
,
10261 width
, height
, depth
, format
, type
,
10267 static void GLAPIENTRY
10268 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10269 GLenum internalformat
, GLint x
, GLint y
,
10270 GLsizei width
, GLint border
)
10272 GET_CURRENT_CONTEXT(ctx
);
10274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10275 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10280 n
[4].e
= internalformat
;
10286 if (ctx
->ExecuteFlag
) {
10287 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10288 internalformat
, x
, y
,
10294 static void GLAPIENTRY
10295 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10296 GLenum internalformat
,
10297 GLint x
, GLint y
, GLsizei width
,
10298 GLsizei height
, GLint border
)
10300 GET_CURRENT_CONTEXT(ctx
);
10302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10303 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10308 n
[4].e
= internalformat
;
10315 if (ctx
->ExecuteFlag
) {
10316 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10317 internalformat
, x
, y
,
10318 width
, height
, border
));
10323 static void GLAPIENTRY
10324 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10325 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10327 GET_CURRENT_CONTEXT(ctx
);
10329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10330 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10340 if (ctx
->ExecuteFlag
) {
10341 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10342 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10347 static void GLAPIENTRY
10348 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10349 GLint xoffset
, GLint yoffset
,
10350 GLint x
, GLint y
, GLsizei width
, GLint height
)
10352 GET_CURRENT_CONTEXT(ctx
);
10354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10355 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10367 if (ctx
->ExecuteFlag
) {
10368 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10370 x
, y
, width
, height
));
10375 static void GLAPIENTRY
10376 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10377 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10378 GLint x
, GLint y
, GLsizei width
, GLint height
)
10380 GET_CURRENT_CONTEXT(ctx
);
10382 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10383 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10396 if (ctx
->ExecuteFlag
) {
10397 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10398 xoffset
, yoffset
, zoffset
,
10399 x
, y
, width
, height
));
10404 static void GLAPIENTRY
10405 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10407 GET_CURRENT_CONTEXT(ctx
);
10409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10410 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10415 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10416 n
[4].f
= params
[0];
10417 n
[5].f
= params
[1];
10418 n
[6].f
= params
[2];
10419 n
[7].f
= params
[3];
10422 n
[4].f
= params
[0];
10423 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10426 if (ctx
->ExecuteFlag
) {
10427 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10432 static void GLAPIENTRY
10433 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10436 parray
[0] = (GLfloat
) param
;
10437 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10438 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10442 static void GLAPIENTRY
10443 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10446 p
[0] = (GLfloat
) param
;
10447 p
[1] = p
[2] = p
[3] = 0.0F
;
10448 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10452 static void GLAPIENTRY
10453 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10456 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10457 p
[0] = INT_TO_FLOAT(param
[0]);
10458 p
[1] = INT_TO_FLOAT(param
[1]);
10459 p
[2] = INT_TO_FLOAT(param
[2]);
10460 p
[3] = INT_TO_FLOAT(param
[3]);
10463 p
[0] = (GLfloat
) param
[0];
10464 p
[1] = p
[2] = p
[3] = 0.0F
;
10466 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10470 static void GLAPIENTRY
10471 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10472 GLenum internalFormat
, GLsizei width
,
10473 GLint border
, GLsizei imageSize
,
10474 const GLvoid
* data
)
10476 GET_CURRENT_CONTEXT(ctx
);
10477 if (target
== GL_PROXY_TEXTURE_1D
) {
10478 /* don't compile, execute immediately */
10479 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10480 internalFormat
, width
,
10486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10488 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
10489 7 + POINTER_DWORDS
);
10494 n
[4].e
= internalFormat
;
10495 n
[5].i
= (GLint
) width
;
10497 n
[7].i
= imageSize
;
10498 save_pointer(&n
[8],
10499 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
10501 if (ctx
->ExecuteFlag
) {
10502 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
10503 (texture
, target
, level
, internalFormat
,
10504 width
, border
, imageSize
, data
));
10510 static void GLAPIENTRY
10511 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10512 GLenum internalFormat
, GLsizei width
,
10513 GLsizei height
, GLint border
, GLsizei imageSize
,
10514 const GLvoid
* data
)
10516 GET_CURRENT_CONTEXT(ctx
);
10517 if (target
== GL_PROXY_TEXTURE_2D
) {
10518 /* don't compile, execute immediately */
10519 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10520 internalFormat
, width
, height
,
10521 border
, imageSize
, data
));
10525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10527 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
10528 8 + POINTER_DWORDS
);
10533 n
[4].e
= internalFormat
;
10534 n
[5].i
= (GLint
) width
;
10535 n
[6].i
= (GLint
) height
;
10537 n
[8].i
= imageSize
;
10538 save_pointer(&n
[9],
10539 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
10541 if (ctx
->ExecuteFlag
) {
10542 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
10543 (texture
, target
, level
, internalFormat
,
10544 width
, height
, border
, imageSize
, data
));
10550 static void GLAPIENTRY
10551 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10552 GLenum internalFormat
, GLsizei width
,
10553 GLsizei height
, GLsizei depth
, GLint border
,
10554 GLsizei imageSize
, const GLvoid
* data
)
10556 GET_CURRENT_CONTEXT(ctx
);
10557 if (target
== GL_PROXY_TEXTURE_3D
) {
10558 /* don't compile, execute immediately */
10559 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10560 internalFormat
, width
,
10561 height
, depth
, border
,
10566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10568 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
10569 9 + POINTER_DWORDS
);
10574 n
[4].e
= internalFormat
;
10575 n
[5].i
= (GLint
) width
;
10576 n
[6].i
= (GLint
) height
;
10577 n
[7].i
= (GLint
) depth
;
10579 n
[9].i
= imageSize
;
10580 save_pointer(&n
[10],
10581 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
10583 if (ctx
->ExecuteFlag
) {
10584 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
10585 (texture
, target
, level
, internalFormat
,
10586 width
, height
, depth
, border
, imageSize
,
10593 static void GLAPIENTRY
10594 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10595 GLsizei width
, GLenum format
,
10596 GLsizei imageSize
, const GLvoid
* data
)
10599 GET_CURRENT_CONTEXT(ctx
);
10600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10602 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
10603 7 + POINTER_DWORDS
);
10609 n
[5].i
= (GLint
) width
;
10611 n
[7].i
= imageSize
;
10612 save_pointer(&n
[8],
10613 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
10615 if (ctx
->ExecuteFlag
) {
10616 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
10617 width
, format
, imageSize
, data
));
10622 static void GLAPIENTRY
10623 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10624 GLint yoffset
, GLsizei width
, GLsizei height
,
10625 GLenum format
, GLsizei imageSize
,
10626 const GLvoid
* data
)
10629 GET_CURRENT_CONTEXT(ctx
);
10630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10632 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10633 9 + POINTER_DWORDS
);
10640 n
[6].i
= (GLint
) width
;
10641 n
[7].i
= (GLint
) height
;
10643 n
[9].i
= imageSize
;
10644 save_pointer(&n
[10],
10645 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10647 if (ctx
->ExecuteFlag
) {
10648 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10649 (texture
, target
, level
, xoffset
, yoffset
,
10650 width
, height
, format
, imageSize
, data
));
10655 static void GLAPIENTRY
10656 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10657 GLint yoffset
, GLint zoffset
, GLsizei width
,
10658 GLsizei height
, GLsizei depth
, GLenum format
,
10659 GLsizei imageSize
, const GLvoid
* data
)
10662 GET_CURRENT_CONTEXT(ctx
);
10663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10665 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
10666 11 + POINTER_DWORDS
);
10674 n
[7].i
= (GLint
) width
;
10675 n
[8].i
= (GLint
) height
;
10676 n
[9].i
= (GLint
) depth
;
10678 n
[11].i
= imageSize
;
10679 save_pointer(&n
[12],
10680 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
10682 if (ctx
->ExecuteFlag
) {
10683 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
10684 (texture
, target
, level
, xoffset
, yoffset
,
10685 zoffset
, width
, height
, depth
, format
,
10691 static void GLAPIENTRY
10692 save_CompressedMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10693 GLenum internalFormat
, GLsizei width
,
10694 GLint border
, GLsizei imageSize
,
10695 const GLvoid
* data
)
10697 GET_CURRENT_CONTEXT(ctx
);
10698 if (target
== GL_PROXY_TEXTURE_1D
) {
10699 /* don't compile, execute immediately */
10700 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10701 internalFormat
, width
,
10707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10709 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
10710 7 + POINTER_DWORDS
);
10715 n
[4].e
= internalFormat
;
10716 n
[5].i
= (GLint
) width
;
10718 n
[7].i
= imageSize
;
10719 save_pointer(&n
[8],
10720 copy_data(data
, imageSize
, "glCompressedMultiTexImage1DEXT"));
10722 if (ctx
->ExecuteFlag
) {
10723 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
,
10724 (texunit
, target
, level
, internalFormat
,
10725 width
, border
, imageSize
, data
));
10731 static void GLAPIENTRY
10732 save_CompressedMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10733 GLenum internalFormat
, GLsizei width
,
10734 GLsizei height
, GLint border
, GLsizei imageSize
,
10735 const GLvoid
* data
)
10737 GET_CURRENT_CONTEXT(ctx
);
10738 if (target
== GL_PROXY_TEXTURE_2D
) {
10739 /* don't compile, execute immediately */
10740 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10741 internalFormat
, width
, height
,
10742 border
, imageSize
, data
));
10746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10748 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
10749 8 + POINTER_DWORDS
);
10754 n
[4].e
= internalFormat
;
10755 n
[5].i
= (GLint
) width
;
10756 n
[6].i
= (GLint
) height
;
10758 n
[8].i
= imageSize
;
10759 save_pointer(&n
[9],
10760 copy_data(data
, imageSize
, "glCompressedMultiTexImage2DEXT"));
10762 if (ctx
->ExecuteFlag
) {
10763 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
,
10764 (texunit
, target
, level
, internalFormat
,
10765 width
, height
, border
, imageSize
, data
));
10771 static void GLAPIENTRY
10772 save_CompressedMultiTexImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10773 GLenum internalFormat
, GLsizei width
,
10774 GLsizei height
, GLsizei depth
, GLint border
,
10775 GLsizei imageSize
, const GLvoid
* data
)
10777 GET_CURRENT_CONTEXT(ctx
);
10778 if (target
== GL_PROXY_TEXTURE_3D
) {
10779 /* don't compile, execute immediately */
10780 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10781 internalFormat
, width
,
10782 height
, depth
, border
,
10787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10789 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
10790 9 + POINTER_DWORDS
);
10795 n
[4].e
= internalFormat
;
10796 n
[5].i
= (GLint
) width
;
10797 n
[6].i
= (GLint
) height
;
10798 n
[7].i
= (GLint
) depth
;
10800 n
[9].i
= imageSize
;
10801 save_pointer(&n
[10],
10802 copy_data(data
, imageSize
, "glCompressedMultiTexImage3DEXT"));
10804 if (ctx
->ExecuteFlag
) {
10805 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
,
10806 (texunit
, target
, level
, internalFormat
,
10807 width
, height
, depth
, border
, imageSize
,
10814 static void GLAPIENTRY
10815 save_CompressedMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10816 GLsizei width
, GLenum format
,
10817 GLsizei imageSize
, const GLvoid
* data
)
10820 GET_CURRENT_CONTEXT(ctx
);
10821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10823 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
10824 7 + POINTER_DWORDS
);
10830 n
[5].i
= (GLint
) width
;
10832 n
[7].i
= imageSize
;
10833 save_pointer(&n
[8],
10834 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage1DEXT"));
10836 if (ctx
->ExecuteFlag
) {
10837 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
,
10838 width
, format
, imageSize
, data
));
10843 static void GLAPIENTRY
10844 save_CompressedMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10845 GLint yoffset
, GLsizei width
, GLsizei height
,
10846 GLenum format
, GLsizei imageSize
,
10847 const GLvoid
* data
)
10850 GET_CURRENT_CONTEXT(ctx
);
10851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10853 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
10854 9 + POINTER_DWORDS
);
10861 n
[6].i
= (GLint
) width
;
10862 n
[7].i
= (GLint
) height
;
10864 n
[9].i
= imageSize
;
10865 save_pointer(&n
[10],
10866 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage2DEXT"));
10868 if (ctx
->ExecuteFlag
) {
10869 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
10870 (texunit
, target
, level
, xoffset
, yoffset
,
10871 width
, height
, format
, imageSize
, data
));
10876 static void GLAPIENTRY
10877 save_CompressedMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10878 GLint yoffset
, GLint zoffset
, GLsizei width
,
10879 GLsizei height
, GLsizei depth
, GLenum format
,
10880 GLsizei imageSize
, const GLvoid
* data
)
10883 GET_CURRENT_CONTEXT(ctx
);
10884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10886 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
10887 11 + POINTER_DWORDS
);
10895 n
[7].i
= (GLint
) width
;
10896 n
[8].i
= (GLint
) height
;
10897 n
[9].i
= (GLint
) depth
;
10899 n
[11].i
= imageSize
;
10900 save_pointer(&n
[12],
10901 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage3DEXT"));
10903 if (ctx
->ExecuteFlag
) {
10904 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
10905 (texunit
, target
, level
, xoffset
, yoffset
,
10906 zoffset
, width
, height
, depth
, format
,
10912 static void GLAPIENTRY
10913 save_NamedProgramStringEXT(GLuint program
, GLenum target
, GLenum format
, GLsizei len
,
10914 const GLvoid
* string
)
10916 GET_CURRENT_CONTEXT(ctx
);
10919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10921 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_STRING
, 4 + POINTER_DWORDS
);
10923 GLubyte
*programCopy
= malloc(len
);
10924 if (!programCopy
) {
10925 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glNamedProgramStringEXT");
10928 memcpy(programCopy
, string
, len
);
10933 save_pointer(&n
[5], programCopy
);
10935 if (ctx
->ExecuteFlag
) {
10936 CALL_NamedProgramStringEXT(ctx
->Exec
, (program
, target
, format
, len
, string
));
10941 static void GLAPIENTRY
10942 save_NamedProgramLocalParameter4fEXT(GLuint program
, GLenum target
, GLuint index
,
10943 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
10945 GET_CURRENT_CONTEXT(ctx
);
10947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10948 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
, 7);
10958 if (ctx
->ExecuteFlag
) {
10959 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
, (program
, target
, index
, x
, y
, z
, w
));
10964 static void GLAPIENTRY
10965 save_NamedProgramLocalParameter4fvEXT(GLuint program
, GLenum target
, GLuint index
,
10966 const GLfloat
*params
)
10968 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, params
[0],
10969 params
[1], params
[2], params
[3]);
10973 static void GLAPIENTRY
10974 save_NamedProgramLocalParameter4dEXT(GLuint program
, GLenum target
, GLuint index
,
10975 GLdouble x
, GLdouble y
,
10976 GLdouble z
, GLdouble w
)
10978 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) x
,
10979 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
10983 static void GLAPIENTRY
10984 save_NamedProgramLocalParameter4dvEXT(GLuint program
, GLenum target
, GLuint index
,
10985 const GLdouble
*params
)
10987 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) params
[0],
10988 (GLfloat
) params
[1], (GLfloat
) params
[2],
10989 (GLfloat
) params
[3]);
10994 * Save an error-generating command into display list.
10996 * KW: Will appear in the list before the vertex buffer containing the
10997 * command that provoked the error. I don't see this as a problem.
11000 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11003 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
11006 save_pointer(&n
[2], (void *) s
);
11007 /* note: the data/string here doesn't have to be freed in
11008 * _mesa_delete_list() since the string is never dynamically
11016 * Compile an error into current display list.
11019 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11021 if (ctx
->CompileFlag
)
11022 save_error(ctx
, error
, s
);
11023 if (ctx
->ExecuteFlag
)
11024 _mesa_error(ctx
, error
, "%s", s
);
11029 * Test if ID names a display list.
11032 islist(struct gl_context
*ctx
, GLuint list
)
11034 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
11044 /**********************************************************************/
11045 /* Display list execution */
11046 /**********************************************************************/
11050 * Execute a display list. Note that the ListBase offset must have already
11051 * been added before calling this function. I.e. the list argument is
11052 * the absolute list number, not relative to ListBase.
11053 * \param list - display list number
11056 execute_list(struct gl_context
*ctx
, GLuint list
)
11058 struct gl_display_list
*dlist
;
11062 if (list
== 0 || !islist(ctx
, list
))
11065 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
11066 /* raise an error? */
11070 dlist
= _mesa_lookup_list(ctx
, list
);
11074 ctx
->ListState
.CallDepth
++;
11076 vbo_save_BeginCallList(ctx
, dlist
);
11082 const OpCode opcode
= n
[0].opcode
;
11084 if (is_ext_opcode(opcode
)) {
11085 n
+= ext_opcode_execute(ctx
, n
);
11090 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
11093 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11095 case OPCODE_ALPHA_FUNC
:
11096 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11098 case OPCODE_BIND_TEXTURE
:
11099 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11101 case OPCODE_BITMAP
:
11103 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11104 ctx
->Unpack
= ctx
->DefaultPacking
;
11105 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
11106 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11107 get_pointer(&n
[7])));
11108 ctx
->Unpack
= save
; /* restore */
11111 case OPCODE_BLEND_COLOR
:
11112 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11114 case OPCODE_BLEND_EQUATION
:
11115 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
11117 case OPCODE_BLEND_EQUATION_SEPARATE
:
11118 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11120 case OPCODE_BLEND_FUNC_SEPARATE
:
11121 CALL_BlendFuncSeparate(ctx
->Exec
,
11122 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11125 case OPCODE_BLEND_FUNC_I
:
11126 /* GL_ARB_draw_buffers_blend */
11127 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
11129 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11130 /* GL_ARB_draw_buffers_blend */
11131 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
11134 case OPCODE_BLEND_EQUATION_I
:
11135 /* GL_ARB_draw_buffers_blend */
11136 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11138 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11139 /* GL_ARB_draw_buffers_blend */
11140 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
11141 (n
[1].ui
, n
[2].e
, n
[3].e
));
11144 case OPCODE_CALL_LIST
:
11145 /* Generated by glCallList(), don't add ListBase */
11146 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11147 execute_list(ctx
, n
[1].ui
);
11150 case OPCODE_CALL_LISTS
:
11151 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11152 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
11156 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
11158 case OPCODE_CLEAR_BUFFER_IV
:
11165 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11168 case OPCODE_CLEAR_BUFFER_UIV
:
11171 value
[0] = n
[3].ui
;
11172 value
[1] = n
[4].ui
;
11173 value
[2] = n
[5].ui
;
11174 value
[3] = n
[6].ui
;
11175 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11178 case OPCODE_CLEAR_BUFFER_FV
:
11185 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11188 case OPCODE_CLEAR_BUFFER_FI
:
11189 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
11191 case OPCODE_CLEAR_COLOR
:
11192 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11194 case OPCODE_CLEAR_ACCUM
:
11195 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11197 case OPCODE_CLEAR_DEPTH
:
11198 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
11200 case OPCODE_CLEAR_INDEX
:
11201 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
11203 case OPCODE_CLEAR_STENCIL
:
11204 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
11206 case OPCODE_CLIP_PLANE
:
11213 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
11216 case OPCODE_COLOR_MASK
:
11217 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
11219 case OPCODE_COLOR_MASK_INDEXED
:
11220 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
11223 case OPCODE_COLOR_MATERIAL
:
11224 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11226 case OPCODE_COPY_PIXELS
:
11227 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11228 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
11231 case OPCODE_COPY_TEX_IMAGE1D
:
11232 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11233 n
[5].i
, n
[6].i
, n
[7].i
));
11235 case OPCODE_COPY_TEX_IMAGE2D
:
11236 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11237 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
11239 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
11240 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11241 n
[4].i
, n
[5].i
, n
[6].i
));
11243 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
11244 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11245 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11248 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
11249 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11250 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11253 case OPCODE_CULL_FACE
:
11254 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
11256 case OPCODE_DEPTH_FUNC
:
11257 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
11259 case OPCODE_DEPTH_MASK
:
11260 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
11262 case OPCODE_DEPTH_RANGE
:
11263 CALL_DepthRange(ctx
->Exec
,
11264 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
11266 case OPCODE_DISABLE
:
11267 CALL_Disable(ctx
->Exec
, (n
[1].e
));
11269 case OPCODE_DISABLE_INDEXED
:
11270 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11272 case OPCODE_DRAW_BUFFER
:
11273 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
11275 case OPCODE_DRAW_PIXELS
:
11277 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11278 ctx
->Unpack
= ctx
->DefaultPacking
;
11279 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
11280 get_pointer(&n
[5])));
11281 ctx
->Unpack
= save
; /* restore */
11284 case OPCODE_ENABLE
:
11285 CALL_Enable(ctx
->Exec
, (n
[1].e
));
11287 case OPCODE_ENABLE_INDEXED
:
11288 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11290 case OPCODE_EVALMESH1
:
11291 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
11293 case OPCODE_EVALMESH2
:
11294 CALL_EvalMesh2(ctx
->Exec
,
11295 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11304 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
11307 case OPCODE_FRONT_FACE
:
11308 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
11310 case OPCODE_FRUSTUM
:
11311 CALL_Frustum(ctx
->Exec
,
11312 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11315 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11317 case OPCODE_INDEX_MASK
:
11318 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
11320 case OPCODE_INIT_NAMES
:
11321 CALL_InitNames(ctx
->Exec
, ());
11330 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
11333 case OPCODE_LIGHT_MODEL
:
11340 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
11343 case OPCODE_LINE_STIPPLE
:
11344 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
11346 case OPCODE_LINE_WIDTH
:
11347 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
11349 case OPCODE_LIST_BASE
:
11350 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
11352 case OPCODE_LOAD_IDENTITY
:
11353 CALL_LoadIdentity(ctx
->Exec
, ());
11355 case OPCODE_LOAD_MATRIX
:
11356 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
11357 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
11359 case OPCODE_LOAD_NAME
:
11360 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
11362 case OPCODE_LOGIC_OP
:
11363 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
11367 GLenum target
= n
[1].e
;
11368 GLint ustride
= _mesa_evaluator_components(target
);
11369 GLint uorder
= n
[5].i
;
11370 GLfloat u1
= n
[2].f
;
11371 GLfloat u2
= n
[3].f
;
11372 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11373 (GLfloat
*) get_pointer(&n
[6])));
11378 GLenum target
= n
[1].e
;
11379 GLfloat u1
= n
[2].f
;
11380 GLfloat u2
= n
[3].f
;
11381 GLfloat v1
= n
[4].f
;
11382 GLfloat v2
= n
[5].f
;
11383 GLint ustride
= n
[6].i
;
11384 GLint vstride
= n
[7].i
;
11385 GLint uorder
= n
[8].i
;
11386 GLint vorder
= n
[9].i
;
11387 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11388 v1
, v2
, vstride
, vorder
,
11389 (GLfloat
*) get_pointer(&n
[10])));
11392 case OPCODE_MAPGRID1
:
11393 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11395 case OPCODE_MAPGRID2
:
11396 CALL_MapGrid2f(ctx
->Exec
,
11397 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
11399 case OPCODE_MATRIX_MODE
:
11400 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
11402 case OPCODE_MULT_MATRIX
:
11403 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
11406 CALL_Ortho(ctx
->Exec
,
11407 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11409 case OPCODE_PASSTHROUGH
:
11410 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
11412 case OPCODE_PATCH_PARAMETER_I
:
11413 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11415 case OPCODE_PATCH_PARAMETER_FV_INNER
:
11418 params
[0] = n
[2].f
;
11419 params
[1] = n
[3].f
;
11420 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11423 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
11426 params
[0] = n
[2].f
;
11427 params
[1] = n
[3].f
;
11428 params
[2] = n
[4].f
;
11429 params
[3] = n
[5].f
;
11430 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11433 case OPCODE_PIXEL_MAP
:
11434 CALL_PixelMapfv(ctx
->Exec
,
11435 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
11437 case OPCODE_PIXEL_TRANSFER
:
11438 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11440 case OPCODE_PIXEL_ZOOM
:
11441 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11443 case OPCODE_POINT_SIZE
:
11444 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
11446 case OPCODE_POINT_PARAMETERS
:
11449 params
[0] = n
[2].f
;
11450 params
[1] = n
[3].f
;
11451 params
[2] = n
[4].f
;
11452 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11455 case OPCODE_POLYGON_MODE
:
11456 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11458 case OPCODE_POLYGON_STIPPLE
:
11460 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11461 ctx
->Unpack
= ctx
->DefaultPacking
;
11462 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
11463 ctx
->Unpack
= save
; /* restore */
11466 case OPCODE_POLYGON_OFFSET
:
11467 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11469 case OPCODE_POLYGON_OFFSET_CLAMP
:
11470 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11472 case OPCODE_POP_ATTRIB
:
11473 CALL_PopAttrib(ctx
->Exec
, ());
11475 case OPCODE_POP_MATRIX
:
11476 CALL_PopMatrix(ctx
->Exec
, ());
11478 case OPCODE_POP_NAME
:
11479 CALL_PopName(ctx
->Exec
, ());
11481 case OPCODE_PRIORITIZE_TEXTURE
:
11482 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
11484 case OPCODE_PUSH_ATTRIB
:
11485 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
11487 case OPCODE_PUSH_MATRIX
:
11488 CALL_PushMatrix(ctx
->Exec
, ());
11490 case OPCODE_PUSH_NAME
:
11491 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
11493 case OPCODE_RASTER_POS
:
11494 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11496 case OPCODE_READ_BUFFER
:
11497 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
11499 case OPCODE_ROTATE
:
11500 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11503 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11505 case OPCODE_SCISSOR
:
11506 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11508 case OPCODE_SHADE_MODEL
:
11509 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
11511 case OPCODE_PROVOKING_VERTEX
:
11512 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
11514 case OPCODE_STENCIL_FUNC
:
11515 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
11517 case OPCODE_STENCIL_MASK
:
11518 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
11520 case OPCODE_STENCIL_OP
:
11521 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
11523 case OPCODE_STENCIL_FUNC_SEPARATE
:
11524 CALL_StencilFuncSeparate(ctx
->Exec
,
11525 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
11527 case OPCODE_STENCIL_MASK_SEPARATE
:
11528 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11530 case OPCODE_STENCIL_OP_SEPARATE
:
11531 CALL_StencilOpSeparate(ctx
->Exec
,
11532 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11534 case OPCODE_TEXENV
:
11537 params
[0] = n
[3].f
;
11538 params
[1] = n
[4].f
;
11539 params
[2] = n
[5].f
;
11540 params
[3] = n
[6].f
;
11541 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11544 case OPCODE_TEXGEN
:
11547 params
[0] = n
[3].f
;
11548 params
[1] = n
[4].f
;
11549 params
[2] = n
[5].f
;
11550 params
[3] = n
[6].f
;
11551 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11554 case OPCODE_TEXPARAMETER
:
11557 params
[0] = n
[3].f
;
11558 params
[1] = n
[4].f
;
11559 params
[2] = n
[5].f
;
11560 params
[3] = n
[6].f
;
11561 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11564 case OPCODE_TEX_IMAGE1D
:
11566 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11567 ctx
->Unpack
= ctx
->DefaultPacking
;
11568 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11569 n
[2].i
, /* level */
11570 n
[3].i
, /* components */
11571 n
[4].i
, /* width */
11572 n
[5].e
, /* border */
11573 n
[6].e
, /* format */
11575 get_pointer(&n
[8])));
11576 ctx
->Unpack
= save
; /* restore */
11579 case OPCODE_TEX_IMAGE2D
:
11581 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11582 ctx
->Unpack
= ctx
->DefaultPacking
;
11583 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11584 n
[2].i
, /* level */
11585 n
[3].i
, /* components */
11586 n
[4].i
, /* width */
11587 n
[5].i
, /* height */
11588 n
[6].e
, /* border */
11589 n
[7].e
, /* format */
11591 get_pointer(&n
[9])));
11592 ctx
->Unpack
= save
; /* restore */
11595 case OPCODE_TEX_IMAGE3D
:
11597 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11598 ctx
->Unpack
= ctx
->DefaultPacking
;
11599 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11600 n
[2].i
, /* level */
11601 n
[3].i
, /* components */
11602 n
[4].i
, /* width */
11603 n
[5].i
, /* height */
11604 n
[6].i
, /* depth */
11605 n
[7].e
, /* border */
11606 n
[8].e
, /* format */
11608 get_pointer(&n
[10])));
11609 ctx
->Unpack
= save
; /* restore */
11612 case OPCODE_TEX_SUB_IMAGE1D
:
11614 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11615 ctx
->Unpack
= ctx
->DefaultPacking
;
11616 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11618 n
[6].e
, get_pointer(&n
[7])));
11619 ctx
->Unpack
= save
; /* restore */
11622 case OPCODE_TEX_SUB_IMAGE2D
:
11624 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11625 ctx
->Unpack
= ctx
->DefaultPacking
;
11626 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11628 n
[6].i
, n
[7].e
, n
[8].e
,
11629 get_pointer(&n
[9])));
11630 ctx
->Unpack
= save
; /* restore */
11633 case OPCODE_TEX_SUB_IMAGE3D
:
11635 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11636 ctx
->Unpack
= ctx
->DefaultPacking
;
11637 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11638 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11639 n
[8].i
, n
[9].e
, n
[10].e
,
11640 get_pointer(&n
[11])));
11641 ctx
->Unpack
= save
; /* restore */
11644 case OPCODE_TRANSLATE
:
11645 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11647 case OPCODE_VIEWPORT
:
11648 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11649 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11651 case OPCODE_WINDOW_POS
:
11652 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11654 case OPCODE_VIEWPORT_ARRAY_V
:
11655 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11656 get_pointer(&n
[3])));
11658 case OPCODE_VIEWPORT_INDEXED_F
:
11659 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11662 case OPCODE_VIEWPORT_INDEXED_FV
: {
11668 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11671 case OPCODE_SCISSOR_ARRAY_V
:
11672 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11673 get_pointer(&n
[3])));
11675 case OPCODE_SCISSOR_INDEXED
:
11676 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11679 case OPCODE_SCISSOR_INDEXED_V
: {
11685 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11688 case OPCODE_DEPTH_ARRAY_V
:
11689 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11690 get_pointer(&n
[3])));
11692 case OPCODE_DEPTH_INDEXED
:
11693 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11695 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11696 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11698 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11699 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11700 n
[4].i
, n
[5].i
, n
[6].i
,
11701 get_pointer(&n
[7])));
11703 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11704 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11705 n
[4].i
, n
[5].i
, n
[6].i
,
11706 n
[7].i
, get_pointer(&n
[8])));
11708 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11709 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11710 n
[4].i
, n
[5].i
, n
[6].i
,
11712 get_pointer(&n
[9])));
11714 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11715 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11716 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11718 get_pointer(&n
[7])));
11720 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
11721 CALL_CompressedTexSubImage2D(ctx
->Exec
,
11722 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11723 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
11724 get_pointer(&n
[9])));
11726 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
11727 CALL_CompressedTexSubImage3D(ctx
->Exec
,
11728 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11729 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11731 get_pointer(&n
[11])));
11733 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
11734 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
11736 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
11737 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11739 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
11740 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11742 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
11743 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
11744 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
11747 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
11748 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
11750 case OPCODE_DEPTH_BOUNDS_EXT
:
11751 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11753 case OPCODE_PROGRAM_STRING_ARB
:
11754 CALL_ProgramStringARB(ctx
->Exec
,
11755 (n
[1].e
, n
[2].e
, n
[3].i
,
11756 get_pointer(&n
[4])));
11758 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
11759 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
11763 case OPCODE_BEGIN_QUERY_ARB
:
11764 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11766 case OPCODE_END_QUERY_ARB
:
11767 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
11769 case OPCODE_QUERY_COUNTER
:
11770 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11772 case OPCODE_BEGIN_QUERY_INDEXED
:
11773 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11775 case OPCODE_END_QUERY_INDEXED
:
11776 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11778 case OPCODE_DRAW_BUFFERS_ARB
:
11780 GLenum buffers
[MAX_DRAW_BUFFERS
];
11781 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11782 for (i
= 0; i
< count
; i
++)
11783 buffers
[i
] = n
[2 + i
].e
;
11784 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11787 case OPCODE_BLIT_FRAMEBUFFER
:
11788 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11789 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11792 case OPCODE_PRIMITIVE_RESTART_NV
:
11793 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11796 case OPCODE_USE_PROGRAM
:
11797 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11799 case OPCODE_UNIFORM_1F
:
11800 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11802 case OPCODE_UNIFORM_2F
:
11803 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11805 case OPCODE_UNIFORM_3F
:
11806 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11808 case OPCODE_UNIFORM_4F
:
11809 CALL_Uniform4f(ctx
->Exec
,
11810 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11812 case OPCODE_UNIFORM_1FV
:
11813 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11815 case OPCODE_UNIFORM_2FV
:
11816 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11818 case OPCODE_UNIFORM_3FV
:
11819 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11821 case OPCODE_UNIFORM_4FV
:
11822 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11824 case OPCODE_UNIFORM_1D
: {
11825 union float64_pair x
;
11827 x
.uint32
[0] = n
[2].ui
;
11828 x
.uint32
[1] = n
[3].ui
;
11830 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11833 case OPCODE_UNIFORM_2D
: {
11834 union float64_pair x
;
11835 union float64_pair y
;
11837 x
.uint32
[0] = n
[2].ui
;
11838 x
.uint32
[1] = n
[3].ui
;
11839 y
.uint32
[0] = n
[4].ui
;
11840 y
.uint32
[1] = n
[5].ui
;
11842 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11845 case OPCODE_UNIFORM_3D
: {
11846 union float64_pair x
;
11847 union float64_pair y
;
11848 union float64_pair z
;
11850 x
.uint32
[0] = n
[2].ui
;
11851 x
.uint32
[1] = n
[3].ui
;
11852 y
.uint32
[0] = n
[4].ui
;
11853 y
.uint32
[1] = n
[5].ui
;
11854 z
.uint32
[0] = n
[6].ui
;
11855 z
.uint32
[1] = n
[7].ui
;
11857 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11860 case OPCODE_UNIFORM_4D
: {
11861 union float64_pair x
;
11862 union float64_pair y
;
11863 union float64_pair z
;
11864 union float64_pair w
;
11866 x
.uint32
[0] = n
[2].ui
;
11867 x
.uint32
[1] = n
[3].ui
;
11868 y
.uint32
[0] = n
[4].ui
;
11869 y
.uint32
[1] = n
[5].ui
;
11870 z
.uint32
[0] = n
[6].ui
;
11871 z
.uint32
[1] = n
[7].ui
;
11872 w
.uint32
[0] = n
[8].ui
;
11873 w
.uint32
[1] = n
[9].ui
;
11875 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11878 case OPCODE_UNIFORM_1DV
:
11879 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11881 case OPCODE_UNIFORM_2DV
:
11882 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11884 case OPCODE_UNIFORM_3DV
:
11885 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11887 case OPCODE_UNIFORM_4DV
:
11888 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11890 case OPCODE_UNIFORM_1I
:
11891 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11893 case OPCODE_UNIFORM_2I
:
11894 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11896 case OPCODE_UNIFORM_3I
:
11897 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11899 case OPCODE_UNIFORM_4I
:
11900 CALL_Uniform4i(ctx
->Exec
,
11901 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11903 case OPCODE_UNIFORM_1IV
:
11904 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11906 case OPCODE_UNIFORM_2IV
:
11907 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11909 case OPCODE_UNIFORM_3IV
:
11910 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11912 case OPCODE_UNIFORM_4IV
:
11913 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11915 case OPCODE_UNIFORM_1UI
:
11916 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11918 case OPCODE_UNIFORM_2UI
:
11919 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11921 case OPCODE_UNIFORM_3UI
:
11922 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11924 case OPCODE_UNIFORM_4UI
:
11925 CALL_Uniform4ui(ctx
->Exec
,
11926 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11928 case OPCODE_UNIFORM_1UIV
:
11929 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11931 case OPCODE_UNIFORM_2UIV
:
11932 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11934 case OPCODE_UNIFORM_3UIV
:
11935 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11937 case OPCODE_UNIFORM_4UIV
:
11938 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11940 case OPCODE_UNIFORM_MATRIX22
:
11941 CALL_UniformMatrix2fv(ctx
->Exec
,
11942 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11944 case OPCODE_UNIFORM_MATRIX33
:
11945 CALL_UniformMatrix3fv(ctx
->Exec
,
11946 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11948 case OPCODE_UNIFORM_MATRIX44
:
11949 CALL_UniformMatrix4fv(ctx
->Exec
,
11950 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11952 case OPCODE_UNIFORM_MATRIX23
:
11953 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11954 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11956 case OPCODE_UNIFORM_MATRIX32
:
11957 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11958 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11960 case OPCODE_UNIFORM_MATRIX24
:
11961 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11962 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11964 case OPCODE_UNIFORM_MATRIX42
:
11965 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11966 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11968 case OPCODE_UNIFORM_MATRIX34
:
11969 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11970 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11972 case OPCODE_UNIFORM_MATRIX43
:
11973 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11974 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11976 case OPCODE_UNIFORM_MATRIX22D
:
11977 CALL_UniformMatrix2dv(ctx
->Exec
,
11978 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11980 case OPCODE_UNIFORM_MATRIX33D
:
11981 CALL_UniformMatrix3dv(ctx
->Exec
,
11982 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11984 case OPCODE_UNIFORM_MATRIX44D
:
11985 CALL_UniformMatrix4dv(ctx
->Exec
,
11986 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11988 case OPCODE_UNIFORM_MATRIX23D
:
11989 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11990 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11992 case OPCODE_UNIFORM_MATRIX32D
:
11993 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11994 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11996 case OPCODE_UNIFORM_MATRIX24D
:
11997 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11998 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12000 case OPCODE_UNIFORM_MATRIX42D
:
12001 CALL_UniformMatrix4x2dv(ctx
->Exec
,
12002 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12004 case OPCODE_UNIFORM_MATRIX34D
:
12005 CALL_UniformMatrix3x4dv(ctx
->Exec
,
12006 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12008 case OPCODE_UNIFORM_MATRIX43D
:
12009 CALL_UniformMatrix4x3dv(ctx
->Exec
,
12010 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12013 case OPCODE_USE_PROGRAM_STAGES
:
12014 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12016 case OPCODE_PROGRAM_UNIFORM_1F
:
12017 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
12019 case OPCODE_PROGRAM_UNIFORM_2F
:
12020 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
12022 case OPCODE_PROGRAM_UNIFORM_3F
:
12023 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12024 n
[3].f
, n
[4].f
, n
[5].f
));
12026 case OPCODE_PROGRAM_UNIFORM_4F
:
12027 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12028 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12030 case OPCODE_PROGRAM_UNIFORM_1FV
:
12031 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12032 get_pointer(&n
[4])));
12034 case OPCODE_PROGRAM_UNIFORM_2FV
:
12035 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12036 get_pointer(&n
[4])));
12038 case OPCODE_PROGRAM_UNIFORM_3FV
:
12039 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12040 get_pointer(&n
[4])));
12042 case OPCODE_PROGRAM_UNIFORM_4FV
:
12043 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12044 get_pointer(&n
[4])));
12046 case OPCODE_PROGRAM_UNIFORM_1D
: {
12047 union float64_pair x
;
12049 x
.uint32
[0] = n
[3].ui
;
12050 x
.uint32
[1] = n
[4].ui
;
12052 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
12055 case OPCODE_PROGRAM_UNIFORM_2D
: {
12056 union float64_pair x
;
12057 union float64_pair y
;
12059 x
.uint32
[0] = n
[3].ui
;
12060 x
.uint32
[1] = n
[4].ui
;
12061 y
.uint32
[0] = n
[5].ui
;
12062 y
.uint32
[1] = n
[6].ui
;
12064 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
12067 case OPCODE_PROGRAM_UNIFORM_3D
: {
12068 union float64_pair x
;
12069 union float64_pair y
;
12070 union float64_pair z
;
12072 x
.uint32
[0] = n
[3].ui
;
12073 x
.uint32
[1] = n
[4].ui
;
12074 y
.uint32
[0] = n
[5].ui
;
12075 y
.uint32
[1] = n
[6].ui
;
12076 z
.uint32
[0] = n
[7].ui
;
12077 z
.uint32
[1] = n
[8].ui
;
12079 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12083 case OPCODE_PROGRAM_UNIFORM_4D
: {
12084 union float64_pair x
;
12085 union float64_pair y
;
12086 union float64_pair z
;
12087 union float64_pair w
;
12089 x
.uint32
[0] = n
[3].ui
;
12090 x
.uint32
[1] = n
[4].ui
;
12091 y
.uint32
[0] = n
[5].ui
;
12092 y
.uint32
[1] = n
[6].ui
;
12093 z
.uint32
[0] = n
[7].ui
;
12094 z
.uint32
[1] = n
[8].ui
;
12095 w
.uint32
[0] = n
[9].ui
;
12096 w
.uint32
[1] = n
[10].ui
;
12098 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12099 x
.d
, y
.d
, z
.d
, w
.d
));
12102 case OPCODE_PROGRAM_UNIFORM_1DV
:
12103 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12104 get_pointer(&n
[4])));
12106 case OPCODE_PROGRAM_UNIFORM_2DV
:
12107 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12108 get_pointer(&n
[4])));
12110 case OPCODE_PROGRAM_UNIFORM_3DV
:
12111 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12112 get_pointer(&n
[4])));
12114 case OPCODE_PROGRAM_UNIFORM_4DV
:
12115 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12116 get_pointer(&n
[4])));
12118 case OPCODE_PROGRAM_UNIFORM_1I
:
12119 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
12121 case OPCODE_PROGRAM_UNIFORM_2I
:
12122 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
12124 case OPCODE_PROGRAM_UNIFORM_3I
:
12125 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12126 n
[3].i
, n
[4].i
, n
[5].i
));
12128 case OPCODE_PROGRAM_UNIFORM_4I
:
12129 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12130 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
12132 case OPCODE_PROGRAM_UNIFORM_1IV
:
12133 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12134 get_pointer(&n
[4])));
12136 case OPCODE_PROGRAM_UNIFORM_2IV
:
12137 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12138 get_pointer(&n
[4])));
12140 case OPCODE_PROGRAM_UNIFORM_3IV
:
12141 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12142 get_pointer(&n
[4])));
12144 case OPCODE_PROGRAM_UNIFORM_4IV
:
12145 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12146 get_pointer(&n
[4])));
12148 case OPCODE_PROGRAM_UNIFORM_1UI
:
12149 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
12151 case OPCODE_PROGRAM_UNIFORM_2UI
:
12152 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12153 n
[3].ui
, n
[4].ui
));
12155 case OPCODE_PROGRAM_UNIFORM_3UI
:
12156 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12157 n
[3].ui
, n
[4].ui
, n
[5].ui
));
12159 case OPCODE_PROGRAM_UNIFORM_4UI
:
12160 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12162 n
[4].ui
, n
[5].ui
, n
[6].ui
));
12164 case OPCODE_PROGRAM_UNIFORM_1UIV
:
12165 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12166 get_pointer(&n
[4])));
12168 case OPCODE_PROGRAM_UNIFORM_2UIV
:
12169 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12170 get_pointer(&n
[4])));
12172 case OPCODE_PROGRAM_UNIFORM_3UIV
:
12173 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12174 get_pointer(&n
[4])));
12176 case OPCODE_PROGRAM_UNIFORM_4UIV
:
12177 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12178 get_pointer(&n
[4])));
12180 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
12181 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
12182 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12183 get_pointer(&n
[5])));
12185 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
12186 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
12187 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12188 get_pointer(&n
[5])));
12190 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
12191 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
12192 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12193 get_pointer(&n
[5])));
12195 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
12196 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
12197 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12198 get_pointer(&n
[5])));
12200 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
12201 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
12202 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12203 get_pointer(&n
[5])));
12205 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
12206 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
12207 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12208 get_pointer(&n
[5])));
12210 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
12211 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
12212 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12213 get_pointer(&n
[5])));
12215 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
12216 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
12217 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12218 get_pointer(&n
[5])));
12220 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
12221 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
12222 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12223 get_pointer(&n
[5])));
12225 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
12226 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
12227 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12228 get_pointer(&n
[5])));
12230 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
12231 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
12232 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12233 get_pointer(&n
[5])));
12235 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
12236 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
12237 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12238 get_pointer(&n
[5])));
12240 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
12241 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
12242 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12243 get_pointer(&n
[5])));
12245 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
12246 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
12247 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12248 get_pointer(&n
[5])));
12250 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
12251 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
12252 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12253 get_pointer(&n
[5])));
12255 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
12256 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
12257 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12258 get_pointer(&n
[5])));
12260 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
12261 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
12262 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12263 get_pointer(&n
[5])));
12265 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
12266 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
12267 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12268 get_pointer(&n
[5])));
12271 case OPCODE_CLIP_CONTROL
:
12272 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12275 case OPCODE_CLAMP_COLOR
:
12276 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12279 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
12280 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
12282 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
12283 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
12285 case OPCODE_ATTR_1F_NV
:
12286 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12288 case OPCODE_ATTR_2F_NV
:
12289 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12291 case OPCODE_ATTR_3F_NV
:
12292 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12294 case OPCODE_ATTR_4F_NV
:
12295 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12297 case OPCODE_ATTR_1F_ARB
:
12298 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12300 case OPCODE_ATTR_2F_ARB
:
12301 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12303 case OPCODE_ATTR_3F_ARB
:
12304 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12306 case OPCODE_ATTR_4F_ARB
:
12307 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12309 case OPCODE_ATTR_1D
: {
12310 GLdouble
*d
= (GLdouble
*) &n
[2];
12311 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
12314 case OPCODE_ATTR_2D
: {
12315 GLdouble
*d
= (GLdouble
*) &n
[2];
12316 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
12319 case OPCODE_ATTR_3D
: {
12320 GLdouble
*d
= (GLdouble
*) &n
[2];
12321 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
12324 case OPCODE_ATTR_4D
: {
12325 GLdouble
*d
= (GLdouble
*) &n
[2];
12326 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
12329 case OPCODE_MATERIAL
:
12330 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
12333 CALL_Begin(ctx
->Exec
, (n
[1].e
));
12336 CALL_End(ctx
->Exec
, ());
12339 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12341 case OPCODE_EVAL_C1
:
12342 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
12344 case OPCODE_EVAL_C2
:
12345 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12347 case OPCODE_EVAL_P1
:
12348 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
12350 case OPCODE_EVAL_P2
:
12351 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12354 /* GL_EXT_texture_integer */
12355 case OPCODE_CLEARCOLOR_I
:
12356 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12358 case OPCODE_CLEARCOLOR_UI
:
12359 CALL_ClearColorIuiEXT(ctx
->Exec
,
12360 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
12362 case OPCODE_TEXPARAMETER_I
:
12365 params
[0] = n
[3].i
;
12366 params
[1] = n
[4].i
;
12367 params
[2] = n
[5].i
;
12368 params
[3] = n
[6].i
;
12369 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12372 case OPCODE_TEXPARAMETER_UI
:
12375 params
[0] = n
[3].ui
;
12376 params
[1] = n
[4].ui
;
12377 params
[2] = n
[5].ui
;
12378 params
[3] = n
[6].ui
;
12379 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12383 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
12384 /* GL_ARB_instanced_arrays */
12385 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12388 case OPCODE_TEXTURE_BARRIER_NV
:
12389 CALL_TextureBarrierNV(ctx
->Exec
, ());
12392 /* GL_EXT/ARB_transform_feedback */
12393 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
12394 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
12396 case OPCODE_END_TRANSFORM_FEEDBACK
:
12397 CALL_EndTransformFeedback(ctx
->Exec
, ());
12399 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
12400 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12402 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
12403 CALL_PauseTransformFeedback(ctx
->Exec
, ());
12405 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
12406 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
12408 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
12409 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12411 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
12412 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
12413 (n
[1].e
, n
[2].ui
, n
[3].ui
));
12415 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
12416 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
12417 (n
[1].e
, n
[2].ui
, n
[3].si
));
12419 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
12420 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
12421 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
12425 case OPCODE_BIND_SAMPLER
:
12426 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12428 case OPCODE_SAMPLER_PARAMETERIV
:
12431 params
[0] = n
[3].i
;
12432 params
[1] = n
[4].i
;
12433 params
[2] = n
[5].i
;
12434 params
[3] = n
[6].i
;
12435 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12438 case OPCODE_SAMPLER_PARAMETERFV
:
12441 params
[0] = n
[3].f
;
12442 params
[1] = n
[4].f
;
12443 params
[2] = n
[5].f
;
12444 params
[3] = n
[6].f
;
12445 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12448 case OPCODE_SAMPLER_PARAMETERIIV
:
12451 params
[0] = n
[3].i
;
12452 params
[1] = n
[4].i
;
12453 params
[2] = n
[5].i
;
12454 params
[3] = n
[6].i
;
12455 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12458 case OPCODE_SAMPLER_PARAMETERUIV
:
12461 params
[0] = n
[3].ui
;
12462 params
[1] = n
[4].ui
;
12463 params
[2] = n
[5].ui
;
12464 params
[3] = n
[6].ui
;
12465 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12469 /* ARB_compute_shader */
12470 case OPCODE_DISPATCH_COMPUTE
:
12471 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12475 case OPCODE_WAIT_SYNC
:
12477 union uint64_pair p
;
12478 p
.uint32
[0] = n
[2].ui
;
12479 p
.uint32
[1] = n
[3].ui
;
12480 CALL_WaitSync(ctx
->Exec
,
12481 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
12485 /* GL_NV_conditional_render */
12486 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
12487 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
12489 case OPCODE_END_CONDITIONAL_RENDER
:
12490 CALL_EndConditionalRender(ctx
->Exec
, ());
12493 case OPCODE_UNIFORM_BLOCK_BINDING
:
12494 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12497 case OPCODE_UNIFORM_SUBROUTINES
:
12498 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
12499 get_pointer(&n
[3])));
12502 /* GL_EXT_window_rectangles */
12503 case OPCODE_WINDOW_RECTANGLES
:
12504 CALL_WindowRectanglesEXT(
12505 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
12508 /* GL_NV_conservative_raster */
12509 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
12510 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12513 /* GL_NV_conservative_raster_dilate */
12514 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
12515 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12518 /* GL_NV_conservative_raster_pre_snap_triangles */
12519 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
12520 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12523 /* GL_EXT_direct_state_access */
12524 case OPCODE_MATRIX_LOAD
:
12525 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12527 case OPCODE_MATRIX_MULT
:
12528 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12530 case OPCODE_MATRIX_ROTATE
:
12531 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12533 case OPCODE_MATRIX_SCALE
:
12534 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12536 case OPCODE_MATRIX_TRANSLATE
:
12537 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12539 case OPCODE_MATRIX_LOAD_IDENTITY
:
12540 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
12542 case OPCODE_MATRIX_ORTHO
:
12543 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
12544 n
[2].f
, n
[3].f
, n
[4].f
,
12545 n
[5].f
, n
[6].f
, n
[7].f
));
12547 case OPCODE_MATRIX_FRUSTUM
:
12548 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
12549 n
[2].f
, n
[3].f
, n
[4].f
,
12550 n
[5].f
, n
[6].f
, n
[7].f
));
12552 case OPCODE_MATRIX_PUSH
:
12553 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
12555 case OPCODE_MATRIX_POP
:
12556 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
12558 case OPCODE_TEXTUREPARAMETER_F
:
12561 params
[0] = n
[4].f
;
12562 params
[1] = n
[5].f
;
12563 params
[2] = n
[6].f
;
12564 params
[3] = n
[7].f
;
12565 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12568 case OPCODE_TEXTUREPARAMETER_I
:
12571 params
[0] = n
[4].i
;
12572 params
[1] = n
[5].i
;
12573 params
[2] = n
[6].i
;
12574 params
[3] = n
[7].i
;
12575 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12578 case OPCODE_TEXTURE_IMAGE1D
:
12580 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12581 ctx
->Unpack
= ctx
->DefaultPacking
;
12582 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12583 n
[2].e
, /* target */
12584 n
[3].i
, /* level */
12585 n
[4].i
, /* components */
12586 n
[5].i
, /* width */
12587 n
[6].e
, /* border */
12588 n
[7].e
, /* format */
12590 get_pointer(&n
[9])));
12591 ctx
->Unpack
= save
; /* restore */
12594 case OPCODE_TEXTURE_IMAGE2D
:
12596 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12597 ctx
->Unpack
= ctx
->DefaultPacking
;
12598 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12599 n
[2].e
, /* target */
12600 n
[3].i
, /* level */
12601 n
[4].i
, /* components */
12602 n
[5].i
, /* width */
12603 n
[6].i
, /* height */
12604 n
[7].e
, /* border */
12605 n
[8].e
, /* format */
12607 get_pointer(&n
[10])));
12608 ctx
->Unpack
= save
; /* restore */
12611 case OPCODE_TEXTURE_IMAGE3D
:
12613 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12614 ctx
->Unpack
= ctx
->DefaultPacking
;
12615 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12616 n
[2].e
, /* target */
12617 n
[3].i
, /* level */
12618 n
[4].i
, /* components */
12619 n
[5].i
, /* width */
12620 n
[6].i
, /* height */
12621 n
[7].i
, /* depth */
12622 n
[8].e
, /* border */
12623 n
[9].e
, /* format */
12624 n
[10].e
, /* type */
12625 get_pointer(&n
[11])));
12626 ctx
->Unpack
= save
; /* restore */
12629 case OPCODE_TEXTURE_SUB_IMAGE1D
:
12631 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12632 ctx
->Unpack
= ctx
->DefaultPacking
;
12633 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12634 n
[4].i
, n
[5].i
, n
[6].e
,
12635 n
[7].e
, get_pointer(&n
[8])));
12636 ctx
->Unpack
= save
; /* restore */
12639 case OPCODE_TEXTURE_SUB_IMAGE2D
:
12641 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12642 ctx
->Unpack
= ctx
->DefaultPacking
;
12643 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12644 n
[4].i
, n
[5].i
, n
[6].e
,
12645 n
[7].i
, n
[8].e
, n
[9].e
,
12646 get_pointer(&n
[10])));
12647 ctx
->Unpack
= save
;
12650 case OPCODE_TEXTURE_SUB_IMAGE3D
:
12652 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12653 ctx
->Unpack
= ctx
->DefaultPacking
;
12654 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12655 n
[4].i
, n
[5].i
, n
[6].i
,
12656 n
[7].i
, n
[8].i
, n
[9].i
,
12658 get_pointer(&n
[12])));
12659 ctx
->Unpack
= save
; /* restore */
12662 case OPCODE_COPY_TEXTURE_IMAGE1D
:
12663 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12664 n
[4].e
, n
[5].i
, n
[6].i
,
12667 case OPCODE_COPY_TEXTURE_IMAGE2D
:
12668 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12669 n
[4].e
, n
[5].i
, n
[6].i
,
12670 n
[7].i
, n
[8].i
, n
[9].i
));
12672 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
12673 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12674 n
[4].i
, n
[5].i
, n
[6].i
,
12677 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
12678 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12679 n
[4].i
, n
[5].i
, n
[6].i
,
12680 n
[7].i
, n
[8].i
, n
[9].i
));
12682 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
12683 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12684 n
[4].i
, n
[5].i
, n
[6].i
,
12685 n
[7].i
, n
[8].i
, n
[9].i
,
12688 case OPCODE_BIND_MULTITEXTURE
:
12689 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
12691 case OPCODE_MULTITEXPARAMETER_F
:
12694 params
[0] = n
[4].f
;
12695 params
[1] = n
[5].f
;
12696 params
[2] = n
[6].f
;
12697 params
[3] = n
[7].f
;
12698 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12701 case OPCODE_MULTITEXPARAMETER_I
:
12704 params
[0] = n
[4].i
;
12705 params
[1] = n
[5].i
;
12706 params
[2] = n
[6].i
;
12707 params
[3] = n
[7].i
;
12708 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12711 case OPCODE_MULTITEX_IMAGE1D
:
12713 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12714 ctx
->Unpack
= ctx
->DefaultPacking
;
12715 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12716 n
[2].e
, /* target */
12717 n
[3].i
, /* level */
12718 n
[4].i
, /* components */
12719 n
[5].i
, /* width */
12720 n
[6].e
, /* border */
12721 n
[7].e
, /* format */
12723 get_pointer(&n
[9])));
12724 ctx
->Unpack
= save
; /* restore */
12727 case OPCODE_MULTITEX_IMAGE2D
:
12729 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12730 ctx
->Unpack
= ctx
->DefaultPacking
;
12731 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12732 n
[2].e
, /* target */
12733 n
[3].i
, /* level */
12734 n
[4].i
, /* components */
12735 n
[5].i
, /* width */
12736 n
[6].i
, /* height */
12737 n
[7].e
, /* border */
12738 n
[8].e
, /* format */
12740 get_pointer(&n
[10])));
12741 ctx
->Unpack
= save
; /* restore */
12744 case OPCODE_MULTITEX_IMAGE3D
:
12746 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12747 ctx
->Unpack
= ctx
->DefaultPacking
;
12748 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12749 n
[2].e
, /* target */
12750 n
[3].i
, /* level */
12751 n
[4].i
, /* components */
12752 n
[5].i
, /* width */
12753 n
[6].i
, /* height */
12754 n
[7].i
, /* depth */
12755 n
[8].e
, /* border */
12756 n
[9].e
, /* format */
12757 n
[10].e
, /* type */
12758 get_pointer(&n
[11])));
12759 ctx
->Unpack
= save
; /* restore */
12762 case OPCODE_MULTITEX_SUB_IMAGE1D
:
12764 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12765 ctx
->Unpack
= ctx
->DefaultPacking
;
12766 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12767 n
[4].i
, n
[5].i
, n
[6].e
,
12768 n
[7].e
, get_pointer(&n
[8])));
12769 ctx
->Unpack
= save
; /* restore */
12772 case OPCODE_MULTITEX_SUB_IMAGE2D
:
12774 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12775 ctx
->Unpack
= ctx
->DefaultPacking
;
12776 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12777 n
[4].i
, n
[5].i
, n
[6].e
,
12778 n
[7].i
, n
[8].e
, n
[9].e
,
12779 get_pointer(&n
[10])));
12780 ctx
->Unpack
= save
; /* restore */
12783 case OPCODE_MULTITEX_SUB_IMAGE3D
:
12785 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12786 ctx
->Unpack
= ctx
->DefaultPacking
;
12787 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12788 n
[4].i
, n
[5].i
, n
[6].i
,
12789 n
[7].i
, n
[8].i
, n
[9].i
,
12791 get_pointer(&n
[12])));
12792 ctx
->Unpack
= save
; /* restore */
12795 case OPCODE_COPY_MULTITEX_IMAGE1D
:
12796 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12797 n
[4].e
, n
[5].i
, n
[6].i
,
12800 case OPCODE_COPY_MULTITEX_IMAGE2D
:
12801 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12802 n
[4].e
, n
[5].i
, n
[6].i
,
12803 n
[7].i
, n
[8].i
, n
[9].i
));
12805 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
12806 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12807 n
[4].i
, n
[5].i
, n
[6].i
,
12810 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
12811 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12812 n
[4].i
, n
[5].i
, n
[6].i
,
12813 n
[7].i
, n
[8].i
, n
[9].i
));
12815 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
12816 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12817 n
[4].i
, n
[5].i
, n
[6].i
,
12818 n
[7].i
, n
[8].i
, n
[9].i
,
12821 case OPCODE_MULTITEXENV
:
12824 params
[0] = n
[4].f
;
12825 params
[1] = n
[5].f
;
12826 params
[2] = n
[6].f
;
12827 params
[3] = n
[7].f
;
12828 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12831 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
12832 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12833 n
[4].e
, n
[5].i
, n
[6].i
,
12834 n
[7].i
, get_pointer(&n
[8])));
12836 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
12837 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12838 n
[4].e
, n
[5].i
, n
[6].i
,
12840 get_pointer(&n
[9])));
12842 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
12843 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12844 n
[4].e
, n
[5].i
, n
[6].i
,
12845 n
[7].i
, n
[8].i
, n
[9].i
,
12846 get_pointer(&n
[10])));
12848 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
12849 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
12850 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12851 n
[5].i
, n
[6].e
, n
[7].i
,
12852 get_pointer(&n
[8])));
12854 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
12855 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
12856 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12857 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12858 n
[9].i
, get_pointer(&n
[10])));
12860 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
12861 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
12862 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12863 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12864 n
[9].i
, n
[10].e
, n
[11].i
,
12865 get_pointer(&n
[12])));
12867 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
12868 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12869 n
[4].e
, n
[5].i
, n
[6].i
,
12870 n
[7].i
, get_pointer(&n
[8])));
12872 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
12873 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12874 n
[4].e
, n
[5].i
, n
[6].i
,
12876 get_pointer(&n
[9])));
12878 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
12879 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12880 n
[4].e
, n
[5].i
, n
[6].i
,
12881 n
[7].i
, n
[8].i
, n
[9].i
,
12882 get_pointer(&n
[10])));
12884 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
12885 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
,
12886 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
12887 n
[5].i
, n
[6].e
, n
[7].i
,
12888 get_pointer(&n
[8])));
12890 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
12891 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
12892 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
12893 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12894 n
[9].i
, get_pointer(&n
[10])));
12896 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
12897 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
12898 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
12899 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12900 n
[9].i
, n
[10].e
, n
[11].i
,
12901 get_pointer(&n
[12])));
12903 case OPCODE_NAMED_PROGRAM_STRING
:
12904 CALL_NamedProgramStringEXT(ctx
->Exec
,
12905 (n
[1].ui
, n
[2].e
, n
[3].e
, n
[4].i
,
12906 get_pointer(&n
[5])));
12908 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
:
12909 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
,
12910 (n
[1].ui
, n
[2].e
, n
[3].ui
, n
[4].f
,
12911 n
[5].f
, n
[6].f
, n
[7].f
));
12914 case OPCODE_CONTINUE
:
12915 n
= (Node
*) get_pointer(&n
[1]);
12920 case OPCODE_END_OF_LIST
:
12926 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
12928 _mesa_problem(ctx
, "%s", msg
);
12933 /* increment n to point to next compiled command */
12934 if (opcode
!= OPCODE_CONTINUE
) {
12935 assert(InstSize
[opcode
] > 0);
12936 n
+= InstSize
[opcode
];
12941 vbo_save_EndCallList(ctx
);
12943 ctx
->ListState
.CallDepth
--;
12948 /**********************************************************************/
12950 /**********************************************************************/
12953 * Test if a display list number is valid.
12955 GLboolean GLAPIENTRY
12956 _mesa_IsList(GLuint list
)
12958 GET_CURRENT_CONTEXT(ctx
);
12959 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12960 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
12961 return islist(ctx
, list
);
12966 * Delete a sequence of consecutive display lists.
12969 _mesa_DeleteLists(GLuint list
, GLsizei range
)
12971 GET_CURRENT_CONTEXT(ctx
);
12973 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12974 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12977 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
12982 /* We may be deleting a set of bitmap lists. See if there's a
12983 * bitmap atlas to free.
12985 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
12987 _mesa_delete_bitmap_atlas(ctx
, atlas
);
12988 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
12992 for (i
= list
; i
< list
+ range
; i
++) {
12993 destroy_list(ctx
, i
);
12999 * Return a display list number, n, such that lists n through n+range-1
13003 _mesa_GenLists(GLsizei range
)
13005 GET_CURRENT_CONTEXT(ctx
);
13007 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13008 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
13011 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
13019 * Make this an atomic operation
13021 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
13023 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
13025 /* reserve the list IDs by with empty/dummy lists */
13027 for (i
= 0; i
< range
; i
++) {
13028 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
13029 make_list(base
+ i
, 1));
13033 if (USE_BITMAP_ATLAS
&&
13035 ctx
->Driver
.DrawAtlasBitmaps
) {
13036 /* "range > 16" is a rough heuristic to guess when glGenLists might be
13037 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
13038 * Create the empty atlas now.
13040 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
13042 atlas
= alloc_bitmap_atlas(ctx
, base
);
13045 /* Atlas _should_ be new/empty now, but clobbering is OK */
13046 assert(atlas
->numBitmaps
== 0);
13047 atlas
->numBitmaps
= range
;
13051 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
13058 * Begin a new display list.
13061 _mesa_NewList(GLuint name
, GLenum mode
)
13063 GET_CURRENT_CONTEXT(ctx
);
13065 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
13066 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13068 if (MESA_VERBOSE
& VERBOSE_API
)
13069 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
13070 _mesa_enum_to_string(mode
));
13073 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
13077 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
13078 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
13082 if (ctx
->ListState
.CurrentList
) {
13083 /* already compiling a display list */
13084 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
13088 ctx
->CompileFlag
= GL_TRUE
;
13089 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
13091 /* Reset accumulated list state */
13092 invalidate_saved_current_state( ctx
);
13094 /* Allocate new display list */
13095 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
13096 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
13097 ctx
->ListState
.CurrentPos
= 0;
13099 vbo_save_NewList(ctx
, name
, mode
);
13101 ctx
->CurrentServerDispatch
= ctx
->Save
;
13102 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13103 if (ctx
->MarshalExec
== NULL
) {
13104 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13110 * End definition of current display list.
13113 _mesa_EndList(void)
13115 GET_CURRENT_CONTEXT(ctx
);
13116 SAVE_FLUSH_VERTICES(ctx
);
13117 FLUSH_VERTICES(ctx
, 0);
13119 if (MESA_VERBOSE
& VERBOSE_API
)
13120 _mesa_debug(ctx
, "glEndList\n");
13122 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
13123 _mesa_error(ctx
, GL_INVALID_OPERATION
,
13124 "glEndList() called inside glBegin/End");
13127 /* Check that a list is under construction */
13128 if (!ctx
->ListState
.CurrentList
) {
13129 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
13133 /* Call before emitting END_OF_LIST, in case the driver wants to
13134 * emit opcodes itself.
13136 vbo_save_EndList(ctx
);
13138 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
13142 /* Destroy old list, if any */
13143 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
13145 /* Install the new list */
13146 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
13147 ctx
->ListState
.CurrentList
->Name
,
13148 ctx
->ListState
.CurrentList
);
13151 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
13152 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
13154 ctx
->ListState
.CurrentList
= NULL
;
13155 ctx
->ListState
.CurrentBlock
= NULL
;
13156 ctx
->ListState
.CurrentPos
= 0;
13157 ctx
->ExecuteFlag
= GL_TRUE
;
13158 ctx
->CompileFlag
= GL_FALSE
;
13160 ctx
->CurrentServerDispatch
= ctx
->Exec
;
13161 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13162 if (ctx
->MarshalExec
== NULL
) {
13163 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13169 _mesa_CallList(GLuint list
)
13171 GLboolean save_compile_flag
;
13172 GET_CURRENT_CONTEXT(ctx
);
13173 FLUSH_CURRENT(ctx
, 0);
13175 if (MESA_VERBOSE
& VERBOSE_API
)
13176 _mesa_debug(ctx
, "glCallList %d\n", list
);
13179 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
13184 mesa_print_display_list( list
);
13186 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
13187 * execute the display list, and restore the CompileFlag.
13189 save_compile_flag
= ctx
->CompileFlag
;
13190 if (save_compile_flag
) {
13191 ctx
->CompileFlag
= GL_FALSE
;
13194 execute_list(ctx
, list
);
13195 ctx
->CompileFlag
= save_compile_flag
;
13197 /* also restore API function pointers to point to "save" versions */
13198 if (save_compile_flag
) {
13199 ctx
->CurrentServerDispatch
= ctx
->Save
;
13200 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13201 if (ctx
->MarshalExec
== NULL
) {
13202 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13209 * Try to execute a glCallLists() command where the display lists contain
13210 * glBitmap commands with a texture atlas.
13211 * \return true for success, false otherwise
13214 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
13217 struct gl_bitmap_atlas
*atlas
;
13220 if (!USE_BITMAP_ATLAS
||
13221 !ctx
->Current
.RasterPosValid
||
13222 ctx
->List
.ListBase
== 0 ||
13223 type
!= GL_UNSIGNED_BYTE
||
13224 !ctx
->Driver
.DrawAtlasBitmaps
) {
13229 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13232 /* Even if glGenLists wasn't called, we can still try to create
13235 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13238 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
13239 /* Try to build the bitmap atlas now.
13240 * If the atlas was created in glGenLists, we'll have recorded the
13241 * number of lists (bitmaps). Otherwise, take a guess at 256.
13243 if (atlas
->numBitmaps
== 0)
13244 atlas
->numBitmaps
= 256;
13245 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
13248 if (!atlas
|| !atlas
->complete
) {
13252 /* check that all display list IDs are in the atlas */
13253 for (i
= 0; i
< n
; i
++) {
13254 const GLubyte
*ids
= (const GLubyte
*) lists
;
13256 if (ids
[i
] >= atlas
->numBitmaps
) {
13261 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
13268 * Execute glCallLists: call multiple display lists.
13271 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
13273 GET_CURRENT_CONTEXT(ctx
);
13275 GLboolean save_compile_flag
;
13277 if (MESA_VERBOSE
& VERBOSE_API
)
13278 _mesa_debug(ctx
, "glCallLists %d\n", n
);
13282 case GL_UNSIGNED_BYTE
:
13284 case GL_UNSIGNED_SHORT
:
13286 case GL_UNSIGNED_INT
:
13294 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
13299 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
13301 } else if (n
== 0 || lists
== NULL
) {
13302 /* nothing to do */
13306 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
13310 /* Save the CompileFlag status, turn it off, execute display list,
13311 * and restore the CompileFlag.
13313 save_compile_flag
= ctx
->CompileFlag
;
13314 ctx
->CompileFlag
= GL_FALSE
;
13316 for (i
= 0; i
< n
; i
++) {
13317 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
13318 execute_list(ctx
, list
);
13321 ctx
->CompileFlag
= save_compile_flag
;
13323 /* also restore API function pointers to point to "save" versions */
13324 if (save_compile_flag
) {
13325 ctx
->CurrentServerDispatch
= ctx
->Save
;
13326 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13327 if (ctx
->MarshalExec
== NULL
) {
13328 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13335 * Set the offset added to list numbers in glCallLists.
13338 _mesa_ListBase(GLuint base
)
13340 GET_CURRENT_CONTEXT(ctx
);
13341 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13342 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13343 ctx
->List
.ListBase
= base
;
13347 * Setup the given dispatch table to point to Mesa's display list
13348 * building functions.
13350 * This does not include any of the tnl functions - they are
13351 * initialized from _mesa_init_api_defaults and from the active vtxfmt
13355 _mesa_initialize_save_table(const struct gl_context
*ctx
)
13357 struct _glapi_table
*table
= ctx
->Save
;
13358 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
13360 /* Initially populate the dispatch table with the contents of the
13361 * normal-execution dispatch table. This lets us skip populating functions
13362 * that should be called directly instead of compiled into display lists.
13364 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
13366 _mesa_loopback_init_api_table(ctx
, table
);
13368 /* VBO functions */
13369 vbo_initialize_save_dispatch(ctx
, table
);
13372 SET_Accum(table
, save_Accum
);
13373 SET_AlphaFunc(table
, save_AlphaFunc
);
13374 SET_Bitmap(table
, save_Bitmap
);
13375 SET_BlendFunc(table
, save_BlendFunc
);
13376 SET_CallList(table
, save_CallList
);
13377 SET_CallLists(table
, save_CallLists
);
13378 SET_Clear(table
, save_Clear
);
13379 SET_ClearAccum(table
, save_ClearAccum
);
13380 SET_ClearColor(table
, save_ClearColor
);
13381 SET_ClearDepth(table
, save_ClearDepth
);
13382 SET_ClearIndex(table
, save_ClearIndex
);
13383 SET_ClearStencil(table
, save_ClearStencil
);
13384 SET_ClipPlane(table
, save_ClipPlane
);
13385 SET_ColorMask(table
, save_ColorMask
);
13386 SET_ColorMaski(table
, save_ColorMaskIndexed
);
13387 SET_ColorMaterial(table
, save_ColorMaterial
);
13388 SET_CopyPixels(table
, save_CopyPixels
);
13389 SET_CullFace(table
, save_CullFace
);
13390 SET_DepthFunc(table
, save_DepthFunc
);
13391 SET_DepthMask(table
, save_DepthMask
);
13392 SET_DepthRange(table
, save_DepthRange
);
13393 SET_Disable(table
, save_Disable
);
13394 SET_Disablei(table
, save_DisableIndexed
);
13395 SET_DrawBuffer(table
, save_DrawBuffer
);
13396 SET_DrawPixels(table
, save_DrawPixels
);
13397 SET_Enable(table
, save_Enable
);
13398 SET_Enablei(table
, save_EnableIndexed
);
13399 SET_EvalMesh1(table
, save_EvalMesh1
);
13400 SET_EvalMesh2(table
, save_EvalMesh2
);
13401 SET_Fogf(table
, save_Fogf
);
13402 SET_Fogfv(table
, save_Fogfv
);
13403 SET_Fogi(table
, save_Fogi
);
13404 SET_Fogiv(table
, save_Fogiv
);
13405 SET_FrontFace(table
, save_FrontFace
);
13406 SET_Frustum(table
, save_Frustum
);
13407 SET_Hint(table
, save_Hint
);
13408 SET_IndexMask(table
, save_IndexMask
);
13409 SET_InitNames(table
, save_InitNames
);
13410 SET_LightModelf(table
, save_LightModelf
);
13411 SET_LightModelfv(table
, save_LightModelfv
);
13412 SET_LightModeli(table
, save_LightModeli
);
13413 SET_LightModeliv(table
, save_LightModeliv
);
13414 SET_Lightf(table
, save_Lightf
);
13415 SET_Lightfv(table
, save_Lightfv
);
13416 SET_Lighti(table
, save_Lighti
);
13417 SET_Lightiv(table
, save_Lightiv
);
13418 SET_LineStipple(table
, save_LineStipple
);
13419 SET_LineWidth(table
, save_LineWidth
);
13420 SET_ListBase(table
, save_ListBase
);
13421 SET_LoadIdentity(table
, save_LoadIdentity
);
13422 SET_LoadMatrixd(table
, save_LoadMatrixd
);
13423 SET_LoadMatrixf(table
, save_LoadMatrixf
);
13424 SET_LoadName(table
, save_LoadName
);
13425 SET_LogicOp(table
, save_LogicOp
);
13426 SET_Map1d(table
, save_Map1d
);
13427 SET_Map1f(table
, save_Map1f
);
13428 SET_Map2d(table
, save_Map2d
);
13429 SET_Map2f(table
, save_Map2f
);
13430 SET_MapGrid1d(table
, save_MapGrid1d
);
13431 SET_MapGrid1f(table
, save_MapGrid1f
);
13432 SET_MapGrid2d(table
, save_MapGrid2d
);
13433 SET_MapGrid2f(table
, save_MapGrid2f
);
13434 SET_MatrixMode(table
, save_MatrixMode
);
13435 SET_MultMatrixd(table
, save_MultMatrixd
);
13436 SET_MultMatrixf(table
, save_MultMatrixf
);
13437 SET_NewList(table
, save_NewList
);
13438 SET_Ortho(table
, save_Ortho
);
13439 SET_PassThrough(table
, save_PassThrough
);
13440 SET_PixelMapfv(table
, save_PixelMapfv
);
13441 SET_PixelMapuiv(table
, save_PixelMapuiv
);
13442 SET_PixelMapusv(table
, save_PixelMapusv
);
13443 SET_PixelTransferf(table
, save_PixelTransferf
);
13444 SET_PixelTransferi(table
, save_PixelTransferi
);
13445 SET_PixelZoom(table
, save_PixelZoom
);
13446 SET_PointSize(table
, save_PointSize
);
13447 SET_PolygonMode(table
, save_PolygonMode
);
13448 SET_PolygonOffset(table
, save_PolygonOffset
);
13449 SET_PolygonStipple(table
, save_PolygonStipple
);
13450 SET_PopAttrib(table
, save_PopAttrib
);
13451 SET_PopMatrix(table
, save_PopMatrix
);
13452 SET_PopName(table
, save_PopName
);
13453 SET_PushAttrib(table
, save_PushAttrib
);
13454 SET_PushMatrix(table
, save_PushMatrix
);
13455 SET_PushName(table
, save_PushName
);
13456 SET_RasterPos2d(table
, save_RasterPos2d
);
13457 SET_RasterPos2dv(table
, save_RasterPos2dv
);
13458 SET_RasterPos2f(table
, save_RasterPos2f
);
13459 SET_RasterPos2fv(table
, save_RasterPos2fv
);
13460 SET_RasterPos2i(table
, save_RasterPos2i
);
13461 SET_RasterPos2iv(table
, save_RasterPos2iv
);
13462 SET_RasterPos2s(table
, save_RasterPos2s
);
13463 SET_RasterPos2sv(table
, save_RasterPos2sv
);
13464 SET_RasterPos3d(table
, save_RasterPos3d
);
13465 SET_RasterPos3dv(table
, save_RasterPos3dv
);
13466 SET_RasterPos3f(table
, save_RasterPos3f
);
13467 SET_RasterPos3fv(table
, save_RasterPos3fv
);
13468 SET_RasterPos3i(table
, save_RasterPos3i
);
13469 SET_RasterPos3iv(table
, save_RasterPos3iv
);
13470 SET_RasterPos3s(table
, save_RasterPos3s
);
13471 SET_RasterPos3sv(table
, save_RasterPos3sv
);
13472 SET_RasterPos4d(table
, save_RasterPos4d
);
13473 SET_RasterPos4dv(table
, save_RasterPos4dv
);
13474 SET_RasterPos4f(table
, save_RasterPos4f
);
13475 SET_RasterPos4fv(table
, save_RasterPos4fv
);
13476 SET_RasterPos4i(table
, save_RasterPos4i
);
13477 SET_RasterPos4iv(table
, save_RasterPos4iv
);
13478 SET_RasterPos4s(table
, save_RasterPos4s
);
13479 SET_RasterPos4sv(table
, save_RasterPos4sv
);
13480 SET_ReadBuffer(table
, save_ReadBuffer
);
13481 SET_Rectf(table
, save_Rectf
);
13482 SET_Rotated(table
, save_Rotated
);
13483 SET_Rotatef(table
, save_Rotatef
);
13484 SET_Scaled(table
, save_Scaled
);
13485 SET_Scalef(table
, save_Scalef
);
13486 SET_Scissor(table
, save_Scissor
);
13487 SET_ShadeModel(table
, save_ShadeModel
);
13488 SET_StencilFunc(table
, save_StencilFunc
);
13489 SET_StencilMask(table
, save_StencilMask
);
13490 SET_StencilOp(table
, save_StencilOp
);
13491 SET_TexEnvf(table
, save_TexEnvf
);
13492 SET_TexEnvfv(table
, save_TexEnvfv
);
13493 SET_TexEnvi(table
, save_TexEnvi
);
13494 SET_TexEnviv(table
, save_TexEnviv
);
13495 SET_TexGend(table
, save_TexGend
);
13496 SET_TexGendv(table
, save_TexGendv
);
13497 SET_TexGenf(table
, save_TexGenf
);
13498 SET_TexGenfv(table
, save_TexGenfv
);
13499 SET_TexGeni(table
, save_TexGeni
);
13500 SET_TexGeniv(table
, save_TexGeniv
);
13501 SET_TexImage1D(table
, save_TexImage1D
);
13502 SET_TexImage2D(table
, save_TexImage2D
);
13503 SET_TexParameterf(table
, save_TexParameterf
);
13504 SET_TexParameterfv(table
, save_TexParameterfv
);
13505 SET_TexParameteri(table
, save_TexParameteri
);
13506 SET_TexParameteriv(table
, save_TexParameteriv
);
13507 SET_Translated(table
, save_Translated
);
13508 SET_Translatef(table
, save_Translatef
);
13509 SET_Viewport(table
, save_Viewport
);
13512 SET_BindTexture(table
, save_BindTexture
);
13513 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
13514 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
13515 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
13516 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
13517 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
13518 SET_TexSubImage1D(table
, save_TexSubImage1D
);
13519 SET_TexSubImage2D(table
, save_TexSubImage2D
);
13522 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
13523 SET_TexImage3D(table
, save_TexImage3D
);
13524 SET_TexSubImage3D(table
, save_TexSubImage3D
);
13527 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
13528 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
13529 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
13531 /* ATI_separate_stencil */
13532 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
13534 /* GL_ARB_imaging */
13535 /* Not all are supported */
13536 SET_BlendColor(table
, save_BlendColor
);
13537 SET_BlendEquation(table
, save_BlendEquation
);
13539 /* 2. GL_EXT_blend_color */
13541 SET_BlendColorEXT(table
, save_BlendColorEXT
);
13544 /* 6. GL_EXT_texture3d */
13546 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
13547 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
13548 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
13551 /* 37. GL_EXT_blend_minmax */
13553 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
13556 /* 54. GL_EXT_point_parameters */
13557 SET_PointParameterf(table
, save_PointParameterfEXT
);
13558 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
13560 /* 91. GL_ARB_tessellation_shader */
13561 SET_PatchParameteri(table
, save_PatchParameteri
);
13562 SET_PatchParameterfv(table
, save_PatchParameterfv
);
13564 /* 100. ARB_viewport_array */
13565 SET_ViewportArrayv(table
, save_ViewportArrayv
);
13566 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
13567 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
13568 SET_ScissorArrayv(table
, save_ScissorArrayv
);
13569 SET_ScissorIndexed(table
, save_ScissorIndexed
);
13570 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
13571 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
13572 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
13574 /* 122. ARB_compute_shader */
13575 SET_DispatchCompute(table
, save_DispatchCompute
);
13576 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
13578 /* 173. GL_EXT_blend_func_separate */
13579 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
13581 /* 197. GL_MESA_window_pos */
13582 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
13583 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
13584 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
13585 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
13586 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
13587 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
13588 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
13589 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
13590 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
13591 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
13592 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
13593 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
13594 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
13595 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
13596 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
13597 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
13598 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
13599 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
13600 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
13601 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
13602 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
13603 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
13604 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
13605 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
13607 /* 245. GL_ATI_fragment_shader */
13608 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
13609 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
13611 /* 262. GL_NV_point_sprite */
13612 SET_PointParameteri(table
, save_PointParameteriNV
);
13613 SET_PointParameteriv(table
, save_PointParameterivNV
);
13615 /* 268. GL_EXT_stencil_two_side */
13616 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
13618 /* ???. GL_EXT_depth_bounds_test */
13619 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
13621 /* ARB 1. GL_ARB_multitexture */
13622 SET_ActiveTexture(table
, save_ActiveTextureARB
);
13624 /* ARB 3. GL_ARB_transpose_matrix */
13625 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
13626 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
13627 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
13628 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
13630 /* ARB 5. GL_ARB_multisample */
13631 SET_SampleCoverage(table
, save_SampleCoverageARB
);
13633 /* ARB 12. GL_ARB_texture_compression */
13634 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
13635 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
13636 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
13637 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
13638 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
13639 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
13641 /* ARB 14. GL_ARB_point_parameters */
13642 /* aliased with EXT_point_parameters functions */
13644 /* ARB 25. GL_ARB_window_pos */
13645 /* aliased with MESA_window_pos functions */
13647 /* ARB 26. GL_ARB_vertex_program */
13648 /* ARB 27. GL_ARB_fragment_program */
13649 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
13650 SET_ProgramStringARB(table
, save_ProgramStringARB
);
13651 SET_BindProgramARB(table
, save_BindProgramARB
);
13652 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
13653 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
13654 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
13655 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
13656 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
13657 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
13658 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
13659 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
13661 SET_BeginQuery(table
, save_BeginQueryARB
);
13662 SET_EndQuery(table
, save_EndQueryARB
);
13663 SET_QueryCounter(table
, save_QueryCounter
);
13665 SET_DrawBuffers(table
, save_DrawBuffersARB
);
13667 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
13669 SET_UseProgram(table
, save_UseProgram
);
13670 SET_Uniform1f(table
, save_Uniform1fARB
);
13671 SET_Uniform2f(table
, save_Uniform2fARB
);
13672 SET_Uniform3f(table
, save_Uniform3fARB
);
13673 SET_Uniform4f(table
, save_Uniform4fARB
);
13674 SET_Uniform1fv(table
, save_Uniform1fvARB
);
13675 SET_Uniform2fv(table
, save_Uniform2fvARB
);
13676 SET_Uniform3fv(table
, save_Uniform3fvARB
);
13677 SET_Uniform4fv(table
, save_Uniform4fvARB
);
13678 SET_Uniform1i(table
, save_Uniform1iARB
);
13679 SET_Uniform2i(table
, save_Uniform2iARB
);
13680 SET_Uniform3i(table
, save_Uniform3iARB
);
13681 SET_Uniform4i(table
, save_Uniform4iARB
);
13682 SET_Uniform1iv(table
, save_Uniform1ivARB
);
13683 SET_Uniform2iv(table
, save_Uniform2ivARB
);
13684 SET_Uniform3iv(table
, save_Uniform3ivARB
);
13685 SET_Uniform4iv(table
, save_Uniform4ivARB
);
13686 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
13687 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
13688 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
13689 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
13690 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
13691 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
13692 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
13693 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
13694 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
13696 /* 299. GL_EXT_blend_equation_separate */
13697 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
13699 /* GL_EXT_gpu_program_parameters */
13700 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
13701 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
13703 /* 364. GL_EXT_provoking_vertex */
13704 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
13706 /* GL_EXT_texture_integer */
13707 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
13708 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
13709 SET_TexParameterIiv(table
, save_TexParameterIiv
);
13710 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
13712 /* GL_ARB_clip_control */
13713 SET_ClipControl(table
, save_ClipControl
);
13715 /* GL_ARB_color_buffer_float */
13716 SET_ClampColor(table
, save_ClampColorARB
);
13719 SET_ClearBufferiv(table
, save_ClearBufferiv
);
13720 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
13721 SET_ClearBufferfv(table
, save_ClearBufferfv
);
13722 SET_ClearBufferfi(table
, save_ClearBufferfi
);
13723 SET_Uniform1ui(table
, save_Uniform1ui
);
13724 SET_Uniform2ui(table
, save_Uniform2ui
);
13725 SET_Uniform3ui(table
, save_Uniform3ui
);
13726 SET_Uniform4ui(table
, save_Uniform4ui
);
13727 SET_Uniform1uiv(table
, save_Uniform1uiv
);
13728 SET_Uniform2uiv(table
, save_Uniform2uiv
);
13729 SET_Uniform3uiv(table
, save_Uniform3uiv
);
13730 SET_Uniform4uiv(table
, save_Uniform4uiv
);
13732 /* GL_ARB_gpu_shader_fp64 */
13733 SET_Uniform1d(table
, save_Uniform1d
);
13734 SET_Uniform2d(table
, save_Uniform2d
);
13735 SET_Uniform3d(table
, save_Uniform3d
);
13736 SET_Uniform4d(table
, save_Uniform4d
);
13737 SET_Uniform1dv(table
, save_Uniform1dv
);
13738 SET_Uniform2dv(table
, save_Uniform2dv
);
13739 SET_Uniform3dv(table
, save_Uniform3dv
);
13740 SET_Uniform4dv(table
, save_Uniform4dv
);
13741 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
13742 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
13743 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
13744 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
13745 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
13746 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
13747 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
13748 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
13749 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
13752 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
13753 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
13754 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
13755 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
13756 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
13757 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
13758 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
13759 SET_DrawTransformFeedbackInstanced(table
,
13760 save_DrawTransformFeedbackInstanced
);
13761 SET_DrawTransformFeedbackStreamInstanced(table
,
13762 save_DrawTransformFeedbackStreamInstanced
);
13763 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
13764 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
13766 /* GL_ARB_instanced_arrays */
13767 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
13769 /* GL_NV_texture_barrier */
13770 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
13772 SET_BindSampler(table
, save_BindSampler
);
13773 SET_SamplerParameteri(table
, save_SamplerParameteri
);
13774 SET_SamplerParameterf(table
, save_SamplerParameterf
);
13775 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
13776 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
13777 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
13778 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
13780 /* GL_ARB_draw_buffer_blend */
13781 SET_BlendFunciARB(table
, save_BlendFunci
);
13782 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
13783 SET_BlendEquationiARB(table
, save_BlendEquationi
);
13784 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
13786 /* GL_NV_conditional_render */
13787 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
13788 SET_EndConditionalRender(table
, save_EndConditionalRender
);
13791 SET_WaitSync(table
, save_WaitSync
);
13793 /* GL_ARB_uniform_buffer_object */
13794 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
13796 /* GL_ARB_shader_subroutines */
13797 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
13799 /* GL_ARB_draw_instanced */
13800 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
13801 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
13803 /* GL_ARB_draw_elements_base_vertex */
13804 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
13806 /* GL_ARB_base_instance */
13807 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
13808 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
13809 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
13811 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
13812 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
13813 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
13814 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
13815 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
13817 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
13818 SET_UseProgramStages(table
, save_UseProgramStages
);
13819 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
13820 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
13821 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
13822 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
13823 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
13824 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
13825 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
13826 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
13827 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
13828 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
13829 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
13830 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
13831 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
13832 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
13833 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
13834 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
13835 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
13836 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
13837 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
13838 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
13839 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
13840 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
13841 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
13842 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
13843 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
13844 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
13845 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
13846 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
13847 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
13848 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
13849 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
13850 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
13851 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
13852 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
13853 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
13854 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
13855 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
13856 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
13857 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
13858 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
13859 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
13860 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
13861 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
13862 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
13863 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
13864 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
13865 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
13866 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
13867 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
13868 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
13870 /* GL_{ARB,EXT}_polygon_offset_clamp */
13871 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
13873 /* GL_EXT_window_rectangles */
13874 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
13876 /* GL_NV_conservative_raster */
13877 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
13879 /* GL_NV_conservative_raster_dilate */
13880 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
13882 /* GL_NV_conservative_raster_pre_snap_triangles */
13883 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
13885 /* GL_EXT_direct_state_access */
13886 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
13887 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
13888 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
13889 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
13890 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
13891 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
13892 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
13893 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
13894 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
13895 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
13896 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
13897 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
13898 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
13899 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
13900 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
13901 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
13902 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
13903 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
13904 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
13905 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
13906 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
13907 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
13908 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
13909 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
13910 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
13911 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
13912 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
13913 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
13914 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
13915 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
13916 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
13917 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
13918 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
13919 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
13920 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
13921 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
13922 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
13923 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
13924 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
13925 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
13926 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
13927 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
13928 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
13929 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
13930 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
13931 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
13932 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
13933 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
13934 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
13935 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
13936 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
13937 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
13938 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
13939 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
13940 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
13941 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
13942 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
13943 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
13944 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
13945 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
13946 SET_CompressedMultiTexImage1DEXT(table
, save_CompressedMultiTexImage1DEXT
);
13947 SET_CompressedMultiTexImage2DEXT(table
, save_CompressedMultiTexImage2DEXT
);
13948 SET_CompressedMultiTexImage3DEXT(table
, save_CompressedMultiTexImage3DEXT
);
13949 SET_CompressedMultiTexSubImage1DEXT(table
, save_CompressedMultiTexSubImage1DEXT
);
13950 SET_CompressedMultiTexSubImage2DEXT(table
, save_CompressedMultiTexSubImage2DEXT
);
13951 SET_CompressedMultiTexSubImage3DEXT(table
, save_CompressedMultiTexSubImage3DEXT
);
13952 SET_NamedProgramStringEXT(table
, save_NamedProgramStringEXT
);
13953 SET_NamedProgramLocalParameter4dEXT(table
, save_NamedProgramLocalParameter4dEXT
);
13954 SET_NamedProgramLocalParameter4dvEXT(table
, save_NamedProgramLocalParameter4dvEXT
);
13955 SET_NamedProgramLocalParameter4fEXT(table
, save_NamedProgramLocalParameter4fEXT
);
13956 SET_NamedProgramLocalParameter4fvEXT(table
, save_NamedProgramLocalParameter4fvEXT
);
13961 static const char *
13962 enum_string(GLenum k
)
13964 return _mesa_enum_to_string(k
);
13969 * Print the commands in a display list. For debugging only.
13970 * TODO: many commands aren't handled yet.
13971 * \param fname filename to write display list to. If null, use stdout.
13973 static void GLAPIENTRY
13974 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
13976 struct gl_display_list
*dlist
;
13982 f
= fopen(fname
, "w");
13987 if (!islist(ctx
, list
)) {
13988 fprintf(f
, "%u is not a display list ID\n", list
);
13992 dlist
= _mesa_lookup_list(ctx
, list
);
13999 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
14001 done
= n
? GL_FALSE
: GL_TRUE
;
14003 const OpCode opcode
= n
[0].opcode
;
14005 if (is_ext_opcode(opcode
)) {
14006 n
+= ext_opcode_print(ctx
, n
, f
);
14011 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
14013 case OPCODE_ACTIVE_TEXTURE
:
14014 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
14016 case OPCODE_BITMAP
:
14017 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
14018 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
14019 get_pointer(&n
[7]));
14021 case OPCODE_BLEND_COLOR
:
14022 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
14023 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14025 case OPCODE_BLEND_EQUATION
:
14026 fprintf(f
, "BlendEquation %s\n",
14027 enum_string(n
[1].e
));
14029 case OPCODE_BLEND_EQUATION_SEPARATE
:
14030 fprintf(f
, "BlendEquationSeparate %s, %s\n",
14031 enum_string(n
[1].e
),
14032 enum_string(n
[2].e
));
14034 case OPCODE_BLEND_FUNC_SEPARATE
:
14035 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
14036 enum_string(n
[1].e
),
14037 enum_string(n
[2].e
),
14038 enum_string(n
[3].e
),
14039 enum_string(n
[4].e
));
14041 case OPCODE_BLEND_EQUATION_I
:
14042 fprintf(f
, "BlendEquationi %u, %s\n",
14043 n
[1].ui
, enum_string(n
[2].e
));
14045 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
14046 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
14047 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14049 case OPCODE_BLEND_FUNC_I
:
14050 fprintf(f
, "BlendFunci %u, %s, %s\n",
14051 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14053 case OPCODE_BLEND_FUNC_SEPARATE_I
:
14054 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
14056 enum_string(n
[2].e
),
14057 enum_string(n
[3].e
),
14058 enum_string(n
[4].e
),
14059 enum_string(n
[5].e
));
14061 case OPCODE_CALL_LIST
:
14062 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
14064 case OPCODE_CALL_LISTS
:
14065 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
14067 case OPCODE_DISABLE
:
14068 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
14070 case OPCODE_ENABLE
:
14071 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
14073 case OPCODE_FRUSTUM
:
14074 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
14075 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14077 case OPCODE_LINE_STIPPLE
:
14078 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
14080 case OPCODE_LINE_WIDTH
:
14081 fprintf(f
, "LineWidth %f\n", n
[1].f
);
14083 case OPCODE_LOAD_IDENTITY
:
14084 fprintf(f
, "LoadIdentity\n");
14086 case OPCODE_LOAD_MATRIX
:
14087 fprintf(f
, "LoadMatrix\n");
14088 fprintf(f
, " %8f %8f %8f %8f\n",
14089 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14090 fprintf(f
, " %8f %8f %8f %8f\n",
14091 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14092 fprintf(f
, " %8f %8f %8f %8f\n",
14093 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14094 fprintf(f
, " %8f %8f %8f %8f\n",
14095 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14097 case OPCODE_MULT_MATRIX
:
14098 fprintf(f
, "MultMatrix (or Rotate)\n");
14099 fprintf(f
, " %8f %8f %8f %8f\n",
14100 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14101 fprintf(f
, " %8f %8f %8f %8f\n",
14102 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14103 fprintf(f
, " %8f %8f %8f %8f\n",
14104 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14105 fprintf(f
, " %8f %8f %8f %8f\n",
14106 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14109 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
14110 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14112 case OPCODE_POINT_SIZE
:
14113 fprintf(f
, "PointSize %f\n", n
[1].f
);
14115 case OPCODE_POP_ATTRIB
:
14116 fprintf(f
, "PopAttrib\n");
14118 case OPCODE_POP_MATRIX
:
14119 fprintf(f
, "PopMatrix\n");
14121 case OPCODE_POP_NAME
:
14122 fprintf(f
, "PopName\n");
14124 case OPCODE_PUSH_ATTRIB
:
14125 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
14127 case OPCODE_PUSH_MATRIX
:
14128 fprintf(f
, "PushMatrix\n");
14130 case OPCODE_PUSH_NAME
:
14131 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
14133 case OPCODE_RASTER_POS
:
14134 fprintf(f
, "RasterPos %g %g %g %g\n",
14135 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14137 case OPCODE_ROTATE
:
14138 fprintf(f
, "Rotate %g %g %g %g\n",
14139 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14142 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14144 case OPCODE_TRANSLATE
:
14145 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14147 case OPCODE_BIND_TEXTURE
:
14148 fprintf(f
, "BindTexture %s %d\n",
14149 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
14151 case OPCODE_SHADE_MODEL
:
14152 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
14155 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
14156 _mesa_enum_to_string(n
[1].ui
),
14157 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
14160 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
14161 _mesa_enum_to_string(n
[1].ui
),
14162 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
14163 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
14165 case OPCODE_MAPGRID1
:
14166 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
14168 case OPCODE_MAPGRID2
:
14169 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
14170 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
14172 case OPCODE_EVALMESH1
:
14173 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
14175 case OPCODE_EVALMESH2
:
14176 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
14177 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
14180 case OPCODE_ATTR_1F_NV
:
14181 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
14183 case OPCODE_ATTR_2F_NV
:
14184 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
14185 n
[1].i
, n
[2].f
, n
[3].f
);
14187 case OPCODE_ATTR_3F_NV
:
14188 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
14189 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14191 case OPCODE_ATTR_4F_NV
:
14192 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
14193 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14195 case OPCODE_ATTR_1F_ARB
:
14196 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
14198 case OPCODE_ATTR_2F_ARB
:
14199 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
14200 n
[1].i
, n
[2].f
, n
[3].f
);
14202 case OPCODE_ATTR_3F_ARB
:
14203 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
14204 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14206 case OPCODE_ATTR_4F_ARB
:
14207 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
14208 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14211 case OPCODE_MATERIAL
:
14212 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
14213 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14216 fprintf(f
, "BEGIN %x\n", n
[1].i
);
14219 fprintf(f
, "END\n");
14222 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
14225 case OPCODE_EVAL_C1
:
14226 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
14228 case OPCODE_EVAL_C2
:
14229 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
14231 case OPCODE_EVAL_P1
:
14232 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
14234 case OPCODE_EVAL_P2
:
14235 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
14238 case OPCODE_PROVOKING_VERTEX
:
14239 fprintf(f
, "ProvokingVertex %s\n",
14240 _mesa_enum_to_string(n
[1].ui
));
14244 * meta opcodes/commands
14247 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
14248 (const char *) get_pointer(&n
[2]));
14250 case OPCODE_CONTINUE
:
14251 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
14252 n
= (Node
*) get_pointer(&n
[1]);
14255 fprintf(f
, "NOP\n");
14257 case OPCODE_END_OF_LIST
:
14258 fprintf(f
, "END-LIST %u\n", list
);
14262 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
14264 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
14265 opcode
, (void *) n
);
14269 fprintf(f
, "command %d, %u operands\n", opcode
,
14273 /* increment n to point to next compiled command */
14274 if (opcode
!= OPCODE_CONTINUE
) {
14275 assert(InstSize
[opcode
] > 0);
14276 n
+= InstSize
[opcode
];
14290 * Clients may call this function to help debug display list problems.
14291 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14292 * changed, or break in the future without notice.
14295 mesa_print_display_list(GLuint list
)
14297 GET_CURRENT_CONTEXT(ctx
);
14298 print_list(ctx
, list
, NULL
);
14302 /**********************************************************************/
14303 /***** Initialization *****/
14304 /**********************************************************************/
14307 save_vtxfmt_init(GLvertexformat
* vfmt
)
14309 vfmt
->ArrayElement
= _ae_ArrayElement
;
14311 vfmt
->Begin
= save_Begin
;
14313 vfmt
->CallList
= save_CallList
;
14314 vfmt
->CallLists
= save_CallLists
;
14316 vfmt
->Color3f
= save_Color3f
;
14317 vfmt
->Color3fv
= save_Color3fv
;
14318 vfmt
->Color4f
= save_Color4f
;
14319 vfmt
->Color4fv
= save_Color4fv
;
14320 vfmt
->EdgeFlag
= save_EdgeFlag
;
14321 vfmt
->End
= save_End
;
14323 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
14324 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
14325 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
14326 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
14327 vfmt
->EvalPoint1
= save_EvalPoint1
;
14328 vfmt
->EvalPoint2
= save_EvalPoint2
;
14330 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
14331 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
14332 vfmt
->Indexf
= save_Indexf
;
14333 vfmt
->Indexfv
= save_Indexfv
;
14334 vfmt
->Materialfv
= save_Materialfv
;
14335 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
14336 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
14337 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
14338 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
14339 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
14340 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
14341 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
14342 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
14343 vfmt
->Normal3f
= save_Normal3f
;
14344 vfmt
->Normal3fv
= save_Normal3fv
;
14345 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
14346 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
14347 vfmt
->TexCoord1f
= save_TexCoord1f
;
14348 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
14349 vfmt
->TexCoord2f
= save_TexCoord2f
;
14350 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
14351 vfmt
->TexCoord3f
= save_TexCoord3f
;
14352 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
14353 vfmt
->TexCoord4f
= save_TexCoord4f
;
14354 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
14355 vfmt
->Vertex2f
= save_Vertex2f
;
14356 vfmt
->Vertex2fv
= save_Vertex2fv
;
14357 vfmt
->Vertex3f
= save_Vertex3f
;
14358 vfmt
->Vertex3fv
= save_Vertex3fv
;
14359 vfmt
->Vertex4f
= save_Vertex4f
;
14360 vfmt
->Vertex4fv
= save_Vertex4fv
;
14361 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
14362 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
14363 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
14364 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
14365 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
14366 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
14367 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
14368 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
14369 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
14370 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
14371 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
14372 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
14373 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
14374 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
14375 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
14376 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
14378 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
14383 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
14384 const GLvertexformat
*vfmt
)
14386 SET_CallList(disp
, vfmt
->CallList
);
14387 SET_CallLists(disp
, vfmt
->CallLists
);
14392 * Initialize display list state for given context.
14395 _mesa_init_display_list(struct gl_context
*ctx
)
14397 static GLboolean tableInitialized
= GL_FALSE
;
14399 /* zero-out the instruction size table, just once */
14400 if (!tableInitialized
) {
14401 memset(InstSize
, 0, sizeof(InstSize
));
14402 tableInitialized
= GL_TRUE
;
14405 /* extension info */
14406 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
14409 ctx
->ListState
.CallDepth
= 0;
14410 ctx
->ExecuteFlag
= GL_TRUE
;
14411 ctx
->CompileFlag
= GL_FALSE
;
14412 ctx
->ListState
.CurrentBlock
= NULL
;
14413 ctx
->ListState
.CurrentPos
= 0;
14415 /* Display List group */
14416 ctx
->List
.ListBase
= 0;
14418 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
14420 InstSize
[OPCODE_NOP
] = 1;
14425 _mesa_free_display_list_data(struct gl_context
*ctx
)
14427 free(ctx
->ListExt
);
14428 ctx
->ListExt
= NULL
;