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_TEXTUREPARAMETER_II
,
574 OPCODE_TEXTUREPARAMETER_IUI
,
575 OPCODE_TEXTURE_IMAGE1D
,
576 OPCODE_TEXTURE_IMAGE2D
,
577 OPCODE_TEXTURE_IMAGE3D
,
578 OPCODE_TEXTURE_SUB_IMAGE1D
,
579 OPCODE_TEXTURE_SUB_IMAGE2D
,
580 OPCODE_TEXTURE_SUB_IMAGE3D
,
581 OPCODE_COPY_TEXTURE_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
584 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
585 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
586 OPCODE_BIND_MULTITEXTURE
,
587 OPCODE_MULTITEXPARAMETER_F
,
588 OPCODE_MULTITEXPARAMETER_I
,
589 OPCODE_MULTITEXPARAMETER_II
,
590 OPCODE_MULTITEXPARAMETER_IUI
,
591 OPCODE_MULTITEX_IMAGE1D
,
592 OPCODE_MULTITEX_IMAGE2D
,
593 OPCODE_MULTITEX_IMAGE3D
,
594 OPCODE_MULTITEX_SUB_IMAGE1D
,
595 OPCODE_MULTITEX_SUB_IMAGE2D
,
596 OPCODE_MULTITEX_SUB_IMAGE3D
,
597 OPCODE_COPY_MULTITEX_IMAGE1D
,
598 OPCODE_COPY_MULTITEX_IMAGE2D
,
599 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
600 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
601 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
603 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
604 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
605 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
606 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
607 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
608 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
609 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
610 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
611 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
612 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
613 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
614 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
615 OPCODE_NAMED_PROGRAM_STRING
,
616 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
,
618 /* The following three are meta instructions */
619 OPCODE_ERROR
, /* raise compiled-in error */
621 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
631 * Display list instructions are stored as sequences of "nodes". Nodes
632 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
633 * are linked together with a pointer.
635 * Each instruction in the display list is stored as a sequence of
636 * contiguous nodes in memory.
637 * Each node is the union of a variety of data types.
639 * Note, all of these members should be 4 bytes in size or less for the
640 * sake of compact display lists. We store 8-byte pointers in a pair of
641 * these nodes using the save/get_pointer() functions below.
659 typedef union gl_dlist_node Node
;
662 /** How many 4-byte dwords to store a pointer */
663 #define POINTER_DWORDS (sizeof(void *) / 4)
665 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
666 * space for display lists. The following types and functions are
667 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
672 GLuint dwords
[POINTER_DWORDS
];
677 * Save a 4 or 8-byte pointer at dest (and dest+1).
680 save_pointer(Node
*dest
, void *src
)
685 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
686 STATIC_ASSERT(sizeof(Node
) == 4);
690 for (i
= 0; i
< POINTER_DWORDS
; i
++)
691 dest
[i
].ui
= p
.dwords
[i
];
696 * Retrieve a 4 or 8-byte pointer from node (node+1).
699 get_pointer(const Node
*node
)
704 for (i
= 0; i
< POINTER_DWORDS
; i
++)
705 p
.dwords
[i
] = node
[i
].ui
;
712 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
729 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
731 union float64_pair tmp; \
733 n[idx].ui = tmp.uint32[0]; \
734 n[idx+1].ui = tmp.uint32[1]; \
739 * How many nodes to allocate at a time. Note that bulk vertex data
740 * from glBegin/glVertex/glEnd primitives will typically wind up in
741 * a VBO, and not directly in the display list itself.
743 #define BLOCK_SIZE 256
748 * Number of nodes of storage needed for each instruction.
749 * Sizes for dynamically allocated opcodes are stored in the context struct.
751 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
754 void mesa_print_display_list(GLuint list
);
758 * Does the given display list only contain a single glBitmap call?
761 is_bitmap_list(const struct gl_display_list
*dlist
)
763 const Node
*n
= dlist
->Head
;
764 if (n
[0].opcode
== OPCODE_BITMAP
) {
765 n
+= InstSize
[OPCODE_BITMAP
];
766 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
774 * Is the given display list an empty list?
777 is_empty_list(const struct gl_display_list
*dlist
)
779 const Node
*n
= dlist
->Head
;
780 return n
[0].opcode
== OPCODE_END_OF_LIST
;
785 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
788 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
791 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
799 * Lookup a gl_bitmap_atlas by listBase ID.
801 static struct gl_bitmap_atlas
*
802 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
804 struct gl_bitmap_atlas
*atlas
;
806 assert(listBase
> 0);
807 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
813 * Create new bitmap atlas and insert into hash table.
815 static struct gl_bitmap_atlas
*
816 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
818 struct gl_bitmap_atlas
*atlas
;
820 assert(listBase
> 0);
821 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
823 atlas
= calloc(1, sizeof(*atlas
));
825 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
833 * Try to build a bitmap atlas. This involves examining a sequence of
834 * display lists which contain glBitmap commands and putting the bitmap
835 * images into a texture map (the atlas).
836 * If we succeed, gl_bitmap_atlas::complete will be set to true.
837 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
840 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
843 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
848 assert(!atlas
->complete
);
849 assert(atlas
->numBitmaps
> 0);
851 /* We use a rectangle texture (non-normalized coords) for the atlas */
852 assert(ctx
->Extensions
.NV_texture_rectangle
);
853 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
855 atlas
->texWidth
= 1024;
856 atlas
->texHeight
= 0; /* determined below */
858 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
859 if (!atlas
->glyphs
) {
861 atlas
->incomplete
= true;
865 /* Loop over the display lists. They should all contain a single glBitmap
866 * call. If not, bail out. Also, compute the position and sizes of each
867 * bitmap in the atlas to determine the texture atlas size.
869 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
870 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
872 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
873 unsigned bitmap_width
, bitmap_height
;
874 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
876 if (!list
|| is_empty_list(list
)) {
878 atlas
->numBitmaps
= i
;
882 if (!is_bitmap_list(list
)) {
883 /* This list does not contain exactly one glBitmap command. Give up. */
884 atlas
->incomplete
= true;
888 /* get bitmap info from the display list command */
890 assert(n
[0].opcode
== OPCODE_BITMAP
);
891 bitmap_width
= n
[1].i
;
892 bitmap_height
= n
[2].i
;
893 bitmap_xorig
= n
[3].f
;
894 bitmap_yorig
= n
[4].f
;
895 bitmap_xmove
= n
[5].f
;
896 bitmap_ymove
= n
[6].f
;
898 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
899 /* advance to the next row of the texture */
905 /* save the bitmap's position in the atlas */
909 g
->h
= bitmap_height
;
910 g
->xorig
= bitmap_xorig
;
911 g
->yorig
= bitmap_yorig
;
912 g
->xmove
= bitmap_xmove
;
913 g
->ymove
= bitmap_ymove
;
915 xpos
+= bitmap_width
;
917 /* keep track of tallest bitmap in the row */
918 row_height
= MAX2(row_height
, bitmap_height
);
921 /* Now we know the texture height */
922 atlas
->texHeight
= ypos
+ row_height
;
924 if (atlas
->texHeight
== 0) {
925 /* no glyphs found, give up */
928 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
929 /* too large, give up */
933 /* Create atlas texture (texture ID is irrelevant) */
934 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
935 if (!atlas
->texObj
) {
939 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
940 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
941 atlas
->texObj
->MaxLevel
= 0;
942 atlas
->texObj
->Immutable
= GL_TRUE
;
944 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
945 GL_TEXTURE_RECTANGLE
, 0);
946 if (!atlas
->texImage
) {
950 if (ctx
->Const
.BitmapUsesRed
)
951 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
952 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
953 GL_RED
, MESA_FORMAT_R_UNORM8
);
955 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
956 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
957 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
959 /* alloc image storage */
960 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
964 /* map teximage, load with bitmap glyphs */
965 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
966 0, 0, atlas
->texWidth
, atlas
->texHeight
,
967 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
972 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
973 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
975 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
976 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
977 const Node
*n
= list
->Head
;
979 assert(n
[0].opcode
== OPCODE_BITMAP
||
980 n
[0].opcode
== OPCODE_END_OF_LIST
);
982 if (n
[0].opcode
== OPCODE_BITMAP
) {
983 unsigned bitmap_width
= n
[1].i
;
984 unsigned bitmap_height
= n
[2].i
;
985 unsigned xpos
= atlas
->glyphs
[i
].x
;
986 unsigned ypos
= atlas
->glyphs
[i
].y
;
987 const void *bitmap_image
= get_pointer(&n
[7]);
989 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
990 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
992 /* put the bitmap image into the texture image */
993 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
994 &ctx
->DefaultPacking
, bitmap_image
,
995 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
1000 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
1002 atlas
->complete
= true;
1007 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
1009 if (atlas
->texObj
) {
1010 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
1012 free(atlas
->glyphs
);
1013 atlas
->glyphs
= NULL
;
1014 atlas
->incomplete
= true;
1019 * Allocate a gl_display_list object with an initial block of storage.
1020 * \param count how many display list nodes/tokens to allocate
1022 static struct gl_display_list
*
1023 make_list(GLuint name
, GLuint count
)
1025 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1027 dlist
->Head
= malloc(sizeof(Node
) * count
);
1028 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1029 /* All InstSize[] entries must be non-zero */
1030 InstSize
[OPCODE_END_OF_LIST
] = 1;
1036 * Lookup function to just encapsulate casting.
1038 struct gl_display_list
*
1039 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1041 return (struct gl_display_list
*)
1042 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1046 /** Is the given opcode an extension code? */
1047 static inline GLboolean
1048 is_ext_opcode(OpCode opcode
)
1050 return (opcode
>= OPCODE_EXT_0
);
1054 /** Destroy an extended opcode instruction */
1056 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1058 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1060 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1061 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1066 /** Execute an extended opcode instruction */
1068 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1070 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1072 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1073 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1078 /** Print an extended opcode instruction */
1080 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1082 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1084 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1085 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1091 * Delete the named display list, but don't remove from hash table.
1092 * \param dlist - display list pointer
1095 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1100 n
= block
= dlist
->Head
;
1102 done
= block
? GL_FALSE
: GL_TRUE
;
1104 const OpCode opcode
= n
[0].opcode
;
1106 /* check for extension opcodes first */
1107 if (is_ext_opcode(opcode
)) {
1108 n
+= ext_opcode_destroy(ctx
, n
);
1112 /* for some commands, we need to free malloc'd memory */
1114 free(get_pointer(&n
[6]));
1117 free(get_pointer(&n
[10]));
1119 case OPCODE_CALL_LISTS
:
1120 free(get_pointer(&n
[3]));
1122 case OPCODE_DRAW_PIXELS
:
1123 free(get_pointer(&n
[5]));
1126 free(get_pointer(&n
[7]));
1128 case OPCODE_POLYGON_STIPPLE
:
1129 free(get_pointer(&n
[1]));
1131 case OPCODE_TEX_IMAGE1D
:
1132 free(get_pointer(&n
[8]));
1134 case OPCODE_TEX_IMAGE2D
:
1135 free(get_pointer(&n
[9]));
1137 case OPCODE_TEX_IMAGE3D
:
1138 free(get_pointer(&n
[10]));
1140 case OPCODE_TEX_SUB_IMAGE1D
:
1141 free(get_pointer(&n
[7]));
1143 case OPCODE_TEX_SUB_IMAGE2D
:
1144 free(get_pointer(&n
[9]));
1146 case OPCODE_TEX_SUB_IMAGE3D
:
1147 free(get_pointer(&n
[11]));
1149 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1150 free(get_pointer(&n
[7]));
1152 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1153 free(get_pointer(&n
[8]));
1155 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1156 free(get_pointer(&n
[9]));
1158 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1159 free(get_pointer(&n
[7]));
1161 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1162 free(get_pointer(&n
[9]));
1164 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1165 free(get_pointer(&n
[11]));
1167 case OPCODE_PROGRAM_STRING_ARB
:
1168 free(get_pointer(&n
[4])); /* program string */
1170 case OPCODE_UNIFORM_1FV
:
1171 case OPCODE_UNIFORM_2FV
:
1172 case OPCODE_UNIFORM_3FV
:
1173 case OPCODE_UNIFORM_4FV
:
1174 case OPCODE_UNIFORM_1DV
:
1175 case OPCODE_UNIFORM_2DV
:
1176 case OPCODE_UNIFORM_3DV
:
1177 case OPCODE_UNIFORM_4DV
:
1178 case OPCODE_UNIFORM_1IV
:
1179 case OPCODE_UNIFORM_2IV
:
1180 case OPCODE_UNIFORM_3IV
:
1181 case OPCODE_UNIFORM_4IV
:
1182 case OPCODE_UNIFORM_1UIV
:
1183 case OPCODE_UNIFORM_2UIV
:
1184 case OPCODE_UNIFORM_3UIV
:
1185 case OPCODE_UNIFORM_4UIV
:
1186 free(get_pointer(&n
[3]));
1188 case OPCODE_UNIFORM_MATRIX22
:
1189 case OPCODE_UNIFORM_MATRIX33
:
1190 case OPCODE_UNIFORM_MATRIX44
:
1191 case OPCODE_UNIFORM_MATRIX24
:
1192 case OPCODE_UNIFORM_MATRIX42
:
1193 case OPCODE_UNIFORM_MATRIX23
:
1194 case OPCODE_UNIFORM_MATRIX32
:
1195 case OPCODE_UNIFORM_MATRIX34
:
1196 case OPCODE_UNIFORM_MATRIX43
:
1197 case OPCODE_UNIFORM_MATRIX22D
:
1198 case OPCODE_UNIFORM_MATRIX33D
:
1199 case OPCODE_UNIFORM_MATRIX44D
:
1200 case OPCODE_UNIFORM_MATRIX24D
:
1201 case OPCODE_UNIFORM_MATRIX42D
:
1202 case OPCODE_UNIFORM_MATRIX23D
:
1203 case OPCODE_UNIFORM_MATRIX32D
:
1204 case OPCODE_UNIFORM_MATRIX34D
:
1205 case OPCODE_UNIFORM_MATRIX43D
:
1206 free(get_pointer(&n
[4]));
1208 case OPCODE_PROGRAM_UNIFORM_1FV
:
1209 case OPCODE_PROGRAM_UNIFORM_2FV
:
1210 case OPCODE_PROGRAM_UNIFORM_3FV
:
1211 case OPCODE_PROGRAM_UNIFORM_4FV
:
1212 case OPCODE_PROGRAM_UNIFORM_1DV
:
1213 case OPCODE_PROGRAM_UNIFORM_2DV
:
1214 case OPCODE_PROGRAM_UNIFORM_3DV
:
1215 case OPCODE_PROGRAM_UNIFORM_4DV
:
1216 case OPCODE_PROGRAM_UNIFORM_1IV
:
1217 case OPCODE_PROGRAM_UNIFORM_2IV
:
1218 case OPCODE_PROGRAM_UNIFORM_3IV
:
1219 case OPCODE_PROGRAM_UNIFORM_4IV
:
1220 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1221 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1222 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1223 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1224 free(get_pointer(&n
[4]));
1226 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1227 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1228 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1229 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1230 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1231 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1232 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1233 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1234 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1235 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1236 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1237 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1238 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1239 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1240 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1241 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1242 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1243 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1244 free(get_pointer(&n
[5]));
1246 case OPCODE_PIXEL_MAP
:
1247 free(get_pointer(&n
[3]));
1249 case OPCODE_VIEWPORT_ARRAY_V
:
1250 case OPCODE_SCISSOR_ARRAY_V
:
1251 case OPCODE_DEPTH_ARRAY_V
:
1252 case OPCODE_UNIFORM_SUBROUTINES
:
1253 case OPCODE_WINDOW_RECTANGLES
:
1254 free(get_pointer(&n
[3]));
1256 case OPCODE_TEXTURE_IMAGE1D
:
1257 case OPCODE_MULTITEX_IMAGE1D
:
1258 free(get_pointer(&n
[9]));
1260 case OPCODE_TEXTURE_IMAGE2D
:
1261 case OPCODE_MULTITEX_IMAGE2D
:
1262 free(get_pointer(&n
[10]));
1264 case OPCODE_TEXTURE_IMAGE3D
:
1265 case OPCODE_MULTITEX_IMAGE3D
:
1266 free(get_pointer(&n
[11]));
1268 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1269 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1270 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
1271 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
1272 free(get_pointer(&n
[8]));
1274 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1275 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1276 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1277 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
1278 free(get_pointer(&n
[10]));
1280 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1281 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1282 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
1283 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
1284 free(get_pointer(&n
[12]));
1286 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
1287 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
1288 free(get_pointer(&n
[8]));
1290 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
1291 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
1292 free(get_pointer(&n
[9]));
1294 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
1295 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
1296 free(get_pointer(&n
[10]));
1298 case OPCODE_NAMED_PROGRAM_STRING
:
1299 free(get_pointer(&n
[5]));
1301 case OPCODE_CONTINUE
:
1302 n
= (Node
*) get_pointer(&n
[1]);
1306 case OPCODE_END_OF_LIST
:
1311 /* just increment 'n' pointer, below */
1315 if (opcode
!= OPCODE_CONTINUE
) {
1316 assert(InstSize
[opcode
] > 0);
1317 n
+= InstSize
[opcode
];
1328 * Called by _mesa_HashWalk() to check if a display list which is being
1329 * deleted belongs to a bitmap texture atlas.
1332 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1334 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1335 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1337 /* See if the list_id falls in the range contained in this texture atlas */
1338 if (atlas
->complete
&&
1339 list_id
>= atlas_id
&&
1340 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1341 /* Mark the atlas as incomplete so it doesn't get used. But don't
1342 * delete it yet since we don't want to try to recreate it in the next
1345 atlas
->complete
= false;
1346 atlas
->incomplete
= true;
1352 * Destroy a display list and remove from hash table.
1353 * \param list - display list number
1356 destroy_list(struct gl_context
*ctx
, GLuint list
)
1358 struct gl_display_list
*dlist
;
1363 dlist
= _mesa_lookup_list(ctx
, list
);
1367 if (is_bitmap_list(dlist
)) {
1368 /* If we're destroying a simple glBitmap display list, there's a
1369 * chance that we're destroying a bitmap image that's in a texture
1370 * atlas. Examine all atlases to see if that's the case. There's
1371 * usually few (if any) atlases so this isn't expensive.
1373 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1374 check_atlas_for_deleted_list
, &list
);
1377 _mesa_delete_list(ctx
, dlist
);
1378 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1383 * Translate the nth element of list from <type> to GLint.
1386 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1398 bptr
= (GLbyte
*) list
;
1399 return (GLint
) bptr
[n
];
1400 case GL_UNSIGNED_BYTE
:
1401 ubptr
= (GLubyte
*) list
;
1402 return (GLint
) ubptr
[n
];
1404 sptr
= (GLshort
*) list
;
1405 return (GLint
) sptr
[n
];
1406 case GL_UNSIGNED_SHORT
:
1407 usptr
= (GLushort
*) list
;
1408 return (GLint
) usptr
[n
];
1410 iptr
= (GLint
*) list
;
1412 case GL_UNSIGNED_INT
:
1413 uiptr
= (GLuint
*) list
;
1414 return (GLint
) uiptr
[n
];
1416 fptr
= (GLfloat
*) list
;
1417 return (GLint
) floorf(fptr
[n
]);
1419 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1420 return (GLint
) ubptr
[0] * 256
1423 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1424 return (GLint
) ubptr
[0] * 65536
1425 + (GLint
) ubptr
[1] * 256
1428 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1429 return (GLint
) ubptr
[0] * 16777216
1430 + (GLint
) ubptr
[1] * 65536
1431 + (GLint
) ubptr
[2] * 256
1440 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1441 * If width < 0 or height < 0 or format or type are invalid we'll just
1442 * return NULL. We will not generate an error since OpenGL command
1443 * arguments aren't error-checked until the command is actually executed
1444 * (not when they're compiled).
1445 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1448 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1449 GLsizei width
, GLsizei height
, GLsizei depth
,
1450 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1451 const struct gl_pixelstore_attrib
*unpack
)
1453 if (width
<= 0 || height
<= 0) {
1457 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1458 /* bad format and/or type */
1462 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1466 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1467 format
, type
, pixels
, unpack
);
1468 if (pixels
&& !image
) {
1469 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1473 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1474 depth
, format
, type
, INT_MAX
, pixels
)) {
1475 const GLubyte
*map
, *src
;
1479 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1480 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1483 /* unable to map src buffer! */
1484 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1488 src
= ADD_POINTERS(map
, pixels
);
1489 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1490 format
, type
, src
, unpack
);
1492 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1495 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1501 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1506 /** Return copy of memory */
1508 memdup(const void *src
, GLsizei bytes
)
1510 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1512 memcpy(b
, src
, bytes
);
1518 * Allocate space for a display list instruction (opcode + payload space).
1519 * \param opcode the instruction opcode (OPCODE_* value)
1520 * \param bytes instruction payload size (not counting opcode)
1521 * \param align8 does the payload need to be 8-byte aligned?
1522 * This is only relevant in 64-bit environments.
1523 * \return pointer to allocated memory (the payload will be at pointer+1)
1526 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1528 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1529 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1533 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1535 if (opcode
< OPCODE_EXT_0
) {
1536 if (InstSize
[opcode
] == 0) {
1537 /* save instruction size now */
1538 InstSize
[opcode
] = numNodes
;
1541 /* make sure instruction size agrees */
1542 assert(numNodes
== InstSize
[opcode
]);
1546 if (sizeof(void *) > sizeof(Node
) && align8
1547 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1548 /* The opcode would get placed at node[0] and the payload would start
1549 * at node[1]. But the payload needs to be at an even offset (8-byte
1558 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1560 /* This block is full. Allocate a new block and chain to it */
1562 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1563 n
[0].opcode
= OPCODE_CONTINUE
;
1564 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1566 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1570 /* a fresh block should be 8-byte aligned on 64-bit systems */
1571 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1573 save_pointer(&n
[1], newblock
);
1574 ctx
->ListState
.CurrentBlock
= newblock
;
1575 ctx
->ListState
.CurrentPos
= 0;
1577 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1578 * we have to insert a NOP so that the payload of the real opcode lands
1579 * on an even location:
1580 * node[0] = OPCODE_NOP
1581 * node[1] = OPCODE_x;
1582 * node[2] = start of payload
1584 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1587 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1589 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1590 n
[0].opcode
= OPCODE_NOP
;
1592 /* The "real" opcode will now be at an odd location and the payload
1593 * will be at an even location.
1596 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1598 n
[0].opcode
= opcode
;
1606 * Allocate space for a display list instruction. Used by callers outside
1607 * this file for things like VBO vertex data.
1609 * \param opcode the instruction opcode (OPCODE_* value)
1610 * \param bytes instruction size in bytes, not counting opcode.
1611 * \return pointer to the usable data area (not including the internal
1615 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1617 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1619 return n
+ 1; /* return pointer to payload area, after opcode */
1626 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1627 * aligned in 64-bit environments, 4-byte aligned otherwise.
1630 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1632 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1634 return n
+ 1; /* return pointer to payload area, after opcode */
1641 * This function allows modules and drivers to get their own opcodes
1642 * for extending display list functionality.
1643 * \param ctx the rendering context
1644 * \param size number of bytes for storing the new display list command
1645 * \param execute function to execute the new display list command
1646 * \param destroy function to destroy the new display list command
1647 * \param print function to print the new display list command
1648 * \return the new opcode number or -1 if error
1651 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1653 void (*execute
) (struct gl_context
*, void *),
1654 void (*destroy
) (struct gl_context
*, void *),
1655 void (*print
) (struct gl_context
*, void *, FILE *))
1657 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1658 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1659 ctx
->ListExt
->Opcode
[i
].Size
=
1660 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1661 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1662 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1663 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1664 return i
+ OPCODE_EXT_0
;
1671 * Allocate space for a display list instruction. The space is basically
1672 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1673 * function parameter, node[2] is the second parameter, etc.
1675 * \param opcode one of OPCODE_x
1676 * \param nparams number of function parameters
1677 * \return pointer to start of instruction space
1679 static inline Node
*
1680 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1682 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1687 * Called by EndList to try to reduce memory used for the list.
1690 trim_list(struct gl_context
*ctx
)
1692 /* If the list we're ending only has one allocated block of nodes/tokens
1693 * and its size isn't a full block size, realloc the block to use less
1694 * memory. This is important for apps that create many small display
1695 * lists and apps that use glXUseXFont (many lists each containing one
1697 * Note: we currently only trim display lists that allocated one block
1698 * of tokens. That hits the short list case which is what we're mainly
1699 * concerned with. Trimming longer lists would involve traversing the
1700 * linked list of blocks.
1702 struct gl_dlist_state
*list
= &ctx
->ListState
;
1704 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1705 (list
->CurrentPos
< BLOCK_SIZE
)) {
1706 /* There's only one block and it's not full, so realloc */
1707 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1708 list
->CurrentList
->Head
=
1709 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1710 if (!list
->CurrentBlock
) {
1711 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1719 * Display List compilation functions
1721 static void GLAPIENTRY
1722 save_Accum(GLenum op
, GLfloat value
)
1724 GET_CURRENT_CONTEXT(ctx
);
1726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1727 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1732 if (ctx
->ExecuteFlag
) {
1733 CALL_Accum(ctx
->Exec
, (op
, value
));
1738 static void GLAPIENTRY
1739 save_AlphaFunc(GLenum func
, GLclampf ref
)
1741 GET_CURRENT_CONTEXT(ctx
);
1743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1744 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1747 n
[2].f
= (GLfloat
) ref
;
1749 if (ctx
->ExecuteFlag
) {
1750 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1755 static void GLAPIENTRY
1756 save_BindTexture(GLenum target
, GLuint texture
)
1758 GET_CURRENT_CONTEXT(ctx
);
1760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1761 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1766 if (ctx
->ExecuteFlag
) {
1767 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1772 static void GLAPIENTRY
1773 save_Bitmap(GLsizei width
, GLsizei height
,
1774 GLfloat xorig
, GLfloat yorig
,
1775 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1777 GET_CURRENT_CONTEXT(ctx
);
1779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1780 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1782 n
[1].i
= (GLint
) width
;
1783 n
[2].i
= (GLint
) height
;
1789 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1790 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1792 if (ctx
->ExecuteFlag
) {
1793 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1794 xorig
, yorig
, xmove
, ymove
, pixels
));
1799 static void GLAPIENTRY
1800 save_BlendEquation(GLenum mode
)
1802 GET_CURRENT_CONTEXT(ctx
);
1804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1805 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1809 if (ctx
->ExecuteFlag
) {
1810 CALL_BlendEquation(ctx
->Exec
, (mode
));
1815 static void GLAPIENTRY
1816 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1818 GET_CURRENT_CONTEXT(ctx
);
1820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1821 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1826 if (ctx
->ExecuteFlag
) {
1827 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1832 static void GLAPIENTRY
1833 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1834 GLenum sfactorA
, GLenum dfactorA
)
1836 GET_CURRENT_CONTEXT(ctx
);
1838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1839 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1841 n
[1].e
= sfactorRGB
;
1842 n
[2].e
= dfactorRGB
;
1846 if (ctx
->ExecuteFlag
) {
1847 CALL_BlendFuncSeparate(ctx
->Exec
,
1848 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1853 static void GLAPIENTRY
1854 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1856 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1860 static void GLAPIENTRY
1861 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1863 GET_CURRENT_CONTEXT(ctx
);
1865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1866 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1873 if (ctx
->ExecuteFlag
) {
1874 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1878 /* GL_ARB_draw_buffers_blend */
1879 static void GLAPIENTRY
1880 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1881 GLenum sfactorA
, GLenum dfactorA
)
1883 GET_CURRENT_CONTEXT(ctx
);
1885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1886 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1889 n
[2].e
= sfactorRGB
;
1890 n
[3].e
= dfactorRGB
;
1894 if (ctx
->ExecuteFlag
) {
1895 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1896 sfactorA
, dfactorA
));
1900 /* GL_ARB_draw_buffers_blend */
1901 static void GLAPIENTRY
1902 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1904 GET_CURRENT_CONTEXT(ctx
);
1906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1907 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1913 if (ctx
->ExecuteFlag
) {
1914 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1918 /* GL_ARB_draw_buffers_blend */
1919 static void GLAPIENTRY
1920 save_BlendEquationi(GLuint buf
, GLenum mode
)
1922 GET_CURRENT_CONTEXT(ctx
);
1924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1925 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1930 if (ctx
->ExecuteFlag
) {
1931 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1935 /* GL_ARB_draw_buffers_blend */
1936 static void GLAPIENTRY
1937 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1939 GET_CURRENT_CONTEXT(ctx
);
1941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1942 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1948 if (ctx
->ExecuteFlag
) {
1949 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1954 /* GL_ARB_draw_instanced. */
1955 static void GLAPIENTRY
1956 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1958 UNUSED GLsizei count
,
1959 UNUSED GLsizei primcount
)
1961 GET_CURRENT_CONTEXT(ctx
);
1962 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1963 "glDrawArraysInstanced() during display list compile");
1966 static void GLAPIENTRY
1967 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1968 UNUSED GLsizei count
,
1970 UNUSED
const GLvoid
*indices
,
1971 UNUSED GLsizei primcount
)
1973 GET_CURRENT_CONTEXT(ctx
);
1974 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1975 "glDrawElementsInstanced() during display list compile");
1978 static void GLAPIENTRY
1979 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1980 UNUSED GLsizei count
,
1982 UNUSED
const GLvoid
*indices
,
1983 UNUSED GLsizei primcount
,
1984 UNUSED GLint basevertex
)
1986 GET_CURRENT_CONTEXT(ctx
);
1987 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1988 "glDrawElementsInstancedBaseVertex() during display list compile");
1991 /* GL_ARB_base_instance. */
1992 static void GLAPIENTRY
1993 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1995 UNUSED GLsizei count
,
1996 UNUSED GLsizei primcount
,
1997 UNUSED GLuint baseinstance
)
1999 GET_CURRENT_CONTEXT(ctx
);
2000 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2001 "glDrawArraysInstancedBaseInstance() during display list compile");
2004 static void APIENTRY
2005 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
2006 UNUSED GLsizei count
,
2008 UNUSED
const void *indices
,
2009 UNUSED GLsizei primcount
,
2010 UNUSED GLuint baseinstance
)
2012 GET_CURRENT_CONTEXT(ctx
);
2013 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2014 "glDrawElementsInstancedBaseInstance() during display list compile");
2017 static void APIENTRY
2018 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
2019 UNUSED GLsizei count
,
2021 UNUSED
const void *indices
,
2022 UNUSED GLsizei primcount
,
2023 UNUSED GLint basevertex
,
2024 UNUSED GLuint baseinstance
)
2026 GET_CURRENT_CONTEXT(ctx
);
2027 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2028 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
2031 static void APIENTRY
2032 save_DrawArraysIndirect(UNUSED GLenum mode
,
2033 UNUSED
const void *indirect
)
2035 GET_CURRENT_CONTEXT(ctx
);
2036 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2037 "glDrawArraysIndirect() during display list compile");
2040 static void APIENTRY
2041 save_DrawElementsIndirect(UNUSED GLenum mode
,
2043 UNUSED
const void *indirect
)
2045 GET_CURRENT_CONTEXT(ctx
);
2046 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2047 "glDrawElementsIndirect() during display list compile");
2050 static void APIENTRY
2051 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2052 UNUSED
const void *indirect
,
2053 UNUSED GLsizei primcount
,
2054 UNUSED GLsizei stride
)
2056 GET_CURRENT_CONTEXT(ctx
);
2057 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2058 "glMultiDrawArraysIndirect() during display list compile");
2061 static void APIENTRY
2062 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2064 UNUSED
const void *indirect
,
2065 UNUSED GLsizei primcount
,
2066 UNUSED GLsizei stride
)
2068 GET_CURRENT_CONTEXT(ctx
);
2069 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2070 "glMultiDrawElementsIndirect() during display list compile");
2074 * While building a display list we cache some OpenGL state.
2075 * Under some circumstances we need to invalidate that state (immediately
2076 * when we start compiling a list, or after glCallList(s)).
2079 invalidate_saved_current_state(struct gl_context
*ctx
)
2083 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2084 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2086 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2087 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2089 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2091 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2095 static void GLAPIENTRY
2096 save_CallList(GLuint list
)
2098 GET_CURRENT_CONTEXT(ctx
);
2100 SAVE_FLUSH_VERTICES(ctx
);
2102 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2107 /* After this, we don't know what state we're in. Invalidate all
2108 * cached information previously gathered:
2110 invalidate_saved_current_state( ctx
);
2112 if (ctx
->ExecuteFlag
) {
2113 _mesa_CallList(list
);
2118 static void GLAPIENTRY
2119 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2121 GET_CURRENT_CONTEXT(ctx
);
2126 SAVE_FLUSH_VERTICES(ctx
);
2130 case GL_UNSIGNED_BYTE
:
2134 case GL_UNSIGNED_SHORT
:
2142 case GL_UNSIGNED_INT
:
2151 if (num
> 0 && type_size
> 0) {
2152 /* create a copy of the array of list IDs to save in the display list */
2153 lists_copy
= memdup(lists
, num
* type_size
);
2158 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2162 save_pointer(&n
[3], lists_copy
);
2165 /* After this, we don't know what state we're in. Invalidate all
2166 * cached information previously gathered:
2168 invalidate_saved_current_state( ctx
);
2170 if (ctx
->ExecuteFlag
) {
2171 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2176 static void GLAPIENTRY
2177 save_Clear(GLbitfield mask
)
2179 GET_CURRENT_CONTEXT(ctx
);
2181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2182 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2186 if (ctx
->ExecuteFlag
) {
2187 CALL_Clear(ctx
->Exec
, (mask
));
2192 static void GLAPIENTRY
2193 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2195 GET_CURRENT_CONTEXT(ctx
);
2197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2198 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2201 n
[2].i
= drawbuffer
;
2203 if (buffer
== GL_COLOR
) {
2214 if (ctx
->ExecuteFlag
) {
2215 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2220 static void GLAPIENTRY
2221 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2229 n
[2].i
= drawbuffer
;
2231 if (buffer
== GL_COLOR
) {
2242 if (ctx
->ExecuteFlag
) {
2243 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2248 static void GLAPIENTRY
2249 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2257 n
[2].i
= drawbuffer
;
2259 if (buffer
== GL_COLOR
) {
2270 if (ctx
->ExecuteFlag
) {
2271 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2276 static void GLAPIENTRY
2277 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2278 GLfloat depth
, GLint stencil
)
2280 GET_CURRENT_CONTEXT(ctx
);
2282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2283 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2286 n
[2].i
= drawbuffer
;
2290 if (ctx
->ExecuteFlag
) {
2291 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2296 static void GLAPIENTRY
2297 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2299 GET_CURRENT_CONTEXT(ctx
);
2301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2302 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2309 if (ctx
->ExecuteFlag
) {
2310 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2315 static void GLAPIENTRY
2316 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2318 GET_CURRENT_CONTEXT(ctx
);
2320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2321 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2328 if (ctx
->ExecuteFlag
) {
2329 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2334 static void GLAPIENTRY
2335 save_ClearDepth(GLclampd depth
)
2337 GET_CURRENT_CONTEXT(ctx
);
2339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2340 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2342 n
[1].f
= (GLfloat
) depth
;
2344 if (ctx
->ExecuteFlag
) {
2345 CALL_ClearDepth(ctx
->Exec
, (depth
));
2350 static void GLAPIENTRY
2351 save_ClearIndex(GLfloat c
)
2353 GET_CURRENT_CONTEXT(ctx
);
2355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2356 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2360 if (ctx
->ExecuteFlag
) {
2361 CALL_ClearIndex(ctx
->Exec
, (c
));
2366 static void GLAPIENTRY
2367 save_ClearStencil(GLint s
)
2369 GET_CURRENT_CONTEXT(ctx
);
2371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2372 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2376 if (ctx
->ExecuteFlag
) {
2377 CALL_ClearStencil(ctx
->Exec
, (s
));
2382 static void GLAPIENTRY
2383 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2385 GET_CURRENT_CONTEXT(ctx
);
2387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2388 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2391 n
[2].f
= (GLfloat
) equ
[0];
2392 n
[3].f
= (GLfloat
) equ
[1];
2393 n
[4].f
= (GLfloat
) equ
[2];
2394 n
[5].f
= (GLfloat
) equ
[3];
2396 if (ctx
->ExecuteFlag
) {
2397 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2403 static void GLAPIENTRY
2404 save_ColorMask(GLboolean red
, GLboolean green
,
2405 GLboolean blue
, GLboolean alpha
)
2407 GET_CURRENT_CONTEXT(ctx
);
2409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2410 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2417 if (ctx
->ExecuteFlag
) {
2418 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2423 static void GLAPIENTRY
2424 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2425 GLboolean blue
, GLboolean alpha
)
2427 GET_CURRENT_CONTEXT(ctx
);
2429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2430 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2438 if (ctx
->ExecuteFlag
) {
2439 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2444 static void GLAPIENTRY
2445 save_ColorMaterial(GLenum face
, GLenum mode
)
2447 GET_CURRENT_CONTEXT(ctx
);
2449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2451 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2456 if (ctx
->ExecuteFlag
) {
2457 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2462 static void GLAPIENTRY
2463 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2465 GET_CURRENT_CONTEXT(ctx
);
2467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2468 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2472 n
[3].i
= (GLint
) width
;
2473 n
[4].i
= (GLint
) height
;
2476 if (ctx
->ExecuteFlag
) {
2477 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2483 static void GLAPIENTRY
2484 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2485 GLint x
, GLint y
, GLsizei width
, GLint border
)
2487 GET_CURRENT_CONTEXT(ctx
);
2489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2490 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2494 n
[3].e
= internalformat
;
2500 if (ctx
->ExecuteFlag
) {
2501 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2502 x
, y
, width
, border
));
2507 static void GLAPIENTRY
2508 save_CopyTexImage2D(GLenum target
, GLint level
,
2509 GLenum internalformat
,
2510 GLint x
, GLint y
, GLsizei width
,
2511 GLsizei height
, GLint border
)
2513 GET_CURRENT_CONTEXT(ctx
);
2515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2516 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2520 n
[3].e
= internalformat
;
2527 if (ctx
->ExecuteFlag
) {
2528 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2529 x
, y
, width
, height
, border
));
2535 static void GLAPIENTRY
2536 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2537 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2539 GET_CURRENT_CONTEXT(ctx
);
2541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2542 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2551 if (ctx
->ExecuteFlag
) {
2552 CALL_CopyTexSubImage1D(ctx
->Exec
,
2553 (target
, level
, xoffset
, x
, y
, width
));
2558 static void GLAPIENTRY
2559 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2560 GLint xoffset
, GLint yoffset
,
2561 GLint x
, GLint y
, GLsizei width
, GLint height
)
2563 GET_CURRENT_CONTEXT(ctx
);
2565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2566 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2577 if (ctx
->ExecuteFlag
) {
2578 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2579 x
, y
, width
, height
));
2584 static void GLAPIENTRY
2585 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2586 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2587 GLint x
, GLint y
, GLsizei width
, GLint height
)
2589 GET_CURRENT_CONTEXT(ctx
);
2591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2592 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2604 if (ctx
->ExecuteFlag
) {
2605 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2606 xoffset
, yoffset
, zoffset
,
2607 x
, y
, width
, height
));
2612 static void GLAPIENTRY
2613 save_CullFace(GLenum mode
)
2615 GET_CURRENT_CONTEXT(ctx
);
2617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2618 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2622 if (ctx
->ExecuteFlag
) {
2623 CALL_CullFace(ctx
->Exec
, (mode
));
2628 static void GLAPIENTRY
2629 save_DepthFunc(GLenum func
)
2631 GET_CURRENT_CONTEXT(ctx
);
2633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2634 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2638 if (ctx
->ExecuteFlag
) {
2639 CALL_DepthFunc(ctx
->Exec
, (func
));
2644 static void GLAPIENTRY
2645 save_DepthMask(GLboolean mask
)
2647 GET_CURRENT_CONTEXT(ctx
);
2649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2650 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2654 if (ctx
->ExecuteFlag
) {
2655 CALL_DepthMask(ctx
->Exec
, (mask
));
2660 static void GLAPIENTRY
2661 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2663 GET_CURRENT_CONTEXT(ctx
);
2665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2666 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2668 n
[1].f
= (GLfloat
) nearval
;
2669 n
[2].f
= (GLfloat
) farval
;
2671 if (ctx
->ExecuteFlag
) {
2672 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2677 static void GLAPIENTRY
2678 save_Disable(GLenum cap
)
2680 GET_CURRENT_CONTEXT(ctx
);
2682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2683 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2687 if (ctx
->ExecuteFlag
) {
2688 CALL_Disable(ctx
->Exec
, (cap
));
2693 static void GLAPIENTRY
2694 save_DisableIndexed(GLuint index
, GLenum cap
)
2696 GET_CURRENT_CONTEXT(ctx
);
2698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2699 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2704 if (ctx
->ExecuteFlag
) {
2705 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2710 static void GLAPIENTRY
2711 save_DrawBuffer(GLenum mode
)
2713 GET_CURRENT_CONTEXT(ctx
);
2715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2716 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2720 if (ctx
->ExecuteFlag
) {
2721 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2726 static void GLAPIENTRY
2727 save_DrawPixels(GLsizei width
, GLsizei height
,
2728 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2730 GET_CURRENT_CONTEXT(ctx
);
2733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2735 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2742 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2743 pixels
, &ctx
->Unpack
));
2745 if (ctx
->ExecuteFlag
) {
2746 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2752 static void GLAPIENTRY
2753 save_Enable(GLenum cap
)
2755 GET_CURRENT_CONTEXT(ctx
);
2757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2758 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2762 if (ctx
->ExecuteFlag
) {
2763 CALL_Enable(ctx
->Exec
, (cap
));
2769 static void GLAPIENTRY
2770 save_EnableIndexed(GLuint index
, GLenum cap
)
2772 GET_CURRENT_CONTEXT(ctx
);
2774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2775 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2780 if (ctx
->ExecuteFlag
) {
2781 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2787 static void GLAPIENTRY
2788 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2790 GET_CURRENT_CONTEXT(ctx
);
2792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2793 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2805 static void GLAPIENTRY
2806 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2808 GET_CURRENT_CONTEXT(ctx
);
2810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2811 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2819 if (ctx
->ExecuteFlag
) {
2820 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2827 static void GLAPIENTRY
2828 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2830 GET_CURRENT_CONTEXT(ctx
);
2832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2833 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2841 if (ctx
->ExecuteFlag
) {
2842 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2847 static void GLAPIENTRY
2848 save_Fogf(GLenum pname
, GLfloat param
)
2852 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2853 save_Fogfv(pname
, parray
);
2857 static void GLAPIENTRY
2858 save_Fogiv(GLenum pname
, const GLint
*params
)
2863 case GL_FOG_DENSITY
:
2867 case GL_FOG_COORDINATE_SOURCE
:
2868 p
[0] = (GLfloat
) *params
;
2874 p
[0] = INT_TO_FLOAT(params
[0]);
2875 p
[1] = INT_TO_FLOAT(params
[1]);
2876 p
[2] = INT_TO_FLOAT(params
[2]);
2877 p
[3] = INT_TO_FLOAT(params
[3]);
2880 /* Error will be caught later in gl_Fogfv */
2881 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2883 save_Fogfv(pname
, p
);
2887 static void GLAPIENTRY
2888 save_Fogi(GLenum pname
, GLint param
)
2892 parray
[1] = parray
[2] = parray
[3] = 0;
2893 save_Fogiv(pname
, parray
);
2897 static void GLAPIENTRY
2898 save_FrontFace(GLenum mode
)
2900 GET_CURRENT_CONTEXT(ctx
);
2902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2903 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2907 if (ctx
->ExecuteFlag
) {
2908 CALL_FrontFace(ctx
->Exec
, (mode
));
2913 static void GLAPIENTRY
2914 save_Frustum(GLdouble left
, GLdouble right
,
2915 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2917 GET_CURRENT_CONTEXT(ctx
);
2919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2920 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2922 n
[1].f
= (GLfloat
) left
;
2923 n
[2].f
= (GLfloat
) right
;
2924 n
[3].f
= (GLfloat
) bottom
;
2925 n
[4].f
= (GLfloat
) top
;
2926 n
[5].f
= (GLfloat
) nearval
;
2927 n
[6].f
= (GLfloat
) farval
;
2929 if (ctx
->ExecuteFlag
) {
2930 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2935 static void GLAPIENTRY
2936 save_Hint(GLenum target
, GLenum mode
)
2938 GET_CURRENT_CONTEXT(ctx
);
2940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2941 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2946 if (ctx
->ExecuteFlag
) {
2947 CALL_Hint(ctx
->Exec
, (target
, mode
));
2952 static void GLAPIENTRY
2953 save_IndexMask(GLuint mask
)
2955 GET_CURRENT_CONTEXT(ctx
);
2957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2958 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2962 if (ctx
->ExecuteFlag
) {
2963 CALL_IndexMask(ctx
->Exec
, (mask
));
2968 static void GLAPIENTRY
2969 save_InitNames(void)
2971 GET_CURRENT_CONTEXT(ctx
);
2972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2973 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2974 if (ctx
->ExecuteFlag
) {
2975 CALL_InitNames(ctx
->Exec
, ());
2980 static void GLAPIENTRY
2981 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2983 GET_CURRENT_CONTEXT(ctx
);
2985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2986 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
3004 case GL_SPOT_DIRECTION
:
3007 case GL_SPOT_EXPONENT
:
3010 case GL_SPOT_CUTOFF
:
3013 case GL_CONSTANT_ATTENUATION
:
3016 case GL_LINEAR_ATTENUATION
:
3019 case GL_QUADRATIC_ATTENUATION
:
3025 for (i
= 0; i
< nParams
; i
++) {
3026 n
[3 + i
].f
= params
[i
];
3029 if (ctx
->ExecuteFlag
) {
3030 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
3035 static void GLAPIENTRY
3036 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
3040 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3041 save_Lightfv(light
, pname
, parray
);
3045 static void GLAPIENTRY
3046 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3053 fparam
[0] = INT_TO_FLOAT(params
[0]);
3054 fparam
[1] = INT_TO_FLOAT(params
[1]);
3055 fparam
[2] = INT_TO_FLOAT(params
[2]);
3056 fparam
[3] = INT_TO_FLOAT(params
[3]);
3059 fparam
[0] = (GLfloat
) params
[0];
3060 fparam
[1] = (GLfloat
) params
[1];
3061 fparam
[2] = (GLfloat
) params
[2];
3062 fparam
[3] = (GLfloat
) params
[3];
3064 case GL_SPOT_DIRECTION
:
3065 fparam
[0] = (GLfloat
) params
[0];
3066 fparam
[1] = (GLfloat
) params
[1];
3067 fparam
[2] = (GLfloat
) params
[2];
3069 case GL_SPOT_EXPONENT
:
3070 case GL_SPOT_CUTOFF
:
3071 case GL_CONSTANT_ATTENUATION
:
3072 case GL_LINEAR_ATTENUATION
:
3073 case GL_QUADRATIC_ATTENUATION
:
3074 fparam
[0] = (GLfloat
) params
[0];
3077 /* error will be caught later in gl_Lightfv */
3080 save_Lightfv(light
, pname
, fparam
);
3084 static void GLAPIENTRY
3085 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3089 parray
[1] = parray
[2] = parray
[3] = 0;
3090 save_Lightiv(light
, pname
, parray
);
3094 static void GLAPIENTRY
3095 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3097 GET_CURRENT_CONTEXT(ctx
);
3099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3100 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3108 if (ctx
->ExecuteFlag
) {
3109 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3114 static void GLAPIENTRY
3115 save_LightModelf(GLenum pname
, GLfloat param
)
3119 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3120 save_LightModelfv(pname
, parray
);
3124 static void GLAPIENTRY
3125 save_LightModeliv(GLenum pname
, const GLint
*params
)
3129 case GL_LIGHT_MODEL_AMBIENT
:
3130 fparam
[0] = INT_TO_FLOAT(params
[0]);
3131 fparam
[1] = INT_TO_FLOAT(params
[1]);
3132 fparam
[2] = INT_TO_FLOAT(params
[2]);
3133 fparam
[3] = INT_TO_FLOAT(params
[3]);
3135 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3136 case GL_LIGHT_MODEL_TWO_SIDE
:
3137 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3138 fparam
[0] = (GLfloat
) params
[0];
3144 /* Error will be caught later in gl_LightModelfv */
3145 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3147 save_LightModelfv(pname
, fparam
);
3151 static void GLAPIENTRY
3152 save_LightModeli(GLenum pname
, GLint param
)
3156 parray
[1] = parray
[2] = parray
[3] = 0;
3157 save_LightModeliv(pname
, parray
);
3161 static void GLAPIENTRY
3162 save_LineStipple(GLint factor
, GLushort pattern
)
3164 GET_CURRENT_CONTEXT(ctx
);
3166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3167 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3172 if (ctx
->ExecuteFlag
) {
3173 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3178 static void GLAPIENTRY
3179 save_LineWidth(GLfloat width
)
3181 GET_CURRENT_CONTEXT(ctx
);
3183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3184 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3188 if (ctx
->ExecuteFlag
) {
3189 CALL_LineWidth(ctx
->Exec
, (width
));
3194 static void GLAPIENTRY
3195 save_ListBase(GLuint base
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3204 if (ctx
->ExecuteFlag
) {
3205 CALL_ListBase(ctx
->Exec
, (base
));
3210 static void GLAPIENTRY
3211 save_LoadIdentity(void)
3213 GET_CURRENT_CONTEXT(ctx
);
3214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3215 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3216 if (ctx
->ExecuteFlag
) {
3217 CALL_LoadIdentity(ctx
->Exec
, ());
3222 static void GLAPIENTRY
3223 save_LoadMatrixf(const GLfloat
* m
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3231 for (i
= 0; i
< 16; i
++) {
3235 if (ctx
->ExecuteFlag
) {
3236 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3241 static void GLAPIENTRY
3242 save_LoadMatrixd(const GLdouble
* m
)
3246 for (i
= 0; i
< 16; i
++) {
3247 f
[i
] = (GLfloat
) m
[i
];
3249 save_LoadMatrixf(f
);
3253 static void GLAPIENTRY
3254 save_LoadName(GLuint name
)
3256 GET_CURRENT_CONTEXT(ctx
);
3258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3259 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3263 if (ctx
->ExecuteFlag
) {
3264 CALL_LoadName(ctx
->Exec
, (name
));
3269 static void GLAPIENTRY
3270 save_LogicOp(GLenum opcode
)
3272 GET_CURRENT_CONTEXT(ctx
);
3274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3275 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3279 if (ctx
->ExecuteFlag
) {
3280 CALL_LogicOp(ctx
->Exec
, (opcode
));
3285 static void GLAPIENTRY
3286 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3287 GLint order
, const GLdouble
* points
)
3289 GET_CURRENT_CONTEXT(ctx
);
3291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3292 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3294 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3296 n
[2].f
= (GLfloat
) u1
;
3297 n
[3].f
= (GLfloat
) u2
;
3298 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3300 save_pointer(&n
[6], pnts
);
3302 if (ctx
->ExecuteFlag
) {
3303 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3307 static void GLAPIENTRY
3308 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3309 GLint order
, const GLfloat
* points
)
3311 GET_CURRENT_CONTEXT(ctx
);
3313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3314 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3316 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3320 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3322 save_pointer(&n
[6], pnts
);
3324 if (ctx
->ExecuteFlag
) {
3325 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3330 static void GLAPIENTRY
3331 save_Map2d(GLenum target
,
3332 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3333 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3334 const GLdouble
* points
)
3336 GET_CURRENT_CONTEXT(ctx
);
3338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3339 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3341 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3342 vstride
, vorder
, points
);
3344 n
[2].f
= (GLfloat
) u1
;
3345 n
[3].f
= (GLfloat
) u2
;
3346 n
[4].f
= (GLfloat
) v1
;
3347 n
[5].f
= (GLfloat
) v2
;
3348 /* XXX verify these strides are correct */
3349 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3350 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3353 save_pointer(&n
[10], pnts
);
3355 if (ctx
->ExecuteFlag
) {
3356 CALL_Map2d(ctx
->Exec
, (target
,
3357 u1
, u2
, ustride
, uorder
,
3358 v1
, v2
, vstride
, vorder
, points
));
3363 static void GLAPIENTRY
3364 save_Map2f(GLenum target
,
3365 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3366 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3367 const GLfloat
* points
)
3369 GET_CURRENT_CONTEXT(ctx
);
3371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3372 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3374 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3375 vstride
, vorder
, points
);
3381 /* XXX verify these strides are correct */
3382 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3383 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3386 save_pointer(&n
[10], pnts
);
3388 if (ctx
->ExecuteFlag
) {
3389 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3390 v1
, v2
, vstride
, vorder
, points
));
3395 static void GLAPIENTRY
3396 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3398 GET_CURRENT_CONTEXT(ctx
);
3400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3401 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3407 if (ctx
->ExecuteFlag
) {
3408 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3413 static void GLAPIENTRY
3414 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3416 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3420 static void GLAPIENTRY
3421 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3422 GLint vn
, GLfloat v1
, GLfloat v2
)
3424 GET_CURRENT_CONTEXT(ctx
);
3426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3427 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3436 if (ctx
->ExecuteFlag
) {
3437 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3443 static void GLAPIENTRY
3444 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3445 GLint vn
, GLdouble v1
, GLdouble v2
)
3447 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3448 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3452 static void GLAPIENTRY
3453 save_MatrixMode(GLenum mode
)
3455 GET_CURRENT_CONTEXT(ctx
);
3457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3458 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3462 if (ctx
->ExecuteFlag
) {
3463 CALL_MatrixMode(ctx
->Exec
, (mode
));
3468 static void GLAPIENTRY
3469 save_MultMatrixf(const GLfloat
* m
)
3471 GET_CURRENT_CONTEXT(ctx
);
3473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3474 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3477 for (i
= 0; i
< 16; i
++) {
3481 if (ctx
->ExecuteFlag
) {
3482 CALL_MultMatrixf(ctx
->Exec
, (m
));
3487 static void GLAPIENTRY
3488 save_MultMatrixd(const GLdouble
* m
)
3492 for (i
= 0; i
< 16; i
++) {
3493 f
[i
] = (GLfloat
) m
[i
];
3495 save_MultMatrixf(f
);
3499 static void GLAPIENTRY
3500 save_NewList(GLuint name
, GLenum mode
)
3502 GET_CURRENT_CONTEXT(ctx
);
3503 /* It's an error to call this function while building a display list */
3504 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3511 static void GLAPIENTRY
3512 save_Ortho(GLdouble left
, GLdouble right
,
3513 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3515 GET_CURRENT_CONTEXT(ctx
);
3517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3518 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3520 n
[1].f
= (GLfloat
) left
;
3521 n
[2].f
= (GLfloat
) right
;
3522 n
[3].f
= (GLfloat
) bottom
;
3523 n
[4].f
= (GLfloat
) top
;
3524 n
[5].f
= (GLfloat
) nearval
;
3525 n
[6].f
= (GLfloat
) farval
;
3527 if (ctx
->ExecuteFlag
) {
3528 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3533 static void GLAPIENTRY
3534 save_PatchParameteri(GLenum pname
, const GLint value
)
3536 GET_CURRENT_CONTEXT(ctx
);
3538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3539 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3544 if (ctx
->ExecuteFlag
) {
3545 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3550 static void GLAPIENTRY
3551 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3553 GET_CURRENT_CONTEXT(ctx
);
3555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3557 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3558 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3560 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3561 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3565 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3575 if (ctx
->ExecuteFlag
) {
3576 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3581 static void GLAPIENTRY
3582 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3584 GET_CURRENT_CONTEXT(ctx
);
3586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3587 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3591 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3593 if (ctx
->ExecuteFlag
) {
3594 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3599 static void GLAPIENTRY
3600 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3602 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3604 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3605 for (i
= 0; i
< mapsize
; i
++) {
3606 fvalues
[i
] = (GLfloat
) values
[i
];
3610 for (i
= 0; i
< mapsize
; i
++) {
3611 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3614 save_PixelMapfv(map
, mapsize
, fvalues
);
3618 static void GLAPIENTRY
3619 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3621 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3623 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3624 for (i
= 0; i
< mapsize
; i
++) {
3625 fvalues
[i
] = (GLfloat
) values
[i
];
3629 for (i
= 0; i
< mapsize
; i
++) {
3630 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3633 save_PixelMapfv(map
, mapsize
, fvalues
);
3637 static void GLAPIENTRY
3638 save_PixelTransferf(GLenum pname
, GLfloat param
)
3640 GET_CURRENT_CONTEXT(ctx
);
3642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3643 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3648 if (ctx
->ExecuteFlag
) {
3649 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3654 static void GLAPIENTRY
3655 save_PixelTransferi(GLenum pname
, GLint param
)
3657 save_PixelTransferf(pname
, (GLfloat
) param
);
3661 static void GLAPIENTRY
3662 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3664 GET_CURRENT_CONTEXT(ctx
);
3666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3667 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3672 if (ctx
->ExecuteFlag
) {
3673 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3678 static void GLAPIENTRY
3679 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3681 GET_CURRENT_CONTEXT(ctx
);
3683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3684 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3691 if (ctx
->ExecuteFlag
) {
3692 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3697 static void GLAPIENTRY
3698 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3702 parray
[1] = parray
[2] = 0.0F
;
3703 save_PointParameterfvEXT(pname
, parray
);
3706 static void GLAPIENTRY
3707 save_PointParameteriNV(GLenum pname
, GLint param
)
3710 parray
[0] = (GLfloat
) param
;
3711 parray
[1] = parray
[2] = 0.0F
;
3712 save_PointParameterfvEXT(pname
, parray
);
3715 static void GLAPIENTRY
3716 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3719 parray
[0] = (GLfloat
) param
[0];
3720 parray
[1] = parray
[2] = 0.0F
;
3721 save_PointParameterfvEXT(pname
, parray
);
3725 static void GLAPIENTRY
3726 save_PointSize(GLfloat size
)
3728 GET_CURRENT_CONTEXT(ctx
);
3730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3731 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3735 if (ctx
->ExecuteFlag
) {
3736 CALL_PointSize(ctx
->Exec
, (size
));
3741 static void GLAPIENTRY
3742 save_PolygonMode(GLenum face
, GLenum mode
)
3744 GET_CURRENT_CONTEXT(ctx
);
3746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3747 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3752 if (ctx
->ExecuteFlag
) {
3753 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3758 static void GLAPIENTRY
3759 save_PolygonStipple(const GLubyte
* pattern
)
3761 GET_CURRENT_CONTEXT(ctx
);
3764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3766 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3769 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3770 pattern
, &ctx
->Unpack
));
3772 if (ctx
->ExecuteFlag
) {
3773 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3778 static void GLAPIENTRY
3779 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3781 GET_CURRENT_CONTEXT(ctx
);
3783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3784 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3789 if (ctx
->ExecuteFlag
) {
3790 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3795 static void GLAPIENTRY
3796 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3798 GET_CURRENT_CONTEXT(ctx
);
3800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3801 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3807 if (ctx
->ExecuteFlag
) {
3808 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3812 static void GLAPIENTRY
3813 save_PopAttrib(void)
3815 GET_CURRENT_CONTEXT(ctx
);
3816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3817 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3818 if (ctx
->ExecuteFlag
) {
3819 CALL_PopAttrib(ctx
->Exec
, ());
3824 static void GLAPIENTRY
3825 save_PopMatrix(void)
3827 GET_CURRENT_CONTEXT(ctx
);
3828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3829 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3830 if (ctx
->ExecuteFlag
) {
3831 CALL_PopMatrix(ctx
->Exec
, ());
3836 static void GLAPIENTRY
3839 GET_CURRENT_CONTEXT(ctx
);
3840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3841 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3842 if (ctx
->ExecuteFlag
) {
3843 CALL_PopName(ctx
->Exec
, ());
3848 static void GLAPIENTRY
3849 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3850 const GLclampf
* priorities
)
3852 GET_CURRENT_CONTEXT(ctx
);
3854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3856 for (i
= 0; i
< num
; i
++) {
3858 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3860 n
[1].ui
= textures
[i
];
3861 n
[2].f
= priorities
[i
];
3864 if (ctx
->ExecuteFlag
) {
3865 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3870 static void GLAPIENTRY
3871 save_PushAttrib(GLbitfield mask
)
3873 GET_CURRENT_CONTEXT(ctx
);
3875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3876 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3880 if (ctx
->ExecuteFlag
) {
3881 CALL_PushAttrib(ctx
->Exec
, (mask
));
3886 static void GLAPIENTRY
3887 save_PushMatrix(void)
3889 GET_CURRENT_CONTEXT(ctx
);
3890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3891 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3892 if (ctx
->ExecuteFlag
) {
3893 CALL_PushMatrix(ctx
->Exec
, ());
3898 static void GLAPIENTRY
3899 save_PushName(GLuint name
)
3901 GET_CURRENT_CONTEXT(ctx
);
3903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3904 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3908 if (ctx
->ExecuteFlag
) {
3909 CALL_PushName(ctx
->Exec
, (name
));
3914 static void GLAPIENTRY
3915 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3917 GET_CURRENT_CONTEXT(ctx
);
3919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3920 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3927 if (ctx
->ExecuteFlag
) {
3928 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3932 static void GLAPIENTRY
3933 save_RasterPos2d(GLdouble x
, GLdouble y
)
3935 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3938 static void GLAPIENTRY
3939 save_RasterPos2f(GLfloat x
, GLfloat y
)
3941 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3944 static void GLAPIENTRY
3945 save_RasterPos2i(GLint x
, GLint y
)
3947 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3950 static void GLAPIENTRY
3951 save_RasterPos2s(GLshort x
, GLshort y
)
3953 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3956 static void GLAPIENTRY
3957 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3959 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3962 static void GLAPIENTRY
3963 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3965 save_RasterPos4f(x
, y
, z
, 1.0F
);
3968 static void GLAPIENTRY
3969 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3971 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3974 static void GLAPIENTRY
3975 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3977 save_RasterPos4f(x
, y
, z
, 1.0F
);
3980 static void GLAPIENTRY
3981 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3983 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3986 static void GLAPIENTRY
3987 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3989 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3992 static void GLAPIENTRY
3993 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3995 save_RasterPos4f(x
, y
, z
, w
);
3998 static void GLAPIENTRY
3999 save_RasterPos2dv(const GLdouble
* v
)
4001 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4004 static void GLAPIENTRY
4005 save_RasterPos2fv(const GLfloat
* v
)
4007 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4010 static void GLAPIENTRY
4011 save_RasterPos2iv(const GLint
* v
)
4013 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4016 static void GLAPIENTRY
4017 save_RasterPos2sv(const GLshort
* v
)
4019 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
4022 static void GLAPIENTRY
4023 save_RasterPos3dv(const GLdouble
* v
)
4025 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4028 static void GLAPIENTRY
4029 save_RasterPos3fv(const GLfloat
* v
)
4031 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4034 static void GLAPIENTRY
4035 save_RasterPos3iv(const GLint
* v
)
4037 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4040 static void GLAPIENTRY
4041 save_RasterPos3sv(const GLshort
* v
)
4043 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4046 static void GLAPIENTRY
4047 save_RasterPos4dv(const GLdouble
* v
)
4049 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4050 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4053 static void GLAPIENTRY
4054 save_RasterPos4fv(const GLfloat
* v
)
4056 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4059 static void GLAPIENTRY
4060 save_RasterPos4iv(const GLint
* v
)
4062 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4063 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4066 static void GLAPIENTRY
4067 save_RasterPos4sv(const GLshort
* v
)
4069 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4073 static void GLAPIENTRY
4074 save_PassThrough(GLfloat token
)
4076 GET_CURRENT_CONTEXT(ctx
);
4078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4079 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4083 if (ctx
->ExecuteFlag
) {
4084 CALL_PassThrough(ctx
->Exec
, (token
));
4089 static void GLAPIENTRY
4090 save_ReadBuffer(GLenum mode
)
4092 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4095 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4099 if (ctx
->ExecuteFlag
) {
4100 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4105 static void GLAPIENTRY
4106 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4108 GET_CURRENT_CONTEXT(ctx
);
4110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4111 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4118 if (ctx
->ExecuteFlag
) {
4119 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4124 static void GLAPIENTRY
4125 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4127 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4131 static void GLAPIENTRY
4132 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4134 GET_CURRENT_CONTEXT(ctx
);
4136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4137 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4143 if (ctx
->ExecuteFlag
) {
4144 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4149 static void GLAPIENTRY
4150 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4152 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4156 static void GLAPIENTRY
4157 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4159 GET_CURRENT_CONTEXT(ctx
);
4161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4162 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4169 if (ctx
->ExecuteFlag
) {
4170 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4175 static void GLAPIENTRY
4176 save_ShadeModel(GLenum mode
)
4178 GET_CURRENT_CONTEXT(ctx
);
4180 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4182 if (ctx
->ExecuteFlag
) {
4183 CALL_ShadeModel(ctx
->Exec
, (mode
));
4186 /* Don't compile this call if it's a no-op.
4187 * By avoiding this state change we have a better chance of
4188 * coalescing subsequent drawing commands into one batch.
4190 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4193 SAVE_FLUSH_VERTICES(ctx
);
4195 ctx
->ListState
.Current
.ShadeModel
= mode
;
4197 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4204 static void GLAPIENTRY
4205 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4207 GET_CURRENT_CONTEXT(ctx
);
4209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4210 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4216 if (ctx
->ExecuteFlag
) {
4217 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4222 static void GLAPIENTRY
4223 save_StencilMask(GLuint mask
)
4225 GET_CURRENT_CONTEXT(ctx
);
4227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4228 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4232 if (ctx
->ExecuteFlag
) {
4233 CALL_StencilMask(ctx
->Exec
, (mask
));
4238 static void GLAPIENTRY
4239 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4241 GET_CURRENT_CONTEXT(ctx
);
4243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4244 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4250 if (ctx
->ExecuteFlag
) {
4251 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4256 static void GLAPIENTRY
4257 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4259 GET_CURRENT_CONTEXT(ctx
);
4261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4262 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4269 if (ctx
->ExecuteFlag
) {
4270 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4275 static void GLAPIENTRY
4276 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4279 GET_CURRENT_CONTEXT(ctx
);
4281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4283 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4291 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4298 if (ctx
->ExecuteFlag
) {
4299 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4300 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4305 static void GLAPIENTRY
4306 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4308 GET_CURRENT_CONTEXT(ctx
);
4310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4311 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4316 if (ctx
->ExecuteFlag
) {
4317 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4322 static void GLAPIENTRY
4323 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4325 GET_CURRENT_CONTEXT(ctx
);
4327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4328 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4335 if (ctx
->ExecuteFlag
) {
4336 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4341 static void GLAPIENTRY
4342 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4344 GET_CURRENT_CONTEXT(ctx
);
4346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4347 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4351 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4359 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4362 if (ctx
->ExecuteFlag
) {
4363 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4368 static void GLAPIENTRY
4369 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4372 parray
[0] = (GLfloat
) param
;
4373 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4374 save_TexEnvfv(target
, pname
, parray
);
4378 static void GLAPIENTRY
4379 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4382 p
[0] = (GLfloat
) param
;
4383 p
[1] = p
[2] = p
[3] = 0.0F
;
4384 save_TexEnvfv(target
, pname
, p
);
4388 static void GLAPIENTRY
4389 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4392 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4393 p
[0] = INT_TO_FLOAT(param
[0]);
4394 p
[1] = INT_TO_FLOAT(param
[1]);
4395 p
[2] = INT_TO_FLOAT(param
[2]);
4396 p
[3] = INT_TO_FLOAT(param
[3]);
4399 p
[0] = (GLfloat
) param
[0];
4400 p
[1] = p
[2] = p
[3] = 0.0F
;
4402 save_TexEnvfv(target
, pname
, p
);
4406 static void GLAPIENTRY
4407 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4409 GET_CURRENT_CONTEXT(ctx
);
4411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4412 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4421 if (ctx
->ExecuteFlag
) {
4422 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4427 static void GLAPIENTRY
4428 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4431 p
[0] = (GLfloat
) params
[0];
4432 p
[1] = (GLfloat
) params
[1];
4433 p
[2] = (GLfloat
) params
[2];
4434 p
[3] = (GLfloat
) params
[3];
4435 save_TexGenfv(coord
, pname
, p
);
4439 static void GLAPIENTRY
4440 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4443 parray
[0] = (GLfloat
) param
;
4444 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4445 save_TexGenfv(coord
, pname
, parray
);
4449 static void GLAPIENTRY
4450 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4453 p
[0] = (GLfloat
) params
[0];
4454 p
[1] = (GLfloat
) params
[1];
4455 p
[2] = (GLfloat
) params
[2];
4456 p
[3] = (GLfloat
) params
[3];
4457 save_TexGenfv(coord
, pname
, p
);
4461 static void GLAPIENTRY
4462 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4466 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4467 save_TexGenfv(coord
, pname
, parray
);
4471 static void GLAPIENTRY
4472 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4476 parray
[1] = parray
[2] = parray
[3] = 0;
4477 save_TexGeniv(coord
, pname
, parray
);
4481 static void GLAPIENTRY
4482 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4484 GET_CURRENT_CONTEXT(ctx
);
4486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4487 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4496 if (ctx
->ExecuteFlag
) {
4497 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4502 static void GLAPIENTRY
4503 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4507 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4508 save_TexParameterfv(target
, pname
, parray
);
4512 static void GLAPIENTRY
4513 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4516 fparam
[0] = (GLfloat
) param
;
4517 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4518 save_TexParameterfv(target
, pname
, fparam
);
4522 static void GLAPIENTRY
4523 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4526 fparam
[0] = (GLfloat
) params
[0];
4527 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4528 save_TexParameterfv(target
, pname
, fparam
);
4532 static void GLAPIENTRY
4533 save_TexImage1D(GLenum target
,
4534 GLint level
, GLint components
,
4535 GLsizei width
, GLint border
,
4536 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4538 GET_CURRENT_CONTEXT(ctx
);
4539 if (target
== GL_PROXY_TEXTURE_1D
) {
4540 /* don't compile, execute immediately */
4541 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4542 border
, format
, type
, pixels
));
4546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4547 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4551 n
[3].i
= components
;
4552 n
[4].i
= (GLint
) width
;
4557 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4558 pixels
, &ctx
->Unpack
));
4560 if (ctx
->ExecuteFlag
) {
4561 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4562 border
, format
, type
, pixels
));
4568 static void GLAPIENTRY
4569 save_TexImage2D(GLenum target
,
4570 GLint level
, GLint components
,
4571 GLsizei width
, GLsizei height
, GLint border
,
4572 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4574 GET_CURRENT_CONTEXT(ctx
);
4575 if (target
== GL_PROXY_TEXTURE_2D
) {
4576 /* don't compile, execute immediately */
4577 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4578 height
, border
, format
, type
, pixels
));
4582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4583 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4587 n
[3].i
= components
;
4588 n
[4].i
= (GLint
) width
;
4589 n
[5].i
= (GLint
) height
;
4594 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4595 pixels
, &ctx
->Unpack
));
4597 if (ctx
->ExecuteFlag
) {
4598 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4599 height
, border
, format
, type
, pixels
));
4605 static void GLAPIENTRY
4606 save_TexImage3D(GLenum target
,
4607 GLint level
, GLint internalFormat
,
4608 GLsizei width
, GLsizei height
, GLsizei depth
,
4610 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4612 GET_CURRENT_CONTEXT(ctx
);
4613 if (target
== GL_PROXY_TEXTURE_3D
) {
4614 /* don't compile, execute immediately */
4615 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4616 height
, depth
, border
, format
, type
,
4621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4622 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4626 n
[3].i
= (GLint
) internalFormat
;
4627 n
[4].i
= (GLint
) width
;
4628 n
[5].i
= (GLint
) height
;
4629 n
[6].i
= (GLint
) depth
;
4633 save_pointer(&n
[10],
4634 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4635 pixels
, &ctx
->Unpack
));
4637 if (ctx
->ExecuteFlag
) {
4638 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4639 height
, depth
, border
, format
, type
,
4646 static void GLAPIENTRY
4647 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4648 GLsizei width
, GLenum format
, GLenum type
,
4649 const GLvoid
* pixels
)
4651 GET_CURRENT_CONTEXT(ctx
);
4654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4656 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4661 n
[4].i
= (GLint
) width
;
4665 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4666 pixels
, &ctx
->Unpack
));
4668 if (ctx
->ExecuteFlag
) {
4669 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4670 format
, type
, pixels
));
4675 static void GLAPIENTRY
4676 save_TexSubImage2D(GLenum target
, GLint level
,
4677 GLint xoffset
, GLint yoffset
,
4678 GLsizei width
, GLsizei height
,
4679 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4681 GET_CURRENT_CONTEXT(ctx
);
4684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4686 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4692 n
[5].i
= (GLint
) width
;
4693 n
[6].i
= (GLint
) height
;
4697 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4698 pixels
, &ctx
->Unpack
));
4700 if (ctx
->ExecuteFlag
) {
4701 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4702 width
, height
, format
, type
, pixels
));
4707 static void GLAPIENTRY
4708 save_TexSubImage3D(GLenum target
, GLint level
,
4709 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4710 GLsizei width
, GLsizei height
, GLsizei depth
,
4711 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4713 GET_CURRENT_CONTEXT(ctx
);
4716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4718 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4725 n
[6].i
= (GLint
) width
;
4726 n
[7].i
= (GLint
) height
;
4727 n
[8].i
= (GLint
) depth
;
4730 save_pointer(&n
[11],
4731 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4732 pixels
, &ctx
->Unpack
));
4734 if (ctx
->ExecuteFlag
) {
4735 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4736 xoffset
, yoffset
, zoffset
,
4737 width
, height
, depth
, format
, type
,
4743 static void GLAPIENTRY
4744 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4746 GET_CURRENT_CONTEXT(ctx
);
4748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4749 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4755 if (ctx
->ExecuteFlag
) {
4756 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4761 static void GLAPIENTRY
4762 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4764 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4769 static void GLAPIENTRY
4770 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4772 GET_CURRENT_CONTEXT(ctx
);
4774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4775 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4779 n
[3].i
= (GLint
) width
;
4780 n
[4].i
= (GLint
) height
;
4782 if (ctx
->ExecuteFlag
) {
4783 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4787 static void GLAPIENTRY
4788 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4791 GET_CURRENT_CONTEXT(ctx
);
4793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4794 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4802 if (ctx
->ExecuteFlag
) {
4803 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4807 static void GLAPIENTRY
4808 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4810 GET_CURRENT_CONTEXT(ctx
);
4812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4813 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4821 if (ctx
->ExecuteFlag
) {
4822 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4826 static void GLAPIENTRY
4827 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4832 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4836 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4838 if (ctx
->ExecuteFlag
) {
4839 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4843 static void GLAPIENTRY
4844 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4847 GET_CURRENT_CONTEXT(ctx
);
4849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4850 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4858 if (ctx
->ExecuteFlag
) {
4859 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4863 static void GLAPIENTRY
4864 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4866 GET_CURRENT_CONTEXT(ctx
);
4868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4869 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4877 if (ctx
->ExecuteFlag
) {
4878 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4882 static void GLAPIENTRY
4883 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4885 GET_CURRENT_CONTEXT(ctx
);
4887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4888 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4892 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4894 if (ctx
->ExecuteFlag
) {
4895 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4899 static void GLAPIENTRY
4900 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4902 GET_CURRENT_CONTEXT(ctx
);
4904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4905 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4908 /* Mesa stores these as floats internally so we deliberately convert
4909 * them to a float here.
4914 if (ctx
->ExecuteFlag
) {
4915 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4919 static void GLAPIENTRY
4920 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4922 GET_CURRENT_CONTEXT(ctx
);
4924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4925 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4929 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4931 if (ctx
->ExecuteFlag
) {
4932 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4936 static void GLAPIENTRY
4937 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4939 GET_CURRENT_CONTEXT(ctx
);
4941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4942 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4949 if (ctx
->ExecuteFlag
) {
4950 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4954 static void GLAPIENTRY
4955 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4957 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4960 static void GLAPIENTRY
4961 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4963 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4966 static void GLAPIENTRY
4967 save_WindowPos2iMESA(GLint x
, GLint y
)
4969 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4972 static void GLAPIENTRY
4973 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4975 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4978 static void GLAPIENTRY
4979 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4981 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4984 static void GLAPIENTRY
4985 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4987 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4990 static void GLAPIENTRY
4991 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4993 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4996 static void GLAPIENTRY
4997 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4999 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
5002 static void GLAPIENTRY
5003 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5005 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5008 static void GLAPIENTRY
5009 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
5011 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5014 static void GLAPIENTRY
5015 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
5017 save_WindowPos4fMESA(x
, y
, z
, w
);
5020 static void GLAPIENTRY
5021 save_WindowPos2dvMESA(const GLdouble
* v
)
5023 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5026 static void GLAPIENTRY
5027 save_WindowPos2fvMESA(const GLfloat
* v
)
5029 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5032 static void GLAPIENTRY
5033 save_WindowPos2ivMESA(const GLint
* v
)
5035 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
5038 static void GLAPIENTRY
5039 save_WindowPos2svMESA(const GLshort
* v
)
5041 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5044 static void GLAPIENTRY
5045 save_WindowPos3dvMESA(const GLdouble
* v
)
5047 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5050 static void GLAPIENTRY
5051 save_WindowPos3fvMESA(const GLfloat
* v
)
5053 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5056 static void GLAPIENTRY
5057 save_WindowPos3ivMESA(const GLint
* v
)
5059 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5062 static void GLAPIENTRY
5063 save_WindowPos3svMESA(const GLshort
* v
)
5065 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5068 static void GLAPIENTRY
5069 save_WindowPos4dvMESA(const GLdouble
* v
)
5071 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5072 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5075 static void GLAPIENTRY
5076 save_WindowPos4fvMESA(const GLfloat
* v
)
5078 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5081 static void GLAPIENTRY
5082 save_WindowPos4ivMESA(const GLint
* v
)
5084 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5085 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5088 static void GLAPIENTRY
5089 save_WindowPos4svMESA(const GLshort
* v
)
5091 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5096 /* GL_ARB_multitexture */
5097 static void GLAPIENTRY
5098 save_ActiveTextureARB(GLenum target
)
5100 GET_CURRENT_CONTEXT(ctx
);
5102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5103 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5107 if (ctx
->ExecuteFlag
) {
5108 CALL_ActiveTexture(ctx
->Exec
, (target
));
5113 /* GL_ARB_transpose_matrix */
5115 static void GLAPIENTRY
5116 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5119 _math_transposefd(tm
, m
);
5120 save_LoadMatrixf(tm
);
5124 static void GLAPIENTRY
5125 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5128 _math_transposef(tm
, m
);
5129 save_LoadMatrixf(tm
);
5133 static void GLAPIENTRY
5134 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5137 _math_transposefd(tm
, m
);
5138 save_MultMatrixf(tm
);
5142 static void GLAPIENTRY
5143 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5146 _math_transposef(tm
, m
);
5147 save_MultMatrixf(tm
);
5150 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5152 GET_CURRENT_CONTEXT(ctx
);
5158 image
= malloc(size
);
5160 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5163 memcpy(image
, data
, size
);
5169 /* GL_ARB_texture_compression */
5170 static void GLAPIENTRY
5171 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5172 GLenum internalFormat
, GLsizei width
,
5173 GLint border
, GLsizei imageSize
,
5174 const GLvoid
* data
)
5176 GET_CURRENT_CONTEXT(ctx
);
5177 if (target
== GL_PROXY_TEXTURE_1D
) {
5178 /* don't compile, execute immediately */
5179 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5180 width
, border
, imageSize
,
5185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5187 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5188 6 + POINTER_DWORDS
);
5192 n
[3].e
= internalFormat
;
5193 n
[4].i
= (GLint
) width
;
5197 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5199 if (ctx
->ExecuteFlag
) {
5200 CALL_CompressedTexImage1D(ctx
->Exec
,
5201 (target
, level
, internalFormat
, width
,
5202 border
, imageSize
, data
));
5208 static void GLAPIENTRY
5209 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5210 GLenum internalFormat
, GLsizei width
,
5211 GLsizei height
, GLint border
, GLsizei imageSize
,
5212 const GLvoid
* data
)
5214 GET_CURRENT_CONTEXT(ctx
);
5215 if (target
== GL_PROXY_TEXTURE_2D
) {
5216 /* don't compile, execute immediately */
5217 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5218 width
, height
, border
,
5223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5225 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5226 7 + POINTER_DWORDS
);
5230 n
[3].e
= internalFormat
;
5231 n
[4].i
= (GLint
) width
;
5232 n
[5].i
= (GLint
) height
;
5236 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5238 if (ctx
->ExecuteFlag
) {
5239 CALL_CompressedTexImage2D(ctx
->Exec
,
5240 (target
, level
, internalFormat
, width
,
5241 height
, border
, imageSize
, data
));
5247 static void GLAPIENTRY
5248 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5249 GLenum internalFormat
, GLsizei width
,
5250 GLsizei height
, GLsizei depth
, GLint border
,
5251 GLsizei imageSize
, const GLvoid
* data
)
5253 GET_CURRENT_CONTEXT(ctx
);
5254 if (target
== GL_PROXY_TEXTURE_3D
) {
5255 /* don't compile, execute immediately */
5256 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5257 width
, height
, depth
, border
,
5262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5264 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5265 8 + POINTER_DWORDS
);
5269 n
[3].e
= internalFormat
;
5270 n
[4].i
= (GLint
) width
;
5271 n
[5].i
= (GLint
) height
;
5272 n
[6].i
= (GLint
) depth
;
5276 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5278 if (ctx
->ExecuteFlag
) {
5279 CALL_CompressedTexImage3D(ctx
->Exec
,
5280 (target
, level
, internalFormat
, width
,
5281 height
, depth
, border
, imageSize
,
5288 static void GLAPIENTRY
5289 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5290 GLsizei width
, GLenum format
,
5291 GLsizei imageSize
, const GLvoid
* data
)
5294 GET_CURRENT_CONTEXT(ctx
);
5295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5297 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5298 6 + POINTER_DWORDS
);
5303 n
[4].i
= (GLint
) width
;
5307 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5309 if (ctx
->ExecuteFlag
) {
5310 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5311 width
, format
, imageSize
,
5317 static void GLAPIENTRY
5318 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5319 GLint yoffset
, GLsizei width
, GLsizei height
,
5320 GLenum format
, GLsizei imageSize
,
5321 const GLvoid
* data
)
5324 GET_CURRENT_CONTEXT(ctx
);
5325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5327 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5328 8 + POINTER_DWORDS
);
5334 n
[5].i
= (GLint
) width
;
5335 n
[6].i
= (GLint
) height
;
5339 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5341 if (ctx
->ExecuteFlag
) {
5342 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5343 (target
, level
, xoffset
, yoffset
, width
,
5344 height
, format
, imageSize
, data
));
5349 static void GLAPIENTRY
5350 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5351 GLint yoffset
, GLint zoffset
, GLsizei width
,
5352 GLsizei height
, GLsizei depth
, GLenum format
,
5353 GLsizei imageSize
, const GLvoid
* data
)
5356 GET_CURRENT_CONTEXT(ctx
);
5357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5359 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5360 10 + POINTER_DWORDS
);
5367 n
[6].i
= (GLint
) width
;
5368 n
[7].i
= (GLint
) height
;
5369 n
[8].i
= (GLint
) depth
;
5371 n
[10].i
= imageSize
;
5372 save_pointer(&n
[11],
5373 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5375 if (ctx
->ExecuteFlag
) {
5376 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5377 (target
, level
, xoffset
, yoffset
,
5378 zoffset
, width
, height
, depth
, format
,
5384 /* GL_ARB_multisample */
5385 static void GLAPIENTRY
5386 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5388 GET_CURRENT_CONTEXT(ctx
);
5390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5391 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5396 if (ctx
->ExecuteFlag
) {
5397 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5403 * GL_ARB_vertex_program
5405 static void GLAPIENTRY
5406 save_BindProgramARB(GLenum target
, GLuint id
)
5408 GET_CURRENT_CONTEXT(ctx
);
5410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5411 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5416 if (ctx
->ExecuteFlag
) {
5417 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5421 static void GLAPIENTRY
5422 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5423 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5425 GET_CURRENT_CONTEXT(ctx
);
5427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5428 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5437 if (ctx
->ExecuteFlag
) {
5438 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5443 static void GLAPIENTRY
5444 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5445 const GLfloat
*params
)
5447 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5448 params
[2], params
[3]);
5452 static void GLAPIENTRY
5453 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5454 const GLfloat
* params
)
5456 GET_CURRENT_CONTEXT(ctx
);
5458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5462 const GLfloat
* p
= params
;
5464 for (i
= 0 ; i
< count
; i
++) {
5465 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5478 if (ctx
->ExecuteFlag
) {
5479 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5484 static void GLAPIENTRY
5485 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5486 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5488 save_ProgramEnvParameter4fARB(target
, index
,
5490 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5494 static void GLAPIENTRY
5495 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5496 const GLdouble
*params
)
5498 save_ProgramEnvParameter4fARB(target
, index
,
5499 (GLfloat
) params
[0],
5500 (GLfloat
) params
[1],
5501 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5505 static void GLAPIENTRY
5506 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5507 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5509 GET_CURRENT_CONTEXT(ctx
);
5511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5512 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5521 if (ctx
->ExecuteFlag
) {
5522 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5527 static void GLAPIENTRY
5528 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5529 const GLfloat
*params
)
5531 GET_CURRENT_CONTEXT(ctx
);
5533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5534 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5543 if (ctx
->ExecuteFlag
) {
5544 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5549 static void GLAPIENTRY
5550 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5551 const GLfloat
*params
)
5553 GET_CURRENT_CONTEXT(ctx
);
5555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5559 const GLfloat
* p
= params
;
5561 for (i
= 0 ; i
< count
; i
++) {
5562 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5575 if (ctx
->ExecuteFlag
) {
5576 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5581 static void GLAPIENTRY
5582 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5583 GLdouble x
, GLdouble y
,
5584 GLdouble z
, GLdouble w
)
5586 GET_CURRENT_CONTEXT(ctx
);
5588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5589 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5593 n
[3].f
= (GLfloat
) x
;
5594 n
[4].f
= (GLfloat
) y
;
5595 n
[5].f
= (GLfloat
) z
;
5596 n
[6].f
= (GLfloat
) w
;
5598 if (ctx
->ExecuteFlag
) {
5599 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5604 static void GLAPIENTRY
5605 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5606 const GLdouble
*params
)
5608 GET_CURRENT_CONTEXT(ctx
);
5610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5611 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5615 n
[3].f
= (GLfloat
) params
[0];
5616 n
[4].f
= (GLfloat
) params
[1];
5617 n
[5].f
= (GLfloat
) params
[2];
5618 n
[6].f
= (GLfloat
) params
[3];
5620 if (ctx
->ExecuteFlag
) {
5621 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5626 /* GL_EXT_stencil_two_side */
5627 static void GLAPIENTRY
5628 save_ActiveStencilFaceEXT(GLenum face
)
5630 GET_CURRENT_CONTEXT(ctx
);
5632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5633 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5637 if (ctx
->ExecuteFlag
) {
5638 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5643 /* GL_EXT_depth_bounds_test */
5644 static void GLAPIENTRY
5645 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5647 GET_CURRENT_CONTEXT(ctx
);
5649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5650 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5652 n
[1].f
= (GLfloat
) zmin
;
5653 n
[2].f
= (GLfloat
) zmax
;
5655 if (ctx
->ExecuteFlag
) {
5656 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5662 static void GLAPIENTRY
5663 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5664 const GLvoid
* string
)
5666 GET_CURRENT_CONTEXT(ctx
);
5669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5671 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5673 GLubyte
*programCopy
= malloc(len
);
5675 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5678 memcpy(programCopy
, string
, len
);
5682 save_pointer(&n
[4], programCopy
);
5684 if (ctx
->ExecuteFlag
) {
5685 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5690 static void GLAPIENTRY
5691 save_BeginQueryARB(GLenum target
, GLuint id
)
5693 GET_CURRENT_CONTEXT(ctx
);
5695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5696 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5701 if (ctx
->ExecuteFlag
) {
5702 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5706 static void GLAPIENTRY
5707 save_EndQueryARB(GLenum target
)
5709 GET_CURRENT_CONTEXT(ctx
);
5711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5712 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5716 if (ctx
->ExecuteFlag
) {
5717 CALL_EndQuery(ctx
->Exec
, (target
));
5721 static void GLAPIENTRY
5722 save_QueryCounter(GLuint id
, GLenum target
)
5724 GET_CURRENT_CONTEXT(ctx
);
5726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5727 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5732 if (ctx
->ExecuteFlag
) {
5733 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5737 static void GLAPIENTRY
5738 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5740 GET_CURRENT_CONTEXT(ctx
);
5742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5743 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5749 if (ctx
->ExecuteFlag
) {
5750 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5754 static void GLAPIENTRY
5755 save_EndQueryIndexed(GLenum target
, GLuint index
)
5757 GET_CURRENT_CONTEXT(ctx
);
5759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5760 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5765 if (ctx
->ExecuteFlag
) {
5766 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5771 static void GLAPIENTRY
5772 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5774 GET_CURRENT_CONTEXT(ctx
);
5776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5777 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5781 if (count
> MAX_DRAW_BUFFERS
)
5782 count
= MAX_DRAW_BUFFERS
;
5783 for (i
= 0; i
< count
; i
++) {
5784 n
[2 + i
].e
= buffers
[i
];
5787 if (ctx
->ExecuteFlag
) {
5788 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5792 static void GLAPIENTRY
5793 save_BindFragmentShaderATI(GLuint id
)
5795 GET_CURRENT_CONTEXT(ctx
);
5798 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5802 if (ctx
->ExecuteFlag
) {
5803 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5807 static void GLAPIENTRY
5808 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5810 GET_CURRENT_CONTEXT(ctx
);
5813 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5821 if (ctx
->ExecuteFlag
) {
5822 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5826 static void GLAPIENTRY
5827 save_Attr1fNV(GLenum attr
, GLfloat x
)
5829 GET_CURRENT_CONTEXT(ctx
);
5831 SAVE_FLUSH_VERTICES(ctx
);
5832 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5838 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5839 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5840 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5842 if (ctx
->ExecuteFlag
) {
5843 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5847 static void GLAPIENTRY
5848 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5850 GET_CURRENT_CONTEXT(ctx
);
5852 SAVE_FLUSH_VERTICES(ctx
);
5853 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5860 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5861 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5862 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5864 if (ctx
->ExecuteFlag
) {
5865 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5869 static void GLAPIENTRY
5870 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5872 GET_CURRENT_CONTEXT(ctx
);
5874 SAVE_FLUSH_VERTICES(ctx
);
5875 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5883 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5884 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5885 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5887 if (ctx
->ExecuteFlag
) {
5888 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5892 static void GLAPIENTRY
5893 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5895 GET_CURRENT_CONTEXT(ctx
);
5897 SAVE_FLUSH_VERTICES(ctx
);
5898 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5907 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5908 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5909 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5911 if (ctx
->ExecuteFlag
) {
5912 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5917 static void GLAPIENTRY
5918 save_Attr1fARB(GLenum attr
, GLfloat x
)
5920 GET_CURRENT_CONTEXT(ctx
);
5922 SAVE_FLUSH_VERTICES(ctx
);
5923 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5929 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5930 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5931 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5933 if (ctx
->ExecuteFlag
) {
5934 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5938 static void GLAPIENTRY
5939 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5941 GET_CURRENT_CONTEXT(ctx
);
5943 SAVE_FLUSH_VERTICES(ctx
);
5944 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5951 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5952 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5953 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5955 if (ctx
->ExecuteFlag
) {
5956 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5960 static void GLAPIENTRY
5961 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5963 GET_CURRENT_CONTEXT(ctx
);
5965 SAVE_FLUSH_VERTICES(ctx
);
5966 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5974 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5975 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5976 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5978 if (ctx
->ExecuteFlag
) {
5979 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5983 static void GLAPIENTRY
5984 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5986 GET_CURRENT_CONTEXT(ctx
);
5988 SAVE_FLUSH_VERTICES(ctx
);
5989 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5998 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5999 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
6000 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
6002 if (ctx
->ExecuteFlag
) {
6003 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
6008 static void GLAPIENTRY
6009 save_EvalCoord1f(GLfloat x
)
6011 GET_CURRENT_CONTEXT(ctx
);
6013 SAVE_FLUSH_VERTICES(ctx
);
6014 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
6018 if (ctx
->ExecuteFlag
) {
6019 CALL_EvalCoord1f(ctx
->Exec
, (x
));
6023 static void GLAPIENTRY
6024 save_EvalCoord1fv(const GLfloat
* v
)
6026 save_EvalCoord1f(v
[0]);
6029 static void GLAPIENTRY
6030 save_EvalCoord2f(GLfloat x
, GLfloat y
)
6032 GET_CURRENT_CONTEXT(ctx
);
6034 SAVE_FLUSH_VERTICES(ctx
);
6035 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
6040 if (ctx
->ExecuteFlag
) {
6041 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
6045 static void GLAPIENTRY
6046 save_EvalCoord2fv(const GLfloat
* v
)
6048 save_EvalCoord2f(v
[0], v
[1]);
6052 static void GLAPIENTRY
6053 save_EvalPoint1(GLint x
)
6055 GET_CURRENT_CONTEXT(ctx
);
6057 SAVE_FLUSH_VERTICES(ctx
);
6058 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6062 if (ctx
->ExecuteFlag
) {
6063 CALL_EvalPoint1(ctx
->Exec
, (x
));
6067 static void GLAPIENTRY
6068 save_EvalPoint2(GLint x
, GLint y
)
6070 GET_CURRENT_CONTEXT(ctx
);
6072 SAVE_FLUSH_VERTICES(ctx
);
6073 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6078 if (ctx
->ExecuteFlag
) {
6079 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6083 static void GLAPIENTRY
6084 save_Indexf(GLfloat x
)
6086 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6089 static void GLAPIENTRY
6090 save_Indexfv(const GLfloat
* v
)
6092 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6095 static void GLAPIENTRY
6096 save_EdgeFlag(GLboolean x
)
6098 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6103 * Compare 'count' elements of vectors 'a' and 'b'.
6104 * \return GL_TRUE if equal, GL_FALSE if different.
6106 static inline GLboolean
6107 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6109 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6114 * This glMaterial function is used for glMaterial calls that are outside
6115 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6117 static void GLAPIENTRY
6118 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6120 GET_CURRENT_CONTEXT(ctx
);
6128 case GL_FRONT_AND_BACK
:
6131 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6140 case GL_AMBIENT_AND_DIFFUSE
:
6146 case GL_COLOR_INDEXES
:
6150 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6154 if (ctx
->ExecuteFlag
) {
6155 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6158 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6160 /* Try to eliminate redundant statechanges. Because it is legal to
6161 * call glMaterial even inside begin/end calls, don't need to worry
6162 * about ctx->Driver.CurrentSavePrimitive here.
6164 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6165 if (bitmask
& (1 << i
)) {
6166 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6167 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6168 /* no change in material value */
6169 bitmask
&= ~(1 << i
);
6172 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6173 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6178 /* If this call has no effect, return early */
6182 SAVE_FLUSH_VERTICES(ctx
);
6184 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6188 for (i
= 0; i
< args
; i
++)
6189 n
[3 + i
].f
= param
[i
];
6193 static void GLAPIENTRY
6194 save_Begin(GLenum mode
)
6196 GET_CURRENT_CONTEXT(ctx
);
6198 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6199 /* compile this error into the display list */
6200 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6202 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6203 /* compile this error into the display list */
6204 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6207 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6209 vbo_save_NotifyBegin(ctx
, mode
, false);
6213 static void GLAPIENTRY
6216 GET_CURRENT_CONTEXT(ctx
);
6217 SAVE_FLUSH_VERTICES(ctx
);
6218 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6219 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6220 if (ctx
->ExecuteFlag
) {
6221 CALL_End(ctx
->Exec
, ());
6225 static void GLAPIENTRY
6226 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6228 GET_CURRENT_CONTEXT(ctx
);
6230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6231 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6238 if (ctx
->ExecuteFlag
) {
6239 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6244 static void GLAPIENTRY
6245 save_Vertex2f(GLfloat x
, GLfloat y
)
6247 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6250 static void GLAPIENTRY
6251 save_Vertex2fv(const GLfloat
* v
)
6253 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6256 static void GLAPIENTRY
6257 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6259 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6262 static void GLAPIENTRY
6263 save_Vertex3fv(const GLfloat
* v
)
6265 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6268 static void GLAPIENTRY
6269 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6271 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6274 static void GLAPIENTRY
6275 save_Vertex4fv(const GLfloat
* v
)
6277 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6280 static void GLAPIENTRY
6281 save_TexCoord1f(GLfloat x
)
6283 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6286 static void GLAPIENTRY
6287 save_TexCoord1fv(const GLfloat
* v
)
6289 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6292 static void GLAPIENTRY
6293 save_TexCoord2f(GLfloat x
, GLfloat y
)
6295 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6298 static void GLAPIENTRY
6299 save_TexCoord2fv(const GLfloat
* v
)
6301 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6304 static void GLAPIENTRY
6305 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6307 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6310 static void GLAPIENTRY
6311 save_TexCoord3fv(const GLfloat
* v
)
6313 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6316 static void GLAPIENTRY
6317 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6319 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6322 static void GLAPIENTRY
6323 save_TexCoord4fv(const GLfloat
* v
)
6325 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6328 static void GLAPIENTRY
6329 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6331 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6334 static void GLAPIENTRY
6335 save_Normal3fv(const GLfloat
* v
)
6337 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6340 static void GLAPIENTRY
6341 save_FogCoordfEXT(GLfloat x
)
6343 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6346 static void GLAPIENTRY
6347 save_FogCoordfvEXT(const GLfloat
* v
)
6349 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6352 static void GLAPIENTRY
6353 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6355 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6358 static void GLAPIENTRY
6359 save_Color3fv(const GLfloat
* v
)
6361 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6364 static void GLAPIENTRY
6365 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6367 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6370 static void GLAPIENTRY
6371 save_Color4fv(const GLfloat
* v
)
6373 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6376 static void GLAPIENTRY
6377 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6379 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6382 static void GLAPIENTRY
6383 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6385 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6389 /* Just call the respective ATTR for texcoord
6391 static void GLAPIENTRY
6392 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6394 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6395 save_Attr1fNV(attr
, x
);
6398 static void GLAPIENTRY
6399 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6401 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6402 save_Attr1fNV(attr
, v
[0]);
6405 static void GLAPIENTRY
6406 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6408 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6409 save_Attr2fNV(attr
, x
, y
);
6412 static void GLAPIENTRY
6413 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6415 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6416 save_Attr2fNV(attr
, v
[0], v
[1]);
6419 static void GLAPIENTRY
6420 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6422 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6423 save_Attr3fNV(attr
, x
, y
, z
);
6426 static void GLAPIENTRY
6427 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6429 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6430 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6433 static void GLAPIENTRY
6434 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6435 GLfloat z
, GLfloat w
)
6437 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6438 save_Attr4fNV(attr
, x
, y
, z
, w
);
6441 static void GLAPIENTRY
6442 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6444 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6445 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6450 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6456 GET_CURRENT_CONTEXT(ctx
);
6457 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6462 static void GLAPIENTRY
6463 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6465 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6466 save_Attr1fARB(index
, x
);
6471 static void GLAPIENTRY
6472 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6474 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6475 save_Attr1fARB(index
, v
[0]);
6480 static void GLAPIENTRY
6481 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6483 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6484 save_Attr2fARB(index
, x
, y
);
6489 static void GLAPIENTRY
6490 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6492 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6493 save_Attr2fARB(index
, v
[0], v
[1]);
6498 static void GLAPIENTRY
6499 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6501 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6502 save_Attr3fARB(index
, x
, y
, z
);
6507 static void GLAPIENTRY
6508 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6510 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6511 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6516 static void GLAPIENTRY
6517 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6520 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6521 save_Attr4fARB(index
, x
, y
, z
, w
);
6526 static void GLAPIENTRY
6527 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6529 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6530 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6535 static void GLAPIENTRY
6536 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6538 GET_CURRENT_CONTEXT(ctx
);
6540 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6542 SAVE_FLUSH_VERTICES(ctx
);
6543 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6546 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6549 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6550 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6552 if (ctx
->ExecuteFlag
) {
6553 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6560 static void GLAPIENTRY
6561 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6563 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6564 save_VertexAttribL1d(index
, v
[0]);
6569 static void GLAPIENTRY
6570 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6572 GET_CURRENT_CONTEXT(ctx
);
6574 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6576 SAVE_FLUSH_VERTICES(ctx
);
6577 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6580 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6581 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6584 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6585 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6586 2 * sizeof(GLdouble
));
6588 if (ctx
->ExecuteFlag
) {
6589 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6596 static void GLAPIENTRY
6597 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6599 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6600 save_VertexAttribL2d(index
, v
[0], v
[1]);
6605 static void GLAPIENTRY
6606 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6608 GET_CURRENT_CONTEXT(ctx
);
6610 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6612 SAVE_FLUSH_VERTICES(ctx
);
6613 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6616 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6617 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6618 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6621 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6622 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6623 3 * sizeof(GLdouble
));
6625 if (ctx
->ExecuteFlag
) {
6626 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6633 static void GLAPIENTRY
6634 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6636 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6637 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6642 static void GLAPIENTRY
6643 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6646 GET_CURRENT_CONTEXT(ctx
);
6648 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6650 SAVE_FLUSH_VERTICES(ctx
);
6651 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6654 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6655 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6656 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6657 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6660 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6661 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6662 4 * sizeof(GLdouble
));
6664 if (ctx
->ExecuteFlag
) {
6665 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6672 static void GLAPIENTRY
6673 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6675 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6676 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6681 static void GLAPIENTRY
6682 save_PrimitiveRestartNV(void)
6684 /* Note: this is used when outside a glBegin/End pair in a display list */
6685 GET_CURRENT_CONTEXT(ctx
);
6686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6687 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6688 if (ctx
->ExecuteFlag
) {
6689 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6694 static void GLAPIENTRY
6695 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6696 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6697 GLbitfield mask
, GLenum filter
)
6699 GET_CURRENT_CONTEXT(ctx
);
6701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6702 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6715 if (ctx
->ExecuteFlag
) {
6716 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6717 dstX0
, dstY0
, dstX1
, dstY1
,
6723 /** GL_EXT_provoking_vertex */
6724 static void GLAPIENTRY
6725 save_ProvokingVertexEXT(GLenum mode
)
6727 GET_CURRENT_CONTEXT(ctx
);
6729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6730 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6734 if (ctx
->ExecuteFlag
) {
6735 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6736 _mesa_ProvokingVertex(mode
);
6741 /** GL_EXT_transform_feedback */
6742 static void GLAPIENTRY
6743 save_BeginTransformFeedback(GLenum mode
)
6745 GET_CURRENT_CONTEXT(ctx
);
6747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6748 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6752 if (ctx
->ExecuteFlag
) {
6753 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6758 /** GL_EXT_transform_feedback */
6759 static void GLAPIENTRY
6760 save_EndTransformFeedback(void)
6762 GET_CURRENT_CONTEXT(ctx
);
6763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6764 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6765 if (ctx
->ExecuteFlag
) {
6766 CALL_EndTransformFeedback(ctx
->Exec
, ());
6770 static void GLAPIENTRY
6771 save_BindTransformFeedback(GLenum target
, GLuint name
)
6773 GET_CURRENT_CONTEXT(ctx
);
6775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6776 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6781 if (ctx
->ExecuteFlag
) {
6782 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6786 static void GLAPIENTRY
6787 save_PauseTransformFeedback(void)
6789 GET_CURRENT_CONTEXT(ctx
);
6790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6791 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6792 if (ctx
->ExecuteFlag
) {
6793 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6797 static void GLAPIENTRY
6798 save_ResumeTransformFeedback(void)
6800 GET_CURRENT_CONTEXT(ctx
);
6801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6802 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6803 if (ctx
->ExecuteFlag
) {
6804 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6808 static void GLAPIENTRY
6809 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6811 GET_CURRENT_CONTEXT(ctx
);
6813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6814 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6819 if (ctx
->ExecuteFlag
) {
6820 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6824 static void GLAPIENTRY
6825 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6827 GET_CURRENT_CONTEXT(ctx
);
6829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6830 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6836 if (ctx
->ExecuteFlag
) {
6837 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6841 static void GLAPIENTRY
6842 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6845 GET_CURRENT_CONTEXT(ctx
);
6847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6848 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6852 n
[3].si
= primcount
;
6854 if (ctx
->ExecuteFlag
) {
6855 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6859 static void GLAPIENTRY
6860 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6861 GLuint stream
, GLsizei primcount
)
6863 GET_CURRENT_CONTEXT(ctx
);
6865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6866 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6871 n
[4].si
= primcount
;
6873 if (ctx
->ExecuteFlag
) {
6874 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6879 static void GLAPIENTRY
6880 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6881 GLuint num_groups_z
)
6883 GET_CURRENT_CONTEXT(ctx
);
6885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6886 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6888 n
[1].ui
= num_groups_x
;
6889 n
[2].ui
= num_groups_y
;
6890 n
[3].ui
= num_groups_z
;
6892 if (ctx
->ExecuteFlag
) {
6893 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6898 static void GLAPIENTRY
6899 save_DispatchComputeIndirect(GLintptr indirect
)
6901 GET_CURRENT_CONTEXT(ctx
);
6902 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6903 "glDispatchComputeIndirect() during display list compile");
6906 static void GLAPIENTRY
6907 save_UseProgram(GLuint program
)
6909 GET_CURRENT_CONTEXT(ctx
);
6911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6912 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6916 if (ctx
->ExecuteFlag
) {
6917 CALL_UseProgram(ctx
->Exec
, (program
));
6922 static void GLAPIENTRY
6923 save_Uniform1fARB(GLint location
, GLfloat x
)
6925 GET_CURRENT_CONTEXT(ctx
);
6927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6928 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6933 if (ctx
->ExecuteFlag
) {
6934 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6939 static void GLAPIENTRY
6940 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6942 GET_CURRENT_CONTEXT(ctx
);
6944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6945 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6951 if (ctx
->ExecuteFlag
) {
6952 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6957 static void GLAPIENTRY
6958 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6960 GET_CURRENT_CONTEXT(ctx
);
6962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6963 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6970 if (ctx
->ExecuteFlag
) {
6971 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6976 static void GLAPIENTRY
6977 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6979 GET_CURRENT_CONTEXT(ctx
);
6981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6982 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6990 if (ctx
->ExecuteFlag
) {
6991 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6996 static void GLAPIENTRY
6997 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6999 GET_CURRENT_CONTEXT(ctx
);
7001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7002 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
7006 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7008 if (ctx
->ExecuteFlag
) {
7009 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
7013 static void GLAPIENTRY
7014 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7016 GET_CURRENT_CONTEXT(ctx
);
7018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7019 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
7023 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7025 if (ctx
->ExecuteFlag
) {
7026 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
7030 static void GLAPIENTRY
7031 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7033 GET_CURRENT_CONTEXT(ctx
);
7035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7036 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
7040 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7042 if (ctx
->ExecuteFlag
) {
7043 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7047 static void GLAPIENTRY
7048 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7050 GET_CURRENT_CONTEXT(ctx
);
7052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7053 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7057 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7059 if (ctx
->ExecuteFlag
) {
7060 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7065 static void GLAPIENTRY
7066 save_Uniform1d(GLint location
, GLdouble x
)
7068 GET_CURRENT_CONTEXT(ctx
);
7070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7071 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7074 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7076 if (ctx
->ExecuteFlag
) {
7077 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7082 static void GLAPIENTRY
7083 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7085 GET_CURRENT_CONTEXT(ctx
);
7087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7088 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7091 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7092 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7094 if (ctx
->ExecuteFlag
) {
7095 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7100 static void GLAPIENTRY
7101 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7103 GET_CURRENT_CONTEXT(ctx
);
7105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7106 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7109 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7110 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7111 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7113 if (ctx
->ExecuteFlag
) {
7114 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7119 static void GLAPIENTRY
7120 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7122 GET_CURRENT_CONTEXT(ctx
);
7124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7125 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7128 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7129 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7130 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7131 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7133 if (ctx
->ExecuteFlag
) {
7134 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7139 static void GLAPIENTRY
7140 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7142 GET_CURRENT_CONTEXT(ctx
);
7144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7145 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7149 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7151 if (ctx
->ExecuteFlag
) {
7152 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7157 static void GLAPIENTRY
7158 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7160 GET_CURRENT_CONTEXT(ctx
);
7162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7163 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7167 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7169 if (ctx
->ExecuteFlag
) {
7170 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7175 static void GLAPIENTRY
7176 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7178 GET_CURRENT_CONTEXT(ctx
);
7180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7181 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7185 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7187 if (ctx
->ExecuteFlag
) {
7188 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7193 static void GLAPIENTRY
7194 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7196 GET_CURRENT_CONTEXT(ctx
);
7198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7199 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7203 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7205 if (ctx
->ExecuteFlag
) {
7206 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7211 static void GLAPIENTRY
7212 save_Uniform1iARB(GLint location
, GLint x
)
7214 GET_CURRENT_CONTEXT(ctx
);
7216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7217 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7222 if (ctx
->ExecuteFlag
) {
7223 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7227 static void GLAPIENTRY
7228 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7230 GET_CURRENT_CONTEXT(ctx
);
7232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7233 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7239 if (ctx
->ExecuteFlag
) {
7240 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7244 static void GLAPIENTRY
7245 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7247 GET_CURRENT_CONTEXT(ctx
);
7249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7250 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7257 if (ctx
->ExecuteFlag
) {
7258 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7262 static void GLAPIENTRY
7263 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7265 GET_CURRENT_CONTEXT(ctx
);
7267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7268 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7276 if (ctx
->ExecuteFlag
) {
7277 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7283 static void GLAPIENTRY
7284 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7286 GET_CURRENT_CONTEXT(ctx
);
7288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7289 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7293 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7295 if (ctx
->ExecuteFlag
) {
7296 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7300 static void GLAPIENTRY
7301 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7303 GET_CURRENT_CONTEXT(ctx
);
7305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7306 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7310 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7312 if (ctx
->ExecuteFlag
) {
7313 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7317 static void GLAPIENTRY
7318 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7320 GET_CURRENT_CONTEXT(ctx
);
7322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7323 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7327 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7329 if (ctx
->ExecuteFlag
) {
7330 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7334 static void GLAPIENTRY
7335 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7337 GET_CURRENT_CONTEXT(ctx
);
7339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7340 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7344 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7346 if (ctx
->ExecuteFlag
) {
7347 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7353 static void GLAPIENTRY
7354 save_Uniform1ui(GLint location
, GLuint x
)
7356 GET_CURRENT_CONTEXT(ctx
);
7358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7359 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7364 if (ctx
->ExecuteFlag
) {
7365 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7369 static void GLAPIENTRY
7370 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7372 GET_CURRENT_CONTEXT(ctx
);
7374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7375 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7381 if (ctx
->ExecuteFlag
) {
7382 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7386 static void GLAPIENTRY
7387 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7389 GET_CURRENT_CONTEXT(ctx
);
7391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7392 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7399 if (ctx
->ExecuteFlag
) {
7400 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7404 static void GLAPIENTRY
7405 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7407 GET_CURRENT_CONTEXT(ctx
);
7409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7410 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7418 if (ctx
->ExecuteFlag
) {
7419 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7425 static void GLAPIENTRY
7426 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7428 GET_CURRENT_CONTEXT(ctx
);
7430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7431 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7435 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7437 if (ctx
->ExecuteFlag
) {
7438 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7442 static void GLAPIENTRY
7443 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7445 GET_CURRENT_CONTEXT(ctx
);
7447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7448 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7452 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7454 if (ctx
->ExecuteFlag
) {
7455 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7459 static void GLAPIENTRY
7460 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7462 GET_CURRENT_CONTEXT(ctx
);
7464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7465 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7469 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7471 if (ctx
->ExecuteFlag
) {
7472 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7476 static void GLAPIENTRY
7477 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7479 GET_CURRENT_CONTEXT(ctx
);
7481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7482 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7486 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7488 if (ctx
->ExecuteFlag
) {
7489 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7495 static void GLAPIENTRY
7496 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7499 GET_CURRENT_CONTEXT(ctx
);
7501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7502 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7507 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7509 if (ctx
->ExecuteFlag
) {
7510 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7514 static void GLAPIENTRY
7515 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7518 GET_CURRENT_CONTEXT(ctx
);
7520 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7521 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7526 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7528 if (ctx
->ExecuteFlag
) {
7529 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7533 static void GLAPIENTRY
7534 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7537 GET_CURRENT_CONTEXT(ctx
);
7539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7540 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7545 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7547 if (ctx
->ExecuteFlag
) {
7548 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7553 static void GLAPIENTRY
7554 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7557 GET_CURRENT_CONTEXT(ctx
);
7559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7560 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7565 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7567 if (ctx
->ExecuteFlag
) {
7568 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7572 static void GLAPIENTRY
7573 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7576 GET_CURRENT_CONTEXT(ctx
);
7578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7579 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7584 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7586 if (ctx
->ExecuteFlag
) {
7587 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7592 static void GLAPIENTRY
7593 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7596 GET_CURRENT_CONTEXT(ctx
);
7598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7599 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7604 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7606 if (ctx
->ExecuteFlag
) {
7607 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7611 static void GLAPIENTRY
7612 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7615 GET_CURRENT_CONTEXT(ctx
);
7617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7618 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7623 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7625 if (ctx
->ExecuteFlag
) {
7626 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7631 static void GLAPIENTRY
7632 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7635 GET_CURRENT_CONTEXT(ctx
);
7637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7638 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7643 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7645 if (ctx
->ExecuteFlag
) {
7646 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7650 static void GLAPIENTRY
7651 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7654 GET_CURRENT_CONTEXT(ctx
);
7656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7657 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7662 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7664 if (ctx
->ExecuteFlag
) {
7665 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7670 static void GLAPIENTRY
7671 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7674 GET_CURRENT_CONTEXT(ctx
);
7676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7677 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7682 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7684 if (ctx
->ExecuteFlag
) {
7685 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7689 static void GLAPIENTRY
7690 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7693 GET_CURRENT_CONTEXT(ctx
);
7695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7696 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7701 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7703 if (ctx
->ExecuteFlag
) {
7704 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7708 static void GLAPIENTRY
7709 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7712 GET_CURRENT_CONTEXT(ctx
);
7714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7715 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7720 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7722 if (ctx
->ExecuteFlag
) {
7723 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7728 static void GLAPIENTRY
7729 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7732 GET_CURRENT_CONTEXT(ctx
);
7734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7735 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7740 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7742 if (ctx
->ExecuteFlag
) {
7743 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7748 static void GLAPIENTRY
7749 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7752 GET_CURRENT_CONTEXT(ctx
);
7754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7755 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7760 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7762 if (ctx
->ExecuteFlag
) {
7763 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7768 static void GLAPIENTRY
7769 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7772 GET_CURRENT_CONTEXT(ctx
);
7774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7775 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7780 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7782 if (ctx
->ExecuteFlag
) {
7783 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7787 static void GLAPIENTRY
7788 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7791 GET_CURRENT_CONTEXT(ctx
);
7793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7794 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7799 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7801 if (ctx
->ExecuteFlag
) {
7802 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7807 static void GLAPIENTRY
7808 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7811 GET_CURRENT_CONTEXT(ctx
);
7813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7814 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7819 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7821 if (ctx
->ExecuteFlag
) {
7822 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7827 static void GLAPIENTRY
7828 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7831 GET_CURRENT_CONTEXT(ctx
);
7833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7834 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7839 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7841 if (ctx
->ExecuteFlag
) {
7842 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7847 static void GLAPIENTRY
7848 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7850 GET_CURRENT_CONTEXT(ctx
);
7852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7853 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7859 if (ctx
->ExecuteFlag
) {
7860 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7864 static void GLAPIENTRY
7865 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7867 GET_CURRENT_CONTEXT(ctx
);
7869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7870 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7876 if (ctx
->ExecuteFlag
) {
7877 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7881 static void GLAPIENTRY
7882 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7884 GET_CURRENT_CONTEXT(ctx
);
7886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7887 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7894 if (ctx
->ExecuteFlag
) {
7895 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7899 static void GLAPIENTRY
7900 save_ProgramUniform3f(GLuint program
, GLint location
,
7901 GLfloat x
, GLfloat y
, GLfloat z
)
7903 GET_CURRENT_CONTEXT(ctx
);
7905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7906 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7914 if (ctx
->ExecuteFlag
) {
7915 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7919 static void GLAPIENTRY
7920 save_ProgramUniform4f(GLuint program
, GLint location
,
7921 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7923 GET_CURRENT_CONTEXT(ctx
);
7925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7926 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7935 if (ctx
->ExecuteFlag
) {
7936 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7940 static void GLAPIENTRY
7941 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7944 GET_CURRENT_CONTEXT(ctx
);
7946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7947 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7952 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7954 if (ctx
->ExecuteFlag
) {
7955 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7959 static void GLAPIENTRY
7960 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7963 GET_CURRENT_CONTEXT(ctx
);
7965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7966 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7971 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7973 if (ctx
->ExecuteFlag
) {
7974 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7978 static void GLAPIENTRY
7979 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7982 GET_CURRENT_CONTEXT(ctx
);
7984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7985 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7990 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7992 if (ctx
->ExecuteFlag
) {
7993 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7997 static void GLAPIENTRY
7998 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
8001 GET_CURRENT_CONTEXT(ctx
);
8003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8004 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
8009 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
8011 if (ctx
->ExecuteFlag
) {
8012 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
8016 static void GLAPIENTRY
8017 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
8019 GET_CURRENT_CONTEXT(ctx
);
8021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8022 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
8026 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8028 if (ctx
->ExecuteFlag
) {
8029 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
8033 static void GLAPIENTRY
8034 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
8036 GET_CURRENT_CONTEXT(ctx
);
8038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8039 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8043 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8044 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8046 if (ctx
->ExecuteFlag
) {
8047 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8051 static void GLAPIENTRY
8052 save_ProgramUniform3d(GLuint program
, GLint location
,
8053 GLdouble x
, GLdouble y
, GLdouble z
)
8055 GET_CURRENT_CONTEXT(ctx
);
8057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8058 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8062 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8063 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8064 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8066 if (ctx
->ExecuteFlag
) {
8067 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8071 static void GLAPIENTRY
8072 save_ProgramUniform4d(GLuint program
, GLint location
,
8073 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8075 GET_CURRENT_CONTEXT(ctx
);
8077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8078 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8082 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8083 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8084 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8085 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8087 if (ctx
->ExecuteFlag
) {
8088 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8092 static void GLAPIENTRY
8093 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8096 GET_CURRENT_CONTEXT(ctx
);
8098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8099 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8104 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8106 if (ctx
->ExecuteFlag
) {
8107 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8111 static void GLAPIENTRY
8112 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8115 GET_CURRENT_CONTEXT(ctx
);
8117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8118 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8123 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8125 if (ctx
->ExecuteFlag
) {
8126 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8130 static void GLAPIENTRY
8131 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8134 GET_CURRENT_CONTEXT(ctx
);
8136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8137 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8142 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8144 if (ctx
->ExecuteFlag
) {
8145 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8149 static void GLAPIENTRY
8150 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8153 GET_CURRENT_CONTEXT(ctx
);
8155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8156 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8161 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8163 if (ctx
->ExecuteFlag
) {
8164 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8168 static void GLAPIENTRY
8169 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8171 GET_CURRENT_CONTEXT(ctx
);
8173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8174 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8180 if (ctx
->ExecuteFlag
) {
8181 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8185 static void GLAPIENTRY
8186 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8188 GET_CURRENT_CONTEXT(ctx
);
8190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8191 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8198 if (ctx
->ExecuteFlag
) {
8199 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8203 static void GLAPIENTRY
8204 save_ProgramUniform3i(GLuint program
, GLint location
,
8205 GLint x
, GLint y
, GLint z
)
8207 GET_CURRENT_CONTEXT(ctx
);
8209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8210 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8218 if (ctx
->ExecuteFlag
) {
8219 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8223 static void GLAPIENTRY
8224 save_ProgramUniform4i(GLuint program
, GLint location
,
8225 GLint x
, GLint y
, GLint z
, GLint w
)
8227 GET_CURRENT_CONTEXT(ctx
);
8229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8230 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8239 if (ctx
->ExecuteFlag
) {
8240 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8244 static void GLAPIENTRY
8245 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8248 GET_CURRENT_CONTEXT(ctx
);
8250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8251 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8256 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8258 if (ctx
->ExecuteFlag
) {
8259 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8263 static void GLAPIENTRY
8264 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8267 GET_CURRENT_CONTEXT(ctx
);
8269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8270 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8275 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8277 if (ctx
->ExecuteFlag
) {
8278 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8282 static void GLAPIENTRY
8283 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8286 GET_CURRENT_CONTEXT(ctx
);
8288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8289 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8294 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8296 if (ctx
->ExecuteFlag
) {
8297 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8301 static void GLAPIENTRY
8302 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8305 GET_CURRENT_CONTEXT(ctx
);
8307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8308 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8313 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8315 if (ctx
->ExecuteFlag
) {
8316 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8320 static void GLAPIENTRY
8321 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8323 GET_CURRENT_CONTEXT(ctx
);
8325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8326 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8332 if (ctx
->ExecuteFlag
) {
8333 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8337 static void GLAPIENTRY
8338 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8340 GET_CURRENT_CONTEXT(ctx
);
8342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8343 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8350 if (ctx
->ExecuteFlag
) {
8351 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8355 static void GLAPIENTRY
8356 save_ProgramUniform3ui(GLuint program
, GLint location
,
8357 GLuint x
, GLuint y
, GLuint z
)
8359 GET_CURRENT_CONTEXT(ctx
);
8361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8362 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8370 if (ctx
->ExecuteFlag
) {
8371 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8375 static void GLAPIENTRY
8376 save_ProgramUniform4ui(GLuint program
, GLint location
,
8377 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8379 GET_CURRENT_CONTEXT(ctx
);
8381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8382 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8391 if (ctx
->ExecuteFlag
) {
8392 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8396 static void GLAPIENTRY
8397 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8400 GET_CURRENT_CONTEXT(ctx
);
8402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8403 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8408 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8410 if (ctx
->ExecuteFlag
) {
8411 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8415 static void GLAPIENTRY
8416 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8419 GET_CURRENT_CONTEXT(ctx
);
8421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8422 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8427 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8429 if (ctx
->ExecuteFlag
) {
8430 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8434 static void GLAPIENTRY
8435 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8438 GET_CURRENT_CONTEXT(ctx
);
8440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8441 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8446 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8448 if (ctx
->ExecuteFlag
) {
8449 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8453 static void GLAPIENTRY
8454 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8457 GET_CURRENT_CONTEXT(ctx
);
8459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8460 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8465 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8467 if (ctx
->ExecuteFlag
) {
8468 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8472 static void GLAPIENTRY
8473 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8474 GLboolean transpose
, const GLfloat
*v
)
8476 GET_CURRENT_CONTEXT(ctx
);
8478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8479 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8480 4 + POINTER_DWORDS
);
8486 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8488 if (ctx
->ExecuteFlag
) {
8489 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8490 (program
, location
, count
, transpose
, v
));
8494 static void GLAPIENTRY
8495 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8496 GLboolean transpose
, const GLfloat
*v
)
8498 GET_CURRENT_CONTEXT(ctx
);
8500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8501 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8502 4 + POINTER_DWORDS
);
8508 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8510 if (ctx
->ExecuteFlag
) {
8511 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8512 (program
, location
, count
, transpose
, v
));
8516 static void GLAPIENTRY
8517 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8518 GLboolean transpose
, const GLfloat
*v
)
8520 GET_CURRENT_CONTEXT(ctx
);
8522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8523 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8524 4 + POINTER_DWORDS
);
8530 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8532 if (ctx
->ExecuteFlag
) {
8533 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8534 (program
, location
, count
, transpose
, v
));
8538 static void GLAPIENTRY
8539 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8540 GLboolean transpose
, const GLfloat
*v
)
8542 GET_CURRENT_CONTEXT(ctx
);
8544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8545 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8546 4 + POINTER_DWORDS
);
8552 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8554 if (ctx
->ExecuteFlag
) {
8555 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8556 (program
, location
, count
, transpose
, v
));
8560 static void GLAPIENTRY
8561 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8562 GLboolean transpose
, const GLfloat
*v
)
8564 GET_CURRENT_CONTEXT(ctx
);
8566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8567 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8568 4 + POINTER_DWORDS
);
8574 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8576 if (ctx
->ExecuteFlag
) {
8577 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8578 (program
, location
, count
, transpose
, v
));
8582 static void GLAPIENTRY
8583 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8584 GLboolean transpose
, const GLfloat
*v
)
8586 GET_CURRENT_CONTEXT(ctx
);
8588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8589 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8590 4 + POINTER_DWORDS
);
8596 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8598 if (ctx
->ExecuteFlag
) {
8599 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8600 (program
, location
, count
, transpose
, v
));
8604 static void GLAPIENTRY
8605 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8606 GLboolean transpose
, const GLfloat
*v
)
8608 GET_CURRENT_CONTEXT(ctx
);
8610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8611 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8612 4 + POINTER_DWORDS
);
8618 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8620 if (ctx
->ExecuteFlag
) {
8621 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8622 (program
, location
, count
, transpose
, v
));
8626 static void GLAPIENTRY
8627 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8628 GLboolean transpose
, const GLfloat
*v
)
8630 GET_CURRENT_CONTEXT(ctx
);
8632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8633 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8634 4 + POINTER_DWORDS
);
8640 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8642 if (ctx
->ExecuteFlag
) {
8643 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8644 (program
, location
, count
, transpose
, v
));
8648 static void GLAPIENTRY
8649 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8650 GLboolean transpose
, const GLfloat
*v
)
8652 GET_CURRENT_CONTEXT(ctx
);
8654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8655 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8656 4 + POINTER_DWORDS
);
8662 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8664 if (ctx
->ExecuteFlag
) {
8665 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8666 (program
, location
, count
, transpose
, v
));
8670 static void GLAPIENTRY
8671 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8672 GLboolean transpose
, const GLdouble
*v
)
8674 GET_CURRENT_CONTEXT(ctx
);
8676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8677 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8678 4 + POINTER_DWORDS
);
8684 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8686 if (ctx
->ExecuteFlag
) {
8687 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8688 (program
, location
, count
, transpose
, v
));
8692 static void GLAPIENTRY
8693 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8694 GLboolean transpose
, const GLdouble
*v
)
8696 GET_CURRENT_CONTEXT(ctx
);
8698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8699 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8700 4 + POINTER_DWORDS
);
8706 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8708 if (ctx
->ExecuteFlag
) {
8709 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8710 (program
, location
, count
, transpose
, v
));
8714 static void GLAPIENTRY
8715 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8716 GLboolean transpose
, const GLdouble
*v
)
8718 GET_CURRENT_CONTEXT(ctx
);
8720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8721 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8722 4 + POINTER_DWORDS
);
8728 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8730 if (ctx
->ExecuteFlag
) {
8731 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8732 (program
, location
, count
, transpose
, v
));
8736 static void GLAPIENTRY
8737 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8738 GLboolean transpose
, const GLdouble
*v
)
8740 GET_CURRENT_CONTEXT(ctx
);
8742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8743 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8744 4 + POINTER_DWORDS
);
8750 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8752 if (ctx
->ExecuteFlag
) {
8753 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8754 (program
, location
, count
, transpose
, v
));
8758 static void GLAPIENTRY
8759 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8760 GLboolean transpose
, const GLdouble
*v
)
8762 GET_CURRENT_CONTEXT(ctx
);
8764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8765 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8766 4 + POINTER_DWORDS
);
8772 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8774 if (ctx
->ExecuteFlag
) {
8775 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8776 (program
, location
, count
, transpose
, v
));
8780 static void GLAPIENTRY
8781 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8782 GLboolean transpose
, const GLdouble
*v
)
8784 GET_CURRENT_CONTEXT(ctx
);
8786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8787 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8788 4 + POINTER_DWORDS
);
8794 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8796 if (ctx
->ExecuteFlag
) {
8797 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8798 (program
, location
, count
, transpose
, v
));
8802 static void GLAPIENTRY
8803 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8804 GLboolean transpose
, const GLdouble
*v
)
8806 GET_CURRENT_CONTEXT(ctx
);
8808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8809 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8810 4 + POINTER_DWORDS
);
8816 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8818 if (ctx
->ExecuteFlag
) {
8819 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8820 (program
, location
, count
, transpose
, v
));
8824 static void GLAPIENTRY
8825 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8826 GLboolean transpose
, const GLdouble
*v
)
8828 GET_CURRENT_CONTEXT(ctx
);
8830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8831 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8832 4 + POINTER_DWORDS
);
8838 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8840 if (ctx
->ExecuteFlag
) {
8841 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8842 (program
, location
, count
, transpose
, v
));
8846 static void GLAPIENTRY
8847 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8848 GLboolean transpose
, const GLdouble
*v
)
8850 GET_CURRENT_CONTEXT(ctx
);
8852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8853 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8854 4 + POINTER_DWORDS
);
8860 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8862 if (ctx
->ExecuteFlag
) {
8863 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8864 (program
, location
, count
, transpose
, v
));
8868 static void GLAPIENTRY
8869 save_ClipControl(GLenum origin
, GLenum depth
)
8871 GET_CURRENT_CONTEXT(ctx
);
8873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8874 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8879 if (ctx
->ExecuteFlag
) {
8880 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8884 static void GLAPIENTRY
8885 save_ClampColorARB(GLenum target
, GLenum clamp
)
8887 GET_CURRENT_CONTEXT(ctx
);
8889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8890 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8895 if (ctx
->ExecuteFlag
) {
8896 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8900 /** GL_EXT_texture_integer */
8901 static void GLAPIENTRY
8902 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8904 GET_CURRENT_CONTEXT(ctx
);
8906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8907 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8914 if (ctx
->ExecuteFlag
) {
8915 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8919 /** GL_EXT_texture_integer */
8920 static void GLAPIENTRY
8921 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8923 GET_CURRENT_CONTEXT(ctx
);
8925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8926 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8933 if (ctx
->ExecuteFlag
) {
8934 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8938 /** GL_EXT_texture_integer */
8939 static void GLAPIENTRY
8940 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8942 GET_CURRENT_CONTEXT(ctx
);
8944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8945 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8954 if (ctx
->ExecuteFlag
) {
8955 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8959 /** GL_EXT_texture_integer */
8960 static void GLAPIENTRY
8961 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8963 GET_CURRENT_CONTEXT(ctx
);
8965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8966 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8970 n
[3].ui
= params
[0];
8971 n
[4].ui
= params
[1];
8972 n
[5].ui
= params
[2];
8973 n
[6].ui
= params
[3];
8975 if (ctx
->ExecuteFlag
) {
8976 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8980 /* GL_ARB_instanced_arrays */
8981 static void GLAPIENTRY
8982 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8984 GET_CURRENT_CONTEXT(ctx
);
8986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8987 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8992 if (ctx
->ExecuteFlag
) {
8993 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8998 /* GL_NV_texture_barrier */
8999 static void GLAPIENTRY
9000 save_TextureBarrierNV(void)
9002 GET_CURRENT_CONTEXT(ctx
);
9003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9004 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
9005 if (ctx
->ExecuteFlag
) {
9006 CALL_TextureBarrierNV(ctx
->Exec
, ());
9011 /* GL_ARB_sampler_objects */
9012 static void GLAPIENTRY
9013 save_BindSampler(GLuint unit
, GLuint sampler
)
9016 GET_CURRENT_CONTEXT(ctx
);
9017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9018 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
9023 if (ctx
->ExecuteFlag
) {
9024 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
9028 static void GLAPIENTRY
9029 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9032 GET_CURRENT_CONTEXT(ctx
);
9033 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9034 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
9039 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9045 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9048 if (ctx
->ExecuteFlag
) {
9049 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9053 static void GLAPIENTRY
9054 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9058 parray
[1] = parray
[2] = parray
[3] = 0;
9059 save_SamplerParameteriv(sampler
, pname
, parray
);
9062 static void GLAPIENTRY
9063 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9066 GET_CURRENT_CONTEXT(ctx
);
9067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9068 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9073 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9079 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9082 if (ctx
->ExecuteFlag
) {
9083 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9087 static void GLAPIENTRY
9088 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9092 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9093 save_SamplerParameterfv(sampler
, pname
, parray
);
9096 static void GLAPIENTRY
9097 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9100 GET_CURRENT_CONTEXT(ctx
);
9101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9102 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9107 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9113 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9116 if (ctx
->ExecuteFlag
) {
9117 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9121 static void GLAPIENTRY
9122 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9125 GET_CURRENT_CONTEXT(ctx
);
9126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9127 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9131 n
[3].ui
= params
[0];
9132 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9133 n
[4].ui
= params
[1];
9134 n
[5].ui
= params
[2];
9135 n
[6].ui
= params
[3];
9138 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9141 if (ctx
->ExecuteFlag
) {
9142 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9146 static void GLAPIENTRY
9147 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9150 GET_CURRENT_CONTEXT(ctx
);
9151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9152 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9154 union uint64_pair p
;
9157 n
[2].ui
= p
.uint32
[0];
9158 n
[3].ui
= p
.uint32
[1];
9159 save_pointer(&n
[4], sync
);
9161 if (ctx
->ExecuteFlag
) {
9162 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9167 /** GL_NV_conditional_render */
9168 static void GLAPIENTRY
9169 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9171 GET_CURRENT_CONTEXT(ctx
);
9173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9174 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9179 if (ctx
->ExecuteFlag
) {
9180 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9184 static void GLAPIENTRY
9185 save_EndConditionalRender(void)
9187 GET_CURRENT_CONTEXT(ctx
);
9188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9189 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9190 if (ctx
->ExecuteFlag
) {
9191 CALL_EndConditionalRender(ctx
->Exec
, ());
9195 static void GLAPIENTRY
9196 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9198 GET_CURRENT_CONTEXT(ctx
);
9200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9201 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9207 if (ctx
->ExecuteFlag
) {
9208 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9212 static void GLAPIENTRY
9213 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9214 const GLuint
*indices
)
9216 GET_CURRENT_CONTEXT(ctx
);
9218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9219 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9221 GLint
*indices_copy
= NULL
;
9224 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9225 n
[1].e
= shadertype
;
9227 save_pointer(&n
[3], indices_copy
);
9229 if (ctx
->ExecuteFlag
) {
9230 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9234 /** GL_EXT_window_rectangles */
9235 static void GLAPIENTRY
9236 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9238 GET_CURRENT_CONTEXT(ctx
);
9240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9241 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9243 GLint
*box_copy
= NULL
;
9246 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9249 save_pointer(&n
[3], box_copy
);
9251 if (ctx
->ExecuteFlag
) {
9252 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9257 /** GL_NV_conservative_raster */
9258 static void GLAPIENTRY
9259 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9261 GET_CURRENT_CONTEXT(ctx
);
9263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9264 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9269 if (ctx
->ExecuteFlag
) {
9270 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9274 /** GL_NV_conservative_raster_dilate */
9275 static void GLAPIENTRY
9276 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9278 GET_CURRENT_CONTEXT(ctx
);
9280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9281 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9286 if (ctx
->ExecuteFlag
) {
9287 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9291 /** GL_NV_conservative_raster_pre_snap_triangles */
9292 static void GLAPIENTRY
9293 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9295 GET_CURRENT_CONTEXT(ctx
);
9297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9298 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9303 if (ctx
->ExecuteFlag
) {
9304 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9308 /** GL_EXT_direct_state_access */
9310 static void GLAPIENTRY
9311 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9313 GET_CURRENT_CONTEXT(ctx
);
9315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9316 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9318 n
[1].e
= matrixMode
;
9319 for (unsigned i
= 0; i
< 16; i
++) {
9323 if (ctx
->ExecuteFlag
) {
9324 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9328 static void GLAPIENTRY
9329 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9332 for (unsigned i
= 0; i
< 16; i
++) {
9333 f
[i
] = (GLfloat
) m
[i
];
9335 save_MatrixLoadfEXT(matrixMode
, f
);
9338 static void GLAPIENTRY
9339 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9341 GET_CURRENT_CONTEXT(ctx
);
9343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9344 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9346 n
[1].e
= matrixMode
;
9347 for (unsigned i
= 0; i
< 16; i
++) {
9351 if (ctx
->ExecuteFlag
) {
9352 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9356 static void GLAPIENTRY
9357 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9360 for (unsigned i
= 0; i
< 16; i
++) {
9361 f
[i
] = (GLfloat
) m
[i
];
9363 save_MatrixMultfEXT(matrixMode
, f
);
9366 static void GLAPIENTRY
9367 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9369 GET_CURRENT_CONTEXT(ctx
);
9371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9372 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9374 n
[1].e
= matrixMode
;
9380 if (ctx
->ExecuteFlag
) {
9381 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9385 static void GLAPIENTRY
9386 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9388 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9391 static void GLAPIENTRY
9392 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9394 GET_CURRENT_CONTEXT(ctx
);
9396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9397 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9399 n
[1].e
= matrixMode
;
9404 if (ctx
->ExecuteFlag
) {
9405 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9409 static void GLAPIENTRY
9410 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9412 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9415 static void GLAPIENTRY
9416 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9418 GET_CURRENT_CONTEXT(ctx
);
9420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9421 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9423 n
[1].e
= matrixMode
;
9428 if (ctx
->ExecuteFlag
) {
9429 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9433 static void GLAPIENTRY
9434 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9436 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9439 static void GLAPIENTRY
9440 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9442 GET_CURRENT_CONTEXT(ctx
);
9444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9445 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9447 n
[1].e
= matrixMode
;
9449 if (ctx
->ExecuteFlag
) {
9450 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9454 static void GLAPIENTRY
9455 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9456 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9458 GET_CURRENT_CONTEXT(ctx
);
9460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9461 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9463 n
[1].e
= matrixMode
;
9464 n
[2].f
= (GLfloat
) left
;
9465 n
[3].f
= (GLfloat
) right
;
9466 n
[4].f
= (GLfloat
) bottom
;
9467 n
[5].f
= (GLfloat
) top
;
9468 n
[6].f
= (GLfloat
) nearval
;
9469 n
[7].f
= (GLfloat
) farval
;
9471 if (ctx
->ExecuteFlag
) {
9472 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9477 static void GLAPIENTRY
9478 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9479 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9481 GET_CURRENT_CONTEXT(ctx
);
9483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9484 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9486 n
[1].e
= matrixMode
;
9487 n
[2].f
= (GLfloat
) left
;
9488 n
[3].f
= (GLfloat
) right
;
9489 n
[4].f
= (GLfloat
) bottom
;
9490 n
[5].f
= (GLfloat
) top
;
9491 n
[6].f
= (GLfloat
) nearval
;
9492 n
[7].f
= (GLfloat
) farval
;
9494 if (ctx
->ExecuteFlag
) {
9495 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9499 static void GLAPIENTRY
9500 save_MatrixPushEXT(GLenum matrixMode
)
9502 GET_CURRENT_CONTEXT(ctx
);
9504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9505 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9507 n
[1].e
= matrixMode
;
9509 if (ctx
->ExecuteFlag
) {
9510 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9514 static void GLAPIENTRY
9515 save_MatrixPopEXT(GLenum matrixMode
)
9517 GET_CURRENT_CONTEXT(ctx
);
9519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9520 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9522 n
[1].e
= matrixMode
;
9524 if (ctx
->ExecuteFlag
) {
9525 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9529 static void GLAPIENTRY
9530 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9533 _math_transposef(tm
, m
);
9534 save_MatrixLoadfEXT(matrixMode
, tm
);
9537 static void GLAPIENTRY
9538 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9541 _math_transposefd(tm
, m
);
9542 save_MatrixLoadfEXT(matrixMode
, tm
);
9545 static void GLAPIENTRY
9546 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9549 _math_transposef(tm
, m
);
9550 save_MatrixMultfEXT(matrixMode
, tm
);
9553 static void GLAPIENTRY
9554 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9557 _math_transposefd(tm
, m
);
9558 save_MatrixMultfEXT(matrixMode
, tm
);
9561 static void GLAPIENTRY
9562 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9563 const GLfloat
*params
)
9565 GET_CURRENT_CONTEXT(ctx
);
9567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9568 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9578 if (ctx
->ExecuteFlag
) {
9579 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9584 static void GLAPIENTRY
9585 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9589 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9590 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9593 static void GLAPIENTRY
9594 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9596 GET_CURRENT_CONTEXT(ctx
);
9598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9599 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9609 if (ctx
->ExecuteFlag
) {
9610 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9614 static void GLAPIENTRY
9615 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9619 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9620 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9623 static void GLAPIENTRY
9624 save_TextureParameterIivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
* params
)
9626 GET_CURRENT_CONTEXT(ctx
);
9628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9629 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_II
, 7);
9639 if (ctx
->ExecuteFlag
) {
9640 CALL_TextureParameterIivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9644 static void GLAPIENTRY
9645 save_TextureParameterIuivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLuint
* params
)
9647 GET_CURRENT_CONTEXT(ctx
);
9649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9650 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_IUI
, 7);
9655 n
[4].ui
= params
[0];
9656 n
[5].ui
= params
[1];
9657 n
[6].ui
= params
[2];
9658 n
[7].ui
= params
[3];
9660 if (ctx
->ExecuteFlag
) {
9661 CALL_TextureParameterIuivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9666 static void GLAPIENTRY
9667 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9668 GLint level
, GLint components
,
9669 GLsizei width
, GLint border
,
9670 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9672 GET_CURRENT_CONTEXT(ctx
);
9673 if (target
== GL_PROXY_TEXTURE_1D
) {
9674 /* don't compile, execute immediately */
9675 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9676 border
, format
, type
, pixels
));
9680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9681 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9686 n
[4].i
= components
;
9687 n
[5].i
= (GLint
) width
;
9692 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9693 pixels
, &ctx
->Unpack
));
9695 if (ctx
->ExecuteFlag
) {
9696 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9697 border
, format
, type
, pixels
));
9703 static void GLAPIENTRY
9704 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9705 GLint level
, GLint components
,
9706 GLsizei width
, GLsizei height
, GLint border
,
9707 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9709 GET_CURRENT_CONTEXT(ctx
);
9710 if (target
== GL_PROXY_TEXTURE_2D
) {
9711 /* don't compile, execute immediately */
9712 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9713 height
, border
, format
, type
, pixels
));
9717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9718 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9723 n
[4].i
= components
;
9724 n
[5].i
= (GLint
) width
;
9725 n
[6].i
= (GLint
) height
;
9729 save_pointer(&n
[10],
9730 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9731 pixels
, &ctx
->Unpack
));
9733 if (ctx
->ExecuteFlag
) {
9734 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9735 height
, border
, format
, type
, pixels
));
9741 static void GLAPIENTRY
9742 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9743 GLint level
, GLint internalFormat
,
9744 GLsizei width
, GLsizei height
, GLsizei depth
,
9746 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9748 GET_CURRENT_CONTEXT(ctx
);
9749 if (target
== GL_PROXY_TEXTURE_3D
) {
9750 /* don't compile, execute immediately */
9751 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9752 height
, depth
, border
, format
, type
,
9757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9758 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9763 n
[4].i
= (GLint
) internalFormat
;
9764 n
[5].i
= (GLint
) width
;
9765 n
[6].i
= (GLint
) height
;
9766 n
[7].i
= (GLint
) depth
;
9770 save_pointer(&n
[11],
9771 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9772 pixels
, &ctx
->Unpack
));
9774 if (ctx
->ExecuteFlag
) {
9775 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9776 width
, height
, depth
, border
, format
,
9783 static void GLAPIENTRY
9784 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9785 GLsizei width
, GLenum format
, GLenum type
,
9786 const GLvoid
* pixels
)
9788 GET_CURRENT_CONTEXT(ctx
);
9791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9793 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9799 n
[5].i
= (GLint
) width
;
9803 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9804 pixels
, &ctx
->Unpack
));
9806 if (ctx
->ExecuteFlag
) {
9807 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9808 format
, type
, pixels
));
9813 static void GLAPIENTRY
9814 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9815 GLint xoffset
, GLint yoffset
,
9816 GLsizei width
, GLsizei height
,
9817 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9819 GET_CURRENT_CONTEXT(ctx
);
9822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9824 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9831 n
[6].i
= (GLint
) width
;
9832 n
[7].i
= (GLint
) height
;
9835 save_pointer(&n
[10],
9836 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9837 pixels
, &ctx
->Unpack
));
9839 if (ctx
->ExecuteFlag
) {
9840 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9841 width
, height
, format
, type
, pixels
));
9846 static void GLAPIENTRY
9847 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9848 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9849 GLsizei width
, GLsizei height
, GLsizei depth
,
9850 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9852 GET_CURRENT_CONTEXT(ctx
);
9855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9857 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9865 n
[7].i
= (GLint
) width
;
9866 n
[8].i
= (GLint
) height
;
9867 n
[9].i
= (GLint
) depth
;
9870 save_pointer(&n
[12],
9871 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9872 pixels
, &ctx
->Unpack
));
9874 if (ctx
->ExecuteFlag
) {
9875 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9876 xoffset
, yoffset
, zoffset
,
9877 width
, height
, depth
, format
, type
,
9882 static void GLAPIENTRY
9883 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9884 GLenum internalformat
, GLint x
, GLint y
,
9885 GLsizei width
, GLint border
)
9887 GET_CURRENT_CONTEXT(ctx
);
9889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9890 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9895 n
[4].e
= internalformat
;
9901 if (ctx
->ExecuteFlag
) {
9902 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9903 internalformat
, x
, y
,
9908 static void GLAPIENTRY
9909 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9910 GLenum internalformat
,
9911 GLint x
, GLint y
, GLsizei width
,
9912 GLsizei height
, GLint border
)
9914 GET_CURRENT_CONTEXT(ctx
);
9916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9917 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9922 n
[4].e
= internalformat
;
9929 if (ctx
->ExecuteFlag
) {
9930 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9931 internalformat
, x
, y
,
9932 width
, height
, border
));
9936 static void GLAPIENTRY
9937 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9938 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9940 GET_CURRENT_CONTEXT(ctx
);
9942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9943 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9953 if (ctx
->ExecuteFlag
) {
9954 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9955 (texture
, target
, level
, xoffset
, x
, y
, width
));
9959 static void GLAPIENTRY
9960 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9961 GLint xoffset
, GLint yoffset
,
9962 GLint x
, GLint y
, GLsizei width
, GLint height
)
9964 GET_CURRENT_CONTEXT(ctx
);
9966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9967 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9979 if (ctx
->ExecuteFlag
) {
9980 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9982 x
, y
, width
, height
));
9987 static void GLAPIENTRY
9988 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9989 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9990 GLint x
, GLint y
, GLsizei width
, GLint height
)
9992 GET_CURRENT_CONTEXT(ctx
);
9994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9995 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
10008 if (ctx
->ExecuteFlag
) {
10009 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10010 xoffset
, yoffset
, zoffset
,
10011 x
, y
, width
, height
));
10016 static void GLAPIENTRY
10017 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
10019 GET_CURRENT_CONTEXT(ctx
);
10021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10022 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
10028 if (ctx
->ExecuteFlag
) {
10029 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
10034 static void GLAPIENTRY
10035 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
10036 const GLfloat
*params
)
10038 GET_CURRENT_CONTEXT(ctx
);
10040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10041 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
10046 n
[4].f
= params
[0];
10047 n
[5].f
= params
[1];
10048 n
[6].f
= params
[2];
10049 n
[7].f
= params
[3];
10051 if (ctx
->ExecuteFlag
) {
10052 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10057 static void GLAPIENTRY
10058 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10062 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10063 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
10066 static void GLAPIENTRY
10067 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10069 GET_CURRENT_CONTEXT(ctx
);
10071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10072 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
10077 n
[4].i
= params
[0];
10078 n
[5].i
= params
[1];
10079 n
[6].i
= params
[2];
10080 n
[7].i
= params
[3];
10082 if (ctx
->ExecuteFlag
) {
10083 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10087 static void GLAPIENTRY
10088 save_MultiTexParameterIivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
10090 GET_CURRENT_CONTEXT(ctx
);
10092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10093 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_II
, 7);
10098 n
[4].i
= params
[0];
10099 n
[5].i
= params
[1];
10100 n
[6].i
= params
[2];
10101 n
[7].i
= params
[3];
10103 if (ctx
->ExecuteFlag
) {
10104 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10108 static void GLAPIENTRY
10109 save_MultiTexParameterIuivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLuint
*params
)
10111 GET_CURRENT_CONTEXT(ctx
);
10113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10114 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_IUI
, 7);
10119 n
[4].ui
= params
[0];
10120 n
[5].ui
= params
[1];
10121 n
[6].ui
= params
[2];
10122 n
[7].ui
= params
[3];
10124 if (ctx
->ExecuteFlag
) {
10125 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10129 static void GLAPIENTRY
10130 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10134 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10135 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10139 static void GLAPIENTRY
10140 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10141 GLint level
, GLint components
,
10142 GLsizei width
, GLint border
,
10143 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10145 GET_CURRENT_CONTEXT(ctx
);
10146 if (target
== GL_PROXY_TEXTURE_1D
) {
10147 /* don't compile, execute immediately */
10148 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10149 border
, format
, type
, pixels
));
10153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10154 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10159 n
[4].i
= components
;
10160 n
[5].i
= (GLint
) width
;
10164 save_pointer(&n
[9],
10165 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10166 pixels
, &ctx
->Unpack
));
10168 if (ctx
->ExecuteFlag
) {
10169 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10170 border
, format
, type
, pixels
));
10176 static void GLAPIENTRY
10177 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10178 GLint level
, GLint components
,
10179 GLsizei width
, GLsizei height
, GLint border
,
10180 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10182 GET_CURRENT_CONTEXT(ctx
);
10183 if (target
== GL_PROXY_TEXTURE_2D
) {
10184 /* don't compile, execute immediately */
10185 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10186 height
, border
, format
, type
, pixels
));
10190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10191 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10196 n
[4].i
= components
;
10197 n
[5].i
= (GLint
) width
;
10198 n
[6].i
= (GLint
) height
;
10202 save_pointer(&n
[10],
10203 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10204 pixels
, &ctx
->Unpack
));
10206 if (ctx
->ExecuteFlag
) {
10207 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10208 height
, border
, format
, type
, pixels
));
10214 static void GLAPIENTRY
10215 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10216 GLint level
, GLint internalFormat
,
10217 GLsizei width
, GLsizei height
, GLsizei depth
,
10219 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10221 GET_CURRENT_CONTEXT(ctx
);
10222 if (target
== GL_PROXY_TEXTURE_3D
) {
10223 /* don't compile, execute immediately */
10224 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10225 height
, depth
, border
, format
, type
,
10230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10231 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10236 n
[4].i
= (GLint
) internalFormat
;
10237 n
[5].i
= (GLint
) width
;
10238 n
[6].i
= (GLint
) height
;
10239 n
[7].i
= (GLint
) depth
;
10243 save_pointer(&n
[11],
10244 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10245 pixels
, &ctx
->Unpack
));
10247 if (ctx
->ExecuteFlag
) {
10248 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10249 width
, height
, depth
, border
, format
,
10256 static void GLAPIENTRY
10257 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10258 GLsizei width
, GLenum format
, GLenum type
,
10259 const GLvoid
* pixels
)
10261 GET_CURRENT_CONTEXT(ctx
);
10264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10266 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10272 n
[5].i
= (GLint
) width
;
10275 save_pointer(&n
[8],
10276 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10277 pixels
, &ctx
->Unpack
));
10279 if (ctx
->ExecuteFlag
) {
10280 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10281 format
, type
, pixels
));
10286 static void GLAPIENTRY
10287 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10288 GLint xoffset
, GLint yoffset
,
10289 GLsizei width
, GLsizei height
,
10290 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10292 GET_CURRENT_CONTEXT(ctx
);
10295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10297 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10304 n
[6].i
= (GLint
) width
;
10305 n
[7].i
= (GLint
) height
;
10308 save_pointer(&n
[10],
10309 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10310 pixels
, &ctx
->Unpack
));
10312 if (ctx
->ExecuteFlag
) {
10313 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10314 width
, height
, format
, type
, pixels
));
10319 static void GLAPIENTRY
10320 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10321 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10322 GLsizei width
, GLsizei height
, GLsizei depth
,
10323 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10325 GET_CURRENT_CONTEXT(ctx
);
10328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10330 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10338 n
[7].i
= (GLint
) width
;
10339 n
[8].i
= (GLint
) height
;
10340 n
[9].i
= (GLint
) depth
;
10343 save_pointer(&n
[12],
10344 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10345 pixels
, &ctx
->Unpack
));
10347 if (ctx
->ExecuteFlag
) {
10348 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10349 xoffset
, yoffset
, zoffset
,
10350 width
, height
, depth
, format
, type
,
10356 static void GLAPIENTRY
10357 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10358 GLenum internalformat
, GLint x
, GLint y
,
10359 GLsizei width
, GLint border
)
10361 GET_CURRENT_CONTEXT(ctx
);
10363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10364 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10369 n
[4].e
= internalformat
;
10375 if (ctx
->ExecuteFlag
) {
10376 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10377 internalformat
, x
, y
,
10383 static void GLAPIENTRY
10384 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10385 GLenum internalformat
,
10386 GLint x
, GLint y
, GLsizei width
,
10387 GLsizei height
, GLint border
)
10389 GET_CURRENT_CONTEXT(ctx
);
10391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10392 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10397 n
[4].e
= internalformat
;
10404 if (ctx
->ExecuteFlag
) {
10405 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10406 internalformat
, x
, y
,
10407 width
, height
, border
));
10412 static void GLAPIENTRY
10413 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10414 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10416 GET_CURRENT_CONTEXT(ctx
);
10418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10419 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10429 if (ctx
->ExecuteFlag
) {
10430 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10431 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10436 static void GLAPIENTRY
10437 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10438 GLint xoffset
, GLint yoffset
,
10439 GLint x
, GLint y
, GLsizei width
, GLint height
)
10441 GET_CURRENT_CONTEXT(ctx
);
10443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10444 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10456 if (ctx
->ExecuteFlag
) {
10457 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10459 x
, y
, width
, height
));
10464 static void GLAPIENTRY
10465 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10466 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10467 GLint x
, GLint y
, GLsizei width
, GLint height
)
10469 GET_CURRENT_CONTEXT(ctx
);
10471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10472 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10485 if (ctx
->ExecuteFlag
) {
10486 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10487 xoffset
, yoffset
, zoffset
,
10488 x
, y
, width
, height
));
10493 static void GLAPIENTRY
10494 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10496 GET_CURRENT_CONTEXT(ctx
);
10498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10499 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10504 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10505 n
[4].f
= params
[0];
10506 n
[5].f
= params
[1];
10507 n
[6].f
= params
[2];
10508 n
[7].f
= params
[3];
10511 n
[4].f
= params
[0];
10512 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10515 if (ctx
->ExecuteFlag
) {
10516 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10521 static void GLAPIENTRY
10522 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10525 parray
[0] = (GLfloat
) param
;
10526 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10527 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10531 static void GLAPIENTRY
10532 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10535 p
[0] = (GLfloat
) param
;
10536 p
[1] = p
[2] = p
[3] = 0.0F
;
10537 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10541 static void GLAPIENTRY
10542 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10545 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10546 p
[0] = INT_TO_FLOAT(param
[0]);
10547 p
[1] = INT_TO_FLOAT(param
[1]);
10548 p
[2] = INT_TO_FLOAT(param
[2]);
10549 p
[3] = INT_TO_FLOAT(param
[3]);
10552 p
[0] = (GLfloat
) param
[0];
10553 p
[1] = p
[2] = p
[3] = 0.0F
;
10555 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10559 static void GLAPIENTRY
10560 save_CompressedTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
10561 GLenum internalFormat
, GLsizei width
,
10562 GLint border
, GLsizei imageSize
,
10563 const GLvoid
* data
)
10565 GET_CURRENT_CONTEXT(ctx
);
10566 if (target
== GL_PROXY_TEXTURE_1D
) {
10567 /* don't compile, execute immediately */
10568 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
10569 internalFormat
, width
,
10575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10577 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
,
10578 7 + POINTER_DWORDS
);
10583 n
[4].e
= internalFormat
;
10584 n
[5].i
= (GLint
) width
;
10586 n
[7].i
= imageSize
;
10587 save_pointer(&n
[8],
10588 copy_data(data
, imageSize
, "glCompressedTextureImage1DEXT"));
10590 if (ctx
->ExecuteFlag
) {
10591 CALL_CompressedTextureImage1DEXT(ctx
->Exec
,
10592 (texture
, target
, level
, internalFormat
,
10593 width
, border
, imageSize
, data
));
10599 static void GLAPIENTRY
10600 save_CompressedTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
10601 GLenum internalFormat
, GLsizei width
,
10602 GLsizei height
, GLint border
, GLsizei imageSize
,
10603 const GLvoid
* data
)
10605 GET_CURRENT_CONTEXT(ctx
);
10606 if (target
== GL_PROXY_TEXTURE_2D
) {
10607 /* don't compile, execute immediately */
10608 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
10609 internalFormat
, width
, height
,
10610 border
, imageSize
, data
));
10614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10616 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
,
10617 8 + POINTER_DWORDS
);
10622 n
[4].e
= internalFormat
;
10623 n
[5].i
= (GLint
) width
;
10624 n
[6].i
= (GLint
) height
;
10626 n
[8].i
= imageSize
;
10627 save_pointer(&n
[9],
10628 copy_data(data
, imageSize
, "glCompressedTextureImage2DEXT"));
10630 if (ctx
->ExecuteFlag
) {
10631 CALL_CompressedTextureImage2DEXT(ctx
->Exec
,
10632 (texture
, target
, level
, internalFormat
,
10633 width
, height
, border
, imageSize
, data
));
10639 static void GLAPIENTRY
10640 save_CompressedTextureImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
10641 GLenum internalFormat
, GLsizei width
,
10642 GLsizei height
, GLsizei depth
, GLint border
,
10643 GLsizei imageSize
, const GLvoid
* data
)
10645 GET_CURRENT_CONTEXT(ctx
);
10646 if (target
== GL_PROXY_TEXTURE_3D
) {
10647 /* don't compile, execute immediately */
10648 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
10649 internalFormat
, width
,
10650 height
, depth
, border
,
10655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10657 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
,
10658 9 + POINTER_DWORDS
);
10663 n
[4].e
= internalFormat
;
10664 n
[5].i
= (GLint
) width
;
10665 n
[6].i
= (GLint
) height
;
10666 n
[7].i
= (GLint
) depth
;
10668 n
[9].i
= imageSize
;
10669 save_pointer(&n
[10],
10670 copy_data(data
, imageSize
, "glCompressedTextureImage3DEXT"));
10672 if (ctx
->ExecuteFlag
) {
10673 CALL_CompressedTextureImage3DEXT(ctx
->Exec
,
10674 (texture
, target
, level
, internalFormat
,
10675 width
, height
, depth
, border
, imageSize
,
10682 static void GLAPIENTRY
10683 save_CompressedTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10684 GLsizei width
, GLenum format
,
10685 GLsizei imageSize
, const GLvoid
* data
)
10688 GET_CURRENT_CONTEXT(ctx
);
10689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10691 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
,
10692 7 + POINTER_DWORDS
);
10698 n
[5].i
= (GLint
) width
;
10700 n
[7].i
= imageSize
;
10701 save_pointer(&n
[8],
10702 copy_data(data
, imageSize
, "glCompressedTextureSubImage1DEXT"));
10704 if (ctx
->ExecuteFlag
) {
10705 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
,
10706 width
, format
, imageSize
, data
));
10711 static void GLAPIENTRY
10712 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10713 GLint yoffset
, GLsizei width
, GLsizei height
,
10714 GLenum format
, GLsizei imageSize
,
10715 const GLvoid
* data
)
10718 GET_CURRENT_CONTEXT(ctx
);
10719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10721 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10722 9 + POINTER_DWORDS
);
10729 n
[6].i
= (GLint
) width
;
10730 n
[7].i
= (GLint
) height
;
10732 n
[9].i
= imageSize
;
10733 save_pointer(&n
[10],
10734 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10736 if (ctx
->ExecuteFlag
) {
10737 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10738 (texture
, target
, level
, xoffset
, yoffset
,
10739 width
, height
, format
, imageSize
, data
));
10744 static void GLAPIENTRY
10745 save_CompressedTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10746 GLint yoffset
, GLint zoffset
, GLsizei width
,
10747 GLsizei height
, GLsizei depth
, GLenum format
,
10748 GLsizei imageSize
, const GLvoid
* data
)
10751 GET_CURRENT_CONTEXT(ctx
);
10752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10754 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
,
10755 11 + POINTER_DWORDS
);
10763 n
[7].i
= (GLint
) width
;
10764 n
[8].i
= (GLint
) height
;
10765 n
[9].i
= (GLint
) depth
;
10767 n
[11].i
= imageSize
;
10768 save_pointer(&n
[12],
10769 copy_data(data
, imageSize
, "glCompressedTextureSubImage3DEXT"));
10771 if (ctx
->ExecuteFlag
) {
10772 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
10773 (texture
, target
, level
, xoffset
, yoffset
,
10774 zoffset
, width
, height
, depth
, format
,
10780 static void GLAPIENTRY
10781 save_CompressedMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10782 GLenum internalFormat
, GLsizei width
,
10783 GLint border
, GLsizei imageSize
,
10784 const GLvoid
* data
)
10786 GET_CURRENT_CONTEXT(ctx
);
10787 if (target
== GL_PROXY_TEXTURE_1D
) {
10788 /* don't compile, execute immediately */
10789 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10790 internalFormat
, width
,
10796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10798 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
,
10799 7 + POINTER_DWORDS
);
10804 n
[4].e
= internalFormat
;
10805 n
[5].i
= (GLint
) width
;
10807 n
[7].i
= imageSize
;
10808 save_pointer(&n
[8],
10809 copy_data(data
, imageSize
, "glCompressedMultiTexImage1DEXT"));
10811 if (ctx
->ExecuteFlag
) {
10812 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
,
10813 (texunit
, target
, level
, internalFormat
,
10814 width
, border
, imageSize
, data
));
10820 static void GLAPIENTRY
10821 save_CompressedMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10822 GLenum internalFormat
, GLsizei width
,
10823 GLsizei height
, GLint border
, GLsizei imageSize
,
10824 const GLvoid
* data
)
10826 GET_CURRENT_CONTEXT(ctx
);
10827 if (target
== GL_PROXY_TEXTURE_2D
) {
10828 /* don't compile, execute immediately */
10829 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10830 internalFormat
, width
, height
,
10831 border
, imageSize
, data
));
10835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10837 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
,
10838 8 + POINTER_DWORDS
);
10843 n
[4].e
= internalFormat
;
10844 n
[5].i
= (GLint
) width
;
10845 n
[6].i
= (GLint
) height
;
10847 n
[8].i
= imageSize
;
10848 save_pointer(&n
[9],
10849 copy_data(data
, imageSize
, "glCompressedMultiTexImage2DEXT"));
10851 if (ctx
->ExecuteFlag
) {
10852 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
,
10853 (texunit
, target
, level
, internalFormat
,
10854 width
, height
, border
, imageSize
, data
));
10860 static void GLAPIENTRY
10861 save_CompressedMultiTexImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10862 GLenum internalFormat
, GLsizei width
,
10863 GLsizei height
, GLsizei depth
, GLint border
,
10864 GLsizei imageSize
, const GLvoid
* data
)
10866 GET_CURRENT_CONTEXT(ctx
);
10867 if (target
== GL_PROXY_TEXTURE_3D
) {
10868 /* don't compile, execute immediately */
10869 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10870 internalFormat
, width
,
10871 height
, depth
, border
,
10876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10878 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
,
10879 9 + POINTER_DWORDS
);
10884 n
[4].e
= internalFormat
;
10885 n
[5].i
= (GLint
) width
;
10886 n
[6].i
= (GLint
) height
;
10887 n
[7].i
= (GLint
) depth
;
10889 n
[9].i
= imageSize
;
10890 save_pointer(&n
[10],
10891 copy_data(data
, imageSize
, "glCompressedMultiTexImage3DEXT"));
10893 if (ctx
->ExecuteFlag
) {
10894 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
,
10895 (texunit
, target
, level
, internalFormat
,
10896 width
, height
, depth
, border
, imageSize
,
10903 static void GLAPIENTRY
10904 save_CompressedMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10905 GLsizei width
, GLenum format
,
10906 GLsizei imageSize
, const GLvoid
* data
)
10909 GET_CURRENT_CONTEXT(ctx
);
10910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10912 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
,
10913 7 + POINTER_DWORDS
);
10919 n
[5].i
= (GLint
) width
;
10921 n
[7].i
= imageSize
;
10922 save_pointer(&n
[8],
10923 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage1DEXT"));
10925 if (ctx
->ExecuteFlag
) {
10926 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
,
10927 width
, format
, imageSize
, data
));
10932 static void GLAPIENTRY
10933 save_CompressedMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10934 GLint yoffset
, GLsizei width
, GLsizei height
,
10935 GLenum format
, GLsizei imageSize
,
10936 const GLvoid
* data
)
10939 GET_CURRENT_CONTEXT(ctx
);
10940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10942 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
,
10943 9 + POINTER_DWORDS
);
10950 n
[6].i
= (GLint
) width
;
10951 n
[7].i
= (GLint
) height
;
10953 n
[9].i
= imageSize
;
10954 save_pointer(&n
[10],
10955 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage2DEXT"));
10957 if (ctx
->ExecuteFlag
) {
10958 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
10959 (texunit
, target
, level
, xoffset
, yoffset
,
10960 width
, height
, format
, imageSize
, data
));
10965 static void GLAPIENTRY
10966 save_CompressedMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10967 GLint yoffset
, GLint zoffset
, GLsizei width
,
10968 GLsizei height
, GLsizei depth
, GLenum format
,
10969 GLsizei imageSize
, const GLvoid
* data
)
10972 GET_CURRENT_CONTEXT(ctx
);
10973 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10975 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
,
10976 11 + POINTER_DWORDS
);
10984 n
[7].i
= (GLint
) width
;
10985 n
[8].i
= (GLint
) height
;
10986 n
[9].i
= (GLint
) depth
;
10988 n
[11].i
= imageSize
;
10989 save_pointer(&n
[12],
10990 copy_data(data
, imageSize
, "glCompressedMultiTexSubImage3DEXT"));
10992 if (ctx
->ExecuteFlag
) {
10993 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
10994 (texunit
, target
, level
, xoffset
, yoffset
,
10995 zoffset
, width
, height
, depth
, format
,
11001 static void GLAPIENTRY
11002 save_NamedProgramStringEXT(GLuint program
, GLenum target
, GLenum format
, GLsizei len
,
11003 const GLvoid
* string
)
11005 GET_CURRENT_CONTEXT(ctx
);
11008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11010 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_STRING
, 4 + POINTER_DWORDS
);
11012 GLubyte
*programCopy
= malloc(len
);
11013 if (!programCopy
) {
11014 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glNamedProgramStringEXT");
11017 memcpy(programCopy
, string
, len
);
11022 save_pointer(&n
[5], programCopy
);
11024 if (ctx
->ExecuteFlag
) {
11025 CALL_NamedProgramStringEXT(ctx
->Exec
, (program
, target
, format
, len
, string
));
11030 static void GLAPIENTRY
11031 save_NamedProgramLocalParameter4fEXT(GLuint program
, GLenum target
, GLuint index
,
11032 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
11034 GET_CURRENT_CONTEXT(ctx
);
11036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
11037 n
= alloc_instruction(ctx
, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
, 7);
11047 if (ctx
->ExecuteFlag
) {
11048 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
, (program
, target
, index
, x
, y
, z
, w
));
11053 static void GLAPIENTRY
11054 save_NamedProgramLocalParameter4fvEXT(GLuint program
, GLenum target
, GLuint index
,
11055 const GLfloat
*params
)
11057 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, params
[0],
11058 params
[1], params
[2], params
[3]);
11062 static void GLAPIENTRY
11063 save_NamedProgramLocalParameter4dEXT(GLuint program
, GLenum target
, GLuint index
,
11064 GLdouble x
, GLdouble y
,
11065 GLdouble z
, GLdouble w
)
11067 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) x
,
11068 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
11072 static void GLAPIENTRY
11073 save_NamedProgramLocalParameter4dvEXT(GLuint program
, GLenum target
, GLuint index
,
11074 const GLdouble
*params
)
11076 save_NamedProgramLocalParameter4fEXT(program
, target
, index
, (GLfloat
) params
[0],
11077 (GLfloat
) params
[1], (GLfloat
) params
[2],
11078 (GLfloat
) params
[3]);
11083 * Save an error-generating command into display list.
11085 * KW: Will appear in the list before the vertex buffer containing the
11086 * command that provoked the error. I don't see this as a problem.
11089 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11092 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
11095 save_pointer(&n
[2], (void *) s
);
11096 /* note: the data/string here doesn't have to be freed in
11097 * _mesa_delete_list() since the string is never dynamically
11105 * Compile an error into current display list.
11108 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
11110 if (ctx
->CompileFlag
)
11111 save_error(ctx
, error
, s
);
11112 if (ctx
->ExecuteFlag
)
11113 _mesa_error(ctx
, error
, "%s", s
);
11118 * Test if ID names a display list.
11121 islist(struct gl_context
*ctx
, GLuint list
)
11123 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
11133 /**********************************************************************/
11134 /* Display list execution */
11135 /**********************************************************************/
11139 * Execute a display list. Note that the ListBase offset must have already
11140 * been added before calling this function. I.e. the list argument is
11141 * the absolute list number, not relative to ListBase.
11142 * \param list - display list number
11145 execute_list(struct gl_context
*ctx
, GLuint list
)
11147 struct gl_display_list
*dlist
;
11151 if (list
== 0 || !islist(ctx
, list
))
11154 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
11155 /* raise an error? */
11159 dlist
= _mesa_lookup_list(ctx
, list
);
11163 ctx
->ListState
.CallDepth
++;
11165 vbo_save_BeginCallList(ctx
, dlist
);
11171 const OpCode opcode
= n
[0].opcode
;
11173 if (is_ext_opcode(opcode
)) {
11174 n
+= ext_opcode_execute(ctx
, n
);
11179 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
11182 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11184 case OPCODE_ALPHA_FUNC
:
11185 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11187 case OPCODE_BIND_TEXTURE
:
11188 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11190 case OPCODE_BITMAP
:
11192 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11193 ctx
->Unpack
= ctx
->DefaultPacking
;
11194 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
11195 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
11196 get_pointer(&n
[7])));
11197 ctx
->Unpack
= save
; /* restore */
11200 case OPCODE_BLEND_COLOR
:
11201 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11203 case OPCODE_BLEND_EQUATION
:
11204 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
11206 case OPCODE_BLEND_EQUATION_SEPARATE
:
11207 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11209 case OPCODE_BLEND_FUNC_SEPARATE
:
11210 CALL_BlendFuncSeparate(ctx
->Exec
,
11211 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11214 case OPCODE_BLEND_FUNC_I
:
11215 /* GL_ARB_draw_buffers_blend */
11216 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
11218 case OPCODE_BLEND_FUNC_SEPARATE_I
:
11219 /* GL_ARB_draw_buffers_blend */
11220 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
11223 case OPCODE_BLEND_EQUATION_I
:
11224 /* GL_ARB_draw_buffers_blend */
11225 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11227 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
11228 /* GL_ARB_draw_buffers_blend */
11229 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
11230 (n
[1].ui
, n
[2].e
, n
[3].e
));
11233 case OPCODE_CALL_LIST
:
11234 /* Generated by glCallList(), don't add ListBase */
11235 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11236 execute_list(ctx
, n
[1].ui
);
11239 case OPCODE_CALL_LISTS
:
11240 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
11241 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
11245 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
11247 case OPCODE_CLEAR_BUFFER_IV
:
11254 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11257 case OPCODE_CLEAR_BUFFER_UIV
:
11260 value
[0] = n
[3].ui
;
11261 value
[1] = n
[4].ui
;
11262 value
[2] = n
[5].ui
;
11263 value
[3] = n
[6].ui
;
11264 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11267 case OPCODE_CLEAR_BUFFER_FV
:
11274 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
11277 case OPCODE_CLEAR_BUFFER_FI
:
11278 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
11280 case OPCODE_CLEAR_COLOR
:
11281 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11283 case OPCODE_CLEAR_ACCUM
:
11284 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11286 case OPCODE_CLEAR_DEPTH
:
11287 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
11289 case OPCODE_CLEAR_INDEX
:
11290 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
11292 case OPCODE_CLEAR_STENCIL
:
11293 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
11295 case OPCODE_CLIP_PLANE
:
11302 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
11305 case OPCODE_COLOR_MASK
:
11306 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
11308 case OPCODE_COLOR_MASK_INDEXED
:
11309 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
11312 case OPCODE_COLOR_MATERIAL
:
11313 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11315 case OPCODE_COPY_PIXELS
:
11316 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11317 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
11320 case OPCODE_COPY_TEX_IMAGE1D
:
11321 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11322 n
[5].i
, n
[6].i
, n
[7].i
));
11324 case OPCODE_COPY_TEX_IMAGE2D
:
11325 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
11326 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
11328 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
11329 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11330 n
[4].i
, n
[5].i
, n
[6].i
));
11332 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
11333 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11334 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11337 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
11338 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11339 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11342 case OPCODE_CULL_FACE
:
11343 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
11345 case OPCODE_DEPTH_FUNC
:
11346 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
11348 case OPCODE_DEPTH_MASK
:
11349 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
11351 case OPCODE_DEPTH_RANGE
:
11352 CALL_DepthRange(ctx
->Exec
,
11353 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
11355 case OPCODE_DISABLE
:
11356 CALL_Disable(ctx
->Exec
, (n
[1].e
));
11358 case OPCODE_DISABLE_INDEXED
:
11359 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11361 case OPCODE_DRAW_BUFFER
:
11362 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
11364 case OPCODE_DRAW_PIXELS
:
11366 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11367 ctx
->Unpack
= ctx
->DefaultPacking
;
11368 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
11369 get_pointer(&n
[5])));
11370 ctx
->Unpack
= save
; /* restore */
11373 case OPCODE_ENABLE
:
11374 CALL_Enable(ctx
->Exec
, (n
[1].e
));
11376 case OPCODE_ENABLE_INDEXED
:
11377 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11379 case OPCODE_EVALMESH1
:
11380 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
11382 case OPCODE_EVALMESH2
:
11383 CALL_EvalMesh2(ctx
->Exec
,
11384 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11393 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
11396 case OPCODE_FRONT_FACE
:
11397 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
11399 case OPCODE_FRUSTUM
:
11400 CALL_Frustum(ctx
->Exec
,
11401 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11404 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11406 case OPCODE_INDEX_MASK
:
11407 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
11409 case OPCODE_INIT_NAMES
:
11410 CALL_InitNames(ctx
->Exec
, ());
11419 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
11422 case OPCODE_LIGHT_MODEL
:
11429 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
11432 case OPCODE_LINE_STIPPLE
:
11433 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
11435 case OPCODE_LINE_WIDTH
:
11436 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
11438 case OPCODE_LIST_BASE
:
11439 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
11441 case OPCODE_LOAD_IDENTITY
:
11442 CALL_LoadIdentity(ctx
->Exec
, ());
11444 case OPCODE_LOAD_MATRIX
:
11445 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
11446 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
11448 case OPCODE_LOAD_NAME
:
11449 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
11451 case OPCODE_LOGIC_OP
:
11452 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
11456 GLenum target
= n
[1].e
;
11457 GLint ustride
= _mesa_evaluator_components(target
);
11458 GLint uorder
= n
[5].i
;
11459 GLfloat u1
= n
[2].f
;
11460 GLfloat u2
= n
[3].f
;
11461 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11462 (GLfloat
*) get_pointer(&n
[6])));
11467 GLenum target
= n
[1].e
;
11468 GLfloat u1
= n
[2].f
;
11469 GLfloat u2
= n
[3].f
;
11470 GLfloat v1
= n
[4].f
;
11471 GLfloat v2
= n
[5].f
;
11472 GLint ustride
= n
[6].i
;
11473 GLint vstride
= n
[7].i
;
11474 GLint uorder
= n
[8].i
;
11475 GLint vorder
= n
[9].i
;
11476 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
11477 v1
, v2
, vstride
, vorder
,
11478 (GLfloat
*) get_pointer(&n
[10])));
11481 case OPCODE_MAPGRID1
:
11482 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11484 case OPCODE_MAPGRID2
:
11485 CALL_MapGrid2f(ctx
->Exec
,
11486 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
11488 case OPCODE_MATRIX_MODE
:
11489 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
11491 case OPCODE_MULT_MATRIX
:
11492 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
11495 CALL_Ortho(ctx
->Exec
,
11496 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11498 case OPCODE_PASSTHROUGH
:
11499 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
11501 case OPCODE_PATCH_PARAMETER_I
:
11502 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11504 case OPCODE_PATCH_PARAMETER_FV_INNER
:
11507 params
[0] = n
[2].f
;
11508 params
[1] = n
[3].f
;
11509 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11512 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
11515 params
[0] = n
[2].f
;
11516 params
[1] = n
[3].f
;
11517 params
[2] = n
[4].f
;
11518 params
[3] = n
[5].f
;
11519 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11522 case OPCODE_PIXEL_MAP
:
11523 CALL_PixelMapfv(ctx
->Exec
,
11524 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
11526 case OPCODE_PIXEL_TRANSFER
:
11527 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11529 case OPCODE_PIXEL_ZOOM
:
11530 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11532 case OPCODE_POINT_SIZE
:
11533 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
11535 case OPCODE_POINT_PARAMETERS
:
11538 params
[0] = n
[2].f
;
11539 params
[1] = n
[3].f
;
11540 params
[2] = n
[4].f
;
11541 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
11544 case OPCODE_POLYGON_MODE
:
11545 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11547 case OPCODE_POLYGON_STIPPLE
:
11549 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11550 ctx
->Unpack
= ctx
->DefaultPacking
;
11551 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
11552 ctx
->Unpack
= save
; /* restore */
11555 case OPCODE_POLYGON_OFFSET
:
11556 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11558 case OPCODE_POLYGON_OFFSET_CLAMP
:
11559 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11561 case OPCODE_POP_ATTRIB
:
11562 CALL_PopAttrib(ctx
->Exec
, ());
11564 case OPCODE_POP_MATRIX
:
11565 CALL_PopMatrix(ctx
->Exec
, ());
11567 case OPCODE_POP_NAME
:
11568 CALL_PopName(ctx
->Exec
, ());
11570 case OPCODE_PRIORITIZE_TEXTURE
:
11571 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
11573 case OPCODE_PUSH_ATTRIB
:
11574 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
11576 case OPCODE_PUSH_MATRIX
:
11577 CALL_PushMatrix(ctx
->Exec
, ());
11579 case OPCODE_PUSH_NAME
:
11580 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
11582 case OPCODE_RASTER_POS
:
11583 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11585 case OPCODE_READ_BUFFER
:
11586 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
11588 case OPCODE_ROTATE
:
11589 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11592 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11594 case OPCODE_SCISSOR
:
11595 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11597 case OPCODE_SHADE_MODEL
:
11598 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
11600 case OPCODE_PROVOKING_VERTEX
:
11601 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
11603 case OPCODE_STENCIL_FUNC
:
11604 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
11606 case OPCODE_STENCIL_MASK
:
11607 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
11609 case OPCODE_STENCIL_OP
:
11610 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
11612 case OPCODE_STENCIL_FUNC_SEPARATE
:
11613 CALL_StencilFuncSeparate(ctx
->Exec
,
11614 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
11616 case OPCODE_STENCIL_MASK_SEPARATE
:
11617 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11619 case OPCODE_STENCIL_OP_SEPARATE
:
11620 CALL_StencilOpSeparate(ctx
->Exec
,
11621 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11623 case OPCODE_TEXENV
:
11626 params
[0] = n
[3].f
;
11627 params
[1] = n
[4].f
;
11628 params
[2] = n
[5].f
;
11629 params
[3] = n
[6].f
;
11630 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11633 case OPCODE_TEXGEN
:
11636 params
[0] = n
[3].f
;
11637 params
[1] = n
[4].f
;
11638 params
[2] = n
[5].f
;
11639 params
[3] = n
[6].f
;
11640 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11643 case OPCODE_TEXPARAMETER
:
11646 params
[0] = n
[3].f
;
11647 params
[1] = n
[4].f
;
11648 params
[2] = n
[5].f
;
11649 params
[3] = n
[6].f
;
11650 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11653 case OPCODE_TEX_IMAGE1D
:
11655 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11656 ctx
->Unpack
= ctx
->DefaultPacking
;
11657 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11658 n
[2].i
, /* level */
11659 n
[3].i
, /* components */
11660 n
[4].i
, /* width */
11661 n
[5].e
, /* border */
11662 n
[6].e
, /* format */
11664 get_pointer(&n
[8])));
11665 ctx
->Unpack
= save
; /* restore */
11668 case OPCODE_TEX_IMAGE2D
:
11670 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11671 ctx
->Unpack
= ctx
->DefaultPacking
;
11672 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11673 n
[2].i
, /* level */
11674 n
[3].i
, /* components */
11675 n
[4].i
, /* width */
11676 n
[5].i
, /* height */
11677 n
[6].e
, /* border */
11678 n
[7].e
, /* format */
11680 get_pointer(&n
[9])));
11681 ctx
->Unpack
= save
; /* restore */
11684 case OPCODE_TEX_IMAGE3D
:
11686 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11687 ctx
->Unpack
= ctx
->DefaultPacking
;
11688 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11689 n
[2].i
, /* level */
11690 n
[3].i
, /* components */
11691 n
[4].i
, /* width */
11692 n
[5].i
, /* height */
11693 n
[6].i
, /* depth */
11694 n
[7].e
, /* border */
11695 n
[8].e
, /* format */
11697 get_pointer(&n
[10])));
11698 ctx
->Unpack
= save
; /* restore */
11701 case OPCODE_TEX_SUB_IMAGE1D
:
11703 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11704 ctx
->Unpack
= ctx
->DefaultPacking
;
11705 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11707 n
[6].e
, get_pointer(&n
[7])));
11708 ctx
->Unpack
= save
; /* restore */
11711 case OPCODE_TEX_SUB_IMAGE2D
:
11713 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11714 ctx
->Unpack
= ctx
->DefaultPacking
;
11715 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11717 n
[6].i
, n
[7].e
, n
[8].e
,
11718 get_pointer(&n
[9])));
11719 ctx
->Unpack
= save
; /* restore */
11722 case OPCODE_TEX_SUB_IMAGE3D
:
11724 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11725 ctx
->Unpack
= ctx
->DefaultPacking
;
11726 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11727 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11728 n
[8].i
, n
[9].e
, n
[10].e
,
11729 get_pointer(&n
[11])));
11730 ctx
->Unpack
= save
; /* restore */
11733 case OPCODE_TRANSLATE
:
11734 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11736 case OPCODE_VIEWPORT
:
11737 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11738 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11740 case OPCODE_WINDOW_POS
:
11741 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11743 case OPCODE_VIEWPORT_ARRAY_V
:
11744 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11745 get_pointer(&n
[3])));
11747 case OPCODE_VIEWPORT_INDEXED_F
:
11748 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11751 case OPCODE_VIEWPORT_INDEXED_FV
: {
11757 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11760 case OPCODE_SCISSOR_ARRAY_V
:
11761 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11762 get_pointer(&n
[3])));
11764 case OPCODE_SCISSOR_INDEXED
:
11765 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11768 case OPCODE_SCISSOR_INDEXED_V
: {
11774 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11777 case OPCODE_DEPTH_ARRAY_V
:
11778 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11779 get_pointer(&n
[3])));
11781 case OPCODE_DEPTH_INDEXED
:
11782 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11784 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11785 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11787 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11788 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11789 n
[4].i
, n
[5].i
, n
[6].i
,
11790 get_pointer(&n
[7])));
11792 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11793 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11794 n
[4].i
, n
[5].i
, n
[6].i
,
11795 n
[7].i
, get_pointer(&n
[8])));
11797 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11798 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11799 n
[4].i
, n
[5].i
, n
[6].i
,
11801 get_pointer(&n
[9])));
11803 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11804 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11805 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11807 get_pointer(&n
[7])));
11809 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
11810 CALL_CompressedTexSubImage2D(ctx
->Exec
,
11811 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11812 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
11813 get_pointer(&n
[9])));
11815 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
11816 CALL_CompressedTexSubImage3D(ctx
->Exec
,
11817 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11818 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11820 get_pointer(&n
[11])));
11822 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
11823 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
11825 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
11826 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11828 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
11829 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11831 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
11832 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
11833 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
11836 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
11837 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
11839 case OPCODE_DEPTH_BOUNDS_EXT
:
11840 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11842 case OPCODE_PROGRAM_STRING_ARB
:
11843 CALL_ProgramStringARB(ctx
->Exec
,
11844 (n
[1].e
, n
[2].e
, n
[3].i
,
11845 get_pointer(&n
[4])));
11847 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
11848 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
11852 case OPCODE_BEGIN_QUERY_ARB
:
11853 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11855 case OPCODE_END_QUERY_ARB
:
11856 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
11858 case OPCODE_QUERY_COUNTER
:
11859 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11861 case OPCODE_BEGIN_QUERY_INDEXED
:
11862 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11864 case OPCODE_END_QUERY_INDEXED
:
11865 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11867 case OPCODE_DRAW_BUFFERS_ARB
:
11869 GLenum buffers
[MAX_DRAW_BUFFERS
];
11870 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11871 for (i
= 0; i
< count
; i
++)
11872 buffers
[i
] = n
[2 + i
].e
;
11873 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11876 case OPCODE_BLIT_FRAMEBUFFER
:
11877 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11878 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11881 case OPCODE_PRIMITIVE_RESTART_NV
:
11882 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11885 case OPCODE_USE_PROGRAM
:
11886 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11888 case OPCODE_UNIFORM_1F
:
11889 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11891 case OPCODE_UNIFORM_2F
:
11892 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11894 case OPCODE_UNIFORM_3F
:
11895 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11897 case OPCODE_UNIFORM_4F
:
11898 CALL_Uniform4f(ctx
->Exec
,
11899 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11901 case OPCODE_UNIFORM_1FV
:
11902 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11904 case OPCODE_UNIFORM_2FV
:
11905 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11907 case OPCODE_UNIFORM_3FV
:
11908 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11910 case OPCODE_UNIFORM_4FV
:
11911 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11913 case OPCODE_UNIFORM_1D
: {
11914 union float64_pair x
;
11916 x
.uint32
[0] = n
[2].ui
;
11917 x
.uint32
[1] = n
[3].ui
;
11919 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11922 case OPCODE_UNIFORM_2D
: {
11923 union float64_pair x
;
11924 union float64_pair y
;
11926 x
.uint32
[0] = n
[2].ui
;
11927 x
.uint32
[1] = n
[3].ui
;
11928 y
.uint32
[0] = n
[4].ui
;
11929 y
.uint32
[1] = n
[5].ui
;
11931 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11934 case OPCODE_UNIFORM_3D
: {
11935 union float64_pair x
;
11936 union float64_pair y
;
11937 union float64_pair z
;
11939 x
.uint32
[0] = n
[2].ui
;
11940 x
.uint32
[1] = n
[3].ui
;
11941 y
.uint32
[0] = n
[4].ui
;
11942 y
.uint32
[1] = n
[5].ui
;
11943 z
.uint32
[0] = n
[6].ui
;
11944 z
.uint32
[1] = n
[7].ui
;
11946 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11949 case OPCODE_UNIFORM_4D
: {
11950 union float64_pair x
;
11951 union float64_pair y
;
11952 union float64_pair z
;
11953 union float64_pair w
;
11955 x
.uint32
[0] = n
[2].ui
;
11956 x
.uint32
[1] = n
[3].ui
;
11957 y
.uint32
[0] = n
[4].ui
;
11958 y
.uint32
[1] = n
[5].ui
;
11959 z
.uint32
[0] = n
[6].ui
;
11960 z
.uint32
[1] = n
[7].ui
;
11961 w
.uint32
[0] = n
[8].ui
;
11962 w
.uint32
[1] = n
[9].ui
;
11964 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11967 case OPCODE_UNIFORM_1DV
:
11968 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11970 case OPCODE_UNIFORM_2DV
:
11971 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11973 case OPCODE_UNIFORM_3DV
:
11974 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11976 case OPCODE_UNIFORM_4DV
:
11977 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11979 case OPCODE_UNIFORM_1I
:
11980 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11982 case OPCODE_UNIFORM_2I
:
11983 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11985 case OPCODE_UNIFORM_3I
:
11986 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11988 case OPCODE_UNIFORM_4I
:
11989 CALL_Uniform4i(ctx
->Exec
,
11990 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11992 case OPCODE_UNIFORM_1IV
:
11993 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11995 case OPCODE_UNIFORM_2IV
:
11996 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11998 case OPCODE_UNIFORM_3IV
:
11999 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12001 case OPCODE_UNIFORM_4IV
:
12002 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12004 case OPCODE_UNIFORM_1UI
:
12005 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12007 case OPCODE_UNIFORM_2UI
:
12008 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
12010 case OPCODE_UNIFORM_3UI
:
12011 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12013 case OPCODE_UNIFORM_4UI
:
12014 CALL_Uniform4ui(ctx
->Exec
,
12015 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
12017 case OPCODE_UNIFORM_1UIV
:
12018 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12020 case OPCODE_UNIFORM_2UIV
:
12021 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12023 case OPCODE_UNIFORM_3UIV
:
12024 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12026 case OPCODE_UNIFORM_4UIV
:
12027 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
12029 case OPCODE_UNIFORM_MATRIX22
:
12030 CALL_UniformMatrix2fv(ctx
->Exec
,
12031 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12033 case OPCODE_UNIFORM_MATRIX33
:
12034 CALL_UniformMatrix3fv(ctx
->Exec
,
12035 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12037 case OPCODE_UNIFORM_MATRIX44
:
12038 CALL_UniformMatrix4fv(ctx
->Exec
,
12039 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12041 case OPCODE_UNIFORM_MATRIX23
:
12042 CALL_UniformMatrix2x3fv(ctx
->Exec
,
12043 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12045 case OPCODE_UNIFORM_MATRIX32
:
12046 CALL_UniformMatrix3x2fv(ctx
->Exec
,
12047 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12049 case OPCODE_UNIFORM_MATRIX24
:
12050 CALL_UniformMatrix2x4fv(ctx
->Exec
,
12051 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12053 case OPCODE_UNIFORM_MATRIX42
:
12054 CALL_UniformMatrix4x2fv(ctx
->Exec
,
12055 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12057 case OPCODE_UNIFORM_MATRIX34
:
12058 CALL_UniformMatrix3x4fv(ctx
->Exec
,
12059 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12061 case OPCODE_UNIFORM_MATRIX43
:
12062 CALL_UniformMatrix4x3fv(ctx
->Exec
,
12063 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12065 case OPCODE_UNIFORM_MATRIX22D
:
12066 CALL_UniformMatrix2dv(ctx
->Exec
,
12067 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12069 case OPCODE_UNIFORM_MATRIX33D
:
12070 CALL_UniformMatrix3dv(ctx
->Exec
,
12071 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12073 case OPCODE_UNIFORM_MATRIX44D
:
12074 CALL_UniformMatrix4dv(ctx
->Exec
,
12075 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12077 case OPCODE_UNIFORM_MATRIX23D
:
12078 CALL_UniformMatrix2x3dv(ctx
->Exec
,
12079 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12081 case OPCODE_UNIFORM_MATRIX32D
:
12082 CALL_UniformMatrix3x2dv(ctx
->Exec
,
12083 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12085 case OPCODE_UNIFORM_MATRIX24D
:
12086 CALL_UniformMatrix2x4dv(ctx
->Exec
,
12087 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12089 case OPCODE_UNIFORM_MATRIX42D
:
12090 CALL_UniformMatrix4x2dv(ctx
->Exec
,
12091 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12093 case OPCODE_UNIFORM_MATRIX34D
:
12094 CALL_UniformMatrix3x4dv(ctx
->Exec
,
12095 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12097 case OPCODE_UNIFORM_MATRIX43D
:
12098 CALL_UniformMatrix4x3dv(ctx
->Exec
,
12099 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
12102 case OPCODE_USE_PROGRAM_STAGES
:
12103 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12105 case OPCODE_PROGRAM_UNIFORM_1F
:
12106 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
12108 case OPCODE_PROGRAM_UNIFORM_2F
:
12109 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
12111 case OPCODE_PROGRAM_UNIFORM_3F
:
12112 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12113 n
[3].f
, n
[4].f
, n
[5].f
));
12115 case OPCODE_PROGRAM_UNIFORM_4F
:
12116 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12117 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
12119 case OPCODE_PROGRAM_UNIFORM_1FV
:
12120 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12121 get_pointer(&n
[4])));
12123 case OPCODE_PROGRAM_UNIFORM_2FV
:
12124 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12125 get_pointer(&n
[4])));
12127 case OPCODE_PROGRAM_UNIFORM_3FV
:
12128 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12129 get_pointer(&n
[4])));
12131 case OPCODE_PROGRAM_UNIFORM_4FV
:
12132 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12133 get_pointer(&n
[4])));
12135 case OPCODE_PROGRAM_UNIFORM_1D
: {
12136 union float64_pair x
;
12138 x
.uint32
[0] = n
[3].ui
;
12139 x
.uint32
[1] = n
[4].ui
;
12141 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
12144 case OPCODE_PROGRAM_UNIFORM_2D
: {
12145 union float64_pair x
;
12146 union float64_pair y
;
12148 x
.uint32
[0] = n
[3].ui
;
12149 x
.uint32
[1] = n
[4].ui
;
12150 y
.uint32
[0] = n
[5].ui
;
12151 y
.uint32
[1] = n
[6].ui
;
12153 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
12156 case OPCODE_PROGRAM_UNIFORM_3D
: {
12157 union float64_pair x
;
12158 union float64_pair y
;
12159 union float64_pair z
;
12161 x
.uint32
[0] = n
[3].ui
;
12162 x
.uint32
[1] = n
[4].ui
;
12163 y
.uint32
[0] = n
[5].ui
;
12164 y
.uint32
[1] = n
[6].ui
;
12165 z
.uint32
[0] = n
[7].ui
;
12166 z
.uint32
[1] = n
[8].ui
;
12168 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12172 case OPCODE_PROGRAM_UNIFORM_4D
: {
12173 union float64_pair x
;
12174 union float64_pair y
;
12175 union float64_pair z
;
12176 union float64_pair w
;
12178 x
.uint32
[0] = n
[3].ui
;
12179 x
.uint32
[1] = n
[4].ui
;
12180 y
.uint32
[0] = n
[5].ui
;
12181 y
.uint32
[1] = n
[6].ui
;
12182 z
.uint32
[0] = n
[7].ui
;
12183 z
.uint32
[1] = n
[8].ui
;
12184 w
.uint32
[0] = n
[9].ui
;
12185 w
.uint32
[1] = n
[10].ui
;
12187 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12188 x
.d
, y
.d
, z
.d
, w
.d
));
12191 case OPCODE_PROGRAM_UNIFORM_1DV
:
12192 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12193 get_pointer(&n
[4])));
12195 case OPCODE_PROGRAM_UNIFORM_2DV
:
12196 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12197 get_pointer(&n
[4])));
12199 case OPCODE_PROGRAM_UNIFORM_3DV
:
12200 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12201 get_pointer(&n
[4])));
12203 case OPCODE_PROGRAM_UNIFORM_4DV
:
12204 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12205 get_pointer(&n
[4])));
12207 case OPCODE_PROGRAM_UNIFORM_1I
:
12208 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
12210 case OPCODE_PROGRAM_UNIFORM_2I
:
12211 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
12213 case OPCODE_PROGRAM_UNIFORM_3I
:
12214 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12215 n
[3].i
, n
[4].i
, n
[5].i
));
12217 case OPCODE_PROGRAM_UNIFORM_4I
:
12218 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12219 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
12221 case OPCODE_PROGRAM_UNIFORM_1IV
:
12222 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12223 get_pointer(&n
[4])));
12225 case OPCODE_PROGRAM_UNIFORM_2IV
:
12226 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12227 get_pointer(&n
[4])));
12229 case OPCODE_PROGRAM_UNIFORM_3IV
:
12230 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12231 get_pointer(&n
[4])));
12233 case OPCODE_PROGRAM_UNIFORM_4IV
:
12234 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12235 get_pointer(&n
[4])));
12237 case OPCODE_PROGRAM_UNIFORM_1UI
:
12238 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
12240 case OPCODE_PROGRAM_UNIFORM_2UI
:
12241 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12242 n
[3].ui
, n
[4].ui
));
12244 case OPCODE_PROGRAM_UNIFORM_3UI
:
12245 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12246 n
[3].ui
, n
[4].ui
, n
[5].ui
));
12248 case OPCODE_PROGRAM_UNIFORM_4UI
:
12249 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
12251 n
[4].ui
, n
[5].ui
, n
[6].ui
));
12253 case OPCODE_PROGRAM_UNIFORM_1UIV
:
12254 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12255 get_pointer(&n
[4])));
12257 case OPCODE_PROGRAM_UNIFORM_2UIV
:
12258 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12259 get_pointer(&n
[4])));
12261 case OPCODE_PROGRAM_UNIFORM_3UIV
:
12262 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12263 get_pointer(&n
[4])));
12265 case OPCODE_PROGRAM_UNIFORM_4UIV
:
12266 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
12267 get_pointer(&n
[4])));
12269 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
12270 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
12271 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12272 get_pointer(&n
[5])));
12274 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
12275 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
12276 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12277 get_pointer(&n
[5])));
12279 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
12280 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
12281 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12282 get_pointer(&n
[5])));
12284 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
12285 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
12286 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12287 get_pointer(&n
[5])));
12289 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
12290 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
12291 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12292 get_pointer(&n
[5])));
12294 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
12295 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
12296 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12297 get_pointer(&n
[5])));
12299 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
12300 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
12301 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12302 get_pointer(&n
[5])));
12304 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
12305 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
12306 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12307 get_pointer(&n
[5])));
12309 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
12310 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
12311 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12312 get_pointer(&n
[5])));
12314 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
12315 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
12316 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12317 get_pointer(&n
[5])));
12319 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
12320 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
12321 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12322 get_pointer(&n
[5])));
12324 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
12325 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
12326 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12327 get_pointer(&n
[5])));
12329 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
12330 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
12331 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12332 get_pointer(&n
[5])));
12334 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
12335 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
12336 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12337 get_pointer(&n
[5])));
12339 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
12340 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
12341 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12342 get_pointer(&n
[5])));
12344 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
12345 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
12346 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12347 get_pointer(&n
[5])));
12349 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
12350 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
12351 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12352 get_pointer(&n
[5])));
12354 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
12355 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
12356 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
12357 get_pointer(&n
[5])));
12360 case OPCODE_CLIP_CONTROL
:
12361 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12364 case OPCODE_CLAMP_COLOR
:
12365 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
12368 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
12369 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
12371 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
12372 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
12374 case OPCODE_ATTR_1F_NV
:
12375 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12377 case OPCODE_ATTR_2F_NV
:
12378 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12380 case OPCODE_ATTR_3F_NV
:
12381 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12383 case OPCODE_ATTR_4F_NV
:
12384 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12386 case OPCODE_ATTR_1F_ARB
:
12387 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12389 case OPCODE_ATTR_2F_ARB
:
12390 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12392 case OPCODE_ATTR_3F_ARB
:
12393 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12395 case OPCODE_ATTR_4F_ARB
:
12396 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12398 case OPCODE_ATTR_1D
: {
12399 GLdouble
*d
= (GLdouble
*) &n
[2];
12400 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
12403 case OPCODE_ATTR_2D
: {
12404 GLdouble
*d
= (GLdouble
*) &n
[2];
12405 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
12408 case OPCODE_ATTR_3D
: {
12409 GLdouble
*d
= (GLdouble
*) &n
[2];
12410 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
12413 case OPCODE_ATTR_4D
: {
12414 GLdouble
*d
= (GLdouble
*) &n
[2];
12415 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
12418 case OPCODE_MATERIAL
:
12419 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
12422 CALL_Begin(ctx
->Exec
, (n
[1].e
));
12425 CALL_End(ctx
->Exec
, ());
12428 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
12430 case OPCODE_EVAL_C1
:
12431 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
12433 case OPCODE_EVAL_C2
:
12434 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
12436 case OPCODE_EVAL_P1
:
12437 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
12439 case OPCODE_EVAL_P2
:
12440 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
12443 /* GL_EXT_texture_integer */
12444 case OPCODE_CLEARCOLOR_I
:
12445 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
12447 case OPCODE_CLEARCOLOR_UI
:
12448 CALL_ClearColorIuiEXT(ctx
->Exec
,
12449 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
12451 case OPCODE_TEXPARAMETER_I
:
12454 params
[0] = n
[3].i
;
12455 params
[1] = n
[4].i
;
12456 params
[2] = n
[5].i
;
12457 params
[3] = n
[6].i
;
12458 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12461 case OPCODE_TEXPARAMETER_UI
:
12464 params
[0] = n
[3].ui
;
12465 params
[1] = n
[4].ui
;
12466 params
[2] = n
[5].ui
;
12467 params
[3] = n
[6].ui
;
12468 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
12472 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
12473 /* GL_ARB_instanced_arrays */
12474 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12477 case OPCODE_TEXTURE_BARRIER_NV
:
12478 CALL_TextureBarrierNV(ctx
->Exec
, ());
12481 /* GL_EXT/ARB_transform_feedback */
12482 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
12483 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
12485 case OPCODE_END_TRANSFORM_FEEDBACK
:
12486 CALL_EndTransformFeedback(ctx
->Exec
, ());
12488 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
12489 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12491 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
12492 CALL_PauseTransformFeedback(ctx
->Exec
, ());
12494 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
12495 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
12497 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
12498 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
12500 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
12501 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
12502 (n
[1].e
, n
[2].ui
, n
[3].ui
));
12504 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
12505 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
12506 (n
[1].e
, n
[2].ui
, n
[3].si
));
12508 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
12509 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
12510 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
12514 case OPCODE_BIND_SAMPLER
:
12515 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12517 case OPCODE_SAMPLER_PARAMETERIV
:
12520 params
[0] = n
[3].i
;
12521 params
[1] = n
[4].i
;
12522 params
[2] = n
[5].i
;
12523 params
[3] = n
[6].i
;
12524 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12527 case OPCODE_SAMPLER_PARAMETERFV
:
12530 params
[0] = n
[3].f
;
12531 params
[1] = n
[4].f
;
12532 params
[2] = n
[5].f
;
12533 params
[3] = n
[6].f
;
12534 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12537 case OPCODE_SAMPLER_PARAMETERIIV
:
12540 params
[0] = n
[3].i
;
12541 params
[1] = n
[4].i
;
12542 params
[2] = n
[5].i
;
12543 params
[3] = n
[6].i
;
12544 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12547 case OPCODE_SAMPLER_PARAMETERUIV
:
12550 params
[0] = n
[3].ui
;
12551 params
[1] = n
[4].ui
;
12552 params
[2] = n
[5].ui
;
12553 params
[3] = n
[6].ui
;
12554 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
12558 /* ARB_compute_shader */
12559 case OPCODE_DISPATCH_COMPUTE
:
12560 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12564 case OPCODE_WAIT_SYNC
:
12566 union uint64_pair p
;
12567 p
.uint32
[0] = n
[2].ui
;
12568 p
.uint32
[1] = n
[3].ui
;
12569 CALL_WaitSync(ctx
->Exec
,
12570 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
12574 /* GL_NV_conditional_render */
12575 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
12576 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
12578 case OPCODE_END_CONDITIONAL_RENDER
:
12579 CALL_EndConditionalRender(ctx
->Exec
, ());
12582 case OPCODE_UNIFORM_BLOCK_BINDING
:
12583 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
12586 case OPCODE_UNIFORM_SUBROUTINES
:
12587 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
12588 get_pointer(&n
[3])));
12591 /* GL_EXT_window_rectangles */
12592 case OPCODE_WINDOW_RECTANGLES
:
12593 CALL_WindowRectanglesEXT(
12594 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
12597 /* GL_NV_conservative_raster */
12598 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
12599 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
12602 /* GL_NV_conservative_raster_dilate */
12603 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
12604 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
12607 /* GL_NV_conservative_raster_pre_snap_triangles */
12608 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
12609 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
12612 /* GL_EXT_direct_state_access */
12613 case OPCODE_MATRIX_LOAD
:
12614 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12616 case OPCODE_MATRIX_MULT
:
12617 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12619 case OPCODE_MATRIX_ROTATE
:
12620 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12622 case OPCODE_MATRIX_SCALE
:
12623 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12625 case OPCODE_MATRIX_TRANSLATE
:
12626 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12628 case OPCODE_MATRIX_LOAD_IDENTITY
:
12629 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
12631 case OPCODE_MATRIX_ORTHO
:
12632 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
12633 n
[2].f
, n
[3].f
, n
[4].f
,
12634 n
[5].f
, n
[6].f
, n
[7].f
));
12636 case OPCODE_MATRIX_FRUSTUM
:
12637 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
12638 n
[2].f
, n
[3].f
, n
[4].f
,
12639 n
[5].f
, n
[6].f
, n
[7].f
));
12641 case OPCODE_MATRIX_PUSH
:
12642 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
12644 case OPCODE_MATRIX_POP
:
12645 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
12647 case OPCODE_TEXTUREPARAMETER_F
:
12650 params
[0] = n
[4].f
;
12651 params
[1] = n
[5].f
;
12652 params
[2] = n
[6].f
;
12653 params
[3] = n
[7].f
;
12654 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12657 case OPCODE_TEXTUREPARAMETER_I
:
12660 params
[0] = n
[4].i
;
12661 params
[1] = n
[5].i
;
12662 params
[2] = n
[6].i
;
12663 params
[3] = n
[7].i
;
12664 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12667 case OPCODE_TEXTUREPARAMETER_II
:
12670 params
[0] = n
[4].i
;
12671 params
[1] = n
[5].i
;
12672 params
[2] = n
[6].i
;
12673 params
[3] = n
[7].i
;
12674 CALL_TextureParameterIivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12677 case OPCODE_TEXTUREPARAMETER_IUI
:
12680 params
[0] = n
[4].ui
;
12681 params
[1] = n
[5].ui
;
12682 params
[2] = n
[6].ui
;
12683 params
[3] = n
[7].ui
;
12684 CALL_TextureParameterIuivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12687 case OPCODE_TEXTURE_IMAGE1D
:
12689 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12690 ctx
->Unpack
= ctx
->DefaultPacking
;
12691 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12692 n
[2].e
, /* target */
12693 n
[3].i
, /* level */
12694 n
[4].i
, /* components */
12695 n
[5].i
, /* width */
12696 n
[6].e
, /* border */
12697 n
[7].e
, /* format */
12699 get_pointer(&n
[9])));
12700 ctx
->Unpack
= save
; /* restore */
12703 case OPCODE_TEXTURE_IMAGE2D
:
12705 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12706 ctx
->Unpack
= ctx
->DefaultPacking
;
12707 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12708 n
[2].e
, /* target */
12709 n
[3].i
, /* level */
12710 n
[4].i
, /* components */
12711 n
[5].i
, /* width */
12712 n
[6].i
, /* height */
12713 n
[7].e
, /* border */
12714 n
[8].e
, /* format */
12716 get_pointer(&n
[10])));
12717 ctx
->Unpack
= save
; /* restore */
12720 case OPCODE_TEXTURE_IMAGE3D
:
12722 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12723 ctx
->Unpack
= ctx
->DefaultPacking
;
12724 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12725 n
[2].e
, /* target */
12726 n
[3].i
, /* level */
12727 n
[4].i
, /* components */
12728 n
[5].i
, /* width */
12729 n
[6].i
, /* height */
12730 n
[7].i
, /* depth */
12731 n
[8].e
, /* border */
12732 n
[9].e
, /* format */
12733 n
[10].e
, /* type */
12734 get_pointer(&n
[11])));
12735 ctx
->Unpack
= save
; /* restore */
12738 case OPCODE_TEXTURE_SUB_IMAGE1D
:
12740 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12741 ctx
->Unpack
= ctx
->DefaultPacking
;
12742 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12743 n
[4].i
, n
[5].i
, n
[6].e
,
12744 n
[7].e
, get_pointer(&n
[8])));
12745 ctx
->Unpack
= save
; /* restore */
12748 case OPCODE_TEXTURE_SUB_IMAGE2D
:
12750 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12751 ctx
->Unpack
= ctx
->DefaultPacking
;
12752 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12753 n
[4].i
, n
[5].i
, n
[6].e
,
12754 n
[7].i
, n
[8].e
, n
[9].e
,
12755 get_pointer(&n
[10])));
12756 ctx
->Unpack
= save
;
12759 case OPCODE_TEXTURE_SUB_IMAGE3D
:
12761 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12762 ctx
->Unpack
= ctx
->DefaultPacking
;
12763 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12764 n
[4].i
, n
[5].i
, n
[6].i
,
12765 n
[7].i
, n
[8].i
, n
[9].i
,
12767 get_pointer(&n
[12])));
12768 ctx
->Unpack
= save
; /* restore */
12771 case OPCODE_COPY_TEXTURE_IMAGE1D
:
12772 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12773 n
[4].e
, n
[5].i
, n
[6].i
,
12776 case OPCODE_COPY_TEXTURE_IMAGE2D
:
12777 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12778 n
[4].e
, n
[5].i
, n
[6].i
,
12779 n
[7].i
, n
[8].i
, n
[9].i
));
12781 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
12782 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12783 n
[4].i
, n
[5].i
, n
[6].i
,
12786 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
12787 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, 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 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
12792 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12793 n
[4].i
, n
[5].i
, n
[6].i
,
12794 n
[7].i
, n
[8].i
, n
[9].i
,
12797 case OPCODE_BIND_MULTITEXTURE
:
12798 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
12800 case OPCODE_MULTITEXPARAMETER_F
:
12803 params
[0] = n
[4].f
;
12804 params
[1] = n
[5].f
;
12805 params
[2] = n
[6].f
;
12806 params
[3] = n
[7].f
;
12807 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12810 case OPCODE_MULTITEXPARAMETER_I
:
12813 params
[0] = n
[4].i
;
12814 params
[1] = n
[5].i
;
12815 params
[2] = n
[6].i
;
12816 params
[3] = n
[7].i
;
12817 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12820 case OPCODE_MULTITEXPARAMETER_II
:
12823 params
[0] = n
[4].i
;
12824 params
[1] = n
[5].i
;
12825 params
[2] = n
[6].i
;
12826 params
[3] = n
[7].i
;
12827 CALL_MultiTexParameterIivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12830 case OPCODE_MULTITEXPARAMETER_IUI
:
12833 params
[0] = n
[4].ui
;
12834 params
[1] = n
[5].ui
;
12835 params
[2] = n
[6].ui
;
12836 params
[3] = n
[7].ui
;
12837 CALL_MultiTexParameterIuivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12840 case OPCODE_MULTITEX_IMAGE1D
:
12842 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12843 ctx
->Unpack
= ctx
->DefaultPacking
;
12844 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12845 n
[2].e
, /* target */
12846 n
[3].i
, /* level */
12847 n
[4].i
, /* components */
12848 n
[5].i
, /* width */
12849 n
[6].e
, /* border */
12850 n
[7].e
, /* format */
12852 get_pointer(&n
[9])));
12853 ctx
->Unpack
= save
; /* restore */
12856 case OPCODE_MULTITEX_IMAGE2D
:
12858 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12859 ctx
->Unpack
= ctx
->DefaultPacking
;
12860 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12861 n
[2].e
, /* target */
12862 n
[3].i
, /* level */
12863 n
[4].i
, /* components */
12864 n
[5].i
, /* width */
12865 n
[6].i
, /* height */
12866 n
[7].e
, /* border */
12867 n
[8].e
, /* format */
12869 get_pointer(&n
[10])));
12870 ctx
->Unpack
= save
; /* restore */
12873 case OPCODE_MULTITEX_IMAGE3D
:
12875 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12876 ctx
->Unpack
= ctx
->DefaultPacking
;
12877 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12878 n
[2].e
, /* target */
12879 n
[3].i
, /* level */
12880 n
[4].i
, /* components */
12881 n
[5].i
, /* width */
12882 n
[6].i
, /* height */
12883 n
[7].i
, /* depth */
12884 n
[8].e
, /* border */
12885 n
[9].e
, /* format */
12886 n
[10].e
, /* type */
12887 get_pointer(&n
[11])));
12888 ctx
->Unpack
= save
; /* restore */
12891 case OPCODE_MULTITEX_SUB_IMAGE1D
:
12893 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12894 ctx
->Unpack
= ctx
->DefaultPacking
;
12895 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12896 n
[4].i
, n
[5].i
, n
[6].e
,
12897 n
[7].e
, get_pointer(&n
[8])));
12898 ctx
->Unpack
= save
; /* restore */
12901 case OPCODE_MULTITEX_SUB_IMAGE2D
:
12903 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12904 ctx
->Unpack
= ctx
->DefaultPacking
;
12905 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12906 n
[4].i
, n
[5].i
, n
[6].e
,
12907 n
[7].i
, n
[8].e
, n
[9].e
,
12908 get_pointer(&n
[10])));
12909 ctx
->Unpack
= save
; /* restore */
12912 case OPCODE_MULTITEX_SUB_IMAGE3D
:
12914 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12915 ctx
->Unpack
= ctx
->DefaultPacking
;
12916 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12917 n
[4].i
, n
[5].i
, n
[6].i
,
12918 n
[7].i
, n
[8].i
, n
[9].i
,
12920 get_pointer(&n
[12])));
12921 ctx
->Unpack
= save
; /* restore */
12924 case OPCODE_COPY_MULTITEX_IMAGE1D
:
12925 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12926 n
[4].e
, n
[5].i
, n
[6].i
,
12929 case OPCODE_COPY_MULTITEX_IMAGE2D
:
12930 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12931 n
[4].e
, n
[5].i
, n
[6].i
,
12932 n
[7].i
, n
[8].i
, n
[9].i
));
12934 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
12935 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12936 n
[4].i
, n
[5].i
, n
[6].i
,
12939 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
12940 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12941 n
[4].i
, n
[5].i
, n
[6].i
,
12942 n
[7].i
, n
[8].i
, n
[9].i
));
12944 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
12945 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12946 n
[4].i
, n
[5].i
, n
[6].i
,
12947 n
[7].i
, n
[8].i
, n
[9].i
,
12950 case OPCODE_MULTITEXENV
:
12953 params
[0] = n
[4].f
;
12954 params
[1] = n
[5].f
;
12955 params
[2] = n
[6].f
;
12956 params
[3] = n
[7].f
;
12957 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12960 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D
:
12961 CALL_CompressedTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12962 n
[4].e
, n
[5].i
, n
[6].i
,
12963 n
[7].i
, get_pointer(&n
[8])));
12965 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D
:
12966 CALL_CompressedTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12967 n
[4].e
, n
[5].i
, n
[6].i
,
12969 get_pointer(&n
[9])));
12971 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D
:
12972 CALL_CompressedTextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12973 n
[4].e
, n
[5].i
, n
[6].i
,
12974 n
[7].i
, n
[8].i
, n
[9].i
,
12975 get_pointer(&n
[10])));
12977 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D
:
12978 CALL_CompressedTextureSubImage1DEXT(ctx
->Exec
,
12979 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12980 n
[5].i
, n
[6].e
, n
[7].i
,
12981 get_pointer(&n
[8])));
12983 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
12984 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
12985 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12986 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12987 n
[9].i
, get_pointer(&n
[10])));
12989 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D
:
12990 CALL_CompressedTextureSubImage3DEXT(ctx
->Exec
,
12991 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12992 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
12993 n
[9].i
, n
[10].e
, n
[11].i
,
12994 get_pointer(&n
[12])));
12996 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D
:
12997 CALL_CompressedMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12998 n
[4].e
, n
[5].i
, n
[6].i
,
12999 n
[7].i
, get_pointer(&n
[8])));
13001 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D
:
13002 CALL_CompressedMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13003 n
[4].e
, n
[5].i
, n
[6].i
,
13005 get_pointer(&n
[9])));
13007 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D
:
13008 CALL_CompressedMultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
13009 n
[4].e
, n
[5].i
, n
[6].i
,
13010 n
[7].i
, n
[8].i
, n
[9].i
,
13011 get_pointer(&n
[10])));
13013 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D
:
13014 CALL_CompressedMultiTexSubImage1DEXT(ctx
->Exec
,
13015 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13016 n
[5].i
, n
[6].e
, n
[7].i
,
13017 get_pointer(&n
[8])));
13019 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D
:
13020 CALL_CompressedMultiTexSubImage2DEXT(ctx
->Exec
,
13021 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13022 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
13023 n
[9].i
, get_pointer(&n
[10])));
13025 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D
:
13026 CALL_CompressedMultiTexSubImage3DEXT(ctx
->Exec
,
13027 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].i
,
13028 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
13029 n
[9].i
, n
[10].e
, n
[11].i
,
13030 get_pointer(&n
[12])));
13032 case OPCODE_NAMED_PROGRAM_STRING
:
13033 CALL_NamedProgramStringEXT(ctx
->Exec
,
13034 (n
[1].ui
, n
[2].e
, n
[3].e
, n
[4].i
,
13035 get_pointer(&n
[5])));
13037 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER
:
13038 CALL_NamedProgramLocalParameter4fEXT(ctx
->Exec
,
13039 (n
[1].ui
, n
[2].e
, n
[3].ui
, n
[4].f
,
13040 n
[5].f
, n
[6].f
, n
[7].f
));
13043 case OPCODE_CONTINUE
:
13044 n
= (Node
*) get_pointer(&n
[1]);
13049 case OPCODE_END_OF_LIST
:
13055 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
13057 _mesa_problem(ctx
, "%s", msg
);
13062 /* increment n to point to next compiled command */
13063 if (opcode
!= OPCODE_CONTINUE
) {
13064 assert(InstSize
[opcode
] > 0);
13065 n
+= InstSize
[opcode
];
13070 vbo_save_EndCallList(ctx
);
13072 ctx
->ListState
.CallDepth
--;
13077 /**********************************************************************/
13079 /**********************************************************************/
13082 * Test if a display list number is valid.
13084 GLboolean GLAPIENTRY
13085 _mesa_IsList(GLuint list
)
13087 GET_CURRENT_CONTEXT(ctx
);
13088 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13089 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
13090 return islist(ctx
, list
);
13095 * Delete a sequence of consecutive display lists.
13098 _mesa_DeleteLists(GLuint list
, GLsizei range
)
13100 GET_CURRENT_CONTEXT(ctx
);
13102 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13103 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13106 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
13111 /* We may be deleting a set of bitmap lists. See if there's a
13112 * bitmap atlas to free.
13114 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
13116 _mesa_delete_bitmap_atlas(ctx
, atlas
);
13117 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
13121 for (i
= list
; i
< list
+ range
; i
++) {
13122 destroy_list(ctx
, i
);
13128 * Return a display list number, n, such that lists n through n+range-1
13132 _mesa_GenLists(GLsizei range
)
13134 GET_CURRENT_CONTEXT(ctx
);
13136 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13137 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
13140 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
13148 * Make this an atomic operation
13150 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
13152 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
13154 /* reserve the list IDs by with empty/dummy lists */
13156 for (i
= 0; i
< range
; i
++) {
13157 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
13158 make_list(base
+ i
, 1));
13162 if (USE_BITMAP_ATLAS
&&
13164 ctx
->Driver
.DrawAtlasBitmaps
) {
13165 /* "range > 16" is a rough heuristic to guess when glGenLists might be
13166 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
13167 * Create the empty atlas now.
13169 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
13171 atlas
= alloc_bitmap_atlas(ctx
, base
);
13174 /* Atlas _should_ be new/empty now, but clobbering is OK */
13175 assert(atlas
->numBitmaps
== 0);
13176 atlas
->numBitmaps
= range
;
13180 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
13187 * Begin a new display list.
13190 _mesa_NewList(GLuint name
, GLenum mode
)
13192 GET_CURRENT_CONTEXT(ctx
);
13194 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
13195 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13197 if (MESA_VERBOSE
& VERBOSE_API
)
13198 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
13199 _mesa_enum_to_string(mode
));
13202 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
13206 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
13207 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
13211 if (ctx
->ListState
.CurrentList
) {
13212 /* already compiling a display list */
13213 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
13217 ctx
->CompileFlag
= GL_TRUE
;
13218 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
13220 /* Reset accumulated list state */
13221 invalidate_saved_current_state( ctx
);
13223 /* Allocate new display list */
13224 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
13225 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
13226 ctx
->ListState
.CurrentPos
= 0;
13228 vbo_save_NewList(ctx
, name
, mode
);
13230 ctx
->CurrentServerDispatch
= ctx
->Save
;
13231 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13232 if (ctx
->MarshalExec
== NULL
) {
13233 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13239 * End definition of current display list.
13242 _mesa_EndList(void)
13244 GET_CURRENT_CONTEXT(ctx
);
13245 SAVE_FLUSH_VERTICES(ctx
);
13246 FLUSH_VERTICES(ctx
, 0);
13248 if (MESA_VERBOSE
& VERBOSE_API
)
13249 _mesa_debug(ctx
, "glEndList\n");
13251 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
13252 _mesa_error(ctx
, GL_INVALID_OPERATION
,
13253 "glEndList() called inside glBegin/End");
13256 /* Check that a list is under construction */
13257 if (!ctx
->ListState
.CurrentList
) {
13258 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
13262 /* Call before emitting END_OF_LIST, in case the driver wants to
13263 * emit opcodes itself.
13265 vbo_save_EndList(ctx
);
13267 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
13271 /* Destroy old list, if any */
13272 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
13274 /* Install the new list */
13275 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
13276 ctx
->ListState
.CurrentList
->Name
,
13277 ctx
->ListState
.CurrentList
);
13280 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
13281 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
13283 ctx
->ListState
.CurrentList
= NULL
;
13284 ctx
->ListState
.CurrentBlock
= NULL
;
13285 ctx
->ListState
.CurrentPos
= 0;
13286 ctx
->ExecuteFlag
= GL_TRUE
;
13287 ctx
->CompileFlag
= GL_FALSE
;
13289 ctx
->CurrentServerDispatch
= ctx
->Exec
;
13290 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13291 if (ctx
->MarshalExec
== NULL
) {
13292 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13298 _mesa_CallList(GLuint list
)
13300 GLboolean save_compile_flag
;
13301 GET_CURRENT_CONTEXT(ctx
);
13302 FLUSH_CURRENT(ctx
, 0);
13304 if (MESA_VERBOSE
& VERBOSE_API
)
13305 _mesa_debug(ctx
, "glCallList %d\n", list
);
13308 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
13313 mesa_print_display_list( list
);
13315 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
13316 * execute the display list, and restore the CompileFlag.
13318 save_compile_flag
= ctx
->CompileFlag
;
13319 if (save_compile_flag
) {
13320 ctx
->CompileFlag
= GL_FALSE
;
13323 execute_list(ctx
, list
);
13324 ctx
->CompileFlag
= save_compile_flag
;
13326 /* also restore API function pointers to point to "save" versions */
13327 if (save_compile_flag
) {
13328 ctx
->CurrentServerDispatch
= ctx
->Save
;
13329 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13330 if (ctx
->MarshalExec
== NULL
) {
13331 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13338 * Try to execute a glCallLists() command where the display lists contain
13339 * glBitmap commands with a texture atlas.
13340 * \return true for success, false otherwise
13343 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
13346 struct gl_bitmap_atlas
*atlas
;
13349 if (!USE_BITMAP_ATLAS
||
13350 !ctx
->Current
.RasterPosValid
||
13351 ctx
->List
.ListBase
== 0 ||
13352 type
!= GL_UNSIGNED_BYTE
||
13353 !ctx
->Driver
.DrawAtlasBitmaps
) {
13358 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13361 /* Even if glGenLists wasn't called, we can still try to create
13364 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
13367 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
13368 /* Try to build the bitmap atlas now.
13369 * If the atlas was created in glGenLists, we'll have recorded the
13370 * number of lists (bitmaps). Otherwise, take a guess at 256.
13372 if (atlas
->numBitmaps
== 0)
13373 atlas
->numBitmaps
= 256;
13374 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
13377 if (!atlas
|| !atlas
->complete
) {
13381 /* check that all display list IDs are in the atlas */
13382 for (i
= 0; i
< n
; i
++) {
13383 const GLubyte
*ids
= (const GLubyte
*) lists
;
13385 if (ids
[i
] >= atlas
->numBitmaps
) {
13390 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
13397 * Execute glCallLists: call multiple display lists.
13400 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
13402 GET_CURRENT_CONTEXT(ctx
);
13404 GLboolean save_compile_flag
;
13406 if (MESA_VERBOSE
& VERBOSE_API
)
13407 _mesa_debug(ctx
, "glCallLists %d\n", n
);
13411 case GL_UNSIGNED_BYTE
:
13413 case GL_UNSIGNED_SHORT
:
13415 case GL_UNSIGNED_INT
:
13423 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
13428 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
13430 } else if (n
== 0 || lists
== NULL
) {
13431 /* nothing to do */
13435 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
13439 /* Save the CompileFlag status, turn it off, execute display list,
13440 * and restore the CompileFlag.
13442 save_compile_flag
= ctx
->CompileFlag
;
13443 ctx
->CompileFlag
= GL_FALSE
;
13445 for (i
= 0; i
< n
; i
++) {
13446 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
13447 execute_list(ctx
, list
);
13450 ctx
->CompileFlag
= save_compile_flag
;
13452 /* also restore API function pointers to point to "save" versions */
13453 if (save_compile_flag
) {
13454 ctx
->CurrentServerDispatch
= ctx
->Save
;
13455 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
13456 if (ctx
->MarshalExec
== NULL
) {
13457 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
13464 * Set the offset added to list numbers in glCallLists.
13467 _mesa_ListBase(GLuint base
)
13469 GET_CURRENT_CONTEXT(ctx
);
13470 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
13471 ASSERT_OUTSIDE_BEGIN_END(ctx
);
13472 ctx
->List
.ListBase
= base
;
13476 * Setup the given dispatch table to point to Mesa's display list
13477 * building functions.
13479 * This does not include any of the tnl functions - they are
13480 * initialized from _mesa_init_api_defaults and from the active vtxfmt
13484 _mesa_initialize_save_table(const struct gl_context
*ctx
)
13486 struct _glapi_table
*table
= ctx
->Save
;
13487 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
13489 /* Initially populate the dispatch table with the contents of the
13490 * normal-execution dispatch table. This lets us skip populating functions
13491 * that should be called directly instead of compiled into display lists.
13493 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
13495 _mesa_loopback_init_api_table(ctx
, table
);
13497 /* VBO functions */
13498 vbo_initialize_save_dispatch(ctx
, table
);
13501 SET_Accum(table
, save_Accum
);
13502 SET_AlphaFunc(table
, save_AlphaFunc
);
13503 SET_Bitmap(table
, save_Bitmap
);
13504 SET_BlendFunc(table
, save_BlendFunc
);
13505 SET_CallList(table
, save_CallList
);
13506 SET_CallLists(table
, save_CallLists
);
13507 SET_Clear(table
, save_Clear
);
13508 SET_ClearAccum(table
, save_ClearAccum
);
13509 SET_ClearColor(table
, save_ClearColor
);
13510 SET_ClearDepth(table
, save_ClearDepth
);
13511 SET_ClearIndex(table
, save_ClearIndex
);
13512 SET_ClearStencil(table
, save_ClearStencil
);
13513 SET_ClipPlane(table
, save_ClipPlane
);
13514 SET_ColorMask(table
, save_ColorMask
);
13515 SET_ColorMaski(table
, save_ColorMaskIndexed
);
13516 SET_ColorMaterial(table
, save_ColorMaterial
);
13517 SET_CopyPixels(table
, save_CopyPixels
);
13518 SET_CullFace(table
, save_CullFace
);
13519 SET_DepthFunc(table
, save_DepthFunc
);
13520 SET_DepthMask(table
, save_DepthMask
);
13521 SET_DepthRange(table
, save_DepthRange
);
13522 SET_Disable(table
, save_Disable
);
13523 SET_Disablei(table
, save_DisableIndexed
);
13524 SET_DrawBuffer(table
, save_DrawBuffer
);
13525 SET_DrawPixels(table
, save_DrawPixels
);
13526 SET_Enable(table
, save_Enable
);
13527 SET_Enablei(table
, save_EnableIndexed
);
13528 SET_EvalMesh1(table
, save_EvalMesh1
);
13529 SET_EvalMesh2(table
, save_EvalMesh2
);
13530 SET_Fogf(table
, save_Fogf
);
13531 SET_Fogfv(table
, save_Fogfv
);
13532 SET_Fogi(table
, save_Fogi
);
13533 SET_Fogiv(table
, save_Fogiv
);
13534 SET_FrontFace(table
, save_FrontFace
);
13535 SET_Frustum(table
, save_Frustum
);
13536 SET_Hint(table
, save_Hint
);
13537 SET_IndexMask(table
, save_IndexMask
);
13538 SET_InitNames(table
, save_InitNames
);
13539 SET_LightModelf(table
, save_LightModelf
);
13540 SET_LightModelfv(table
, save_LightModelfv
);
13541 SET_LightModeli(table
, save_LightModeli
);
13542 SET_LightModeliv(table
, save_LightModeliv
);
13543 SET_Lightf(table
, save_Lightf
);
13544 SET_Lightfv(table
, save_Lightfv
);
13545 SET_Lighti(table
, save_Lighti
);
13546 SET_Lightiv(table
, save_Lightiv
);
13547 SET_LineStipple(table
, save_LineStipple
);
13548 SET_LineWidth(table
, save_LineWidth
);
13549 SET_ListBase(table
, save_ListBase
);
13550 SET_LoadIdentity(table
, save_LoadIdentity
);
13551 SET_LoadMatrixd(table
, save_LoadMatrixd
);
13552 SET_LoadMatrixf(table
, save_LoadMatrixf
);
13553 SET_LoadName(table
, save_LoadName
);
13554 SET_LogicOp(table
, save_LogicOp
);
13555 SET_Map1d(table
, save_Map1d
);
13556 SET_Map1f(table
, save_Map1f
);
13557 SET_Map2d(table
, save_Map2d
);
13558 SET_Map2f(table
, save_Map2f
);
13559 SET_MapGrid1d(table
, save_MapGrid1d
);
13560 SET_MapGrid1f(table
, save_MapGrid1f
);
13561 SET_MapGrid2d(table
, save_MapGrid2d
);
13562 SET_MapGrid2f(table
, save_MapGrid2f
);
13563 SET_MatrixMode(table
, save_MatrixMode
);
13564 SET_MultMatrixd(table
, save_MultMatrixd
);
13565 SET_MultMatrixf(table
, save_MultMatrixf
);
13566 SET_NewList(table
, save_NewList
);
13567 SET_Ortho(table
, save_Ortho
);
13568 SET_PassThrough(table
, save_PassThrough
);
13569 SET_PixelMapfv(table
, save_PixelMapfv
);
13570 SET_PixelMapuiv(table
, save_PixelMapuiv
);
13571 SET_PixelMapusv(table
, save_PixelMapusv
);
13572 SET_PixelTransferf(table
, save_PixelTransferf
);
13573 SET_PixelTransferi(table
, save_PixelTransferi
);
13574 SET_PixelZoom(table
, save_PixelZoom
);
13575 SET_PointSize(table
, save_PointSize
);
13576 SET_PolygonMode(table
, save_PolygonMode
);
13577 SET_PolygonOffset(table
, save_PolygonOffset
);
13578 SET_PolygonStipple(table
, save_PolygonStipple
);
13579 SET_PopAttrib(table
, save_PopAttrib
);
13580 SET_PopMatrix(table
, save_PopMatrix
);
13581 SET_PopName(table
, save_PopName
);
13582 SET_PushAttrib(table
, save_PushAttrib
);
13583 SET_PushMatrix(table
, save_PushMatrix
);
13584 SET_PushName(table
, save_PushName
);
13585 SET_RasterPos2d(table
, save_RasterPos2d
);
13586 SET_RasterPos2dv(table
, save_RasterPos2dv
);
13587 SET_RasterPos2f(table
, save_RasterPos2f
);
13588 SET_RasterPos2fv(table
, save_RasterPos2fv
);
13589 SET_RasterPos2i(table
, save_RasterPos2i
);
13590 SET_RasterPos2iv(table
, save_RasterPos2iv
);
13591 SET_RasterPos2s(table
, save_RasterPos2s
);
13592 SET_RasterPos2sv(table
, save_RasterPos2sv
);
13593 SET_RasterPos3d(table
, save_RasterPos3d
);
13594 SET_RasterPos3dv(table
, save_RasterPos3dv
);
13595 SET_RasterPos3f(table
, save_RasterPos3f
);
13596 SET_RasterPos3fv(table
, save_RasterPos3fv
);
13597 SET_RasterPos3i(table
, save_RasterPos3i
);
13598 SET_RasterPos3iv(table
, save_RasterPos3iv
);
13599 SET_RasterPos3s(table
, save_RasterPos3s
);
13600 SET_RasterPos3sv(table
, save_RasterPos3sv
);
13601 SET_RasterPos4d(table
, save_RasterPos4d
);
13602 SET_RasterPos4dv(table
, save_RasterPos4dv
);
13603 SET_RasterPos4f(table
, save_RasterPos4f
);
13604 SET_RasterPos4fv(table
, save_RasterPos4fv
);
13605 SET_RasterPos4i(table
, save_RasterPos4i
);
13606 SET_RasterPos4iv(table
, save_RasterPos4iv
);
13607 SET_RasterPos4s(table
, save_RasterPos4s
);
13608 SET_RasterPos4sv(table
, save_RasterPos4sv
);
13609 SET_ReadBuffer(table
, save_ReadBuffer
);
13610 SET_Rectf(table
, save_Rectf
);
13611 SET_Rotated(table
, save_Rotated
);
13612 SET_Rotatef(table
, save_Rotatef
);
13613 SET_Scaled(table
, save_Scaled
);
13614 SET_Scalef(table
, save_Scalef
);
13615 SET_Scissor(table
, save_Scissor
);
13616 SET_ShadeModel(table
, save_ShadeModel
);
13617 SET_StencilFunc(table
, save_StencilFunc
);
13618 SET_StencilMask(table
, save_StencilMask
);
13619 SET_StencilOp(table
, save_StencilOp
);
13620 SET_TexEnvf(table
, save_TexEnvf
);
13621 SET_TexEnvfv(table
, save_TexEnvfv
);
13622 SET_TexEnvi(table
, save_TexEnvi
);
13623 SET_TexEnviv(table
, save_TexEnviv
);
13624 SET_TexGend(table
, save_TexGend
);
13625 SET_TexGendv(table
, save_TexGendv
);
13626 SET_TexGenf(table
, save_TexGenf
);
13627 SET_TexGenfv(table
, save_TexGenfv
);
13628 SET_TexGeni(table
, save_TexGeni
);
13629 SET_TexGeniv(table
, save_TexGeniv
);
13630 SET_TexImage1D(table
, save_TexImage1D
);
13631 SET_TexImage2D(table
, save_TexImage2D
);
13632 SET_TexParameterf(table
, save_TexParameterf
);
13633 SET_TexParameterfv(table
, save_TexParameterfv
);
13634 SET_TexParameteri(table
, save_TexParameteri
);
13635 SET_TexParameteriv(table
, save_TexParameteriv
);
13636 SET_Translated(table
, save_Translated
);
13637 SET_Translatef(table
, save_Translatef
);
13638 SET_Viewport(table
, save_Viewport
);
13641 SET_BindTexture(table
, save_BindTexture
);
13642 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
13643 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
13644 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
13645 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
13646 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
13647 SET_TexSubImage1D(table
, save_TexSubImage1D
);
13648 SET_TexSubImage2D(table
, save_TexSubImage2D
);
13651 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
13652 SET_TexImage3D(table
, save_TexImage3D
);
13653 SET_TexSubImage3D(table
, save_TexSubImage3D
);
13656 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
13657 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
13658 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
13660 /* ATI_separate_stencil */
13661 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
13663 /* GL_ARB_imaging */
13664 /* Not all are supported */
13665 SET_BlendColor(table
, save_BlendColor
);
13666 SET_BlendEquation(table
, save_BlendEquation
);
13668 /* 2. GL_EXT_blend_color */
13670 SET_BlendColorEXT(table
, save_BlendColorEXT
);
13673 /* 6. GL_EXT_texture3d */
13675 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
13676 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
13677 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
13680 /* 37. GL_EXT_blend_minmax */
13682 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
13685 /* 54. GL_EXT_point_parameters */
13686 SET_PointParameterf(table
, save_PointParameterfEXT
);
13687 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
13689 /* 91. GL_ARB_tessellation_shader */
13690 SET_PatchParameteri(table
, save_PatchParameteri
);
13691 SET_PatchParameterfv(table
, save_PatchParameterfv
);
13693 /* 100. ARB_viewport_array */
13694 SET_ViewportArrayv(table
, save_ViewportArrayv
);
13695 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
13696 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
13697 SET_ScissorArrayv(table
, save_ScissorArrayv
);
13698 SET_ScissorIndexed(table
, save_ScissorIndexed
);
13699 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
13700 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
13701 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
13703 /* 122. ARB_compute_shader */
13704 SET_DispatchCompute(table
, save_DispatchCompute
);
13705 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
13707 /* 173. GL_EXT_blend_func_separate */
13708 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
13710 /* 197. GL_MESA_window_pos */
13711 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
13712 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
13713 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
13714 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
13715 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
13716 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
13717 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
13718 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
13719 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
13720 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
13721 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
13722 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
13723 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
13724 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
13725 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
13726 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
13727 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
13728 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
13729 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
13730 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
13731 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
13732 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
13733 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
13734 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
13736 /* 245. GL_ATI_fragment_shader */
13737 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
13738 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
13740 /* 262. GL_NV_point_sprite */
13741 SET_PointParameteri(table
, save_PointParameteriNV
);
13742 SET_PointParameteriv(table
, save_PointParameterivNV
);
13744 /* 268. GL_EXT_stencil_two_side */
13745 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
13747 /* ???. GL_EXT_depth_bounds_test */
13748 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
13750 /* ARB 1. GL_ARB_multitexture */
13751 SET_ActiveTexture(table
, save_ActiveTextureARB
);
13753 /* ARB 3. GL_ARB_transpose_matrix */
13754 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
13755 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
13756 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
13757 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
13759 /* ARB 5. GL_ARB_multisample */
13760 SET_SampleCoverage(table
, save_SampleCoverageARB
);
13762 /* ARB 12. GL_ARB_texture_compression */
13763 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
13764 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
13765 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
13766 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
13767 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
13768 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
13770 /* ARB 14. GL_ARB_point_parameters */
13771 /* aliased with EXT_point_parameters functions */
13773 /* ARB 25. GL_ARB_window_pos */
13774 /* aliased with MESA_window_pos functions */
13776 /* ARB 26. GL_ARB_vertex_program */
13777 /* ARB 27. GL_ARB_fragment_program */
13778 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
13779 SET_ProgramStringARB(table
, save_ProgramStringARB
);
13780 SET_BindProgramARB(table
, save_BindProgramARB
);
13781 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
13782 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
13783 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
13784 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
13785 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
13786 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
13787 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
13788 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
13790 SET_BeginQuery(table
, save_BeginQueryARB
);
13791 SET_EndQuery(table
, save_EndQueryARB
);
13792 SET_QueryCounter(table
, save_QueryCounter
);
13794 SET_DrawBuffers(table
, save_DrawBuffersARB
);
13796 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
13798 SET_UseProgram(table
, save_UseProgram
);
13799 SET_Uniform1f(table
, save_Uniform1fARB
);
13800 SET_Uniform2f(table
, save_Uniform2fARB
);
13801 SET_Uniform3f(table
, save_Uniform3fARB
);
13802 SET_Uniform4f(table
, save_Uniform4fARB
);
13803 SET_Uniform1fv(table
, save_Uniform1fvARB
);
13804 SET_Uniform2fv(table
, save_Uniform2fvARB
);
13805 SET_Uniform3fv(table
, save_Uniform3fvARB
);
13806 SET_Uniform4fv(table
, save_Uniform4fvARB
);
13807 SET_Uniform1i(table
, save_Uniform1iARB
);
13808 SET_Uniform2i(table
, save_Uniform2iARB
);
13809 SET_Uniform3i(table
, save_Uniform3iARB
);
13810 SET_Uniform4i(table
, save_Uniform4iARB
);
13811 SET_Uniform1iv(table
, save_Uniform1ivARB
);
13812 SET_Uniform2iv(table
, save_Uniform2ivARB
);
13813 SET_Uniform3iv(table
, save_Uniform3ivARB
);
13814 SET_Uniform4iv(table
, save_Uniform4ivARB
);
13815 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
13816 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
13817 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
13818 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
13819 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
13820 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
13821 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
13822 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
13823 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
13825 /* 299. GL_EXT_blend_equation_separate */
13826 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
13828 /* GL_EXT_gpu_program_parameters */
13829 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
13830 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
13832 /* 364. GL_EXT_provoking_vertex */
13833 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
13835 /* GL_EXT_texture_integer */
13836 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
13837 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
13838 SET_TexParameterIiv(table
, save_TexParameterIiv
);
13839 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
13841 /* GL_ARB_clip_control */
13842 SET_ClipControl(table
, save_ClipControl
);
13844 /* GL_ARB_color_buffer_float */
13845 SET_ClampColor(table
, save_ClampColorARB
);
13848 SET_ClearBufferiv(table
, save_ClearBufferiv
);
13849 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
13850 SET_ClearBufferfv(table
, save_ClearBufferfv
);
13851 SET_ClearBufferfi(table
, save_ClearBufferfi
);
13852 SET_Uniform1ui(table
, save_Uniform1ui
);
13853 SET_Uniform2ui(table
, save_Uniform2ui
);
13854 SET_Uniform3ui(table
, save_Uniform3ui
);
13855 SET_Uniform4ui(table
, save_Uniform4ui
);
13856 SET_Uniform1uiv(table
, save_Uniform1uiv
);
13857 SET_Uniform2uiv(table
, save_Uniform2uiv
);
13858 SET_Uniform3uiv(table
, save_Uniform3uiv
);
13859 SET_Uniform4uiv(table
, save_Uniform4uiv
);
13861 /* GL_ARB_gpu_shader_fp64 */
13862 SET_Uniform1d(table
, save_Uniform1d
);
13863 SET_Uniform2d(table
, save_Uniform2d
);
13864 SET_Uniform3d(table
, save_Uniform3d
);
13865 SET_Uniform4d(table
, save_Uniform4d
);
13866 SET_Uniform1dv(table
, save_Uniform1dv
);
13867 SET_Uniform2dv(table
, save_Uniform2dv
);
13868 SET_Uniform3dv(table
, save_Uniform3dv
);
13869 SET_Uniform4dv(table
, save_Uniform4dv
);
13870 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
13871 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
13872 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
13873 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
13874 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
13875 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
13876 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
13877 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
13878 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
13881 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
13882 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
13883 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
13884 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
13885 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
13886 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
13887 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
13888 SET_DrawTransformFeedbackInstanced(table
,
13889 save_DrawTransformFeedbackInstanced
);
13890 SET_DrawTransformFeedbackStreamInstanced(table
,
13891 save_DrawTransformFeedbackStreamInstanced
);
13892 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
13893 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
13895 /* GL_ARB_instanced_arrays */
13896 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
13898 /* GL_NV_texture_barrier */
13899 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
13901 SET_BindSampler(table
, save_BindSampler
);
13902 SET_SamplerParameteri(table
, save_SamplerParameteri
);
13903 SET_SamplerParameterf(table
, save_SamplerParameterf
);
13904 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
13905 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
13906 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
13907 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
13909 /* GL_ARB_draw_buffer_blend */
13910 SET_BlendFunciARB(table
, save_BlendFunci
);
13911 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
13912 SET_BlendEquationiARB(table
, save_BlendEquationi
);
13913 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
13915 /* GL_NV_conditional_render */
13916 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
13917 SET_EndConditionalRender(table
, save_EndConditionalRender
);
13920 SET_WaitSync(table
, save_WaitSync
);
13922 /* GL_ARB_uniform_buffer_object */
13923 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
13925 /* GL_ARB_shader_subroutines */
13926 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
13928 /* GL_ARB_draw_instanced */
13929 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
13930 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
13932 /* GL_ARB_draw_elements_base_vertex */
13933 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
13935 /* GL_ARB_base_instance */
13936 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
13937 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
13938 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
13940 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
13941 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
13942 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
13943 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
13944 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
13946 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
13947 SET_UseProgramStages(table
, save_UseProgramStages
);
13948 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
13949 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
13950 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
13951 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
13952 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
13953 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
13954 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
13955 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
13956 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
13957 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
13958 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
13959 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
13960 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
13961 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
13962 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
13963 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
13964 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
13965 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
13966 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
13967 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
13968 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
13969 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
13970 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
13971 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
13972 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
13973 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
13974 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
13975 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
13976 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
13977 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
13978 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
13979 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
13980 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
13981 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
13982 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
13983 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
13984 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
13985 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
13986 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
13987 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
13988 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
13989 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
13990 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
13991 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
13992 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
13993 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
13994 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
13995 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
13996 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
13997 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
13999 /* GL_{ARB,EXT}_polygon_offset_clamp */
14000 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
14002 /* GL_EXT_window_rectangles */
14003 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
14005 /* GL_NV_conservative_raster */
14006 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
14008 /* GL_NV_conservative_raster_dilate */
14009 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
14011 /* GL_NV_conservative_raster_pre_snap_triangles */
14012 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
14014 /* GL_EXT_direct_state_access */
14015 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
14016 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
14017 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
14018 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
14019 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
14020 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
14021 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
14022 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
14023 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
14024 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
14025 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
14026 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
14027 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
14028 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
14029 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
14030 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
14031 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
14032 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
14033 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
14034 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
14035 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
14036 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
14037 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
14038 SET_TextureParameterIivEXT(table
, save_TextureParameterIivEXT
);
14039 SET_TextureParameterIuivEXT(table
, save_TextureParameterIuivEXT
);
14040 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
14041 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
14042 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
14043 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
14044 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
14045 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
14046 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
14047 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
14048 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
14049 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
14050 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
14051 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
14052 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
14053 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
14054 SET_MultiTexParameterIivEXT(table
, save_MultiTexParameterIivEXT
);
14055 SET_MultiTexParameterIuivEXT(table
, save_MultiTexParameterIuivEXT
);
14056 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
14057 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
14058 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
14059 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
14060 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
14061 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
14062 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
14063 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
14064 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
14065 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
14066 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
14067 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
14068 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
14069 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
14070 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
14071 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
14072 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
14073 SET_CompressedTextureImage1DEXT(table
, save_CompressedTextureImage1DEXT
);
14074 SET_CompressedTextureImage2DEXT(table
, save_CompressedTextureImage2DEXT
);
14075 SET_CompressedTextureImage3DEXT(table
, save_CompressedTextureImage3DEXT
);
14076 SET_CompressedTextureSubImage1DEXT(table
, save_CompressedTextureSubImage1DEXT
);
14077 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
14078 SET_CompressedTextureSubImage3DEXT(table
, save_CompressedTextureSubImage3DEXT
);
14079 SET_CompressedMultiTexImage1DEXT(table
, save_CompressedMultiTexImage1DEXT
);
14080 SET_CompressedMultiTexImage2DEXT(table
, save_CompressedMultiTexImage2DEXT
);
14081 SET_CompressedMultiTexImage3DEXT(table
, save_CompressedMultiTexImage3DEXT
);
14082 SET_CompressedMultiTexSubImage1DEXT(table
, save_CompressedMultiTexSubImage1DEXT
);
14083 SET_CompressedMultiTexSubImage2DEXT(table
, save_CompressedMultiTexSubImage2DEXT
);
14084 SET_CompressedMultiTexSubImage3DEXT(table
, save_CompressedMultiTexSubImage3DEXT
);
14085 SET_NamedProgramStringEXT(table
, save_NamedProgramStringEXT
);
14086 SET_NamedProgramLocalParameter4dEXT(table
, save_NamedProgramLocalParameter4dEXT
);
14087 SET_NamedProgramLocalParameter4dvEXT(table
, save_NamedProgramLocalParameter4dvEXT
);
14088 SET_NamedProgramLocalParameter4fEXT(table
, save_NamedProgramLocalParameter4fEXT
);
14089 SET_NamedProgramLocalParameter4fvEXT(table
, save_NamedProgramLocalParameter4fvEXT
);
14094 static const char *
14095 enum_string(GLenum k
)
14097 return _mesa_enum_to_string(k
);
14102 * Print the commands in a display list. For debugging only.
14103 * TODO: many commands aren't handled yet.
14104 * \param fname filename to write display list to. If null, use stdout.
14106 static void GLAPIENTRY
14107 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
14109 struct gl_display_list
*dlist
;
14115 f
= fopen(fname
, "w");
14120 if (!islist(ctx
, list
)) {
14121 fprintf(f
, "%u is not a display list ID\n", list
);
14125 dlist
= _mesa_lookup_list(ctx
, list
);
14132 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
14134 done
= n
? GL_FALSE
: GL_TRUE
;
14136 const OpCode opcode
= n
[0].opcode
;
14138 if (is_ext_opcode(opcode
)) {
14139 n
+= ext_opcode_print(ctx
, n
, f
);
14144 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
14146 case OPCODE_ACTIVE_TEXTURE
:
14147 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
14149 case OPCODE_BITMAP
:
14150 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
14151 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
14152 get_pointer(&n
[7]));
14154 case OPCODE_BLEND_COLOR
:
14155 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
14156 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14158 case OPCODE_BLEND_EQUATION
:
14159 fprintf(f
, "BlendEquation %s\n",
14160 enum_string(n
[1].e
));
14162 case OPCODE_BLEND_EQUATION_SEPARATE
:
14163 fprintf(f
, "BlendEquationSeparate %s, %s\n",
14164 enum_string(n
[1].e
),
14165 enum_string(n
[2].e
));
14167 case OPCODE_BLEND_FUNC_SEPARATE
:
14168 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
14169 enum_string(n
[1].e
),
14170 enum_string(n
[2].e
),
14171 enum_string(n
[3].e
),
14172 enum_string(n
[4].e
));
14174 case OPCODE_BLEND_EQUATION_I
:
14175 fprintf(f
, "BlendEquationi %u, %s\n",
14176 n
[1].ui
, enum_string(n
[2].e
));
14178 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
14179 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
14180 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14182 case OPCODE_BLEND_FUNC_I
:
14183 fprintf(f
, "BlendFunci %u, %s, %s\n",
14184 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
14186 case OPCODE_BLEND_FUNC_SEPARATE_I
:
14187 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
14189 enum_string(n
[2].e
),
14190 enum_string(n
[3].e
),
14191 enum_string(n
[4].e
),
14192 enum_string(n
[5].e
));
14194 case OPCODE_CALL_LIST
:
14195 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
14197 case OPCODE_CALL_LISTS
:
14198 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
14200 case OPCODE_DISABLE
:
14201 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
14203 case OPCODE_ENABLE
:
14204 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
14206 case OPCODE_FRUSTUM
:
14207 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
14208 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14210 case OPCODE_LINE_STIPPLE
:
14211 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
14213 case OPCODE_LINE_WIDTH
:
14214 fprintf(f
, "LineWidth %f\n", n
[1].f
);
14216 case OPCODE_LOAD_IDENTITY
:
14217 fprintf(f
, "LoadIdentity\n");
14219 case OPCODE_LOAD_MATRIX
:
14220 fprintf(f
, "LoadMatrix\n");
14221 fprintf(f
, " %8f %8f %8f %8f\n",
14222 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14223 fprintf(f
, " %8f %8f %8f %8f\n",
14224 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14225 fprintf(f
, " %8f %8f %8f %8f\n",
14226 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14227 fprintf(f
, " %8f %8f %8f %8f\n",
14228 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14230 case OPCODE_MULT_MATRIX
:
14231 fprintf(f
, "MultMatrix (or Rotate)\n");
14232 fprintf(f
, " %8f %8f %8f %8f\n",
14233 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
14234 fprintf(f
, " %8f %8f %8f %8f\n",
14235 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
14236 fprintf(f
, " %8f %8f %8f %8f\n",
14237 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
14238 fprintf(f
, " %8f %8f %8f %8f\n",
14239 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
14242 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
14243 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14245 case OPCODE_POINT_SIZE
:
14246 fprintf(f
, "PointSize %f\n", n
[1].f
);
14248 case OPCODE_POP_ATTRIB
:
14249 fprintf(f
, "PopAttrib\n");
14251 case OPCODE_POP_MATRIX
:
14252 fprintf(f
, "PopMatrix\n");
14254 case OPCODE_POP_NAME
:
14255 fprintf(f
, "PopName\n");
14257 case OPCODE_PUSH_ATTRIB
:
14258 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
14260 case OPCODE_PUSH_MATRIX
:
14261 fprintf(f
, "PushMatrix\n");
14263 case OPCODE_PUSH_NAME
:
14264 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
14266 case OPCODE_RASTER_POS
:
14267 fprintf(f
, "RasterPos %g %g %g %g\n",
14268 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14270 case OPCODE_ROTATE
:
14271 fprintf(f
, "Rotate %g %g %g %g\n",
14272 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
14275 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14277 case OPCODE_TRANSLATE
:
14278 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
14280 case OPCODE_BIND_TEXTURE
:
14281 fprintf(f
, "BindTexture %s %d\n",
14282 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
14284 case OPCODE_SHADE_MODEL
:
14285 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
14288 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
14289 _mesa_enum_to_string(n
[1].ui
),
14290 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
14293 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
14294 _mesa_enum_to_string(n
[1].ui
),
14295 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
14296 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
14298 case OPCODE_MAPGRID1
:
14299 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
14301 case OPCODE_MAPGRID2
:
14302 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
14303 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
14305 case OPCODE_EVALMESH1
:
14306 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
14308 case OPCODE_EVALMESH2
:
14309 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
14310 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
14313 case OPCODE_ATTR_1F_NV
:
14314 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
14316 case OPCODE_ATTR_2F_NV
:
14317 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
14318 n
[1].i
, n
[2].f
, n
[3].f
);
14320 case OPCODE_ATTR_3F_NV
:
14321 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
14322 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14324 case OPCODE_ATTR_4F_NV
:
14325 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
14326 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14328 case OPCODE_ATTR_1F_ARB
:
14329 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
14331 case OPCODE_ATTR_2F_ARB
:
14332 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
14333 n
[1].i
, n
[2].f
, n
[3].f
);
14335 case OPCODE_ATTR_3F_ARB
:
14336 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
14337 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
14339 case OPCODE_ATTR_4F_ARB
:
14340 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
14341 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
14344 case OPCODE_MATERIAL
:
14345 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
14346 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
14349 fprintf(f
, "BEGIN %x\n", n
[1].i
);
14352 fprintf(f
, "END\n");
14355 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
14358 case OPCODE_EVAL_C1
:
14359 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
14361 case OPCODE_EVAL_C2
:
14362 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
14364 case OPCODE_EVAL_P1
:
14365 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
14367 case OPCODE_EVAL_P2
:
14368 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
14371 case OPCODE_PROVOKING_VERTEX
:
14372 fprintf(f
, "ProvokingVertex %s\n",
14373 _mesa_enum_to_string(n
[1].ui
));
14377 * meta opcodes/commands
14380 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
14381 (const char *) get_pointer(&n
[2]));
14383 case OPCODE_CONTINUE
:
14384 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
14385 n
= (Node
*) get_pointer(&n
[1]);
14388 fprintf(f
, "NOP\n");
14390 case OPCODE_END_OF_LIST
:
14391 fprintf(f
, "END-LIST %u\n", list
);
14395 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
14397 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
14398 opcode
, (void *) n
);
14402 fprintf(f
, "command %d, %u operands\n", opcode
,
14406 /* increment n to point to next compiled command */
14407 if (opcode
!= OPCODE_CONTINUE
) {
14408 assert(InstSize
[opcode
] > 0);
14409 n
+= InstSize
[opcode
];
14423 * Clients may call this function to help debug display list problems.
14424 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14425 * changed, or break in the future without notice.
14428 mesa_print_display_list(GLuint list
)
14430 GET_CURRENT_CONTEXT(ctx
);
14431 print_list(ctx
, list
, NULL
);
14435 /**********************************************************************/
14436 /***** Initialization *****/
14437 /**********************************************************************/
14440 save_vtxfmt_init(GLvertexformat
* vfmt
)
14442 vfmt
->ArrayElement
= _ae_ArrayElement
;
14444 vfmt
->Begin
= save_Begin
;
14446 vfmt
->CallList
= save_CallList
;
14447 vfmt
->CallLists
= save_CallLists
;
14449 vfmt
->Color3f
= save_Color3f
;
14450 vfmt
->Color3fv
= save_Color3fv
;
14451 vfmt
->Color4f
= save_Color4f
;
14452 vfmt
->Color4fv
= save_Color4fv
;
14453 vfmt
->EdgeFlag
= save_EdgeFlag
;
14454 vfmt
->End
= save_End
;
14456 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
14457 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
14458 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
14459 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
14460 vfmt
->EvalPoint1
= save_EvalPoint1
;
14461 vfmt
->EvalPoint2
= save_EvalPoint2
;
14463 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
14464 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
14465 vfmt
->Indexf
= save_Indexf
;
14466 vfmt
->Indexfv
= save_Indexfv
;
14467 vfmt
->Materialfv
= save_Materialfv
;
14468 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
14469 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
14470 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
14471 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
14472 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
14473 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
14474 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
14475 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
14476 vfmt
->Normal3f
= save_Normal3f
;
14477 vfmt
->Normal3fv
= save_Normal3fv
;
14478 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
14479 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
14480 vfmt
->TexCoord1f
= save_TexCoord1f
;
14481 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
14482 vfmt
->TexCoord2f
= save_TexCoord2f
;
14483 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
14484 vfmt
->TexCoord3f
= save_TexCoord3f
;
14485 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
14486 vfmt
->TexCoord4f
= save_TexCoord4f
;
14487 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
14488 vfmt
->Vertex2f
= save_Vertex2f
;
14489 vfmt
->Vertex2fv
= save_Vertex2fv
;
14490 vfmt
->Vertex3f
= save_Vertex3f
;
14491 vfmt
->Vertex3fv
= save_Vertex3fv
;
14492 vfmt
->Vertex4f
= save_Vertex4f
;
14493 vfmt
->Vertex4fv
= save_Vertex4fv
;
14494 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
14495 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
14496 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
14497 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
14498 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
14499 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
14500 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
14501 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
14502 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
14503 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
14504 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
14505 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
14506 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
14507 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
14508 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
14509 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
14511 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
14516 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
14517 const GLvertexformat
*vfmt
)
14519 SET_CallList(disp
, vfmt
->CallList
);
14520 SET_CallLists(disp
, vfmt
->CallLists
);
14525 * Initialize display list state for given context.
14528 _mesa_init_display_list(struct gl_context
*ctx
)
14530 static GLboolean tableInitialized
= GL_FALSE
;
14532 /* zero-out the instruction size table, just once */
14533 if (!tableInitialized
) {
14534 memset(InstSize
, 0, sizeof(InstSize
));
14535 tableInitialized
= GL_TRUE
;
14538 /* extension info */
14539 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
14542 ctx
->ListState
.CallDepth
= 0;
14543 ctx
->ExecuteFlag
= GL_TRUE
;
14544 ctx
->CompileFlag
= GL_FALSE
;
14545 ctx
->ListState
.CurrentBlock
= NULL
;
14546 ctx
->ListState
.CurrentPos
= 0;
14548 /* Display List group */
14549 ctx
->List
.ListBase
= 0;
14551 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
14553 InstSize
[OPCODE_NOP
] = 1;
14558 _mesa_free_display_list_data(struct gl_context
*ctx
)
14560 free(ctx
->ListExt
);
14561 ctx
->ListExt
= NULL
;